/* ==========================================================================
   1REY — Admin panel
   Layout, login, dashboard, tables, drawers, labs, settings
   ========================================================================== */

:root {
  --sidebar-w: 272px;
  --topbar-h: 76px;
  --admin-bg: #08080b;
  --admin-panel: #101016;
  --admin-panel-2: #14141b;
  --admin-radius: 18px;
}

.admin-body {
  background:
    radial-gradient(1000px 560px at 88% -10%, rgba(201, 151, 62, 0.1), transparent 62%),
    radial-gradient(760px 500px at 0% 30%, rgba(126, 169, 255, 0.035), transparent 60%),
    var(--admin-bg);
}

.admin-body::after {
  background-image: none;
}

[hidden] { display: none !important; }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login-view {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  place-items: stretch;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  min-height: calc(100vh - 36px);
  border-radius: 30px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(232, 197, 106, 0.04) inset;
}

/* ---------- visual side ---------- */
.login-visual {
  position: relative;
  isolation: isolate;
  padding: 34px 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  min-height: 640px;
  overflow: hidden;
  background: #0b0b0f;
}

.login-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;
  z-index: -3;
  transform: scale(1.03);
  animation: loginDrift 22s ease-in-out infinite alternate;
}

@keyframes loginDrift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.5%, -1%, 0); }
}

.login-visual-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(8, 8, 11, 0.94) 0%, rgba(8, 8, 11, 0.82) 42%, rgba(8, 8, 11, 0.18) 78%, rgba(8, 8, 11, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 8, 11, 0.94) 0%, rgba(8, 8, 11, 0.15) 48%, rgba(8, 8, 11, 0.55) 100%);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(232, 197, 106, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 197, 106, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(600px 500px at 20% 60%, #000 10%, transparent 75%);
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  z-index: -1;
}
.login-orb--a {
  width: 420px;
  height: 420px;
  top: -130px;
  left: -110px;
  background: radial-gradient(circle, rgba(232, 197, 106, 0.14), transparent 65%);
}
.login-orb--b {
  width: 320px;
  height: 320px;
  bottom: 8%;
  right: 18%;
  background: radial-gradient(circle, rgba(232, 197, 106, 0.08), transparent 66%);
}

.login-visual-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.login-brand img { width: 44px; height: 44px; filter: drop-shadow(0 6px 18px rgba(232, 197, 106, 0.3)); }
.login-brand span { display: flex; flex-direction: column; line-height: 1.4; }
.login-brand strong { font-size: 15px; font-weight: 800; color: #fff; }
.login-brand small { font-size: 9.5px; color: var(--gold-2); }

.login-demo-badge {
  backdrop-filter: blur(10px);
  background: rgba(232, 197, 106, 0.12);
}

.login-visual-body {
  position: relative;
  max-width: 540px;
  padding-block: 10px 20px;
}
.login-visual-body .eyebrow { margin-bottom: 16px; }
.login-visual-body h1 {
  font-size: clamp(2.3rem, 3.6vw, 3.45rem);
  line-height: 1.32;
  font-weight: 900;
  margin-bottom: 18px;
  text-shadow: 0 10px 42px rgba(0, 0, 0, 0.45);
}
.login-visual-body > p {
  font-size: 13px;
  line-height: 2.1;
  color: rgba(246, 243, 236, 0.76);
  max-width: 470px;
  margin-bottom: 22px;
}
.login-points { display: flex; flex-direction: column; gap: 10px; }
.login-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  width: fit-content;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 17, 0.44);
  backdrop-filter: blur(9px);
}
.login-points .ic { color: var(--gold-2); font-size: 16px; }

.login-visual-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(10, 10, 14, 0.5);
  backdrop-filter: blur(14px);
  width: fit-content;
}
.login-metric b { display: block; font-size: 19px; font-weight: 800; color: var(--gold-1); line-height: 1.35; }
.login-metric span { font-size: 9.5px; color: var(--dim); }
.login-metric-sep { width: 1px; height: 26px; background: var(--line-2); }

/* ---------- form side ---------- */
.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(560px 340px at 50% 0%, rgba(232, 197, 106, 0.07), transparent 70%),
    linear-gradient(165deg, #111117 0%, #0c0c11 100%);
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/ai-scan.webp") center/cover no-repeat;
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: min(432px, 100%);
  padding: 34px;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: rgba(17, 17, 23, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 34px 90px -30px rgba(0, 0, 0, 0.9);
  animation: adminIn 0.55s var(--ease);
}
.login-card::before {
  content: "";
  display: block;
  height: 1px;
  margin: -34px -34px 28px;
  background: linear-gradient(90deg, transparent, var(--gold-line-strong), transparent);
}

.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-mobile-brand img { width: 40px; height: 40px; }
.login-mobile-brand span { display: flex; flex-direction: column; line-height: 1.4; }
.login-mobile-brand strong { font-size: 14px; }
.login-mobile-brand small { font-size: 9.5px; color: var(--gold-2); }

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
}
.login-kicker .dot { width: 5px; height: 5px; }

.login-title h2 { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 4px; }
.login-title p { font-size: 11.5px; color: var(--dim); margin-bottom: 24px; }

.login-card .field { margin-bottom: 16px; }
.login-input .input { height: 50px; background: rgba(8, 8, 11, 0.55); }
.login-input input { padding-inline-end: 48px; }

