/* =========================================================
   Mayflower Admin v2 • Redesigned Dashboard
   Sidebar layout · Refined dark theme · Better UX
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  --bg0:#04070d;
  --bg1:#080d18;
  --bg2:#0c1224;
  --bg3:#111830;

  --surface:rgba(255,255,255,.035);
  --surface2:rgba(255,255,255,.055);
  --surface3:rgba(255,255,255,.075);

  --text:#f0e8ec;
  --text2:rgba(255,255,255,.78);
  --muted:rgba(255,255,255,.55);
  --muted2:rgba(255,255,255,.38);

  --accent:#fb7185;
  --accent2:#fda4af;
  --accent-glow:rgba(251,113,133,.15);
  --accent-glow2:rgba(251,113,133,.08);
  --good:#6ee7b7;
  --good-bg:rgba(110,231,183,.10);
  --good-border:rgba(110,231,183,.25);
  --amber:#fbbf24;
  --amber-bg:rgba(251,191,36,.10);
  --amber-border:rgba(251,191,36,.25);
  --bad:#fb7185;
  --bad-bg:rgba(251,113,133,.10);
  --bad-border:rgba(251,113,133,.25);
  --purple:#a78bfa;
  --purple-bg:rgba(167,139,250,.10);
  --purple-border:rgba(167,139,250,.25);
  --blue:#60a5fa;

  --border:rgba(255,255,255,.08);
  --border2:rgba(255,255,255,.12);
  --border3:rgba(255,255,255,.18);
  --shadow:0 8px 32px rgba(0,0,0,.4);
  --shadow-lg:0 16px 64px rgba(0,0,0,.5);

  --mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font:'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif;

  --sidebar-w:260px;
  --topbar-h:56px;
  --radius:14px;
  --radius-sm:10px;
  --radius-lg:18px;
  --radius-xl:22px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
a{ color:inherit; text-decoration:none; }

body{
  color:var(--text);
  background:var(--bg0);
  font-family:var(--font);
  min-height:100vh;
  overflow-x:hidden;
}

/* ========================
   Layout: Sidebar + Main
   ======================== */
.layout{
  display:block;
  min-height:100vh;
}

@media (max-width:900px){
  /* On mobile, .sidebar becomes the full-screen overlay */
  .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    width:100% !important;
    z-index:9999 !important;
    background:rgba(0,0,0,.5) !important;
    display:none !important;
    border-right:none !important;
  }
  .sidebar.open{
    display:block !important;
  }

  /* .sidebarInner is the actual left panel */
  .sidebar .sidebarInner{
    position:absolute;
    top:0; left:0; bottom:0;
    width:280px;
    max-width:85vw;
    background:var(--bg1);
    overflow-y:auto;
    box-shadow:8px 0 40px rgba(0,0,0,.6);
    display:flex;
    flex-direction:column;
  }

  .mobileToggle{ display:flex !important; }
}

/* ========================
   Sidebar
   ======================== */
.sidebar{
  position:fixed;
  top:0; left:0; bottom:0;
  width:var(--sidebar-w);
  background:var(--bg1);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  z-index:50;
  overflow-y:auto;
  overflow-x:hidden;
}

.sidebar .sidebarInner{
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
}

.sidebarHeader{
  padding:20px 18px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.sidebarBrand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.sidebarClose{
  display:none;
  align-items:center;
  justify-content:center;
  width:36px; height:36px;
  border-radius:8px;
  border:1px solid var(--border2);
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-size:16px;
  cursor:pointer;
  flex:0 0 auto;
  -webkit-tap-highlight-color:transparent;
  font-family:var(--font);
}
.sidebarClose:active{ background:rgba(255,255,255,.15); }

@media (max-width:900px){
  .sidebarClose{ display:flex; }
}
.sidebarLogo{
  width:34px; height:34px;
  border-radius:10px;
  background:linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow:0 4px 16px rgba(251,113,133,.25);
  flex:0 0 auto;
}
.sidebarBrand h1{
  font-size:14px;
  font-weight:700;
  letter-spacing:.1px;
  line-height:1.2;
}
.sidebarBrand p{
  font-size:11px;
  color:var(--muted);
  margin-top:2px;
}

.sidebarGroup{
  padding:12px 12px 6px;
}
.sidebarGroupLabel{
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--muted2);
  padding:0 8px;
  margin-bottom:6px;
}

