/* ==================================================================
   ARKCHEAT PANEL — "MARINE" UI v7.0
   Clean, soft, multi-hue. Teal / cyan / blue / lilac / gold / coral.
   ================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Surfaces */
  --bg:  #070d12;
  --s1:  #0a141b;
  --s2:  #0e1820;
  --s3:  #13212b;
  --s4:  #1a2c37;
  --s5:  #223844;

  /* Accent + supporting hues */
  --acc:     #2dd4bf;
  --acc-h:   #4ee0cd;
  --acc-d:   #14b8a6;
  --acc-08:  rgba(45,212,191,.08);
  --acc-13:  rgba(45,212,191,.13);
  --acc-20:  rgba(45,212,191,.20);
  --acc-35:  rgba(45,212,191,.35);

  --cyan:    #38bdf8;
  --blue:    #6291f5;
  --lilac:   #c084fc;
  --gold:    #fcd34d;
  --coral:   #fb7185;
  --emerald: #34d399;

  /* Semantic (mapped onto the palette) */
  --danger:  #fb7185;
  --warn:    #fcd34d;
  --success: #34d399;
  --purple:  #c084fc;

  /* Text */
  --text:   #e6f0f4;
  --text2:  #adc2cc;
  --muted:  #7d97a3;
  --muted2: #93aab5;

  /* Lines */
  --line:  rgba(255,255,255,.07);
  --line2: rgba(255,255,255,.13);
  --line3: rgba(255,255,255,.20);

  /* Legacy aliases — individual pages still reference these older token names
     in inline <style> blocks. Keep them mapped so those rules stay valid. */
  --border:  var(--line);
  --border2: var(--line2);
  --bg2:     var(--s2);
  --bg3:     var(--s3);
  --acc2:    var(--cyan);

  /* Geometry */
  --r:  14px;
  --r2: 10px;
  --r3: 9px;
  --r4: 7px;
  --sbw: 222px;

  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Inter', system-ui, sans-serif;   /* numerals use tabular-nums, not a mono face */

  --sh:  0 24px 60px rgba(0,0,0,.55);
  --sh2: 0 8px 24px rgba(0,0,0,.4);
}

/* ══ RESET ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body {
  min-height: 100%;
  font-family: var(--body);
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
  overflow-x: hidden; max-width: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: var(--body); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--s5); }
::selection { background: var(--acc); color: #062a26; }

/* Stop the browser painting autofilled inputs white */
input:-webkit-autofill, input:-webkit-autofill:hover,
input:-webkit-autofill:focus, input:-webkit-autofill:active,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--s3) inset !important;
  box-shadow: 0 0 0 1000px var(--s3) inset !important;
  caret-color: var(--acc);
  transition: background-color 9999s ease-out 0s;
  font-family: var(--body) !important;
}

/* ══ SHELL ══ */
.app { display: flex; min-height: 100vh; }