.login-eye {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--dim);
  transition: 0.2s;
}
.login-eye:hover { color: var(--gold-2); background: rgba(232, 197, 106, 0.07); }
.login-eye .ic { font-size: 17px; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 123, 123, 0.24);
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 11.5px;
  margin-bottom: 14px;
  animation: shakeX 0.35s ease;
}
.login-error .ic { font-size: 16px; flex: none; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

.login-submit {
  --btn-h: 50px;
  margin-top: 4px;
  font-size: 13.5px;
}
.login-submit .spinner { width: 17px; height: 17px; border-color: rgba(8, 8, 11, 0.25); border-top-color: #17130a; }
.login-submit .ic { font-size: 18px; }
.login-submit-label { display: inline-flex; align-items: center; gap: 8px; }
.login-submit.is-loading .login-submit-label { display: none; }

.demo-cred {
  margin-top: 20px;
  border: 1px dashed rgba(232, 197, 106, 0.3);
  border-radius: 13px;
  background: rgba(232, 197, 106, 0.04);
  padding: 12px 14px;
}
.demo-cred-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11px; }
.demo-cred-head .ic { color: var(--gold-2); font-size: 15px; }
.demo-cred-head .badge { margin-inline-start: auto; font-size: 8.5px; padding: 1px 7px; }
.demo-cred-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: 10.5px; color: var(--muted); }
.demo-cred-row code {
  direction: ltr;
  unicode-bidi: embed;
  color: var(--gold-1);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}
.demo-cred-row .btn { margin-inline-start: auto; }

.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: var(--dim);
}
.login-foot a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); transition: 0.2s; width: fit-content; }
.login-foot a:hover { color: var(--gold-2); }
.login-foot a .ic { font-size: 14px; }

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.admin-app { min-height: 100vh; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(4, 4, 7, 0.66);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.admin-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--line);
  background:
    radial-gradient(320px 260px at 100% 0%, rgba(232, 197, 106, 0.08), transparent 62%),
    linear-gradient(180deg, #0b0b10 0%, #08080c 100%);
  transition: transform 0.35s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.sidebar-brand-link { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.sidebar-brand-link img { width: 41px; height: 41px; filter: drop-shadow(0 5px 15px rgba(232, 197, 106, 0.25)); }
.sidebar-brand-link span { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.sidebar-brand-link strong { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.sidebar-brand-link small { font-size: 9px; color: var(--gold-2); }
.sidebar-collapse {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--dim);
  border: 1px solid transparent;
  transition: 0.2s;
  flex: none;
}
.sidebar-collapse:hover { color: var(--gold-2); background: var(--gold-soft); border-color: var(--gold-line); }
.sidebar-collapse .ic { font-size: 16px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-group-label {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: #625e57;
  font-weight: 600;
  padding: 14px 10px 6px;
}
.sidebar-group-label:first-child { padding-top: 4px; }

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: 0.2s;
  text-align: start;
  width: 100%;
}
.sidebar-link .ic { font-size: 17px; color: #8b877e; transition: 0.2s; }
.sidebar-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.sidebar-link:hover .ic { color: var(--gold-2); }
.sidebar-link.active {
  color: var(--gold-1);
  border-color: var(--gold-line);
  background: linear-gradient(90deg, rgba(232, 197, 106, 0.04), rgba(232, 197, 106, 0.12));
  box-shadow: 0 8px 24px -14px rgba(232, 197, 106, 0.4);
}
.sidebar-link.active .ic { color: var(--gold-2); }
.sidebar-link.active::before {
  content: "";
  position: absolute;
  inset-inline-end: -12px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--gold-2);
  box-shadow: 0 0 12px rgba(232, 197, 106, 0.7);
}
.sidebar-link-badge {
  margin-inline-start: auto;
  font-size: 8.5px;
  font-weight: 700;
  min-width: 20px;
  height: 18px;
  padding-inline: 5px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sidebar-link.active .sidebar-link-badge { background: rgba(232, 197, 106, 0.14); color: var(--gold-1); }
.sidebar-link-badge.is-warn { background: var(--bad-bg); color: var(--bad); }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.055); }
.sidebar-engine {
  border: 1px solid rgba(232, 197, 106, 0.17);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(232, 197, 106, 0.09), rgba(232, 197, 106, 0.02));
  padding: 11px 12px;
  margin-bottom: 10px;
}
.sidebar-engine-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.sidebar-engine-head b { color: var(--gold-1); font-weight: 700; }
.sidebar-engine-ver { margin-inline-start: auto; font-size: 8px; color: var(--dim); direction: ltr; }
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(69, 214, 155, 0.4);
  animation: pulseRing 2s infinite;
  flex: none;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(69, 214, 155, 0.35); }
  70% { box-shadow: 0 0 0 7px rgba(69, 214, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(69, 214, 155, 0); }
}
.sidebar-engine p { font-size: 8.5px; color: var(--muted); line-height: 1.7; margin-top: 5px; }
.sidebar-engine-bar { height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); margin-top: 8px; overflow: hidden; }
.sidebar-engine-bar span { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); }