.sidebarLink{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 12px;
  border-radius:var(--radius-sm);
  font-size:13px;
  font-weight:500;
  color:var(--text2);
  cursor:pointer;
  transition:all .12s ease;
  border:1px solid transparent;
  margin-bottom:2px;
}
.sidebarLink:hover{
  background:var(--surface);
  color:var(--text);
}
.sidebarLink.active{
  background:var(--accent-glow);
  border-color:rgba(251,113,133,.2);
  color:var(--text);
  font-weight:600;
}
.sidebarLink .icon{
  font-size:16px;
  width:22px;
  text-align:center;
  flex:0 0 auto;
}
.sidebarLink .badge{
  margin-left:auto;
  font-size:10px;
  padding:2px 7px;
  border-radius:999px;
  background:var(--surface2);
  color:var(--muted);
  font-weight:600;
}

.sidebarFooter{
  margin-top:auto;
  padding:14px 18px;
  border-top:1px solid var(--border);
}
.sidebarFooter a{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted);
  padding:6px 0;
  transition:color .15s;
}
.sidebarFooter a:hover{ color:var(--text); }

/* ========================
   Main Content
   ======================== */
.main{
  margin-left:var(--sidebar-w);
  min-height:100vh;
  min-width:0;
  width:calc(100vw - var(--sidebar-w));
  background:
    radial-gradient(1000px 500px at 30% -5%, rgba(251,113,133,.06), transparent 60%),
    radial-gradient(800px 400px at 80% 5%, rgba(167,139,250,.05), transparent 55%),
    var(--bg0);
}

@media (max-width:900px){
  .main{ margin-left:0; width:100%; }
}

/* Mobile hamburger */
.mobileToggle{
  display:none;
  position:fixed;
  top:10px; left:10px;
  z-index:10000;
  width:42px; height:42px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border2);
  background:var(--bg2);
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:18px;
  color:var(--text);
  box-shadow:0 4px 16px rgba(0,0,0,.4);
  -webkit-tap-highlight-color:transparent;
}