/* ══════════════ SIDEBAR ══════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sbw); z-index: 60;
  background: var(--s1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 13px;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 0; }

.sb-logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.logo-box {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r3);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--acc), var(--blue));
  color: #062a26; font-size: 12px; font-weight: 700;
}
.logo-box img { width: 100%; height: 100%; object-fit: cover; }
.logo-name { font-size: 15px; font-weight: 600; letter-spacing: -.2px; line-height: 1.2; }
.logo-ver { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.sb-nav { flex: 1; display: flex; flex-direction: column; }
.sb-sec { margin-bottom: 2px; }
.sb-lbl {
  display: block; padding: 16px 9px 7px;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
}
.ni {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; margin-bottom: 1px; border-radius: var(--r4);
  color: var(--text2); font-size: 13.5px; font-weight: 450;
  cursor: pointer; transition: background .14s, color .14s;
}
.ni-ico { width: 17px; height: 17px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ni-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; opacity: .7; transition: opacity .14s; }
.ni:hover { background: rgba(255,255,255,.035); color: var(--text); }
.ni:hover .ni-ico svg { opacity: .95; }
.ni.on { background: var(--acc-08); color: var(--acc); }
.ni.on .ni-ico svg { opacity: 1; }
.nb {
  margin-left: auto; padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600;
}
.nb-g { background: var(--acc-20); color: var(--acc); }
.nb-r { background: rgba(251,113,133,.2); color: var(--coral); }

.sb-foot { margin-top: auto; padding-top: 14px; }
.uc {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r2);
  background: var(--s2); border: 1px solid var(--line);
}
.ua {
  width: 31px; height: 31px; flex-shrink: 0; border-radius: var(--r3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.ua-owner    { background: linear-gradient(140deg, var(--acc), var(--cyan)); color: #062a26; }
.ua-admin    { background: linear-gradient(140deg, var(--blue), var(--lilac)); color: #fff; }
.ua-reseller { background: var(--s4); color: var(--text2); }
.un { font-size: 13px; font-weight: 550; line-height: 1.2; }
.ur { font-size: 11.5px; margin-top: 1px; }
.ur-owner { color: var(--acc); } .ur-admin { color: var(--blue); } .ur-reseller { color: var(--muted); }
.lout {
  margin-left: auto; flex-shrink: 0;
  width: 29px; height: 29px; border-radius: var(--r4);
  border: 1px solid var(--line2); background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .15s;
}
.lout svg { width: 14px; height: 14px; }
.lout:hover { background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.35); color: var(--coral); }

/* ══════════════ MAIN ══════════════ */
.main { flex: 1; min-width: 0; margin-left: var(--sbw); display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex-shrink: 0;
  position: sticky; top: 0; z-index: 40;
  background: rgba(7,13,18,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 0 30px;
}
.pg-title {
  font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--text);
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-title small {
  font-size: 11.5px; font-weight: 500; color: var(--acc);
  background: var(--acc-08); border: 1px solid var(--acc-20);
  padding: 2px 9px; border-radius: 20px;
}
.topbar-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.content { flex: 1; padding: 30px; min-width: 0; }

.maint-bar {
  display: none; align-items: center; gap: 10px;
  padding: 11px 30px;
  background: rgba(252,211,77,.07);
  border-bottom: 1px solid rgba(252,211,77,.22);
  font-size: 13px; color: var(--gold);
}
.maint-bar.show { display: flex; }

/* ══ STATUS PILL ══ */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500; border: 1px solid;
}
.p-on   { background: var(--acc-08);          color: var(--acc);   border-color: var(--acc-20); }
.p-off  { background: rgba(251,113,133,.09);  color: var(--coral); border-color: rgba(251,113,133,.25); }
.p-warn { background: rgba(252,211,77,.09);   color: var(--gold);  border-color: rgba(252,211,77,.25); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ══ GRIDS ══ */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; }
.g-left { display: grid; grid-template-columns: 1.35fr .65fr; gap: 15px; }

/* ══ KPI ══ */
.kpi {
  background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 19px 21px;
  transition: border-color .18s, transform .18s;
}
.kpi:hover { border-color: var(--line2); transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.kpi-ico {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r4);
  display: flex; align-items: center; justify-content: center;
  background: var(--kb, var(--acc-13)); color: var(--kc, var(--acc));
}
.kpi-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-lbl { font-size: 12.5px; color: var(--muted); font-weight: 450; }
.kpi-trend { margin-left: auto; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 20px; }
.t-up { background: rgba(52,211,153,.13); color: var(--emerald); }
.t-dn { background: rgba(251,113,133,.13); color: var(--coral); }
.kpi-val {
  font-size: clamp(24px,3vw,29px); font-weight: 600;
  letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pbar { height: 5px; border-radius: 20px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 14px; }
.pfill { height: 100%; border-radius: 20px; background: var(--kc, var(--acc)); }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 9px; }