.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0; }
.sidebar-site-link { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--dim); transition: 0.2s; }
.sidebar-site-link:hover { color: var(--gold-2); }
.sidebar-site-link .ic { font-size: 13px; }
.sidebar-version { font-size: 8px; color: #56534d; }

.admin-main {
  min-height: 100vh;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- topbar ---------- */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 11, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-menu {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  place-items: center;
  flex: none;
}
.topbar-menu .ic { font-size: 19px; }

.topbar-title { min-width: 148px; line-height: 1.35; }
.topbar-crumb { display: block; font-size: 8.5px; color: var(--dim); letter-spacing: 0.04em; }
.topbar-title h1 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(330px, 30vw);
  margin-inline-start: auto;
}
.topbar-search > .ic {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--dim);
  font-size: 16px;
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  padding-inline: 37px 54px;
  font-size: 11px;
  outline: 0;
  transition: 0.2s;
}
.topbar-search input:focus { border-color: var(--gold-line-strong); background: rgba(232, 197, 106, 0.035); }
.topbar-search input::placeholder { color: var(--dim); }
.topbar-search kbd {
  position: absolute;
  inset-inline-end: 8px;
  font-family: inherit;
  font-size: 8px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.03);
  direction: ltr;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.topbar-search + .topbar-actions { margin-inline-start: 0; }
.topbar-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: 0.2s;
  flex: none;
}
.topbar-icon:hover { color: var(--gold-2); border-color: var(--gold-line); background: var(--gold-soft); }
.topbar-icon .ic { font-size: 18px; }
.topbar-count {
  position: absolute;
  top: -5px;
  inset-inline-start: -5px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  color: #191307;
  background: var(--gold-grad);
  border: 2px solid #0a0a0e;
  font-variant-numeric: tabular-nums;
}
.topbar-new { flex: none; }

.user-menu-wrap { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: 0.2s;
  color: var(--text-2);
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.35; text-align: start; }
.user-chip-text b { font-size: 11px; font-weight: 700; color: var(--text); }
.user-chip-text small { font-size: 8.5px; color: var(--dim); }
.user-chip-chev { color: var(--dim); display: grid; place-items: center; }
.user-chip-chev .ic { font-size: 13px; transition: 0.2s; }
.user-chip[aria-expanded="true"] .user-chip-chev .ic { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  width: 224px;
  z-index: 95;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgba(20, 20, 27, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.8);
  padding: 6px;
  animation: modalIn 0.22s var(--ease);
}
.user-dropdown-head { padding: 10px 10px 9px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-dropdown-head b { display: block; font-size: 11.5px; }
.user-dropdown-head span { font-size: 9.5px; color: var(--dim); direction: ltr; display: block; }
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-2);
  text-align: start;
  transition: 0.15s;
}
.user-dropdown button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.user-dropdown button .ic { font-size: 15px; color: var(--dim); }
.user-dropdown button.danger { color: var(--bad); }
.user-dropdown button.danger .ic { color: var(--bad); }
.user-dropdown hr { margin: 5px 4px; border-color: var(--line); }

/* ---------- content ---------- */
.admin-content {
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 24px 28px 38px;
  min-width: 0;
}
.admin-view { animation: adminIn 0.42s var(--ease); }
@keyframes adminIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.admin-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: #625e57;
}
.admin-footer-mid { color: #4d4a45; }
.admin-footer-status { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.admin-footer-status .dot { width: 5px; height: 5px; }

/* ==========================================================================
   PAGE PRIMITIVES
   ========================================================================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head-copy { min-width: 0; }
.page-head h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 800; line-height: 1.4; }
.page-head p { font-size: 11px; color: var(--dim); margin-top: 3px; max-width: 620px; line-height: 1.9; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel-head-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.panel-head .panel-title-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.panel-head .panel-title-right h3 { font-size: 12.5px; }
.panel-sub { font-size: 9.5px; color: var(--dim); }

.admin-panel { border-radius: var(--admin-radius); border: 1px solid var(--line); background: var(--admin-panel); overflow: hidden; min-width: 0; }
.admin-panel .panel-head { padding: 14px 18px; }
.admin-panel .panel-body { padding: 18px; }

.link-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--gold-2); transition: 0.2s; }
.link-inline:hover { color: var(--gold-1); gap: 7px; }
.link-inline .ic { font-size: 13px; }

.progress { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); transition: width 0.5s var(--ease); }
.progress.progress-ok > span { background: linear-gradient(90deg, #2caf7c, #45d69b); }
.progress.progress-bad > span { background: linear-gradient(90deg, #cc5858, #ff7b7b); }
.progress.progress-info > span { background: linear-gradient(90deg, #5c86d8, #7ea9ff); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.kpi-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(155deg, #13131a, #0f0f15);
  padding: 16px 16px 14px;
  overflow: hidden;
  transition: 0.25s var(--ease);
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--kpi-color, var(--gold-2)), transparent);
  opacity: 0.4;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kpi-label { font-size: 10px; color: var(--muted); }
.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--kpi-color, var(--gold-2));
  background: color-mix(in srgb, var(--kpi-color, var(--gold-2)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--kpi-color, var(--gold-2)) 24%, transparent);
  flex: none;
}
.kpi-icon .ic { font-size: 16px; }
.kpi-value { display: flex; align-items: baseline; gap: 5px; line-height: 1.25; margin-bottom: 6px; }
.kpi-value b { font-size: clamp(20px, 2vw, 25px); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-value span { font-size: 9px; color: var(--dim); }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--dim); min-height: 18px; }
.kpi-trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.kpi-trend.up { color: var(--ok); }
.kpi-trend.down { color: var(--bad); }
.kpi-trend .ic { font-size: 11px; }
.kpi-spark { margin-inline-start: auto; opacity: 0.9; flex: none; }
.kpi-spark svg { width: 72px; height: 24px; display: block; }

/* ---------- dashboard hero ---------- */
.dash-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: var(--admin-radius);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(560px 240px at 88% 0%, rgba(232, 197, 106, 0.14), transparent 68%),
    linear-gradient(145deg, #191921, #101016);
  overflow: hidden;
  margin-bottom: 16px;
}
.dash-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold-line-strong), transparent);
}
.dash-hero-copy { min-width: 0; max-width: 720px; }
.dash-hero-copy .eyebrow { margin-bottom: 9px; font-size: 8.5px; }
.dash-hero-copy h2 { font-size: clamp(1.15rem, 2vw, 1.5rem); margin-bottom: 5px; }
.dash-hero-copy p { font-size: 11px; color: var(--muted); line-height: 1.95; }
.dash-hero-copy p b { color: var(--gold-1); font-weight: 600; }
.dash-hero-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.engine-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid var(--gold-line);
  background: rgba(232, 197, 106, 0.06);
  backdrop-filter: blur(8px);
}
.engine-chip-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--gold-2); background: var(--gold-soft); border: 1px solid var(--gold-line); }
.engine-chip-icon .ic { font-size: 16px; }
.engine-chip b { display: block; font-size: 10px; }
.engine-chip span { display: block; font-size: 8.5px; color: var(--dim); }

