:root{
  --bg:#070A12;
  --card: rgba(255,255,255,0.07);
  --card2: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.10);
  --text:#F4F6FF;
  --muted: rgba(244,246,255,0.70);
  --shadow: 0 16px 50px rgba(0,0,0,0.55);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background: var(--bg);
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1200px 800px at 18% 18%, rgba(120,86,255,0.22), transparent 60%),
    radial-gradient(900px 700px at 80% 35%, rgba(0,210,255,0.16), transparent 55%),
    radial-gradient(800px 600px at 50% 92%, rgba(255,170,70,0.10), transparent 55%),
    linear-gradient(180deg, #070A12 0%, #060812 100%);
  pointer-events:none;
}

.container{
  position:relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.container.narrow{ max-width: 520px; }

/* =========================
   Header / Brand
========================= */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,0.10);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.title{ font-size: 18px; font-weight: 750; }
.subtitle{ font-size: 13px; color: var(--muted); margin-top:2px; }

.header-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;              /* ✅ important: avoids ugly squeezing */
  justify-content: flex-end;
}

/* =========================
   Cards / Typography
========================= */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
  margin-bottom: 14px;          /* ✅ extra breathing room */
}

h1{margin:0 0 8px; font-size: 22px;}
h2{margin:0; font-size: 16px; letter-spacing: 0.2px;}
.muted{color:var(--muted)}
.sep{border:none; border-top:1px solid rgba(255,255,255,0.10); margin:14px 0;}

/* =========================
   Layout grids
========================= */
.grid{display:grid; gap:18px;}
.grid.kpis{grid-template-columns: repeat(4, 1fr);}
.grid.two{grid-template-columns: 1.25fr 1fr;}

@media (max-width: 980px){
  .grid.kpis{grid-template-columns: repeat(2, 1fr);}
  .grid.two{grid-template-columns: 1fr;}
}

/* KPI cards */
.kpi{padding: 14px;}
.kpi-label{font-size: 12px; color: var(--muted); margin-bottom: 8px;}
.kpi-value{font-size: 30px; font-weight: 800; line-height:1;}
.kpi-sub{font-size: 12px; margin-top: 10px;}

/* Card header row */
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.row{display:flex; gap:10px; align-items:center; flex-wrap: wrap;}

/* =========================
   Pills / Buttons
========================= */
.pill{
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.15);
  color: var(--muted);
}

.btn{
  cursor:pointer;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.10);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 650;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover{ background: rgba(255,255,255,0.14); }
.btn:active{ transform: translateY(1px); }

.btn.small{ padding: 7px 10px; font-size: 12px; border-radius: 10px; }
.btn.ghost{ background: transparent; }
.btn.danger{ border-color: rgba(255,80,80,0.35); }
.btn.danger:hover{ background: rgba(255,80,80,0.12); }

/* =========================
   Forms
========================= */
.form{display:grid; gap:10px; margin-top: 12px;}
.label{font-size: 12px; color: var(--muted);}
.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.20);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(120,86,255,0.55);
  box-shadow: 0 0 0 4px rgba(120,86,255,0.18);
}

/* Login status */
.status{ margin-top: 10px; font-size: 13px; }
.status.ok{ color: #9CFFB3; }
.status.err{ color: #FFB0B0; }

/* =========================
   Lists / Items
========================= */
.list{display:grid; gap:10px;}
.item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid rgba(255,255,255,0.08);
}
.item .left{display:grid; gap:3px;}
.item .right{font-weight:800;}

.small{font-size:12px;}
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* =========================
   Websites grid
========================= */
.sites-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
}

@media (max-width: 720px){
  .sites-grid{grid-template-columns:1fr;}
}

.site{
  padding: 12px;
  border-radius: 16px;
  background: var(--card2);
  border: 1px solid rgba(255,255,255,0.08);
  display:grid;
  gap:8px;
}
.site a{
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}
.site a:hover{ text-decoration: underline; }
.site .meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color: var(--muted);
  font-size: 12px;
}
.badge{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.15);
}
.badge.off{opacity:0.6}

/* =========================
   Messages
========================= */
.messages{display:grid; gap:10px;}
.msg{
  padding: 12px;
  border-radius: 16px;
  background: var(--card2);
  border: 1px solid rgba(255,255,255,0.08);
  display:grid;
  gap:8px;
}
.msg-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  flex-wrap: wrap;
}
.msg strong{font-size: 13px;}
.msg .body{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

/* =========================
   Footer / misc
========================= */
.footer{margin-top: 18px; text-align:center; font-size: 12px;}
.footnote{margin-top:12px; font-size:12px;}

/* Today/Tomorrow label row */
.subhead{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* =========================
   NAV (Dashboard / Websites)
   ✅ Cleaner, responsive tabs
========================= */
.nav{
  display:flex;
  align-items:center;
  gap:6px;
  padding:4px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
}

.navlink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.navlink:hover{
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
}

.navlink.active{
  color: var(--text);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.12);
}

/* Mobile: keep header usable + nav as scrollable tabs */
@media (max-width: 720px){
  .header{ align-items:flex-start; }
  .header-actions{ width:100%; justify-content: space-between; }

  .nav{
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar{ height: 0; }
}


/* =========================
   Page transition
========================= */

/* Initial hidden state */
.page {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Visible after load */
.page.page-enter {
  opacity: 1;
  transform: translateY(0);
}

/* Fade-out before navigation */
.page.page-exit {
  opacity: 0;
  transform: translateY(-6px);
}