/* Top bar */
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 28px;
  background:rgba(4,7,13,.85);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  flex-wrap:wrap;
}
.topbarLeft{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.topbarTitle{
  font-size:15px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.topbarRight{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width:900px){
  .topbar{ padding:12px 14px 12px 60px; }
}
@media (max-width:500px){
  .topbar{ padding:10px 12px 10px 58px; }
  .topbarTitle{ font-size:14px; }
  .topbarRight .badge{ display:none; }
}

.overall{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:600;
  color:var(--text2);
}

.meta{
  font-size:12px;
  color:var(--muted);
}

/* Content area */
.content{
  padding:24px 28px 60px;
  max-width:1200px;
  width:100%;
  min-width:0;
}

@media (max-width:900px){
  .content{ padding:18px 16px 40px; }
}
@media (max-width:500px){
  .content{ padding:14px 10px 32px; }
}

/* Page sections (tabs) */
.pageSection{
  display:none;
  animation:fadeIn .25s ease;
}
.pageSection.active{
  display:block;
}
@keyframes fadeIn{
  from{ opacity:0; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}

/* ========================
   Components
   ======================== */

/* Buttons */
.btn{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:1px solid var(--border2);
  background:var(--surface);
  color:var(--text);
  padding:8px 14px;
  border-radius:var(--radius-sm);
  cursor:pointer;
  font-weight:600;
  font-size:12px;
  font-family:var(--font);
  transition:all .1s ease;
  white-space:nowrap;
}
.btn:hover{ background:var(--surface2); border-color:var(--border3); }
.btn:active{ transform:scale(.98); }
.btn[disabled]{ opacity:.4; cursor:not-allowed; pointer-events:none; }

.btn.primary{
  background:rgba(251,113,133,.12);
  border-color:rgba(251,113,133,.3);
  color:var(--accent2);
}
.btn.primary:hover{ background:rgba(251,113,133,.18); }

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

.btn.warn{
  background:var(--amber-bg);
  border-color:var(--amber-border);
  color:var(--amber);
}

.btn.danger{
  background:var(--bad-bg);
  border-color:var(--bad-border);
  color:var(--bad);
}

.btn.ghost{
  background:transparent;
  border-color:transparent;
}
.btn.ghost:hover{ background:var(--surface); border-color:var(--border); }

.btn.sm{ padding:5px 10px; font-size:11px; border-radius:8px; }
.btn.lg{ padding:10px 20px; font-size:13px; }
.btn.icon-only{ padding:7px; min-width:32px; }

@media (max-width:500px){
  .btn{ padding:10px 14px; font-size:13px; min-height:40px; }
  .btn.sm{ padding:8px 12px; font-size:12px; min-height:36px; }
}

/* Dot indicators */
.dot{
  width:8px; height:8px;
  border-radius:50%;
  background:var(--amber);
  flex:0 0 auto;
}
.dot.ok{ background:var(--good); box-shadow:0 0 8px rgba(110,231,183,.3); }
.dot.warn{ background:var(--amber); box-shadow:0 0 8px rgba(251,191,36,.3); }
.dot.bad{ background:var(--bad); box-shadow:0 0 8px rgba(251,113,133,.3); }

/* Cards */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:18px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:radial-gradient(600px 200px at 10% 0%, rgba(251,113,133,.04), transparent 60%);
  pointer-events:none;
}
.card > *{ position:relative; }
.card + .card{ margin-top:14px; }

.card.full-width{ grid-column:1 / -1; }

@media (max-width:500px){
  .card{ padding:14px 12px; border-radius:var(--radius); }
}

.cardHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.cardTitle{
  display:flex;
  align-items:center;
  gap:10px;
}
.cardTitle h3{
  font-size:15px;
  font-weight:700;
}
.cardTitle .emoji{
  font-size:18px;
}
.cardDesc{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

/* Sections */
.section{
  margin-top:14px;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:var(--radius-xl);
  padding:16px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}
.section::before{
  content:"";
  position:absolute; inset:-2px;
  background:radial-gradient(800px 250px at 10% 0%, rgba(251,113,133,.06), transparent 60%);
  pointer-events:none;
  opacity:.6;
}
.section > *{ position:relative; }

.sectionHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:12px;
  margin-bottom:12px;
  border-bottom:1px solid var(--border);
}
.sectionTitle strong{
  font-size:14px;
}

.sectionGrid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:12px;
}

@media (max-width:500px){
  .section{ padding:12px 10px; border-radius:var(--radius); }
  .sectionGrid{ gap:10px; }
}

/* Service cards in Control Room */
.svcCard{
  grid-column:span 6;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:var(--radius-lg);
  padding:16px;
  box-shadow:var(--shadow);
  overflow:hidden;
  position:relative;
  min-width:0;
}
.svcCard::before{
  content:"";
  position:absolute; inset:-2px;
  background:radial-gradient(500px 200px at 15% 0%, rgba(110,231,183,.05), transparent 60%);
  pointer-events:none;
}
.svcCard > *{ position:relative; }
.svcCard.full{ grid-column:span 12; }

@media (max-width:860px){
  .svcCard{ grid-column:span 12; }
}
@media (max-width:500px){
  .svcCard{ padding:12px 10px; border-radius:var(--radius); }
}

/* Form controls */
label,
.lbl{
  display:block;
  font-size:11px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  margin:12px 0 5px;
}
label:first-child,
.lbl:first-child{ margin-top:0; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
select,
textarea{
  width:100%;
  border-radius:var(--radius-sm);
  border:1px solid var(--border2);
  background:rgba(0,0,0,.25);
  color:var(--text);
  padding:9px 12px;
  outline:none;
  font-family:var(--font);
  font-size:13px;
  transition:border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance:none;
}
input:focus, select:focus, textarea:focus{
  border-color:rgba(251,113,133,.35);
  box-shadow:0 0 0 3px rgba(251,113,133,.08);
}
textarea{
  min-height:100px;
  resize:vertical;
  line-height:1.4;
}
.mono,
textarea.mono,
input.mono{
  font-family:var(--mono);
  font-size:12px;
}

select{ appearance:auto; cursor:pointer; }
input::placeholder, textarea::placeholder{ color:var(--muted2); }

@media (max-width:500px){
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
  select,
  textarea{
    font-size:16px;
    padding:10px 12px;
  }
  .mono, textarea.mono, input.mono{ font-size:14px; }
}

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
  font-size:11px;
  font-weight:600;
  color:var(--text2);
}

/* Badge */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:600;
}
.badge.purple{
  background:var(--purple-bg);
  border:1px solid var(--purple-border);
  color:var(--purple);
}
.badge.green{
  background:var(--good-bg);
  border:1px solid var(--good-border);
  color:var(--good);
}
.badge.amber{
  background:var(--amber-bg);
  border:1px solid var(--amber-border);
  color:var(--amber);
}
.badge.red{
  background:var(--bad-bg);
  border:1px solid var(--bad-border);
  color:var(--bad);
}

