:root{
  --bg:#f4f6f8;
  --surface:#ffffff;
  --surface-alt:#f8fafc;
  --text:#16202a;
  --muted:#64748b;
  --border:#dbe2ea;
  --primary:#0f766e;
  --primary-dark:#0b5c56;
  --danger:#b91c1c;
  --radius:18px;
  --shadow:0 10px 35px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

html,body{
  max-width:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg);
  color:var(--text);
}

body.mobile-menu-open{
  overflow:hidden;
}

a{text-decoration:none}

.app-shell{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  background:#0f172a;
  color:#e2e8f0;
  min-width:0;
}

.sidebar-inner{
  min-height:100%;
}

.sidebar .nav-link{
  color:#cbd5e1;
  border-radius:12px;
  padding:.8rem .9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus{
  background:rgba(255,255,255,.08);
  color:#fff;
}

.brand{
  display:flex;
  gap:.9rem;
  align-items:center;
}

.logo-mark{
  width:46px;
  height:46px;
  border-radius:14px;
  background:linear-gradient(135deg,#14b8a6,#0f766e);
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:700;
  box-shadow:var(--shadow);
}

.main-content{
  min-width:0;
  padding:28px;
}

.page-title{
  font-size:1.75rem;
  font-weight:700;
  margin:0;
}

.summary-card,
.prediction-panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem 1.1rem;
  box-shadow:var(--shadow);
}

.summary-card .label{
  font-size:.86rem;
  color:var(--muted);
  margin-bottom:.4rem;
}

.summary-card .value{
  font-size:2rem;
  font-weight:800;
  line-height:1.1;
}

.summary-card .small-value{
  font-size:1.05rem;
  font-weight:700;
}

.summary-card.compact .value{
  font-size:1.2rem;
}

.disclaimer-box{
  padding:1rem 1.05rem;
  border-radius:14px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}

.prediction-grid{
  display:grid;
  gap:.9rem;
}

.prediction-set{
  background:var(--surface-alt);
  border:1px solid var(--border);
  border-radius:16px;
  padding:.9rem;
}

.set-title{
  font-size:.82rem;
  font-weight:700;
  color:var(--muted);
  margin-bottom:.55rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.balls{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
}

.ball{
  width:42px;
  height:42px;
  border-radius:999px;
  background:var(--primary);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:700;
}

.auth-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:1.25rem;
  background:radial-gradient(circle at top,#d1fae5 0,#f4f6f8 45%);
}

.login-card{
  max-width:520px;
  width:100%;
  border-radius:24px;
}

.card{
  border-radius:var(--radius)!important;
}

.table thead th{
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  background:#f8fafc;
}

.btn-primary{
  background:var(--primary);
  border-color:var(--primary);
}

.btn-primary:hover{
  background:var(--primary-dark);
  border-color:var(--primary-dark);
}

.public-wrap{
  max-width:1100px;
}

.topbar{
  gap:1rem;
}

.table-responsive{
  border-radius:var(--radius);
}

.mobile-topbar,
.sidebar-mobile-head,
.sidebar-backdrop{
  display:none;
}

.mobile-menu-toggle,
.sidebar-close{
  border:0;
  background:none;
  color:inherit;
}

@media (max-width:991px){
  .app-shell{
    display:block;
    min-height:100vh;
  }

  .mobile-topbar{
    display:flex;
    align-items:center;
    gap:.9rem;
    position:sticky;
    top:0;
    z-index:1040;
    padding:14px 16px;
    background:rgba(244,246,248,.96);
    backdrop-filter:blur(10px);
    border-bottom:1px solid rgba(219,226,234,.95);
  }

  .mobile-topbar__titles{
    min-width:0;
  }

  .mobile-topbar__title{
    font-size:1rem;
    font-weight:700;
    line-height:1.2;
    color:var(--text);
  }

  .mobile-topbar__subtitle{
    font-size:.76rem;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .mobile-menu-toggle{
    width:46px;
    height:46px;
    border-radius:14px;
    background:#0f172a;
    display:inline-flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:5px;
    flex:0 0 auto;
    box-shadow:var(--shadow);
  }

  .mobile-menu-toggle span{
    display:block;
    width:18px;
    height:2px;
    border-radius:999px;
    background:#fff;
  }

  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:min(84vw,320px);
    max-width:320px;
    transform:translateX(-100%);
    transition:transform .28s ease;
    z-index:1050;
    overflow-y:auto;
    box-shadow:0 18px 50px rgba(15,23,42,.34);
  }

  body.mobile-menu-open .sidebar{
    transform:translateX(0);
  }

  .sidebar-inner{
    min-height:100dvh;
    padding-bottom:24px;
  }

  .sidebar-mobile-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:1rem;
    padding-bottom:.85rem;
    border-bottom:1px solid rgba(255,255,255,.08);
  }

  .sidebar-mobile-head__brand{
    font-size:.92rem;
    font-weight:700;
    letter-spacing:.03em;
    text-transform:uppercase;
    color:#94a3b8;
  }

  .sidebar-close{
    width:42px;
    height:42px;
    border-radius:12px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:1.7rem;
    line-height:1;
  }

  .sidebar-backdrop{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.5);
    z-index:1045;
  }

  body.mobile-menu-open .sidebar-backdrop{
    display:block;
  }

  .main-content{
    min-width:0;
    padding:18px 16px 24px;
  }

  .topbar{
    margin-bottom:1rem!important;
  }

  .topbar .page-title{
    font-size:1.9rem;
  }

  .summary-card .value{
    font-size:1.55rem;
  }

  .table-responsive{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:575.98px){
  .main-content{
    padding:16px 12px 22px;
  }

  .page-title{
    font-size:1.55rem;
  }

  .card,
  .summary-card,
  .prediction-panel{
    border-radius:16px!important;
  }

  .ball{
    width:38px;
    height:38px;
    font-size:.92rem;
  }

  .btn{
    width:100%;
  }

  .topbar{
    align-items:flex-start!important;
  }
}

@media print{
  .sidebar,
  .sidebar-backdrop,
  .mobile-topbar,
  .topbar,
  .btn,
  form{
    display:none!important;
  }

  .main-content,
  .public-wrap{
    padding:0;
  }

  .card,
  .summary-card,
  .prediction-panel{
    box-shadow:none;
    border:1px solid #ccc;
  }
}