/* ---------- dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.dash-grid--three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.chart-box { position: relative; min-height: 220px; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; font-size: 9.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-swatch--dash { height: 2px; width: 13px; border-radius: 2px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  pointer-events: none;
}
.donut-center b { font-size: 24px; font-weight: 800; color: var(--gold-1); line-height: 1.2; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 8.5px; color: var(--dim); }
.donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 9px; }
.donut-legend-item { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.donut-legend-item .legend-swatch { width: 7px; height: 7px; border-radius: 50%; }
.donut-legend-item b { margin-inline-start: auto; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend-item small { color: var(--dim); font-size: 8.5px; min-width: 34px; text-align: end; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { min-width: 0; }
.bar-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 9.5px; color: var(--muted); margin-bottom: 4px; }
.bar-meta b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.bar-track > span { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); min-width: 4px; transition: width 0.6s var(--ease); }

/* feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.055); }
.feed-item:first-child { padding-top: 0; }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--feed-color, var(--gold-2));
  background: color-mix(in srgb, var(--feed-color, var(--gold-2)) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--feed-color, var(--gold-2)) 20%, transparent);
}
.feed-icon .ic { font-size: 14px; }
.feed-main { min-width: 0; flex: 1; }
.feed-main p { font-size: 10px; line-height: 1.7; color: var(--text-2); }
.feed-main p b { color: var(--text); font-weight: 600; }
.feed-main span { font-size: 8.5px; color: var(--dim); }

/* finance snapshot */
.fin-snap { display: flex; flex-direction: column; gap: 12px; }
.fin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); }
.fin-row b { color: var(--text); font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fin-row b.bad { color: var(--bad); }
.fin-block { border-top: 1px dashed rgba(255, 255, 255, 0.06); padding-top: 11px; }
.fin-block:first-child { border-top: 0; padding-top: 0; }
.fin-block .fin-row { margin-bottom: 6px; }
.fin-block small { font-size: 8.5px; color: var(--dim); }

/* ==========================================================================
   FILTERS / TABLES
   ========================================================================== */
.summary-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9.5px;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s;
}
.summary-chip b { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-chip:hover { border-color: var(--line-2); color: var(--text); }
.summary-chip.active { color: var(--gold-1); border-color: var(--gold-line-strong); background: var(--gold-soft); }
.summary-chip.active b { color: var(--gold-1); }
.summary-chip .dot { width: 5px; height: 5px; }

.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}
.filter-search { position: relative; width: 240px; max-width: 100%; }
.filter-search .ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 15px; }
.filter-search .input { height: 36px; padding-inline-start: 34px; font-size: 10.5px; border-radius: 9px; }
.filters-bar .select, .filters-bar .input { height: 36px; font-size: 10.5px; border-radius: 9px; }
.filters-bar .select { width: auto; min-width: 118px; padding-inline: 28px 10px; }
.input.date-input { direction: ltr; text-align: end; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.filters-bar .date-input { width: 132px; }
.filters-bar .filters-spacer { margin-inline-start: auto; }

.table-wrap { overflow-x: auto; }
.admin-table { min-width: 760px; font-size: 11px; }
.admin-table th { font-size: 8.5px; padding: 9px 12px; letter-spacing: 0.02em; }
.admin-table td { padding: 10px 12px; vertical-align: middle; }
.admin-table tbody tr { cursor: default; }
.admin-table tbody tr.row-click { cursor: pointer; }
.admin-table tbody tr.row-click:hover { background: rgba(232, 197, 106, 0.035); }
.admin-table .cell-main { font-size: 11px; }
.admin-table .cell-sub { font-size: 8.5px; }
.admin-table .num { font-variant-numeric: tabular-nums; }
.table-code { display: flex; align-items: center; gap: 8px; }
.table-code-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--code-color, var(--gold-2));
  background: color-mix(in srgb, var(--code-color, var(--gold-2)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--code-color, var(--gold-2)) 20%, transparent);
}
.table-code-icon .ic { font-size: 14px; }
.table-code code { direction: ltr; unicode-bidi: embed; font-family: inherit; font-size: 10px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.table-person { display: flex; align-items: center; gap: 8px; }
.table-person .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }
.table-person b { display: block; font-size: 10.5px; font-weight: 600; color: var(--text); line-height: 1.5; }
.table-person small { display: block; font-size: 8.5px; color: var(--dim); }

