:root{
    --bg:#F6F7FB;
    --card:#ffffff;
    --ink:#0E1222;
    --muted:#667085;
    --blue:#2F57D6;
    --blue2:#1E3EA8;
    --line:#E6E8F0;
    --good:#12B76A;
    --warn:#F79009;
    --bad:#F04438;
    --shadow: 0 10px 30px rgba(16,24,40,.08);
    --radius: 18px;
  
    --tap: 46px;
  }
  
  *{box-sizing:border-box}
  html,body{height:100%}
  
  body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
    background:var(--bg);
    color:var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  .app-shell{
    min-height:100vh;
    display:flex;
    flex-direction:column;
    padding-bottom:78px; /* bottom nav */
  }
  
  .topbar{
    position:sticky;
    top:0;
    z-index:10;
    background:rgba(246,247,251,.92);
    backdrop-filter: blur(10px);
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
  }
  
  .icon-btn{
    width:40px;height:40px;
    border-radius:14px;
    border:1px solid var(--line);
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:16px;
    cursor:pointer;
    box-shadow: 0 6px 16px rgba(16,24,40,.06);
  }
  .icon-btn i{font-size:16px}
  .icon-btn:active{transform:scale(.98)}
  
  .topbar-title{flex:1; min-width:0}
  .brand{font-weight:900; letter-spacing:.2px}
  .brand span{color:var(--blue)}
  .subtitle{
    font-size:12px;
    color:var(--muted);
    margin-top:2px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis
  }
  
  .main{
    width:100%;
    max-width:880px;
    margin:0 auto;
    padding:12px;
  }
  
  .card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow: var(--shadow);
  }
  
  .section-title{
    font-weight:900;
    font-size:16px;
    margin:12px 2px 10px;
  }
  
  .row{display:flex; gap:10px}
  .col{flex:1}
  .stack{display:flex; flex-direction:column; gap:10px}
  
  .input{
    width:100%;
    padding:12px 14px;
    border-radius:16px;
    border:1px solid var(--line);
    font-size:15px;
    outline:none;
  }
  .input:focus{
    border-color:rgba(47,87,214,.55);
    box-shadow:0 0 0 4px rgba(47,87,214,.12)
  }
  
  .btn{
    border:none;
    border-radius:999px;           /* pill */
    padding:12px 14px;
    font-weight:900;
    cursor:pointer;
    font-size:14px;
    min-height: var(--tap);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    line-height:1;
    white-space:nowrap;
  }
  
  .btn i{font-size:14px}
  
  .btn-primary{
    background:var(--blue);
    color:white;
    box-shadow: 0 10px 24px rgba(47,87,214,.18);
  }
  .btn-primary:active{transform:scale(.99)}
  
  .btn-ghost{
    background:#fff;
    border:1px solid var(--line);
    color:var(--ink);
  }
  .btn-ghost:hover{background:#fbfcff}
  .btn-ghost:active{transform:scale(.99)}
  
  .chips{display:flex; gap:8px; flex-wrap:wrap}
  .chip{
    padding:9px 12px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:999px;
    color:var(--ink);
    font-size:13px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
  }
  .chip i{font-size:13px; opacity:.9}
  .chip:active{transform:scale(.99)}
  .chip.active{
    border-color:rgba(47,87,214,.35);
    box-shadow:0 0 0 4px rgba(47,87,214,.10)
  }
  
  .badges{display:flex; gap:8px; flex-wrap:wrap}
  .badge{
    font-size:11px;
    font-weight:900;
    letter-spacing:.3px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid var(--line);
    background:#fff;
  }
  .badge.blue{border-color:rgba(47,87,214,.25); background:rgba(47,87,214,.08); color:var(--blue2)}
  .badge.green{border-color:rgba(18,183,106,.25); background:rgba(18,183,106,.08); color:#067647}
  .badge.orange{border-color:rgba(247,144,9,.25); background:rgba(247,144,9,.10); color:#B54708}
  
  .meta{
    color:var(--muted);
    font-size:12px;
    line-height:1.35;
  }
  
  .hr{height:1px;background:var(--line);border:none;margin:12px 0}
  
  /* Reduce gigantismo */
  .big{
    font-size:28px;
    font-weight:1000;
    letter-spacing:-.4px;
  }
  
  .actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap
  }
  .actions .btn{
    flex:1;
    min-width:0; /* evita “descuadre” */
  }
  
  /* Lists */
  .list{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  
  .item{
    padding:12px;
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    display:flex;
    justify-content:space-between;
    gap:10px;
  }
  .item .title{font-weight:900}
  .item .sub{font-size:12px;color:var(--muted); margin-top:2px}
  .item .right{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
  
  .small-btn{
    padding:9px 10px;
    border-radius:12px;
    border:1px solid var(--line);
    background:#fff;
    font-weight:900;
    cursor:pointer;
    font-size:12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
  }
  .small-btn.primary{border-color:rgba(47,87,214,.35); color:var(--blue2); background:rgba(47,87,214,.06)}
  .small-btn.danger{border-color:rgba(240,68,56,.25); color:#B42318; background:rgba(240,68,56,.06)}
  
  /* Bottom nav modern */
  .bottom-nav{
    position:fixed;
    left:0; right:0; bottom:0;
    height:72px;
    display:flex;
    justify-content:space-around;
    align-items:center;
    background:rgba(255,255,255,.94);
    border-top:1px solid var(--line);
    backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index:20;
  }
  
  .bn-item{
    text-decoration:none;
    color:var(--muted);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    font-weight:900;
    font-size:12px;
    width:33%;
    padding:10px 8px;
  }
  
  .bn-ico{
    width:36px;
    height:30px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .bn-ico i{font-size:18px}
  
  .bn-item.active{
    color:var(--blue2);
  }
  .bn-item.active .bn-ico{
    background: rgba(47,87,214,.10);
    border: 1px solid rgba(47,87,214,.18);
  }
  
  /* Toast */
  .toast{
    position:fixed;
    left:50%;
    transform:translateX(-50%);
    bottom:90px;
    background:rgba(14,18,34,.92);
    color:#fff;
    padding:10px 12px;
    border-radius:12px;
    font-size:13px;
    opacity:0;
    pointer-events:none;
    transition: opacity .18s ease;
    z-index:30;
    max-width:min(520px, calc(100vw - 24px));
  }
  .toast.show{opacity:1}
  
  @media (min-width: 860px){
    .row.two{gap:14px}
  }
  