/* Status line in service cards */
.statusLine{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
}
.statusMain{
  font-weight:700;
  color:var(--text2);
}
.statusDetail{
  color:var(--muted);
  font-size:11px;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Actions row */
.actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* Log toolbar + logbox */
.logToolbar{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  margin-top:12px;
  flex-wrap:wrap;
}
.toggle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
  font-size:11px;
  color:var(--muted);
  user-select:none;
  cursor:pointer;
}
.toggle input{ accent-color:var(--accent); cursor:pointer; }

.logbox{
  margin-top:8px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.3);
  border-radius:var(--radius);
  padding:10px 12px;
  color:var(--text2);
  font-family:var(--mono);
  font-size:11px;
  line-height:1.5;
  min-height:140px;
  max-height:380px;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-all;
}

@media (max-width:500px){
  .logbox{ font-size:10px; padding:8px; min-height:100px; max-height:280px; }
}

/* Command bar */
.cmdBar{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:10px;
  padding:8px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.15);
  border-radius:var(--radius);
}
.cmdInput{
  flex:1;
  min-width:0;
  padding:8px 12px;
  border-radius:8px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
  font-family:var(--mono);
  font-size:12px;
}
.cmdInput::placeholder{ color:var(--muted2); }

/* Grids */
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid3{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; }
.grid4{ display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; }
@media (max-width:900px){
  .grid2{ grid-template-columns:1fr; }
  .grid3{ grid-template-columns:1fr; }
  .grid4{ grid-template-columns:1fr 1fr; }
}
@media (max-width:500px){
  .grid4{ grid-template-columns:1fr; }
}

/* Utility */
.row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.hr{ height:1px; background:var(--border); margin:14px 0; }
.small{ font-size:12px; }
.tiny{ font-size:11px; color:var(--muted); }
.muted{ color:var(--muted); }

@media (max-width:500px){
  .row{ gap:6px; }
}

/* Toast */
.toast{
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%) translateY(80px);
  background:var(--bg3);
  border:1px solid var(--border2);
  padding:10px 18px;
  border-radius:var(--radius);
  font-size:13px;
  font-weight:600;
  color:var(--text);
  z-index:200;
  pointer-events:none;
  opacity:0;
  transition:all .3s cubic-bezier(.4,0,.2,1);
  box-shadow:var(--shadow-lg);
  max-width:90vw;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.toast.success{ border-color:var(--good-border); }
.toast.error{ border-color:var(--bad-border); }

/* API Alert */
.apiAlert{
  display:none;
  margin-bottom:14px;
  padding:12px 16px;
  border-radius:var(--radius);
  border:1px solid var(--bad-border);
  background:var(--bad-bg);
  animation:fadeIn .3s ease;
}
.apiAlert.show{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.apiAlertLeft{ display:flex; align-items:center; gap:10px; min-width:0; }
.apiAlertRight{ display:flex; align-items:center; gap:8px; }
.apiAlertTitle{ font-size:13px; font-weight:700; }
.apiAlertMsg{ font-size:12px; color:var(--text2); }
.apiAlertStamp{ font-size:11px; color:var(--muted); }

/* kbd */
.kbd{
  font-family:var(--mono);
  font-size:10px;
  font-weight:600;
  border:1px solid var(--border);
  background:rgba(0,0,0,.2);
  padding:2px 6px;
  border-radius:6px;
  color:var(--muted);
}

/* Dashboard stat cards */
.statGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
  gap:12px;
  margin-bottom:18px;
}
.statCard{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  position:relative;
  overflow:hidden;
}
.statCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
}
.statCard > *{ position:relative; }
.statCard .statEmoji{ font-size:24px; margin-bottom:8px; display:block; }
.statCard .statValue{ font-size:22px; font-weight:800; letter-spacing:-.5px; }
.statCard .statLabel{ font-size:11px; color:var(--muted); margin-top:2px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; }

