/* ClipShield Admin — matches the app's palette. */
:root {
  --bg: #F5F2EC;
  --card: #FFFFFF;
  --ink: #191722;
  --mut: #726E7C;
  --line: rgba(20, 18, 30, 0.10);
  --tangerine: #FF6A3D;
  --soft-tangerine: #FFE9E1;
  --grape: #7C5CFF;
  --lime: #12B56A;
  --soft-lime: #DCF6E8;
  --warn: #FF9800;
  --error: #E53935;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.2px; }

/* -------------------------------------------------- chrome: sidebar shell */
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--tangerine); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 0.5px;
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand strong { font-weight: 800; }
.brand-lg { font-size: 19px; justify-content: center; margin-bottom: 22px; }
.who { color: var(--mut); font-size: 13px; }

/* Fixed left sidebar. */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 244px; z-index: 60;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.side-brand {
  display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  padding: 6px 8px 16px;
}
.side-brand strong { font-weight: 800; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--mut); font-weight: 700; font-size: 13.5px;
}
.side-link .nav-ic { flex: 0 0 auto; opacity: 0.8; }
.side-link:hover { background: var(--bg); color: var(--ink); }
.side-link.active { background: var(--soft-tangerine); color: var(--tangerine); }
.side-link.active .nav-ic { opacity: 1; }