.conf-cell { display: flex; align-items: center; gap: 7px; min-width: 82px; }
.conf-cell b { font-size: 9.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 32px; }
.conf-bar { flex: 1; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.conf-bar span { display: block; height: 100%; border-radius: 99px; }
.conf-bar span.ok { background: var(--ok); }
.conf-bar span.warn { background: var(--warn); }
.conf-bar span.bad { background: var(--bad); }
.conf-bar span.muted { background: var(--dim); }

.table-actions { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.table-actions .btn-icon { width: 28px; height: 28px; border-radius: 7px; }
.table-actions .btn-icon .ic { font-size: 14px; }
.table-actions .btn-icon.danger:hover { color: var(--bad); background: var(--bad-bg); border-color: rgba(255,123,123,.2); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--dim);
}
.pager-info b { color: var(--text-2); font-weight: 600; }
.pager-btns { display: flex; align-items: center; gap: 3px; }
.pager-btn {
  min-width: 28px;
  height: 28px;
  padding-inline: 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  display: inline-grid;
  place-items: center;
  transition: 0.18s;
}
.pager-btn:hover:not([disabled]) { color: var(--gold-2); border-color: var(--gold-line); }
.pager-btn.active { color: #191307; background: var(--gold-grad); border-color: transparent; font-weight: 700; }
.pager-btn[disabled] { opacity: 0.35; pointer-events: none; }
.pager-btn .ic { font-size: 14px; }

.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .empty-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--dim); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.empty-state .empty-icon .ic { font-size: 25px; }
.empty-state h4 { font-size: 12px; margin-bottom: 4px; }
.empty-state p { font-size: 10px; color: var(--dim); line-height: 1.8; }

/* ==========================================================================
   DRAWERS / DETAILS
   ========================================================================== */
.drawer-panel { width: min(680px, 100%); }
.drawer-head { padding: 16px 22px; }
.dh-main { min-width: 0; }
.dh-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dh-title h3 { font-size: 15px; }
.dh-title code { direction: ltr; unicode-bidi: embed; font-family: inherit; color: var(--gold-1); font-size: 12px; font-weight: 700; }
.dh-sub { font-size: 9.5px; color: var(--dim); margin-top: 3px; }
.drawer-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.drawer-section { min-width: 0; }
.drawer-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.drawer-section h4 { font-size: 10.5px; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.drawer-section h4 .ic { font-size: 14px; color: var(--gold-2); }
.drawer-section-head small { font-size: 8.5px; color: var(--dim); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.info-grid.info-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-cell { background: var(--admin-panel-2); padding: 9px 11px; min-width: 0; }
.info-cell > span { display: block; font-size: 8.5px; color: var(--dim); margin-bottom: 2px; }
.info-cell b { display: block; font-size: 10.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.info-cell b.ltr { direction: ltr; text-align: end; }
.info-cell b.mono { font-variant-numeric: tabular-nums; }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  padding: 9px 10px;
  min-width: 0;
}
.mini-stat span { display: block; font-size: 8.5px; color: var(--dim); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stat b { display: block; font-size: 14px; font-weight: 700; color: var(--gold-1); line-height: 1.4; font-variant-numeric: tabular-nums; }
.mini-stat b small { font-size: 8px; font-weight: 400; color: var(--dim); }

.detail-list { display: flex; flex-direction: column; }
.mini-caption { margin: 2px 0 8px; color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.055); font-size: 10px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--dim); flex: none; }
.detail-row .v { color: var(--text-2); text-align: end; font-weight: 500; overflow-wrap: anywhere; }
.detail-row .v.ltr { direction: ltr; }
.detail-row .v.mono { font-variant-numeric: tabular-nums; }

.ai-box {
  border: 1px solid rgba(232, 197, 106, 0.2);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(232, 197, 106, 0.075), rgba(232, 197, 106, 0.015));
  padding: 12px 14px;
}
.ai-box-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 9px; color: var(--gold-2); }
.ai-box-head .ic { font-size: 14px; }
.ai-box-head .badge { margin-inline-start: auto; font-size: 8px; padding: 1px 6px; }
.ai-box h5 { font-size: 11.5px; font-weight: 700; color: var(--gold-1); line-height: 1.8; }
.ai-box p { font-size: 10px; line-height: 1.9; color: var(--text-2); margin-top: 3px; }
.ai-flags { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ai-flag { display: flex; gap: 5px; font-size: 9px; color: var(--warn); align-items: flex-start; }
.ai-flag .ic { font-size: 12px; flex: none; margin-top: 2px; }

.lab-result-list { display: flex; flex-direction: column; gap: 6px; }
.lab-result-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 9.5px;
}
.lab-result-row .lab-mark { width: 27px; height: 27px; border-radius: 7px; font-size: 7.5px; }
.lab-result-main { flex: 1; min-width: 0; }
.lab-result-main b { display: block; font-size: 9.5px; font-weight: 600; color: var(--text-2); }
.lab-result-main span { display: block; font-size: 8px; color: var(--dim); }
.lab-result-metrics { display: flex; align-items: center; gap: 10px; flex: none; }
.lab-result-metrics b { font-size: 10px; font-variant-numeric: tabular-nums; }
.lab-result-metrics small { font-size: 7.5px; color: var(--dim); display: block; text-align: center; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 0; padding-inline-start: 3px; }
.timeline-item { position: relative; padding: 0 18px 12px 0; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: 3px; top: 12px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; inset-inline-start: 0; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 3px rgba(232, 197, 106, 0.11); }
.timeline-item b { display: block; font-size: 9.5px; font-weight: 600; }
.timeline-item span { font-size: 8.5px; color: var(--dim); }

/* ==========================================================================
   LABS
   ========================================================================== */