/* ══ CARD ══ */
.card {
  background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px; overflow: hidden;
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 16px 21px; border-bottom: 1px solid var(--line);
}
.ct {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 550; color: var(--text);
}
.ct svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--acc); }
.card-b { padding: 21px; }

/* ══ TABLE ══ */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 12px 21px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .13s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(45,212,191,.03); }
tbody td { padding: 13px 21px; vertical-align: middle; }
.td-mono { font-variant-numeric: tabular-nums; color: var(--text2); }
.kcode {
  display: inline-block; padding: 4px 10px; border-radius: var(--r4);
  background: var(--s3); border: 1px solid var(--line);
  font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums;
}

/* ══ BADGES ══ */
.bx {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.bx::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.b-owner    { background: var(--acc-13);          color: var(--acc); }
.b-admin    { background: rgba(98,145,245,.14);   color: var(--blue); }
.b-reseller { background: rgba(255,255,255,.06);  color: var(--muted2); }
.b-active   { background: rgba(52,211,153,.14);   color: var(--emerald); }
.b-unused   { background: rgba(56,189,248,.14);   color: var(--cyan); }
.b-ban      { background: rgba(251,113,133,.14);  color: var(--coral); }
.b-exp      { background: rgba(252,211,77,.14);   color: var(--gold); }
.b-purple   { background: rgba(192,132,252,.14);  color: var(--lilac); }

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r3);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap; user-select: none;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }

