/* =========================================================
   FrontlineQSR Global Styles (v4.3)
   Stability Before Scale
   ========================================================= */

:root{
  --bg:#0f172a;
  --panel:#111827;
  --panel-soft:rgba(255,255,255,0.04);
  --border:rgba(255,255,255,0.08);
  --text:#e5e7eb;
  --muted:#9ca3af;
  --accent:#2563eb;
  --success:#16a34a;
  --danger:#dc2626;
  --radius:14px;
}

/* Reset */
*,
*::before,
*::after{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;
}

a{ text-decoration:none; color:inherit; }

/* =========================================================
   Layout (supports BOTH legacy + current HTML)
   ========================================================= */

/* Legacy */
.shell{ display:flex; min-height:100vh; }
.side{
  width:240px;
  background:var(--panel);
  padding:20px 16px;
  border-right:1px solid var(--border);
}
.content{ flex:1; padding:24px; }

/* Current */
.app-shell{ display:flex; min-height:100vh; }
.sidebar{
  width:240px;
  background:var(--panel);
  padding:20px 16px;
  border-right:1px solid var(--border);
}
.main{ flex:1; padding:24px; }

/* =========================================================
   Brand + Nav (supports .nav a + .nav-link)
   ========================================================= */

.brand{
  font-weight:900;
  font-size:18px;
  margin-bottom:24px;
}

/* anchor styling regardless of class */
.nav a,
.nav .nav-link{
  display:block;
  padding:10px 12px;
  margin-bottom:6px;
  border-radius:var(--radius);
  font-weight:600;
  color:var(--muted);
  transition:background .2s ease,color .2s ease,visibility .2s ease;
}

.nav a:hover,
.nav .nav-link:hover{
  background:var(--panel-soft);
  color:var(--text);
}

.nav a.active,
.nav .nav-link.active{
  background:var(--accent);
  color:#fff;
}

/* =========================================================
   Topbar
   ========================================================= */

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.topbar-title h1{ margin:0; }
.topbar-title .muted{ margin-top:6px; }

.muted{ color:var(--muted); }

/* =========================================================
   Panels / Cards
   ========================================================= */

.panel,
.card{
  background:var(--panel);
  padding:20px;
  border-radius:var(--radius);
  border:1px solid var(--border);
}

.hr{ height:1px; background:var(--border); margin:18px 0; }
.small{ font-size:13px; color:var(--muted); }

/* =========================================================
   Buttons
   ========================================================= */

.btn{
  padding:8px 14px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panel-soft);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
  transition:all .2s ease;
}

.btn:hover{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.btn.danger{ background:var(--danger); border-color:var(--danger); color:#fff; }
.btn.success{ background:var(--success); border-color:var(--success); color:#fff; }

/* =========================================================
   Forms
   ========================================================= */

input,textarea,select{
  background:var(--panel-soft);
  border:1px solid var(--border);
  color:var(--text);
  padding:10px 12px;
  border-radius:var(--radius);
  width:100%;
}

input:focus,textarea:focus,select:focus{
  outline:none;
  border-color:var(--accent);
}

label{
  font-weight:700;
  display:block;
  margin-bottom:6px;
}

textarea{ resize:vertical; }

/* =========================================================
   Grids
   ========================================================= */

.grid2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

/* =========================================================
   Monospace
   ========================================================= */

.mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  white-space:pre-wrap;
  word-break:break-word;
}

/* =========================================================
   NAV GATING (CRITICAL)
   ✅ Do NOT use display:none
   ✅ Do NOT use opacity:0 here (some pages "show" by clearing opacity)
   We gate with visibility + pointer-events only.
   ========================================================= */

[data-admin-only],
[data-flqsr-nav],
[data-nav-key]{
  visibility:hidden;
  pointer-events:none;
}

/* =========================================================
   Utility
   ========================================================= */

.metaLine{ font-size:13px; opacity:.75; margin-top:6px; }
.wrap{ max-width:1100px; margin:0 auto; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width:900px){
  .shell,.app-shell{ flex-direction:column; }

  .side,.sidebar{
    width:100%;
    border-right:none;
    border-bottom:1px solid var(--border);
  }

  .content,.main{ padding:16px; }
  .grid2{ grid-template-columns:1fr; }
}
/* =========================================================
   Admin Review badges
   ========================================================= */

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:var(--text);
}

.badge.ok{
  border-color:rgba(34,197,94,.25);
  background:rgba(34,197,94,.12);
  color:#bbf7d0;
}

.badge.warn{
  border-color:rgba(245,158,11,.25);
  background:rgba(245,158,11,.12);
  color:#fde68a;
}