.labs-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.labs-summary .mini-stat { padding: 11px 13px; }
.labs-summary .mini-stat b { font-size: 18px; }
.labs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.lab-admin-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, #121219, #0f0f15);
  padding: 15px;
  overflow: hidden;
  transition: 0.25s var(--ease);
  min-width: 0;
}
.lab-admin-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lab-color), transparent);
  opacity: 0.55;
}
.lab-admin-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.lab-admin-card.is-paused { opacity: 0.72; }
.lab-card-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.lab-card-head .lab-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 9px; }
.lab-card-title { min-width: 0; flex: 1; }
.lab-card-title h4 { font-size: 11px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-card-title span { display: flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--dim); margin-top: 1px; }
.lab-card-title .ic { font-size: 10px; }
.lab-card-head .badge { flex: none; font-size: 8px; padding: 1px 7px; }
.lab-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 9px 0; border-block: 1px solid var(--line); margin-bottom: 10px; }
.lab-card-stat { text-align: center; }
.lab-card-stat b { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.lab-card-stat span { display: block; font-size: 7.5px; color: var(--dim); }
.lab-card-svc { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; margin-bottom: 9px; }
.lab-card-svc span { font-size: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); color: var(--muted); }
.lab-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 8px; color: var(--dim); margin-bottom: 10px; }
.lab-card-meta .ltr { direction: ltr; }
.lab-card-actions { display: flex; align-items: center; gap: 4px; padding-top: 9px; border-top: 1px solid var(--line); }
.lab-card-actions .btn { --btn-h: 29px; font-size: 9px; padding-inline: 9px; border-radius: 7px; }
.lab-card-actions .btn .ic { font-size: 12px; }
.lab-card-actions .btn-icon { width: 28px; height: 28px; border-radius: 7px; }
.lab-card-actions .btn-icon .ic { font-size: 14px; }
.lab-card-actions .lab-actions-spacer { margin-inline-start: auto; }

.lab-test-state { font-size: 8.5px; color: var(--gold-2); display: inline-flex; align-items: center; gap: 5px; }
.mini-spin { width: 10px; height: 10px; border: 1.5px solid rgba(232,197,106,.22); border-top-color: var(--gold-2); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ==========================================================================
   FORMS / MODALS
   ========================================================================== */
.form-section-title { font-size: 9px; color: var(--dim); letter-spacing: 0.08em; font-weight: 600; margin: 4px 0 10px; display: flex; align-items: center; gap: 7px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.modal .form-grid { gap: 13px; }
.modal .field > label { font-size: 10px; }
.modal .input, .modal .select, .modal .textarea { font-size: 11px; }
.modal .input, .modal .select { height: 38px; }
.modal .textarea { min-height: 74px; }
.modal .hint { font-size: 9px; }
.modal .check span, .modal .switch { font-size: 10px; }
.modal-foot .btn { --btn-h: 36px; font-size: 11px; }
.modal-body .helper { font-size: 9.5px; color: var(--dim); line-height: 1.8; }
.modal-body .helper b { color: var(--gold-2); }

.code-samples { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.code-sample {
  font-size: 8.5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--muted);
  direction: ltr;
  transition: 0.18s;
}
.code-sample:hover { color: var(--gold-1); border-color: var(--gold-line); background: var(--gold-soft); }

.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: rgba(255,255,255,.018); }
.switch-row span { font-size: 9.5px; color: var(--text-2); }

/* ---------- new inquiry scan ---------- */
.admin-scan { padding: 2px 0 4px; }
.scan-topline { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.scan-radar-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--gold-2); background: var(--gold-soft); border: 1px solid var(--gold-line); flex: none; }
.scan-radar-icon .ic { font-size: 19px; animation: pulseSoft 1.8s infinite; }
.scan-topline b { display: block; font-size: 12px; }
.scan-topline span { display: block; font-size: 9px; color: var(--dim); }
.scan-topline code { margin-inline-start: auto; direction: ltr; font-family: inherit; color: var(--gold-1); font-size: 11px; font-weight: 700; }
.scan-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.scan-progress-row .scan-bar { flex: 1; height: 4px; }
.scan-progress-row .scan-pct { font-size: 10px; flex: none; }
.admin-scan .scan-lab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.016);
  margin-bottom: 5px;
  font-size: 9.5px;
  color: var(--muted);
  transition: 0.2s;
}
.admin-scan .scan-lab .lab-mark { width: 23px; height: 23px; border-radius: 6px; font-size: 7px; }
.admin-scan .scan-lab-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-scan .scan-lab-status { font-size: 8.5px; color: var(--dim); }
.admin-scan .scan-lab.is-active { border-color: var(--gold-line); background: var(--gold-soft); color: var(--text); }
.admin-scan .scan-lab.is-active .scan-lab-status { color: var(--gold-2); }
.admin-scan .scan-lab.is-done .scan-lab-status { color: var(--ok); }
.admin-scan .scan-ai-line { margin-top: 10px; }
.admin-scan .scan-ai-line .ic { font-size: 13px; }
.admin-scan .scan-ai-line p { font-size: 9px; }

