:root {
  color-scheme: dark;
  --bg: #080d14;
  --surface: #0e1621;
  --surface-raised: #121d2a;
  --surface-soft: #172334;
  --line: #263447;
  --line-strong: #3a4b61;
  --text: #edf2f7;
  --text-soft: #c2cedb;
  --muted: #8493a6;
  --accent: #e66f2f;
  --accent-hover: #f17d3d;
  --accent-soft: rgba(230, 111, 47, .12);
  --danger: #ef6a6a;
  --success: #4ec995;
  --radius-panel: 18px;
  --radius-control: 10px;
  --shadow: 0 24px 70px rgba(2, 7, 14, .34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 650px at 85% -120px, rgba(230, 111, 47, .13), transparent 70%),
    radial-gradient(900px 550px at 10% 350px, rgba(26, 45, 75, .22), transparent 65%),
    radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px;
  color: var(--text);
  font: 15px/1.55 "Segoe UI Variable", Aptos, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, .button-primary, .button-secondary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(230, 111, 47, .4);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.hidden { display: none !important; }
.shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(58, 75, 97, .65);
}
.brand-lockup, .topbar-actions, .panel-heading, .table-toolbar, .toolbar-actions, .output-actions, .form-actions {
  display: flex;
  align-items: center;
}
.brand-lockup { gap: 14px; }
.brand-logo-img {
  height: 36px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(230, 111, 47, 0.25));
}
.brand-divider {
  width: 1px;
  height: 26px;
  background: rgba(58, 75, 97, 0.7);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(230, 111, 47, .5);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(230, 111, 47, .24), rgba(230, 111, 47, .08));
  color: #ff9d68;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.02em;
  box-shadow: 0 0 16px rgba(230, 111, 47, .16);
}
.brand-owner {
  display: block;
  margin-bottom: 1px;
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.topbar-actions { gap: 10px; }
.server-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}
.server-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(78, 201, 149, .1); }

/* Login Layout - Centered Circuit Tech Aesthetic */
.login-layout {
  position: relative;
  min-height: calc(100dvh - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow: hidden;
}

/* Circuit Backdrop */
.circuit-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.circuit-svg {
  width: 100%;
  max-width: 1300px;
  height: 100%;
  max-height: 850px;
}

/* Auth Card Container */
.auth-card-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 410px;
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  padding: 38px 30px 28px;
  border-radius: 20px;
  background: #13161f;
  border: 1px solid #232938;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 70px rgba(0, 0, 0, 0.8),
    0 0 40px -10px rgba(230, 111, 47, 0.08);
  text-align: center;
}

/* Brand Logo Header */
.auth-brand-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.auth-brand-logo {
  height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(0, 119, 237, 0.28));
  user-select: none;
}

/* Header */
.auth-header {
  margin-bottom: 26px;
}
.auth-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #f8fafc;
}
.auth-header p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #718298;
}

/* Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: #536277;
  pointer-events: none;
  transition: color 0.18s ease;
  z-index: 2;
}
.auth-input-group input {
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 12px 16px 12px 46px;
  border-radius: 10px;
  background: #0d0f15;
  border: 1px solid #202636;
  color: #f1f5f9;
  font-size: 14px;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.auth-input-group input:hover {
  border-color: #323b4e;
}
.auth-input-group input:focus {
  border-color: #0077ed;
  background: #0e1118;
  box-shadow: 0 0 0 3px rgba(0, 119, 237, 0.18);
  outline: none;
}
.auth-input-group:focus-within .auth-input-icon {
  color: #38bdf8;
}

.auth-password-group input {
  padding-right: 46px;
}
.password-toggle {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #647387;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
  user-select: none;
  -webkit-user-select: none;
}
.password-toggle:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
}
.password-toggle:focus-visible {
  outline: 2px solid rgba(0, 119, 237, 0.5);
  outline-offset: 1px;
}
.password-toggle .eye-hide {
  display: none;
}
.password-toggle.is-visible .eye-show {
  display: none;
}
.password-toggle.is-visible .eye-hide {
  display: block;
}

/* Submit Button */
.auth-submit-btn {
  margin-top: 6px;
  width: 100%;
  min-height: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #0077ed;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 119, 237, 0.35);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.auth-submit-btn:hover {
  background: #0d82f7;
  box-shadow: 0 6px 22px rgba(0, 119, 237, 0.45);
  transform: translateY(-1px);
}
.auth-submit-btn:active {
  transform: translateY(1px);
}

/* Alert Message */
.auth-card .message {
  display: none;
  min-height: 0;
  margin: 0;
}
.auth-card .message.bad,
.auth-card .message.ok {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 12px 0 0;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  animation: alert-slide-down .2s ease both;
}
@keyframes alert-slide-down {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-card .message.bad {
  background: rgba(239, 106, 106, 0.12);
  border: 1px solid rgba(239, 106, 106, 0.35);
  color: #ff9d9d;
}
.auth-card .message.bad::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9d9d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.auth-card .message.ok {
  background: rgba(78, 201, 149, 0.12);
  border: 1px solid rgba(78, 201, 149, 0.35);
  color: #6ee7b7;
}

/* Divider & Footer Brand */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 22px 0 14px;
  text-align: center;
  color: #4b586e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #1f2635;
}
.auth-divider span {
  padding: 0 10px;
}