.side-foot { padding: 12px 4px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.side-foot .who { display: block; margin-bottom: 10px; font-size: 12.5px; }

.nav-overlay { display: none; }

/* Content column sits to the right of the fixed sidebar. */
.content { margin-left: 244px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.hamburger { display: none; cursor: pointer; color: var(--ink); padding: 4px; margin: -4px 0; }
.topbar-brand { display: none; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.topbar-brand strong { font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 22px; flex: 1; }
.foot { text-align: center; color: var(--mut); font-size: 12px; padding: 20px 0 34px; }

/* Mobile / narrow: the sidebar becomes a slide-in drawer, opened by the
   hamburger with no JavaScript (label toggles the hidden checkbox). */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(15, 14, 19, 0.18);
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .nav-overlay {
    display: block; position: fixed; inset: 0; background: rgba(15, 14, 19, 0.45); z-index: 50;
  }
  .content { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .topbar-brand { display: flex; }
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card-highlight { border-color: var(--tangerine); box-shadow: 0 4px 18px rgba(255, 106, 61, 0.12); }
.card-warn { border-color: var(--warn); background: #FFF9F0; }

.grid-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat-num { font-size: 25px; font-weight: 800; letter-spacing: -0.6px; }
.stat-label { color: var(--mut); font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mut); font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 800; }
.table tbody tr:hover { background: #FAFAF8; }
.table-kv th { width: 170px; }

.muted { color: var(--mut); }
.small { font-size: 12px; }
.key { background: var(--bg); padding: 3px 7px; border-radius: 6px; letter-spacing: 0.5px; }
.key-lg { font-size: 19px; font-weight: 800; padding: 10px 14px; }
.keyline { margin: 6px 0 10px; }
.log {
  background: #14121E; color: #E8E6F0; padding: 13px; border-radius: 11px;
  overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-word;
}

/* ---------------------------------------------------------------- pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; }
.pill-ok   { background: var(--soft-lime); color: var(--lime); }
.pill-off  { background: var(--line); color: var(--mut); }
.pill-bad  { background: #FDE7E7; color: var(--error); }
.pill-warn { background: #FFF1DC; color: #B36B00; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 700; color: var(--mut); }
.field input, .field select, .searchbar input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--tangerine); outline-offset: -1px; }
.field input:disabled { opacity: 0.5; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--tangerine); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.searchbar { display: flex; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; }
.searchbar input { max-width: 320px; }
.hint { color: var(--mut); font-size: 12.5px; margin: 12px 0 0; line-height: 1.55; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer;
  text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--tangerine); border-color: var(--tangerine); color: #fff; }
.btn-primary:hover { filter: brightness(0.95); background: var(--tangerine); }
.btn-danger { color: var(--error); border-color: rgba(229, 57, 53, 0.35); }
.btn-danger:hover { background: #FDE7E7; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- flash */
.flash { padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.flash-ok    { background: var(--soft-lime); color: #0B7A47; }
.flash-error { background: #FDE7E7; color: #A61B18; }
.flash-warn  { background: #FFF1DC; color: #8A5200; }

/* ---------------------------------------------------------------- login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px; width: 100%; max-width: 370px;
  display: flex; flex-direction: column; gap: 15px;
  box-shadow: 0 10px 34px rgba(20, 18, 30, 0.07);
}

@media (max-width: 640px) {
  .wrap { padding: 14px; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 7px 6px; }
}

/* ---------------------------------------------------------- page header */
.page-head { margin: 4px 0 20px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.6px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--mut); font-size: 13.5px; line-height: 1.5; max-width: 720px; }

/* Clickable stat tiles (dashboard). */
a.stat { text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; display: block; }
a.stat:hover { border-color: var(--tangerine); transform: translateY(-1px); }
.stat-hint { color: var(--tangerine); font-size: 11px; font-weight: 700; margin-top: 6px; }

/* ------------------------------------------------------- notice banners */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px; margin-bottom: 18px;
  border: 1px solid var(--line); background: var(--card); font-size: 13.5px; line-height: 1.5;
}
.notice .notice-ic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.notice-info    { border-color: rgba(10,165,224,.4); background: var(--soft-ocean, #DAF0FB); }
.notice-info .notice-ic { background: var(--ocean, #0AA5E0); color: #fff; }
.notice-ok      { border-color: rgba(18,181,106,.4); background: var(--soft-lime); }
.notice-ok .notice-ic { background: var(--lime); color: #fff; }
.notice-off     { border-color: var(--line); background: var(--bg); }
.notice-off .notice-ic { background: var(--mut); color: #fff; }
.notice strong { font-weight: 800; }
:root { --ocean:#0AA5E0; --soft-ocean:#DAF0FB; }

/* --------------------------------------------------------------- steps */
.steps { counter-reset: step; margin: 6px 0 0; padding: 0; list-style: none; }
.steps li {
  position: relative; padding: 0 0 14px 40px; color: var(--ink); font-size: 13.5px; line-height: 1.5;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--tangerine); color: #fff; font-weight: 800; font-size: 13px;
  display: grid; place-items: center;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::after {
  content: ''; position: absolute; left: 12.5px; top: 26px; bottom: 4px; width: 1px; background: var(--line);
}
.steps li:last-child::after { display: none; }

/* ---------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
}
.chip-num { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); }
.chip-lab { font-size: 11px; font-weight: 700; color: var(--mut); }
.chip-lime .chip-num { color: var(--lime); }
.chip-warn { border-color: rgba(255,152,0,.45); background: #FFF7EC; }
.chip-warn .chip-num { color: #B36B00; }
.chip-zero .chip-num { color: var(--error); }

/* ----------------------------------------------------- disclosure panel */
details.disc { border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; background: var(--bg); }
details.disc > summary {
  cursor: pointer; list-style: none; padding: 11px 14px; font-weight: 700; font-size: 13px;
  color: var(--ink); display: flex; align-items: center; gap: 8px;
}
details.disc > summary::-webkit-details-marker { display: none; }
details.disc > summary::before { content: '▸'; color: var(--mut); font-size: 12px; transition: transform .15s; }
details.disc[open] > summary::before { transform: rotate(90deg); }
details.disc > summary:hover { color: var(--tangerine); }
details.disc .disc-body { padding: 4px 14px 14px; }

/* ---------------------------------------------------- reseller headings */
.res-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.res-head .res-name { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.res-head .res-spacer { flex: 1; }

/* ---------------------------------------------------------------- charts */
.chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 190px; overflow-x: auto; padding-bottom: 4px;
}
.bar-col { flex: 1 0 22px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-val { font-size: 10px; font-weight: 800; color: var(--mut); height: 14px; }
.bar-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--bg); border-radius: 4px; overflow: hidden;
}
.bar-fill { width: 100%; background: var(--tangerine); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-lab {
  font-size: 9px; color: var(--mut); margin-top: 5px; white-space: nowrap;
  transform: rotate(-45deg); transform-origin: center; height: 22px;
}
.share {
  display: inline-block; vertical-align: middle; width: 120px; height: 7px;
  background: var(--bg); border-radius: 4px; overflow: hidden; margin-right: 7px;
}
.share-fill { height: 100%; background: var(--tangerine); }