.scan-result {
  text-align: center;
  padding: 10px 4px 2px;
  animation: adminIn 0.35s var(--ease);
}
.scan-result-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; }
.scan-result-icon .ic { font-size: 27px; }
.scan-result-icon.ok { color: var(--ok); background: var(--ok-bg); border: 1px solid rgba(69,214,155,.24); }
.scan-result-icon.warn { color: var(--warn); background: var(--warn-bg); border: 1px solid rgba(242,182,75,.24); }
.scan-result-icon.bad { color: var(--bad); background: var(--bad-bg); border: 1px solid rgba(255,123,123,.24); }
.scan-result h4 { font-size: 15px; margin-bottom: 4px; }
.scan-result > p { font-size: 10.5px; color: var(--muted); line-height: 1.9; }
.scan-result-meta { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 14px 0; padding: 12px; border-block: 1px solid var(--line); }
.scan-result-meta div { text-align: center; }
.scan-result-meta b { display: block; font-size: 15px; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.scan-result-meta span { font-size: 8.5px; color: var(--dim); }
.scan-result-actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---------- invoice editor ---------- */
.inv-editor { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.inv-editor-head { display: flex; align-items: center; gap: 8px; padding: 8px 11px; background: rgba(255,255,255,.02); border-bottom: 1px solid var(--line); font-size: 9px; color: var(--dim); }
.inv-editor-head .inv-col-title { flex: 1; }
.inv-editor-head .inv-col-qty { width: 58px; }
.inv-editor-head .inv-col-price { width: 112px; }
.inv-editor-head .inv-col-total { width: 96px; text-align: end; }
.inv-editor-head .inv-col-x { width: 28px; }
.inv-items { display: flex; flex-direction: column; }
.inv-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.inv-item:last-child { border-bottom: 0; }
.inv-item .input { height: 32px; font-size: 10px; }
.inv-item .inv-title { flex: 1; min-width: 0; }
.inv-item .inv-qty { width: 58px; text-align: center; }
.inv-item .inv-price { width: 112px; }
.inv-item .inv-line-total { width: 96px; text-align: end; font-size: 9.5px; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.inv-item .inv-remove { width: 28px; height: 28px; border-radius: 6px; color: var(--dim); display: grid; place-items: center; flex: none; }
.inv-item .inv-remove:hover { color: var(--bad); background: var(--bad-bg); }
.inv-item .inv-remove .ic { font-size: 13px; }

.inv-summary {
  width: min(350px, 100%);
  margin-top: 13px;
  margin-inline-start: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
  padding: 11px 13px;
}
.inv-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 10px; color: var(--muted); }
.inv-sum-row b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.inv-sum-row .mini-input { width: 96px; height: 28px; font-size: 9.5px; text-align: end; }
.inv-sum-row.grand { border-top: 1px solid var(--gold-line); margin-top: 5px; padding-top: 8px; font-size: 11px; color: var(--text); }
.inv-sum-row.grand b { color: var(--gold-1); font-size: 13px; font-weight: 800; }

.invoice-items-table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.invoice-items-table th { text-align: start; font-size: 8px; color: var(--dim); font-weight: 500; padding: 6px 7px; border-bottom: 1px solid var(--line); }
.invoice-items-table td { padding: 7px; border-bottom: 1px solid rgba(255,255,255,.05); }
.invoice-items-table td:last-child, .invoice-items-table th:last-child { text-align: end; }
.invoice-items-table .num { font-variant-numeric: tabular-nums; }

.invoice-totals { display: flex; flex-direction: column; gap: 5px; width: min(300px, 100%); margin-inline-start: auto; }
.invoice-totals .detail-row { border-bottom: 0; padding: 3px 0; }
.invoice-totals .detail-row.grand { border-top: 1px solid var(--gold-line); margin-top: 4px; padding-top: 8px; font-size: 11.5px; }
.invoice-totals .detail-row.grand .v { color: var(--gold-1); font-weight: 800; }

.pay-progress { display: flex; flex-direction: column; gap: 6px; }
.pay-progress-top { display: flex; align-items: center; justify-content: space-between; font-size: 9.5px; color: var(--muted); }
.pay-progress-top b { color: var(--text); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* ---------- notifications ---------- */
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  text-align: start;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
  transition: 0.18s;
}
.notif-item:hover { border-color: var(--line-2); background: rgba(255,255,255,.04); }
.notif-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.notif-icon .ic { font-size: 14px; }
.notif-main { min-width: 0; flex: 1; }
.notif-main b { display: block; font-size: 10px; color: var(--text); font-weight: 600; }
.notif-main span { display: block; font-size: 8.5px; color: var(--dim); line-height: 1.7; }
.notif-item > .ic { color: var(--dim); font-size: 13px; margin-top: 7px; }

/* ==========================================================================
   SETTINGS
   ========================================================================== */
.settings-layout { display: flex; flex-direction: column; gap: 14px; max-width: 1080px; }
.settings-section { border: 1px solid var(--line); border-radius: var(--admin-radius); background: var(--admin-panel); overflow: hidden; }
.settings-section-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.012); }
.settings-section-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--gold-2); background: var(--gold-soft); border: 1px solid var(--gold-line); flex: none; }
.settings-section-icon .ic { font-size: 15px; }
.settings-section-head h3 { font-size: 11.5px; }
.settings-section-head p { font-size: 8.5px; color: var(--dim); margin-top: 1px; }
.settings-section-body { padding: 16px 18px; }
.settings-section-body .form-grid { gap: 13px; }
.settings-section-body .field > label { font-size: 9.5px; }
.settings-section-body .input, .settings-section-body .select { height: 38px; font-size: 11px; }
.settings-section-body .textarea { min-height: 76px; font-size: 11px; }
.settings-range-row { display: flex; align-items: center; gap: 12px; }
.settings-range-row input[type="range"] { flex: 1; accent-color: var(--gold-2); height: 4px; }
.settings-range-val { min-width: 44px; text-align: center; font-size: 12px; font-weight: 700; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.settings-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgba(18, 18, 25, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 46px -20px rgba(0,0,0,.9);
}
.settings-savebar span { font-size: 9.5px; color: var(--dim); }
.settings-savebar .actions { display: flex; gap: 8px; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid rgba(255,123,123,.2); border-radius: 11px; background: rgba(255,123,123,.045); }
.danger-zone b { display: block; font-size: 10.5px; color: var(--text); }
.danger-zone p { font-size: 9px; color: var(--muted); line-height: 1.8; margin-top: 1px; }
.danger-zone .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.security-note { display: flex; gap: 9px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.018); font-size: 9.5px; color: var(--muted); line-height: 1.8; }
.security-note .ic { color: var(--gold-2); font-size: 15px; flex: none; margin-top: 2px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1320px) {
  .labs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  .topbar-search { width: 230px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid--three { grid-template-columns: 1fr; }
  .dash-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-col > * { min-width: 0; }
  .login-shell { grid-template-columns: 1fr 0.92fr; }
  .login-visual { padding: 28px 30px; }
  .login-visual-body h1 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
}

@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(105%); box-shadow: -30px 0 70px -20px rgba(0,0,0,.8); }
  .sidebar-open .admin-sidebar { transform: none; }
  .sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .admin-main { margin-inline-start: 0; }
  .topbar-menu { display: grid; }
  .sidebar-collapse { display: none; }
  .topbar-search { width: min(300px, 32vw); }
}