.section-label { color: var(--accent-hover); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.form-stack { display: grid; gap: 4px; }

.overview {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(520px, 1.1fr);
  gap: clamp(40px, 7vw, 90px);
  align-items: end;
  padding: 58px 0 40px;
}
.overview-copy h2, .section-heading h2 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.overview-copy p, .section-heading > p { max-width: 58ch; margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-width: 0; padding: 19px 22px 18px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin: 3px 0; font-size: 28px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(14, 22, 33, .78);
}
.tabbar button {
  min-width: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.tabbar button:hover { background: rgba(255, 255, 255, .035); color: var(--text-soft); }
.tabbar button:active { transform: translateY(1px); }
.tabbar button.active { background: var(--surface-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035); }
.tabbar span, .tabbar small { display: block; }
.tabbar span { font-size: 13px; font-weight: 700; }
.tabbar small { margin-top: 1px; color: inherit; font-size: 11px; opacity: .76; }
.global-message { margin: 10px 0 0; }
.tab { padding: 46px 0 80px; animation: tab-enter .26s ease both; }
@keyframes tab-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 50px; margin-bottom: 24px; }
.section-heading h2 { font-size: clamp(28px, 3.2vw, 40px); }
.section-heading > p { max-width: 47ch; padding-bottom: 3px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 16px; }
.rebrand-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.panel {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.panel-heading { justify-content: space-between; gap: 18px; margin-bottom: 22px; }
h3 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.025em; }
.panel-heading p, .guidance-panel p, .migration-panel p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-index { color: #53647a; font: 600 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 12px; font-weight: 650; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #0a111a;
  color: var(--text);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
input, select { padding: 10px 12px; }
textarea { padding: 13px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5d6d80; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #0c141f; box-shadow: 0 0 0 3px rgba(230, 111, 47, .1); outline: 0; }
.inline-fields { display: grid; grid-template-columns: 94px 1fr; gap: 8px; }
.form-actions { justify-content: flex-end; padding-top: 2px; }

button, .button-primary, .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease, opacity .18s ease;
}
.button-primary, button.button-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(230, 111, 47, .17);
}
.button-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button-secondary, button.button-secondary {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
}
.button-secondary:hover { border-color: #60738c; background: rgba(255, 255, 255, .035); color: var(--text); }
.button-primary:active, .button-secondary:active { transform: translateY(1px); }
button:disabled, .button-primary:disabled, .button-secondary:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button-full { width: 100%; margin-top: 8px; }
.button-compact { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.button-link { width: fit-content; margin-top: 22px; }

.output-panel { display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface-raised), var(--surface)); }
.output-panel textarea { min-height: 170px; flex: 1; font: 12px/1.65 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.output-actions { justify-content: flex-end; margin-top: 12px; }
.message { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.message:empty { min-height: 0; margin-top: 0; }
.message.bad { color: #ff8989; }
.message.ok { color: #70d7aa; }

.table-panel { margin-top: 16px; padding: 0; overflow: hidden; }
.table-toolbar { justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.table-toolbar h3 { margin-top: 4px; }
.toolbar-actions { gap: 10px; }
.search-field { display: flex; align-items: center; gap: 10px; margin: 0; }
.search-field span { color: var(--muted); font-size: 11px; }
.search-field input { width: 220px; min-height: 38px; padding: 8px 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 18px; text-align: left; vertical-align: top; }
th { border-bottom: 1px solid var(--line); color: #718197; background: rgba(8, 13, 20, .45); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td { border-bottom: 1px solid rgba(38, 52, 71, .65); color: var(--text-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .018); }
.cell-primary { display: block; color: var(--text); font-weight: 650; }
.cell-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.serial-badge { display: inline-flex; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface-soft); font: 650 11px/1.35 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.history-list { display: flex; flex-wrap: wrap; gap: 5px; }
.history-item { display: inline-flex; gap: 5px; padding: 4px 7px; border-radius: 7px; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; white-space: nowrap; }
.history-item small { color: var(--muted); font: inherit; }
.action-column { width: 180px; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.row-actions button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.button-danger { border: 1px solid rgba(239, 106, 106, .4); background: transparent; color: #ff9696; }
.button-danger:hover { background: rgba(239, 106, 106, .08); border-color: var(--danger); }
.empty-cell { padding: 42px 20px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text-soft); font-size: 14px; }
.empty-state span { max-width: 42ch; margin: 5px auto 0; color: var(--muted); font-size: 12px; }
.skeleton { display: block; width: 75%; height: 11px; border-radius: 5px; background: linear-gradient(90deg, #172334 25%, #213044 50%, #172334 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.guidance-panel { position: relative; overflow: hidden; background: var(--surface-raised); }
.guidance-panel::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 230px; height: 230px; border-radius: 50%; background: rgba(230, 111, 47, .08); pointer-events: none; }
.guidance-panel h3 { max-width: 14ch; margin: 13px 0 22px; font-size: 27px; line-height: 1.08; letter-spacing: -.045em; }
.guidance-panel ol { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.guidance-panel li { position: relative; padding: 10px 0 10px 34px; border-top: 1px solid var(--line); color: var(--text-soft); counter-increment: steps; }
.guidance-panel li::before { content: counter(steps, decimal-leading-zero); position: absolute; left: 0; top: 11px; color: var(--accent-hover); font: 600 10px/1.5 ui-monospace, monospace; }
.guidance-panel > p { margin-top: 22px; }

.migration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.migration-panel { min-height: 310px; display: flex; flex-direction: column; align-items: flex-start; }
.migration-panel h3 { max-width: 18ch; margin-top: 34px; font-size: 28px; line-height: 1.08; letter-spacing: -.04em; }
.migration-panel > p { max-width: 50ch; margin-top: 14px; }
.stacked-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; padding-top: 30px; }
.accent-panel { background: linear-gradient(150deg, rgba(230, 111, 47, .15), var(--surface) 55%); }
.accent-panel small { display: block; margin-top: 10px; color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: #68798e; font-size: 11px; }

@media (max-width: 960px) {
  .overview { grid-template-columns: 1fr; gap: 28px; }
  .workspace-grid, .rebrand-grid { grid-template-columns: 1fr; }
  .guidance-panel h3 { max-width: 22ch; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1280px); }
  .topbar { min-height: 64px; }
  .brand-logo-img { height: 28px; max-width: 130px; }
  .brand-divider { height: 20px; }
  .brand-owner { font-size: 9px; }
  .topbar h1 { font-size: 13px; }
  .server-status { display: none; }
  .login-layout { min-height: auto; align-items: flex-start; padding: 20px 0 40px; }
  .circuit-backdrop { display: none; }
  .auth-card-container { max-width: 100%; width: 100%; }
  .auth-card { padding: 30px 20px 24px; border-radius: 18px; }
  .auth-brand-logo { height: 42px; max-width: 180px; }
  .auth-header h2 { font-size: 20px; }
  .auth-form { gap: 14px; }
  .auth-input-group input { min-height: 46px; height: 46px; }
  .auth-submit-btn { min-height: 46px; height: 46px; }
  .overview { padding: 42px 0 28px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 14px 4px; border-left: 0; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: 0; }
  .metric strong { grid-column: 2; grid-row: 1 / span 2; margin-left: 20px; }
  .metric small { grid-column: 1; }
  .tabbar { display: flex; overflow-x: auto; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar button { flex: 0 0 150px; }
  .tabbar small { display: none; }
  .tab { padding: 34px 0 60px; }
  .panel { padding: 19px; }
  .form-grid, .migration-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .migration-panel { min-height: 270px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; align-items: flex-end; }
  .search-field { flex: 1; align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-field input { width: 100%; }
  th, td { padding: 12px 14px; }
  footer { flex-direction: column; gap: 4px; }
}

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

/* Admin workspace — shared charcoal and orange palette with the user app. */
.authenticated {
  --bg: #0c0e12;
  --surface: #15181e;
  --surface-raised: #191c22;
  --surface-soft: #20242d;
  --line: #292e38;
  --line-strong: #414752;
  --text: #f3f4f7;
  --text-soft: #c0c5ce;
  --muted: #959dab;
  --accent: #ff8a3d;
  --accent-hover: #ffa466;
  background: var(--bg);
  font-size: 14px;
}
.authenticated .shell { width: auto; max-width: 1680px; margin: 0 0 0 238px; padding: 0 38px; }
.authenticated .topbar { min-height: 78px; border-color: var(--line); }
.authenticated .topbar .brand-logo-img, .authenticated .brand-divider { display: none; }
.authenticated .brand-owner { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .1em; }
.authenticated .topbar h1 { font-size: 14px; }
.authenticated .server-status { border: 0; font-size: 11px; font-weight: 400; padding: 0 8px; }
.server-status[data-state="idle"] i { background: var(--muted); box-shadow: none; }
.server-status[data-state="loading"] i { background: var(--accent); box-shadow: none; }
.server-status[data-state="error"] i { background: var(--danger); box-shadow: none; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; display: flex; flex-direction: column; padding: 28px 18px 22px; background: #111318; border-right: 1px solid var(--line); z-index: 5; overflow-y: auto; }
.sidebar-brand { padding: 0 5px 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.sidebar-brand img { display: block; width: 100%; height: auto; }
.sidebar-brand > span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .18em; text-align: center; margin-top: 12px; }
.sidebar-label { color: #717b8c; font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; padding: 0 14px; margin-bottom: 13px; }
.tabbar { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.tabbar button { display: flex; align-items: center; gap: 13px; padding: 14px 13px; border: 1px solid transparent; border-radius: 10px; }
.tabbar button.active { color: #ffac71; background: #ff8a3d12; border-color: #ff8a3d26; box-shadow: none; }
.tabbar span { font-size: 13px; font-weight: 550; }
.tabbar small { margin-top: 4px; font-size: 10px; font-weight: 400; }
.tabbar svg, .code-empty svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-bottom { display: flex; align-items: center; gap: 11px; padding: 20px 9px 0; margin-top: auto; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; }
.sidebar-bottom strong { color: var(--text-soft); font-size: 11px; font-weight: 500; }
.sidebar-bottom small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.sidebar-monogram { display: grid; place-items: center; height: 35px; width: 35px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--accent); font-size: 11px; }
.overview { display: block; padding: 30px 0 28px; }
.overview-copy { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.overview-copy h2 { margin: 8px 0; font-size: 30px; line-height: 1.25; letter-spacing: -.035em; font-weight: 600; }
.overview-copy p { font-size: 12px; line-height: 1.7; }
.dashboard-date { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 26px; border: 0; }
.metric, .metric:first-child { display: block; position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 19px 22px; background: linear-gradient(120deg,#1b1e25,#15181e); }
.metric::after { content: ''; position: absolute; right: 20px; top: 22px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px #ff8a3d0d; }
.metric:nth-child(2)::after { background: #6aa9ed; box-shadow: 0 0 0 5px #6aa9ed0d; }
.metric:nth-child(3)::after { background: #65c69a; box-shadow: 0 0 0 5px #65c69a0d; }
.metric span { padding-right: 20px; font-size: 12px; }.metric small { font-size: 10px; }
.metric strong { font-size: 30px; font-weight: 600; line-height: 1.25; margin: 12px 0 7px; }
.tab { padding: 0 0 38px; }
.section-label { font-size: 9px; font-weight: 600; letter-spacing: .14em; }
.section-heading { gap: 24px; margin-bottom: 18px; align-items: center; }
.section-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.3; margin: 4px 0 0; }
.section-heading > p { max-width: 40ch; font-size: 11px; line-height: 1.7; }
.workspace-grid, .rebrand-grid { grid-template-columns: minmax(0,1.4fr) minmax(280px,1fr); gap: 20px; }
.panel { border-color: var(--line); background: var(--surface); padding: 24px; box-shadow: none; }
.panel-heading { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.panel h3 { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.panel p { font-size: 12px; line-height: 1.7; }
.panel-index { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.form-grid { gap: 18px; }.field { min-width: 0; }.field label { font-size: 11px; font-weight: 500; margin-bottom: 7px; color: var(--text-soft); }
.authenticated input, .authenticated select, .authenticated textarea { background: #0e1116; border-color: var(--line); color: var(--text); font-size: 13px; border-radius: 9px; }
.authenticated input, .authenticated select { min-height: 44px; padding: 10px 12px; }
.authenticated input::placeholder, .authenticated textarea::placeholder { color: #737d8e; }
.authenticated .button-primary { background: linear-gradient(130deg,#ff994f,#f47c32); color: #22140a; border: 1px solid transparent; box-shadow: none; font-size: 12px; font-weight: 650; }
.authenticated .button-primary:hover { background: #ffa668; }
.authenticated .button-secondary { border-color: var(--line); color: var(--text-soft); background: #ffffff03; font-size: 12px; }
.authenticated .button-secondary:hover:not(:disabled) { background: #ffffff08; border-color: var(--line-strong); }
.form-actions { justify-content: space-between; padding-top: 18px; margin-top: 2px; border-top: 1px solid var(--line); gap: 16px; }.form-note { color: var(--muted); font-size: 10px; }
.output-panel { display: flex; flex-direction: column; background: radial-gradient(ellipse at top right,#ff8a3d09,transparent 65%),var(--surface); }
.output-panel .panel-heading { width: 100%; }
.code-empty { display: flex; flex: 1; min-height: 220px; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 12px; padding: 20px; background: #0e111640; }
.code-empty svg { width: 39px; height: 39px; color: var(--accent); background: #ff8a3d0d; border-radius: 10px; padding: 8px; box-sizing: content-box; margin-bottom: 18px; }
.code-empty strong { font-size: 13px; font-weight: 500; }.code-empty p { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
#codeOutput { flex: 1; min-height: 240px; resize: vertical; font: 12px/1.8 ui-monospace,monospace; color: #ffc296; padding: 18px; }
.output-actions { margin-top: 16px; }.output-actions button { width: 100%; }.message:empty { display: none; }.message { font-size: 12px; overflow-wrap: anywhere; }
#dashboardMessage:not(:empty) { padding: 13px 16px; margin: 0 0 22px; border: 1px solid #ef6a6a35; border-radius: 10px; background: #ef6a6a0a; }
.table-panel { padding: 0; margin-top: 24px; overflow: hidden; }.table-toolbar { padding: 20px 24px; gap: 20px; }.table-toolbar h3 { margin: 4px 0 0; }.count-badge { display: inline-block; vertical-align: middle; font-size: 10px; font-weight: 500; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; margin-left: 6px; }
.search-field input { width: 200px; }.toolbar-actions { gap: 12px; }th { color: var(--muted); background: #101318; padding: 13px 24px; font-weight: 500; }td { padding: 18px 24px; border-color: var(--line); font-size: 12px; }.cell-primary { font-weight: 550; }.cell-secondary { font-size: 10px; margin-top: 4px; }.history-item { color: #ffbc8c; background: #ff8a3d0c; border: 1px solid #ff8a3d1c; border-radius: 6px; }.serial-badge { color: var(--text-soft); font-weight: 400; }
.guidance-panel { padding: 28px; }.guidance-panel h3 { max-width: 20ch; margin: 14px 0 24px; font-size: 24px; line-height: 1.3; }.guidance-panel li { font-size: 12px; padding-top: 15px; padding-bottom: 15px; }.guidance-panel li::before { top: 16px; }.guidance-panel::after { display: none; }
.migration-panel { padding: 28px; min-height: 320px; }.migration-panel h3 { font-size: 24px; line-height: 1.25; margin-top: 22px; }.migration-panel .button-link { margin-top: auto; }.migration-panel > small { font-size: 10px; }.accent-panel { background: radial-gradient(ellipse at top right,#ff8a3d16,transparent 70%),var(--surface); }
.authenticated footer { color: #808998; font-size: 10px; padding: 20px 0 28px; }
@media(min-width:1920px) { .authenticated .shell { margin-right: auto; margin-left: calc(238px + (100vw - 1920px)/2); } }
@media(max-width:1150px) { .authenticated .shell { margin-left: 214px; padding: 0 26px; }.admin-sidebar { width: 214px; padding-left: 14px; padding-right: 14px; }.dashboard-date { display: none; }.workspace-grid,.rebrand-grid { grid-template-columns: minmax(0,1.3fr) minmax(250px,1fr); gap: 16px; }.panel { padding: 20px; }.table-panel { padding: 0; }.section-heading { flex-direction: row; }.form-note { max-width: 12ch; } }
@media(max-width:960px) { .workspace-grid,.rebrand-grid { grid-template-columns: 1fr; }.code-empty { min-height: 170px; }.output-panel { min-height: 330px; }.guidance-panel h3 { max-width: none; }.section-heading > p { max-width: 30ch; }.form-note { max-width: none; }.migration-grid { grid-template-columns: 1fr; } }
@media(max-width:760px) {
  .authenticated .shell { margin: 0; padding: 0 18px; }.authenticated .topbar { min-height: 64px; gap: 10px; }.authenticated .brand-lockup { gap: 0; }.authenticated .topbar h1 { font-size: 13px; }.authenticated .server-status { display: inline-flex; font-size: 10px; padding: 0; }.topbar-actions { gap: 10px; }
  .admin-sidebar { position: sticky; top: 0; width: auto; margin: 0 -18px; padding: 10px 18px 0; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }.sidebar-brand { display: none; }.sidebar-label,.sidebar-bottom { display: none; }.authenticated .topbar .brand-logo-img { display: block; height: auto; width: 135px; max-width: none; }.authenticated .topbar .brand-lockup>div:not(.brand-divider) { display: none; }
  .tabbar { flex-direction: row; gap: 6px; overflow-x: auto; }.tabbar button { flex: 1 0 auto; justify-content: center; padding: 12px 10px; gap: 8px; border-radius: 8px 8px 0 0; }.tabbar span { font-size: 11px; }.tabbar small { display: none; }.tabbar svg { width: 16px; height: 16px; }
  .overview { padding: 26px 0; }.overview-copy h2 { font-size: 26px; max-width: 20ch; }.overview-copy p { font-size: 12px; }.metric-grid { gap: 9px; margin-top: 22px; }.metric,.metric:first-child { padding: 14px 12px; border-radius: 11px; }.metric::after { display: none; }.metric span { font-size: 10px; padding-right: 0; }.metric strong { font-size: 26px; margin: 9px 0 5px; }.metric small { font-size: 9px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }.section-heading h2 { font-size: 21px; }.section-heading > p { max-width: 48ch; }.panel { padding: 20px; border-radius: 14px; }.panel-heading { padding-bottom: 16px; margin-bottom: 18px; }.form-grid { grid-template-columns: 1fr; gap: 17px; }.field-wide { grid-column: auto; }.form-actions { align-items: flex-start; flex-direction: column; gap: 12px; }.form-actions button { width: 100%; min-height: 44px; }.panel p { font-size: 11px; }.table-panel { padding: 0; }.table-toolbar { padding: 19px; align-items: stretch; }.toolbar-actions { gap: 10px; }.search-field { min-width: 0; }.search-field input { width: 100%; }.toolbar-actions button { white-space: nowrap; min-height: 44px; }.table-wrap table { min-width: 650px; }th,td { padding: 14px 19px; }.guidance-panel h3 { font-size: 22px; }.migration-panel h3 { font-size: 23px; }.tab { padding-bottom: 28px; }
}
@media(max-width:370px) { .authenticated .server-status { display: none; }.metric small { font-size: 8px; } }

/* Ringkasan operasional: enam metrik, termasuk status lisensi dan keaktifan. */
.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric:nth-child(4)::after { background: #b08ae0; box-shadow: 0 0 0 5px #b08ae00d; }
.metric:nth-child(5)::after { background: #4ec995; box-shadow: 0 0 0 5px #4ec9950d; }
.metric:nth-child(6)::after { background: #8493a6; box-shadow: 0 0 0 5px #8493a60d; }
.metric-warn strong { color: #f0b429; }
.metric-warn::after { background: #f0b429 !important; box-shadow: 0 0 0 5px #f0b4290d !important; }

/* Status lisensi dan jejak audit. */
.status-badge { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.status-active { color: var(--success); border-color: rgba(78, 201, 149, .32); background: rgba(78, 201, 149, .1); }
.status-expired { color: var(--danger); border-color: rgba(239, 106, 106, .32); background: rgba(239, 106, 106, .1); }
.status-none { color: var(--muted); border-color: var(--line); background: var(--surface-soft); }
.status-action { color: var(--text-soft); border-color: var(--line); background: var(--surface-soft); font-weight: 600; }
.status-badge + .cell-secondary { margin-top: 4px; }
.toolbar-note { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* Form penerbitan lisensi dan rebrand pindah ke modal agar tabelnya tetap terlihat. */
.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 26px 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}
.modal::backdrop { background: rgba(4, 8, 14, .68); backdrop-filter: blur(3px); }
.modal-close-form { display: flex; justify-content: flex-end; margin: -6px -6px 0 0; }
.modal-close {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-soft); }
.modal-head { margin: 2px 0 20px; }
.modal-head h3 { margin: 6px 0 4px; font-size: 21px; font-weight: 620; letter-spacing: -.025em; }
.modal-head p { margin: 0; color: var(--muted); font-size: 13px; }
.modal-result { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-result label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.modal-result textarea {
  width: 100%; min-height: 108px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--bg); color: var(--text);
  font: 12px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.modal .field label small { margin-left: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.modal .field input:disabled { opacity: .55; cursor: not-allowed; }
.modal .message:empty { display: none; }

.delete-modal.modal { width: min(480px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-panel); }
.delete-modal-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border: 1px solid #ef6a6a40; border-radius: 13px; background: #ef6a6a12; color: var(--danger); }
.delete-modal-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.delete-modal-description { margin: 0; color: var(--text-soft); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.delete-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.delete-modal-actions button { min-height: 44px; }
.delete-modal-actions .button-danger { background: #a82f38; border-color: #a82f38; color: #fff; }
.delete-modal-actions .button-danger:hover { background: #bf3842; border-color: #bf3842; }

/* Tiga tindakan per baris rebrand membutuhkan kolom yang lebih lebar. */
.action-column { width: 230px; }

@media (max-width: 640px) {
  .modal { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* .metric span dibuat block dan diberi padding untuk label kartu; angka di dalam
   sub-keterangan harus tetap segaris dan rapat dengan teksnya. */
.metric small > span { display: inline; padding: 0; margin-right: 4px; color: var(--text-soft); font-weight: 650; }

/* Tabel jejak audit: kolom sempit tidak boleh memecah teks, kolom rincian harus membungkus. */
.audit-time, .audit-admin { white-space: nowrap; }
.audit-time .cell-primary { font-variant-numeric: tabular-nums; }
.audit-entity { white-space: nowrap; }
.audit-entity .cell-secondary { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.audit-detail { width: 100%; min-width: 220px; }
.audit-detail .history-item { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Kolom rincian butuh ruang lebih saat tabel digeser, agar chip tidak membungkus
   berlebihan dan tinggi barisnya tetap seragam. */
@media (max-width: 760px) {
  #audit .table-wrap table { min-width: 800px; }
}

/* Ringkasan trial / berlisensi di atas tabel pengguna. */
.summary-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.summary-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.summary-chip strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
#users .action-column { width: 150px; }

@media (max-width: 760px) {
  #users .table-wrap table { min-width: 940px; }
}

/* Kode sudah diterbitkan tetapi belum dimasukkan pengguna: target tindak lanjut. */
.status-warn { color: #f0b429; border-color: rgba(240, 180, 41, .32); background: rgba(240, 180, 41, .1); }

/* Tanggal dan ID tidak boleh terpecah di tengah nilainya. */
.cell-nowrap { white-space: nowrap; }

/* Tab prospek: filter pemilik, tautan jumlah prospek, dan catatan panjang. */
.owner-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 24px 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-soft); color: var(--text-soft); font-size: 12px; }
.owner-filter strong { color: var(--text); }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-hover); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.link-button:hover { text-decoration: underline; }
.prospect-note { min-width: 180px; max-width: 280px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #prospects .table-wrap table { min-width: 980px; }
  .owner-filter { margin: 0 16px 12px; flex-direction: column; align-items: flex-start; }
}

/* Dashboard sebagai halaman pertama: metrik dan tindak lanjut hanya di sini,
   sehingga tab lain langsung dibuka pada tabelnya. */
.dashboard-date { display: none; }
.authenticated .dashboard-date { display: inline-block; }
.authenticated .tab { padding-top: 28px; }
.tab > :first-child { margin-top: 0; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.metric:nth-child(2)::after { background: #f0b429; box-shadow: 0 0 0 5px #f0b4290d; }
.metric:nth-child(3)::after { background: #65c69a; box-shadow: 0 0 0 5px #65c69a0d; }
.metric:nth-child(4)::after { background: #6aa9ed; box-shadow: 0 0 0 5px #6aa9ed0d; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-top: 24px; }
.overview-grid .table-panel { margin-top: 0; }
.table-toolbar .toolbar-note { margin-top: 4px; font-size: 11px; }

.action-list { display: grid; }
.action-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; min-height: 0; padding: 15px 24px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text-soft); text-align: left; white-space: normal; font-weight: 400; line-height: 1.4; }
.action-item:last-child { border-bottom: 0; }
.action-item:hover { background: rgba(255, 255, 255, .025); }
.action-item:active { transform: none; }
.action-count { justify-content: center; min-width: 42px; font-variant-numeric: tabular-nums; }
.action-copy strong, .action-copy small { display: block; }
.action-copy strong { color: var(--text); font-size: 13px; font-weight: 550; }
.action-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.action-arrow { color: var(--muted); transition: transform .18s ease, color .18s ease; }
.action-item:hover .action-arrow { color: var(--accent); transform: translateX(3px); }
.action-item.is-empty .action-copy strong { color: var(--muted); }
.action-list .empty-state { padding: 28px 24px; }

.recent-list { margin: 0; padding: 0; list-style: none; }
.recent-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 13px 24px; border-bottom: 1px solid var(--line); font-size: 12px; }
.recent-list li:last-child { border-bottom: 0; }
.recent-when { color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-when small, .recent-what small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.recent-what { min-width: 0; }
.recent-what strong { color: var(--text); font-weight: 550; }
.recent-what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .recent-empty { display: block; padding: 28px 24px; color: var(--muted); text-align: center; }

/* Menu samping dikelompokkan menurut alur kerja. */
.tabbar { gap: 4px; }
.tabbar button { padding: 11px 13px; }
.tabbar .nav-group { display: block; margin: 16px 14px 6px; color: #717b8c; font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-brand { margin-bottom: 18px; }

/* Chip status sekaligus menjadi filter. */
.filter-chips { margin: 0; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.filter-chips:empty { display: none; }
button.summary-chip { min-height: 30px; padding: 5px 11px; background: transparent; font-weight: 400; line-height: 1.2; cursor: pointer; }
button.summary-chip:hover { border-color: var(--line-strong); color: var(--text-soft); }
button.summary-chip:active { transform: none; }
button.summary-chip.active { border-color: #ff8a3d55; background: #ff8a3d14; color: #ffac71; }
button.summary-chip.active strong { color: #ffc296; }
.summary-info { border-style: dashed; }
.owner-filter { margin-top: 14px; }

@media (max-width: 1150px) {
  .authenticated .dashboard-date { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .tabbar .nav-group { display: none; }
  .table-toolbar > .button-compact { align-self: flex-start; }
  .tabbar { gap: 6px; }
  .authenticated .tab { padding-top: 22px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .overview-grid { gap: 16px; margin-top: 16px; }
  .toolbar-actions { flex-wrap: wrap; }
  .toolbar-actions .search-field:first-child { flex: 1 1 100%; }
  .toolbar-actions .search-field select { width: 100%; }
  .filter-chips { padding: 12px 19px; }
  .action-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 14px 19px; }
  .recent-list li { grid-template-columns: 84px minmax(0, 1fr); padding: 12px 19px; }
  #users .table-wrap table { min-width: 760px; }
  #prospects .table-wrap table { min-width: 820px; }
  .table-wrap table { min-width: 620px; }
  #overview .table-wrap table { min-width: 0; }
}
@media (min-width: 761px) {
  .tabbar button { justify-content: flex-start; text-align: left; }
}
/* Pesan di bawah tabel mengikuti jarak tepi panel, tidak menempel ke garisnya. */
.table-panel > .message:not(:empty) { margin: 0; padding: 14px 24px; border-top: 1px solid var(--line); }

/* Baris pengguna dan pembeli membuka panel detail; semua tindakan ada di sana,
   dan tabel pengguna menambah ikon pintas untuk terbitkan kode dan hapus. */
tr.row-clickable { cursor: pointer; }
.row-open { display: block; min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; white-space: normal; cursor: pointer; }
.row-open:hover .cell-primary, tr.row-clickable:hover .row-open .cell-primary { color: var(--accent-hover); }
.row-open:active { transform: none; }
.row-chevron { display: none; }

.drawer { width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .22s ease both; }
.drawer::backdrop { background: rgba(4, 8, 14, .6); backdrop-filter: blur(2px); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 6px 0 3px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.drawer-head p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.drawer-head form { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-status { padding-bottom: 18px; }
.drawer-status .cell-secondary { font-size: 11px; }
.detail-list { display: grid; margin: 0; border-top: 1px solid var(--line); }
.detail-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; color: var(--text-soft); overflow-wrap: anywhere; }
.detail-list code { font: 11px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--text-soft); }
.drawer-subhead { margin: 22px 0 10px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.code-history { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.code-history li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.code-history small { color: var(--muted); font-size: 11px; }
.code-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
#revokeReason, #issuedCodeOutput { width: 100%; min-height: 100px; }
@media (max-width: 480px) {
  .code-history li { grid-template-columns: auto minmax(0, 1fr); }
  .code-actions { grid-column: 2; justify-content: flex-start; }
}
#drawerMessage:not(:empty) { margin: 0; padding: 10px 24px; border-top: 1px solid var(--line); }
.drawer-actions { padding: 16px 24px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.drawer-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.drawer-buttons button { flex: 1 1 auto; }
.drawer-danger { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(239, 106, 106, .25); border-radius: 10px; background: rgba(239, 106, 106, .04); }
.drawer-danger strong, .drawer-danger small { display: block; }
.drawer-danger strong { color: #ff9696; font-size: 12px; font-weight: 600; }
.drawer-danger small { margin-top: 2px; color: var(--muted); font-size: 11px; }

/* Di tablet dan HP setiap baris tabel menjadi kartu: sel pertama sebagai judul,
   sisanya berlabel. Lima kolom tidak muat di lebar konten sekitar 500px. */
@media (max-width: 960px) {
  .table-wrap .table-cards { min-width: 0 !important; }
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; min-width: 0; padding: 0; border: 0; }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards td:first-child, .table-cards td.empty-cell, .table-cards td.cell-actions, .table-cards td.audit-detail, .table-cards td.prospect-note { grid-column: 1 / -1; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
  .table-cards .cell-nowrap { white-space: normal; }
  .table-cards .audit-detail, .table-cards .prospect-note { min-width: 0; max-width: none; }
  .table-cards td:first-child .cell-primary { font-size: 14px; }
}
@media (max-width: 760px) {
  .table-cards tr { padding-left: 19px; padding-right: 19px; }
  .drawer { width: 100vw; border-left: 0; }
  .drawer-head, .drawer-body { padding-left: 19px; padding-right: 19px; }
  .drawer-actions { padding: 14px 19px 20px; }
  .detail-list > div { grid-template-columns: 110px minmax(0, 1fr); }
}

/* Tablet: di bawah 1024px judul dan kontrol tabel tidak muat berdampingan, jadi
   toolbar bertumpuk dan kontrolnya membungkus alih-alih terpotong panel. */
@media (max-width: 1024px) {
  .table-toolbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-start; align-items: flex-end; }
  .toolbar-actions .search-field { flex: 1 1 200px; min-width: 0; }
  .toolbar-actions .search-field input { width: 100%; }
  .toolbar-actions .search-field select { min-width: 150px; width: 100%; }
  .table-toolbar > .button-compact { align-self: flex-start; }
  /* A toolbar holding just one button keeps it beside the title. */
  .table-toolbar:not(:has(.toolbar-actions)) { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}

/* Keterbacaan: teks sekunder minimal 11px, label huruf kapital minimal 10.5px. */
.authenticated .cell-secondary, .authenticated .metric small, .authenticated .tabbar small,
.authenticated .sidebar-bottom small, .authenticated .count-badge, .authenticated .form-note,
.authenticated footer, .recent-when small, .recent-what small, .migration-panel > small,
.authenticated .table-toolbar .toolbar-note { font-size: 11px; }
.authenticated .section-label, .authenticated .brand-owner, .authenticated .sidebar-brand > span,
.authenticated .tabbar .nav-group, .authenticated th, .drawer-subhead, .modal .field label small,
.table-cards td[data-label]::before { font-size: 10.5px; }
@media (max-width: 760px) {
  .authenticated .metric small, .authenticated .metric > span, .authenticated .server-status, .authenticated .cell-secondary { font-size: 11px; }
  .table-cards td[data-label]::before { font-size: 10.5px; }
  /* Nama, kontak, status, dan prospek cukup untuk memindai daftar pengguna.
     Identitas lengkap dan aktivitas tetap tersedia di panel detail. */
  .table-cards tr { gap: 10px 16px; }
  .table-cards td { font-size: 13px; overflow-wrap: anywhere; }
  .table-cards .person-dob, .table-cards .user-origin, .table-cards .user-activity { display: none; }
  .table-cards .row-open { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 32px; }
  .table-cards .row-open .cell-primary { font-size: 15px; }
  .table-cards .row-chevron { display: block; flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .authenticated .table-cards .cell-secondary, .authenticated .drawer .cell-secondary { font-size: 12px; }
  .table-cards .status-badge { font-size: 12px; white-space: normal; line-height: 1.4; }
}

/* Ikon pintas di baris pengguna. */
#users .action-column { width: 112px; }
#users .cell-actions { vertical-align: middle; }
.icon-button, .row-actions .icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text-soft); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); color: var(--accent-hover); }
.icon-button.icon-danger { border-color: rgba(239, 106, 106, .35); color: #ff9696; }
.icon-button.icon-danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(239, 106, 106, .08); color: #ffb0b0; }
@media (max-width: 960px) {
  .table-cards .row-actions { justify-content: flex-start; }
  .icon-button, .row-actions .icon-button { width: 40px; height: 40px; }
}

/* Modal mengikuti tinggi layar: tombol tutup menumpang di pojok, jarak antar
   isian menyusut di layar pendek, dan kotak kode bergulir sendiri alih-alih
   memanjangkan modal. */
.modal { position: fixed; padding: clamp(18px, 3vh, 26px) clamp(18px, 3vw, 28px); }
.modal-close-form { position: absolute; top: clamp(12px, 2vh, 18px); right: clamp(12px, 2vw, 18px); margin: 0; }
.modal-head { margin: 0 0 clamp(12px, 2.2vh, 20px); padding-right: 44px; }
.modal-head h3 { margin-top: clamp(2px, .6vh, 6px); }
.modal .form-grid { gap: clamp(10px, 1.8vh, 18px) 14px; }
.modal .field label { margin-bottom: clamp(4px, .7vh, 7px); }
.authenticated .modal input, .authenticated .modal select { min-height: clamp(38px, 5.2vh, 44px); padding-top: 8px; padding-bottom: 8px; }
.modal .form-actions { padding-top: clamp(10px, 1.8vh, 18px); }
.modal-result { margin-top: clamp(12px, 2vh, 20px); padding-top: clamp(12px, 2vh, 18px); }
.modal #codeOutput { flex: none; min-height: 0; height: clamp(88px, 18vh, 200px); padding: 12px 14px; resize: vertical; }
#licenseDialog .form-note { max-width: 48ch; }
#licenseDialog .field > small { font-size: 11px; line-height: 1.4; color: var(--muted); }
#licenseDialog #codeOutput { height: clamp(76px, 14vh, 160px); }
.modal .output-actions { margin-top: clamp(8px, 1.4vh, 16px); }
.delete-modal .modal-head { padding-right: 0; }