/* Items list (for mod builder etc) */
.list{ display:flex; flex-direction:column; gap:10px; }
.item{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px;
  background:rgba(0,0,0,.12);
}
.itemHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.itemHead h4{
  font-size:13px;
  font-weight:700;
}

/* Panels for split views */
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:16px;
  box-shadow:var(--shadow);
}

/* Admin Nav (now replaced by sidebar, kept for compat) */
.adminNav{ display:none; }

/* Code textarea */
textarea.code{
  width:100%;
  min-height:200px;
  font-family:var(--mono);
  font-size:11px;
  line-height:1.5;
}

/* Collapsible details cards */
details.card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:10px 14px;
  background:rgba(0,0,0,.1);
}
details.card > summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  font-weight:600;
  font-size:13px;
}
details.card > summary::-webkit-details-marker{ display:none; }

.pillSmall{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  font-weight:600;
}

/* Note box */
.noteBox{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px;
  background:rgba(0,0,0,.12);
  font-size:12px;
  color:var(--text2);
  line-height:1.5;
}

/* Page hero */
.pageHero{
  margin-bottom:20px;
}
.pageHero h2{
  font-size:22px;
  font-weight:800;
  letter-spacing:-.2px;
  margin-bottom:4px;
}
.pageHero p{
  font-size:13px;
  color:var(--muted);
  max-width:60ch;
  line-height:1.5;
}

/* Quick actions bar */
.quickActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

/* Footer note */
.footerNote{
  margin-top:24px;
  font-size:11px;
  color:var(--muted2);
  text-align:center;
  padding:16px 0;
  border-top:1px solid var(--border);
}

/* Mind Garden specific overrides */
.mg-tabs{
  display:flex;gap:4px;margin:16px 0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);padding:4px;
}
.mg-tab{
  flex:1;padding:9px 8px;
  border:none;border-radius:8px;
  background:transparent;color:var(--muted);
  font-size:13px;font-weight:600;
  cursor:pointer;transition:all .2s;
  font-family:var(--font);
}
.mg-tab.active{
  background:var(--accent-glow);
  color:var(--text);
  border:1px solid rgba(251,113,133,.2);
}

/* Scrollbar styling */
::-webkit-scrollbar{ width:6px; height:6px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.12);
  border-radius:3px;
}
::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.2); }

/* ========================
   Mobile-specific overrides
   ======================== */
@media (max-width:900px){
  /* Stat grid */
  .statGrid{ grid-template-columns:1fr 1fr; }

  /* Card header wraps */
  .cardHeader{ flex-wrap:wrap; }

  /* Section header wraps */
  .sectionHeader{ flex-wrap:wrap; gap:8px; }

  /* Status line in svc cards */
  .statusDetail{ max-width:50vw; }

  /* Actions wrap tighter */
  .actions{ gap:5px; }

  /* API alert stacks */
  .apiAlert.show{ flex-direction:column; align-items:flex-start; }
  .apiAlertRight{ width:100%; justify-content:flex-start; }

  /* Item heads stack on mobile */
  .itemHead{ flex-direction:column; align-items:flex-start; gap:8px; }
  .itemHead > .row{ width:100%; }

  /* Mind garden tabs smaller */
  .mg-tab{ padding:9px 6px; font-size:12px; }
}

@media (max-width:500px){
  .statGrid{ grid-template-columns:1fr; }
  .statCard{ padding:12px; }

  /* Topbar overall status hides on very small */
  .overall span:not(.dot){ display:none; }

  /* Logbox toolbar stacks */
  .logToolbar{ flex-direction:column; align-items:flex-start; gap:6px; }

  /* Command bar wraps */
  .cmdBar{ flex-wrap:wrap; }
  .cmdInput{ min-width:0; width:100%; }

  /* Sections tighter */
  .section + .section{ margin-top:10px; }

  /* Mind garden cards */
  .mg-card{ padding:12px; border-radius:var(--radius); }

  /* Page hero smaller */
  .pageHero h2{ font-size:18px; }
  .pageHero p{ font-size:12px; }

  /* Pill wraps */
  .pill{ font-size:10px; padding:4px 8px; }

  /* Quick actions scroll horizontally */
  .quickActions{ overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; }
  .quickActions > *{ flex:0 0 auto; }
}