@media (max-width: 960px) {
  .login-view { padding: 12px; }
  .login-shell { grid-template-columns: 1fr; min-height: calc(100vh - 24px); }
  .login-visual { display: none; }
  .login-panel { padding: 34px 22px; min-height: calc(100vh - 24px); }
  .login-panel::before { opacity: 0.1; filter: blur(2px); }
  .login-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,11,.84), rgba(8,8,11,.96));
    z-index: 0;
  }
  .login-card { position: relative; z-index: 1; }
  .login-mobile-brand { display: flex; }
  .login-card::before { margin-top: -34px; }
  .topbar-search { display: none; }
  .topbar-actions { margin-inline-start: auto; }
  .labs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-content { padding-inline: 20px; }
}

@media (max-width: 760px) {
  .topbar-new > span:not([data-ic]) { display: none; }
  .topbar-new { width: 38px; padding: 0; justify-content: center; }
  .topbar-new .ic { font-size: 18px; }
  .user-chip-text, .user-chip-chev { display: none; }
  .user-chip { padding: 3px; }
  .admin-topbar { padding-inline: 16px; gap: 10px; }
  .admin-content { padding: 16px 16px 28px; }
  .admin-footer { padding-inline: 16px; }
  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; justify-content: center; }
  .seg { width: 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg-btn { flex: 1 0 auto; justify-content: center; padding-inline: 5px; gap: 3px; font-size: 10.5px; }
  .dash-col { grid-template-columns: 1fr; }
  .labs-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid.info-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-bar { gap: 6px; }
  .filter-search { width: 100%; }
  .filters-bar .select { flex: 1; min-width: 100px; }
  .filters-bar .date-input { width: calc(50% - 3px); }
  .filters-bar .filters-spacer { width: 100%; margin: 0; }
  .filters-bar .filters-spacer .btn { flex: 1; }
  .dash-hero { padding: 18px; }
  .dash-hero-side { width: 100%; }
  .engine-chip { flex: 1; }
  .settings-savebar { bottom: 8px; }
  .settings-savebar > span { display: none; }
  .settings-savebar .actions { margin-inline-start: auto; }
  .login-card { padding: 26px 22px; }
  .login-card::before { margin: -26px -22px 22px; }
  .demo-cred-row .btn { margin-inline-start: 0; width: 100%; }
}

@media (max-width: 560px) {
  .login-view { padding: 0; }
  .login-shell { border: 0; border-radius: 0; min-height: 100vh; }
  .login-panel { padding: 24px 16px; min-height: 100vh; }
  .login-card { padding: 24px 18px; border-radius: 18px; }
  .login-card::before { margin: -24px -18px 20px; }
  .login-title h2 { font-size: 22px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { padding: 14px; }
  .kpi-value b { font-size: 23px; }
  .dash-hero-copy h2 { font-size: 15px; }
  .page-head h2 { font-size: 18px; }
  .page-head-actions .btn { font-size: 10.5px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .panel-title-right { flex: 1; }
  .summary-chips { width: 100%; }
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
  .drawer-body { padding: 16px; }
  .drawer-head { padding: 14px 16px; }
  .drawer-foot { padding: 10px 16px; flex-wrap: wrap; }
  .drawer-foot .btn { flex: 1; justify-content: center; }
  .info-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .inv-editor-head { display: none; }
  .inv-item { flex-wrap: wrap; padding: 9px; gap: 5px; }
  .inv-item .inv-title { flex: 0 0 calc(100% - 34px); }
  .inv-item .inv-remove { margin-inline-start: auto; }
  .inv-item .inv-qty { width: calc(33.33% - 4px); }
  .inv-item .inv-price { width: calc(33.33% - 4px); }
  .inv-item .inv-line-total { width: calc(33.33% - 4px); text-align: center; }
  .inv-summary { width: 100%; }
  .switch-grid { grid-template-columns: 1fr; }
  .scan-topline code { width: 100%; margin-inline-start: 0; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .admin-footer-mid { display: none; }
  .admin-footer-status { margin-inline-start: 0; width: 100%; }
  .lab-card-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .login-visual-img { animation: none; }
}