.btn-acc   { background: var(--acc-13); color: var(--acc); border-color: var(--acc-20); }
.btn-acc:hover { background: var(--acc); color: #062a26; border-color: var(--acc); }
.btn-blue  { background: rgba(98,145,245,.13); color: var(--blue); border-color: rgba(98,145,245,.28); }
.btn-blue:hover { background: var(--blue); color: #fff; }
.btn-red   { background: rgba(251,113,133,.13); color: var(--coral); border-color: rgba(251,113,133,.28); }
.btn-red:hover { background: var(--coral); color: #3d0713; }
.btn-warn  { background: rgba(252,211,77,.13); color: var(--gold); border-color: rgba(252,211,77,.28); }
.btn-warn:hover { background: var(--gold); color: #3a2c05; }
.btn-ghost { background: var(--s3); color: var(--text2); border-color: var(--line2); }
.btn-ghost:hover { background: var(--s4); color: var(--text); border-color: var(--line3); }
.btn-solid { background: var(--acc); color: #062a26; border-color: var(--acc); font-weight: 600; }
.btn-solid:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn-solid svg { stroke: #062a26; }

.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-xs { padding: 5px 10px; font-size: 11.5px; gap: 5px; border-radius: var(--r4); }
.btn-full { width: 100%; padding: 12px; font-size: 14px; }
.btn-acc.btn-full { background: var(--acc); color: #062a26; border-color: var(--acc); font-weight: 600; }
.btn-acc.btn-full:hover { background: var(--acc-h); }
.btn-acc.btn-full svg { stroke: #062a26; }

/* ══ FORMS ══ */
.fg { margin-bottom: 17px; }
.fl { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 500; color: var(--text2); }
.fi {
  width: 100%; padding: 11px 13px;
  background: var(--s3); border: 1px solid var(--line2);
  border-radius: var(--r3); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.fi:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-13); }
.fi::placeholder { color: var(--muted); }
.fi:read-only { background: var(--s2); color: var(--muted2); }
textarea.fi { resize: vertical; min-height: 90px; }
select.fi {
  cursor: pointer; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237d97a3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
select.fi option { background: var(--s3); color: var(--text); }
.fi-mono { font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.fi-hint { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.5; }

/* ══ TOGGLE ══ */
.tog { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.tog input { position: absolute; opacity: 0; width: 0; height: 0; }
.togsl {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--s4); border: 1px solid var(--line2);
  border-radius: 20px; transition: .2s;
}
.togsl::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  left: 3px; top: 3px; border-radius: 50%;
  background: var(--muted); transition: .2s;
}
.tog input:checked + .togsl { background: var(--acc); border-color: var(--acc); }
.tog input:checked + .togsl::before { transform: translateX(18px); background: #062a26; }

/* ══ CODE ══ */
code {
  padding: 2px 8px; border-radius: var(--r4);
  background: var(--acc-08); border: 1px solid var(--acc-13);
  color: var(--acc); font-size: 12.5px;
}

/* ══ SEARCH ══ */
.sbar {
  display: flex; align-items: center; position: relative;
  padding: 0 13px; border-radius: var(--r3);
  background: var(--s3); border: 1px solid var(--line2);
  transition: border-color .16s, box-shadow .16s;
}
.sbar:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-13); }
.sbar svg { color: var(--muted); flex-shrink: 0; margin-right: 9px; }
.sbar input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 13.5px; padding: 10px 0;
}
.sbar input::placeholder { color: var(--muted); }

/* ══ MODAL ══ */
.modal-bg {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(3,7,10,.8); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.open { display: flex; animation: fadeIn .18s; }
.mbox {
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--s2); border: 1px solid var(--line2);
  border-radius: var(--r); box-shadow: var(--sh);
  animation: popIn .22s cubic-bezier(.34,1.3,.64,1);
}
.mbox-sm { max-width: 430px; }
.mhead {
  flex-shrink: 0; padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mtit { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex-shrink: 0; }
.mcls {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--r4);
  background: var(--s3); border: 1px solid var(--line2); color: var(--muted);
  font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.mcls:hover { background: rgba(251,113,133,.15); border-color: rgba(251,113,133,.35); color: var(--coral); }
.mbody { padding: 22px; overflow-y: auto; }
.mfoot {
  flex-shrink: 0; padding: 16px 22px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
}
.mfoot .btn-acc { background: var(--acc); color: #062a26; border-color: var(--acc); }
.mfoot .btn-red { background: var(--coral); color: #3d0713; border-color: var(--coral); }
.mfoot .btn[disabled], .btn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }

.key-box {
  padding: 16px 18px; border-radius: var(--r2);
  background: var(--s3); border: 1px solid var(--acc-20);
  color: var(--acc); font-size: 13.5px;
  word-break: break-all; line-height: 1.9;
}
.kv-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 11px; font-size: 13px; }
.kv-k { width: 106px; flex-shrink: 0; color: var(--muted); font-size: 12.5px; }
.kv-v { color: var(--text); font-weight: 450; word-break: break-all; }
.sep { height: 1px; background: var(--line); margin: 20px 0; }

/* ══ ALERTS ══ */
.alert {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; margin-bottom: 16px;
  border: 1px solid; border-radius: var(--r2); font-size: 13.5px;
}
.a-info { background: rgba(98,145,245,.07); border-color: rgba(98,145,245,.22); color: #a9c3fb; }
.a-warn { background: rgba(252,211,77,.07);  border-color: rgba(252,211,77,.22);  color: #f6e4a8; }
.a-ok   { background: var(--acc-08);         border-color: var(--acc-20);         color: #8fe9dd; }
.a-err  { background: rgba(251,113,133,.07); border-color: rgba(251,113,133,.22); color: #fbb2be; }

/* ══ TOASTS ══ */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 11px;
  min-width: 240px; max-width: 340px; padding: 13px 16px;
  background: var(--s3); border: 1px solid var(--line2);
  border-radius: var(--r2); box-shadow: var(--sh2);
  font-size: 13.5px; cursor: pointer; pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══ MISC ══ */
.srow {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 17px; margin-bottom: 10px;
  background: var(--s3); border: 1px solid var(--line); border-radius: var(--r2);
}
.logo-drop {
  padding: 30px; text-align: center; cursor: pointer;
  background: var(--acc-08); border: 1px dashed var(--acc-20);
  border-radius: var(--r2); transition: .18s;
}
.logo-drop:hover { border-color: var(--acc); background: var(--acc-13); }
.logo-drop input { display: none; }
.owner-only {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--acc-08); border: 1px solid var(--acc-20); color: var(--acc);
  font-size: 11.5px; font-weight: 500;
}
.maint-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px; margin-bottom: 16px;
  background: var(--s2); border: 1px solid rgba(252,211,77,.25); border-radius: var(--r);
}
.kfmt {
  padding: 16px; margin-bottom: 14px; text-align: center;
  background: var(--s3); border: 1px solid var(--acc-20); border-radius: var(--r2);
  font-size: 15px; color: var(--acc); letter-spacing: 1px;
}
.kfmt span { color: var(--muted); }
.ref-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: var(--r2);
  background: var(--acc-08); border: 1px solid var(--acc-20);
  font-size: 19px; font-weight: 600; color: var(--acc); letter-spacing: 3px;
}
.info-box { padding: 14px 16px; background: rgba(98,145,245,.06); border: 1px solid rgba(98,145,245,.2); border-radius: var(--r2); font-size: 13px; color: var(--text2); line-height: 1.6; }
.warn-box { padding: 14px 16px; background: rgba(252,211,77,.06); border: 1px solid rgba(252,211,77,.2); border-radius: var(--r2); font-size: 13px; color: var(--text2); line-height: 1.6; }
.code-box {
  padding: 14px 16px; background: var(--s3);
  border: 1px solid var(--line2); border-radius: var(--r2);
  font-size: 12.5px; color: var(--acc); word-break: break-all; line-height: 1.8;
}

/* ══ PAGINATION ══ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px; flex-wrap: wrap; }
.pg-btn {
  min-width: 34px; padding: 7px 12px; text-align: center;
  background: var(--s3); border: 1px solid var(--line);
  border-radius: var(--r4); color: var(--text2);
  font-size: 12.5px; cursor: pointer; transition: .15s;
}
.pg-btn:hover { border-color: var(--acc-35); color: var(--acc); }
.pg-btn.on { background: var(--acc); border-color: var(--acc); color: #062a26; font-weight: 600; }

/* ══ TABS ══ */
.rb-tabs { display: flex; gap: 4px; padding: 5px; margin-bottom: 20px; background: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); flex-wrap: wrap; }
.rb-tab {
  flex: 1; padding: 9px 14px; border: none; border-radius: var(--r4);
  background: none; color: var(--muted2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.rb-tab:hover { background: rgba(255,255,255,.04); color: var(--text); }
.rb-tab.on { background: var(--acc); color: #062a26; font-weight: 600; }
.rb-pane { display: none; }
.rb-pane.on { display: block; animation: fadeIn .2s; }

/* ══════════════ LOGIN ══════════════ */
.login-scene {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg); position: relative; overflow: hidden;
}
.orb1 { position: absolute; top: -22%; left: 50%; transform: translateX(-50%);
        width: 620px; height: 620px; pointer-events: none;
        background: radial-gradient(circle, rgba(45,212,191,.13), transparent 65%); }
.orb2 { position: absolute; bottom: -20%; right: -8%; width: 520px; height: 520px; pointer-events: none;
        background: radial-gradient(circle, rgba(98,145,245,.10), transparent 65%); }
.orb3 { position: absolute; top: 30%; left: -10%; width: 460px; height: 460px; pointer-events: none;
        background: radial-gradient(circle, rgba(192,132,252,.07), transparent 65%); }
.pts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pt { position: absolute; border-radius: 50%; animation: ptf linear infinite; }
@keyframes ptf {
  0%   { transform: translateY(110vh); opacity: 0; }
  10%  { opacity: .7; }
  90%  { opacity: .35; }
  100% { transform: translateY(-10vh); opacity: 0; }
}

.login-wrap { width: 100%; max-width: 390px; position: relative; z-index: 10; }
.login-card {
  background: rgba(14,24,32,.92);
  border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0,0,0,.55);
  overflow: hidden;
}
.login-top { padding: 32px 30px 0; }
.brand-logo {
  width: 38px; height: 38px; margin-bottom: 18px; border-radius: var(--r2);
  background: linear-gradient(140deg, var(--acc), var(--blue));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: #062a26; font-size: 15px; font-weight: 700;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo-inner { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.brand-name { font-size: 21px; font-weight: 600; letter-spacing: -.4px; margin-bottom: 5px; }
.brand-sub { font-size: 13.5px; color: var(--muted); }

.login-body { padding: 26px 30px 24px; }
.sec-tags { display: none; }   /* security badges removed */

.login-field { margin-bottom: 15px; }
.login-label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 500; color: var(--text2); }
.login-inp-wrap { position: relative; }
.login-input {
  width: 100%; padding: 11px 13px;
  background: var(--s3); border: 1px solid var(--line2);
  border-radius: var(--r3); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.login-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-13); }
.login-input::placeholder { color: var(--muted); }
.login-input-icon-right {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 5px; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; transition: color .15s;
}
.login-input-icon-right:hover { color: var(--acc); }

.login-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0; }
.stay-lbl { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.forgot-link { font-size: 12.5px; color: var(--acc); font-weight: 500; }
.forgot-link:hover { color: var(--acc-h); }

.btn-login {
  width: 100%; padding: 12px;
  background: var(--acc); color: #062a26;
  border: none; border-radius: var(--r3);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .16s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login svg { stroke: #062a26; }
.btn-login:hover { background: var(--acc-h); }
.btn-login:disabled { opacity: .5; cursor: not-allowed; }

.login-foot { padding: 16px 30px 24px; border-top: 1px solid var(--line); text-align: center; }
.login-foot p { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.login-foot a { color: var(--acc); font-weight: 500; }
.login-foot .reset-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  padding: 7px 14px; border: 1px solid var(--line2); border-radius: var(--r4);
  font-size: 12.5px; color: var(--muted); transition: .15s;
}
.login-foot .reset-link:hover { color: var(--acc); border-color: var(--acc-35); }

/* ══ MOBILE ══ */
.menu-tog { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.mob-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 55; }
.mob-overlay.show { display: block; }

@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px)  { .g2, .g3, .g-left { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .menu-tog { display: flex; align-items: center; }
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,.7); }
  .main { margin-left: 0; }
  .topbar { height: 58px; padding: 0 15px; gap: 10px; }
  .pg-title { font-size: 14px; }
  .pg-title small { display: none; }
  .topbar-r .btn { padding: 7px 12px; font-size: 12px; }
  .content { padding: 16px; }
  .app, .main, .content { max-width: 100vw; overflow-x: hidden; }
  .content > * { max-width: 100%; }
  .card-h { padding: 14px 16px; }
  .card-b { padding: 16px; }
  .kpi { padding: 16px 17px; }
  table { font-size: 12.5px; }
  thead th { padding: 11px 15px; }
  tbody td { padding: 12px 15px; white-space: nowrap; }
  code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .fi-hint, .srow, .kv-v { overflow-wrap: anywhere; word-break: break-word; }
  .kcode { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  .srow { flex-wrap: wrap; gap: 10px; }
  .kv-row { flex-direction: column; gap: 3px; }
  .kv-k { width: auto; }
  .mbox { width: 94vw; max-width: 94vw; }
  .mbody { padding: 18px; }
  .mhead, .mfoot { padding: 15px 18px; }
  .rb-tab { flex: 1 1 auto; font-size: 12px; padding: 8px 11px; }
  .kfmt { font-size: 13px; word-break: break-all; }
  .login-top { padding: 28px 22px 0; }
  .login-body { padding: 22px 22px 20px; }
  .login-foot { padding: 15px 22px 20px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
}
@media (max-width: 430px) { .g4 { grid-template-columns: 1fr; } }

/* ══ ANIMATION ══ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.anim-in { animation: slideUp .3s ease; }
.ico { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════════
   OVERLAP / OVERFLOW SAFETY NET  (added — prevents text & box
   overlap across every panel page without changing the layout)
   ══════════════════════════════════════════════════════════════ */

/* 1) Global box-sizing so padding never pushes boxes past their track */
* { box-sizing: border-box; }

/* 2) Cards & their bodies must clip and allow long content to wrap */
.card, .card-b { min-width: 0; }
.card-b { overflow-wrap: anywhere; }

/* 3) srow: label left, value right — allow the value to shrink & wrap
      instead of overlapping the label on narrow cards */
.srow { min-width: 0; }
.srow > span:first-child { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.srow > span:last-child  { flex: 0 1 auto; min-width: 0; text-align: right;
                           overflow-wrap: anywhere; word-break: break-word; }

/* 4) Any grid cell can shrink (fixes children with nowrap overflowing the column) */
.g2 > *, .g3 > *, .g4 > *, .g-left > * { min-width: 0; }

/* 5) Card header: title + right-side controls shouldn't collide */
.card-h { gap: 10px; flex-wrap: wrap; }
.card-h .ct { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 6) Long monospace values (keys, tokens, ids) always wrap, never overflow */
.fi-mono, .kfmt, .kv-v, code, .mono { overflow-wrap: anywhere; word-break: break-word; }

/* 7) Tables: keep them scrollable rather than letting cells overlap */
.tw { max-width: 100%; }
table td, table th { overflow-wrap: anywhere; }

/* 8) Form hints and labels wrap cleanly */
.fi-hint, .fl { overflow-wrap: anywhere; }

/* 9) Rebranding page rows: prevent the label/value/badge stack from colliding */
.rb-row, .rb-item, .rb-line { min-width: 0; gap: 10px; flex-wrap: wrap; }
.rb-row > *, .rb-item > * { min-width: 0; overflow-wrap: anywhere; }

/* Inline mono code box (bot webhook URL etc) */
.code-box2{background:var(--s3);border:1px solid var(--border);border-radius:var(--r2);
  padding:10px 12px;font-family:monospace;font-size:12px;color:var(--acc);
  overflow-wrap:anywhere;word-break:break-all}

/* Pills/badges never overflow their container; they clip instead of overlapping */
.bx, .pill, .kill-badge, .ver-badge, .lib-slot-badge {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
/* Table cells holding pills allow them to wrap to a new line if truly tight */
td .bx { vertical-align: middle; }
/* Ensure flex rows with a pill on the right don't crush the left label */
.card-h, .srow, .kpi, .kv, .rb-row { min-width: 0; }

/* Settings permission rows (clean, no overlap) */
.perm-row{display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:12px 0;border-bottom:1px solid var(--border);min-width:0}
.perm-row:last-of-type{border-bottom:none}
.perm-txt{min-width:0;flex:1}
.perm-title{font-weight:700;font-size:13px;overflow-wrap:anywhere}
.perm-sub{font-size:11px;color:var(--muted);margin-top:3px;line-height:1.5;overflow-wrap:anywhere}
.perm-row .tog{flex:0 0 auto}

/* ── Extra polish: card headers & pills never collide, always breathe ── */
.card-h{gap:12px;flex-wrap:wrap;align-items:center;row-gap:8px}
.card-h .ct{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}
.card-h .pill,.card-h .bx,.card-h .owner-only{flex:0 0 auto}
/* Owner-only tag spacing so it doesn't stick to the title */
.owner-only{white-space:nowrap;margin-left:auto}
/* URL/code rows: wrap cleanly on small screens, button never overlaps code */
.url-row,.code-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;min-width:0}
.url-row code,.code-row code{flex:1 1 220px;min-width:0;word-break:break-all}

/* Session auto-logout countdown pill */
.sess-timer{font-variant-numeric:tabular-nums;font-family:var(--mono,monospace);
  font-size:11px;font-weight:700;letter-spacing:.5px;transition:all .3s}
.sess-timer svg{opacity:.85}
