:root{
  --bg:#070B16;
  --panel:#0B1022;
  --panel2:#0E1731;
  --line:rgba(255,255,255,.10);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --good:#39d98a;
  --warn:#ffd166;
  --bad:#ff5ea8;
  --blue:#5cc8ff;
  --glow: 0 18px 80px rgba(0,0,0,.55);
  --radius:18px;
  --radius2:26px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(92,200,255,.14), rgba(0,0,0,0) 55%),
    radial-gradient(900px 700px at 90% 20%, rgba(255,94,168,.10), rgba(0,0,0,0) 50%),
    linear-gradient(180deg, #050713, #070B16 45%, #060A14);
  color:var(--text);
}
a{color:inherit}
.wrap{min-height:100%; display:flex}
.sidebar{
  width:290px;
  background: linear-gradient(180deg, rgba(14,23,49,.72), rgba(8,12,26,.72));
  border-right:1px solid var(--line);
  padding:18px 14px;
  position:sticky; top:0; height:100vh;
}
.brand{
  display:flex; flex-direction:column;
  gap:6px; padding:12px 12px 16px;
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--glow);
}
.brand .t{font-weight:900; letter-spacing:.2px; font-size:16px}
.brand .s{font-size:12.5px; color:var(--muted)}
.nav{margin-top:14px; display:flex; flex-direction:column; gap:10px}
.nav a{
  display:flex; gap:10px; align-items:flex-start;
  padding:12px 12px;
  border:1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  text-decoration:none;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.nav a:hover{transform: translateY(-1px); border-color: rgba(92,200,255,.35); box-shadow: 0 18px 60px rgba(0,0,0,.35)}
.nav .icon{width:22px; text-align:center; opacity:.95}
.nav .txt{display:flex; flex-direction:column; gap:2px}
.nav .h{font-weight:800; font-size:13.5px}
.nav .p{font-size:12.2px; color:var(--muted); line-height:1.25}
.main{flex:1; padding:26px 24px 50px}
.top{
  display:flex; justify-content:space-between; align-items:center;
  gap:14px; margin-bottom:16px;
}
.h1{font-size:22px; font-weight:950; letter-spacing:.2px}
.sub{color:var(--muted); font-size:13px; line-height:1.35}
.grid{display:grid; grid-template-columns: repeat(12, 1fr); gap:14px; margin-top:14px}
.card{
  grid-column: span 12;
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--glow);
  padding:16px;
}
@media(min-width:1000px){
  .card.half{grid-column: span 6}
  .card.third{grid-column: span 4}
}
.hr{height:1px; background: var(--line); margin:14px 0}
.kpi{display:flex; gap:12px; flex-wrap:wrap}
.pill{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding:9px 12px; border-radius: 999px;
  font-size:12.5px;
}
.btnrow{display:flex; flex-wrap:wrap; gap:10px; margin-top:12px}
.btn{
  display:inline-flex; gap:10px; align-items:center;
  padding:11px 14px; border-radius: 16px;
  border:1px solid rgba(92,200,255,.35);
  background: linear-gradient(180deg, rgba(92,200,255,.16), rgba(92,200,255,.07));
  text-decoration:none; font-weight:900; font-size:13px;
  box-shadow: 0 18px 58px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{transform: translateY(-1px); box-shadow: 0 22px 70px rgba(0,0,0,.45); border-color: rgba(255,94,168,.35)}
.btn.secondary{
  border-color: rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
}
.table{width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; border-radius: 18px; border:1px solid rgba(255,255,255,.10)}
.table th,.table td{padding:10px 10px; font-size:12.5px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left; vertical-align:top}
.table th{color:rgba(255,255,255,.82); font-weight:900; background: rgba(255,255,255,.05)}
.table tr:last-child td{border-bottom:none}
.badge{display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius: 999px; font-size:12px; border:1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05)}
.badge.good{border-color: rgba(57,217,138,.45)}
.badge.warn{border-color: rgba(255,209,102,.45)}
.badge.bad{border-color: rgba(255,94,168,.45)}
label{display:block; font-size:12.5px; font-weight:800; margin-bottom:6px; color:rgba(255,255,255,.85)}
input,select{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,30,.65);
  color: var(--text);
  outline:none;
}
input:focus,select:focus{border-color: rgba(92,200,255,.45)}
.formgrid{display:grid; grid-template-columns: repeat(12, 1fr); gap:12px}
.col6{grid-column: span 12}
@media(min-width:1000px){.col6{grid-column: span 6}}
.note{font-size:12.5px; color:var(--muted); line-height:1.35}
.alert{
  padding:12px 12px; border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.alert.good{border-color: rgba(57,217,138,.45)}
.alert.warn{border-color: rgba(255,209,102,.45)}
.alert.bad{border-color: rgba(255,94,168,.45)}

/* GT_BTN_TEXT_WHITE_OVERRIDE
   Force button text to remain readable (some browsers/themes inherit dark text).
*/
.btn,
.btn:link,
.btn:visited,
.btn:hover,
.btn:active,
button.btn {
  color: rgba(255,255,255,.96) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.btn.secondary,
.btn.secondary:link,
.btn.secondary:visited,
.btn.secondary:hover,
.btn.secondary:active,
button.btn.secondary {
  color: rgba(255,255,255,.92) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

/* === PAGE_OFFSET_FIX_V1 === */

.main{
  padding-top:20px !important;
}

.page{
  margin-top:0 !important;
  padding-top:0 !important;
}


/* === GT_DEBUG_OVERLAY_FIX === */

.gt-debug-overlay{
  position:fixed !important;
  bottom:20px !important;
  right:20px !important;
  width:600px;
  max-height:70vh;
  overflow:auto;
  z-index:9999;
}


/* === GT_DEBUG_OVERLAY_FIX === */

.gt-debug-overlay{
  position:fixed !important;
  bottom:20px !important;
  right:20px !important;
  width:600px;
  max-height:70vh;
  overflow:auto;
  z-index:9999;
}


/* === GT_DEBUG_OVERLAY_FLOAT_CATCHALL_V1 === */
.gt-debug-overlay,
#gt-debug-overlay,
#gt_debug_overlay,
.gtDebugOverlay,
.gt-debug,
.gtDebug,
.debugOverlay,
.debug-overlay{
  position: fixed !important;
  left: 280px !important;
  right: 20px !important;
  bottom: 20px !important;
  max-height: 46vh !important;
  overflow: auto !important;
  z-index: 99999 !important;
}

@media (max-width: 980px){
  .gt-debug-overlay,
  #gt-debug-overlay,
  #gt_debug_overlay,
  .gtDebugOverlay,
  .gt-debug,
  .gtDebug,
  .debugOverlay,
  .debug-overlay{
    left: 12px !important;
    right: 12px !important;
  }
}


/* === GT_LAYOUT_TOP_ALIGN_V1 ===
   Fix: content being pushed to bottom of main area.
   Forces main column to layout from the top.
*/
.shell{
  min-height: 100vh !important;
  align-items: stretch !important;
}

.main{
  align-self: stretch !important;
  justify-content: flex-start !important;
  align-content: flex-start !important;
}

.topbar{
  margin-top: 0 !important;
}

.page{
  margin-top: 0 !important;
  padding-top: 0 !important;
}


/* === GT_SHELL_FLEX_FIX_V1 ===
   layout.php uses .shell but app.css originally uses .wrap
   Without this, sidebar + main stack vertically (main drops below sidebar).
*/
.shell{
  min-height:100vh;
  display:flex;
}

/* Make the main column behave like a proper app column */
.shell > .main{
  flex:1;
  min-width:0;
  padding:26px 24px 50px;
}

/* layout.php uses different sidebar inner classnames than app.css expects */
.brandName{font-weight:900; letter-spacing:.2px; font-size:16px}
.brandSub{font-size:12.5px; color:var(--muted)}

/* layout.php nav markup */
.navItem{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:12px 12px;
  border:1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  text-decoration:none;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.navItem:hover{
  transform: translateY(-1px);
  border-color: rgba(92,200,255,.35);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.navLabel{font-weight:800; font-size:13.5px}
.navSub{font-size:12.2px; color:var(--muted); line-height:1.25}

/* sidebar footer */
.sidebarFoot{margin-top:14px}
.meLine{font-size:12.5px; color:rgba(255,255,255,.85)}
.meLine b{color:rgba(255,255,255,.95)}

/* topbar/page used by layout.php (optional but clean) */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
}
.topTitle{font-size:22px; font-weight:950; letter-spacing:.2px}
.topMeta{color:var(--muted); font-size:12.5px}


/* === SIDEBAR SCROLL FIX === */
html, body {
  height: 100%;
}

body {
  overflow: hidden;
}

.shell {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: stretch;
}

.sidebar {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
}

.main {
  min-width: 0;
  flex: 1 1 auto;
  height: 100vh;
  overflow: hidden;
}

.page {
  height: calc(100vh - 72px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* optional: nicer sidebar scrollbar */
.sidebar::-webkit-scrollbar {
  width: 10px;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(56,189,248,.35);
  border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(56,189,248,.55);
}
