:root {
  color-scheme: light;
  --bg-main: #fffbf1;
  --bg-sidebar: #fff;
  --bg-card: #fff;
  --bg-card-hover: #fff1cc;
  --bg-card-inner: #fffaf0;
  --border: #ecdfbf;
  --border-focus: #9d6000;
  --text: #281c0a;
  --text-muted: #695539;
  --text-dim: #746044;
  --primary: #ffb000;
  --primary-hover: #e99c00;
  --gold: #78551b;
  --gold-light: #78551b;
  --gold-bg: #fff3d6;
  --success: #116345;
  --danger: #9b2734;
}
body { background: var(--bg-main); color: var(--text) }
.sidebar { overflow-y: auto; border-color: var(--border) }
.brand-box { align-items: center }
.brand-icon, .login-crown { background: #ffe7a4; color: var(--primary); font-size: 30px; font-weight: 800 }
.brand-info h2 { font-size: 19px }
.nav-menu { padding: 12px }
.nav-item { width: 100%; background: transparent; text-align: left; border-radius: 9px; min-height: 42px }
.nav-item:hover, .nav-item.active { color: var(--primary); background: #fff0c6; border-color: #efdbad }
.nav-item.active { font-weight: 750 }
.nav-badge, .nav-badge.active-badge { background: #ffecb4; color: #754800 }
.top-header { min-height: 76px; height: auto; gap: 14px; background: #ffffffed; backdrop-filter: blur(12px) }
#breadcrumb-current { color: var(--text); font-size: clamp(20px, 3vw, 28px); letter-spacing: -.035em }
.content-area { padding: clamp(16px, 3vw, 36px) }
.overview-intro {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 20px; margin-bottom: 20px; padding: clamp(18px, 4vw, 32px);
  border-radius: 16px; border: 1px solid #eed9a6; background: linear-gradient(115deg, #ffffff, #ffe8ab);
}
.overview-intro h2 { font-size: clamp(23px, 3.5vw, 34px); letter-spacing: -.035em }
.overview-intro p { margin-top: 6px; color: var(--text-muted); line-height: 1.5 }
.overview-actions, .order-actions { display: flex; flex-wrap: wrap; gap: 8px }
#dash-orders-count { padding: 2px 6px; border-radius: 6px; background: #ffffff26 }
.stats-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px }
.stat-card, .panel-card, .config-card { border-color: var(--border); box-shadow: 0 3px 12px #69470e10; border-radius: 13px }
.stat-card:hover { transform: none }
.panel-header { background: #fffaf0 }
.panel-title-box p { line-height: 1.45 }
.brand-info h2, .panel-title-box h3, .stat-details h2, .custom-table b,
.search-input, .form-control, .modal-header h3, .login-card h2,
.btn-icon:hover, .btn-close-modal:hover { color: var(--text) }
.btn-action-sm { text-decoration: none; min-height: 36px }
.btn-primary-sm { background: var(--primary); border-color: var(--primary); color: #251800 }
.btn-primary-sm:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #251800 }
.btn-action-sm:disabled { cursor: default; opacity: .55 }
.badge-neutral, .badge-success, .badge-danger, .badge-gold { white-space: nowrap }
.badge-neutral { color: #43574f; background: #edf1ef }
.badge-success { color: #116345; background: #e2f4e8 }
.badge-danger { color: #942c38; background: #fce9eb }
.badge-gold { color: #78551b; background: #fff3d6 }
.custom-table th { background: #fff4d7 }
.custom-table td { border-color: #f0e5ca }
.custom-table tr:hover td { background: #fffaf0 }
.table-summary { padding: 12px 16px; color: var(--text-muted); font-size: 13px }
.order-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start }
.order-tools, .price-editor, .order-row { padding: 14px 18px }
.order-tools { display: grid; align-items: center; gap: 6px }
.order-tools label, .price-editor label { font-size: 13px; font-weight: 650 }
.order-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border) }
.order-row p { margin-top: 4px; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere }
.price-editor label { display: grid; gap: 6px; margin-bottom: 12px }
#zlMsg { display: block; color: var(--text-muted); font-size: 14px }

.modal-box { max-height: calc(100dvh - 24px); overflow-y: auto }
.panel-actions { flex-wrap: wrap; max-width: 100% }
.panel-actions > *, .form-control, .panel-card { min-width: 0; max-width: 100% }
#sidebar-scrim { display: none }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px }
.view-panel.active { animation: view-enter .17s ease-out }
@keyframes view-enter { from { opacity: .65; transform: translateY(4px) } to { opacity: 1; transform: none } }
@media (max-width: 900px) {
  .sidebar { visibility: hidden; width: min(280px, 86vw); transition: transform .2s ease, visibility .2s }
  .sidebar.open { visibility: visible }
  body:has(.sidebar.open) #sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 99; border: 0; background: #30200775 }
  .top-header { min-height: 60px; padding: 8px 12px }
  .header-left, .header-right { gap: 8px; min-width: 0 }
  .header-right { flex-wrap: wrap; justify-content: flex-end }
  .menu-toggle-btn { min-width: 42px; min-height: 42px }
  .panel-header { padding: 14px }
}
@media (max-width: 650px) {
  .order-layout { grid-template-columns: 1fr; gap: 0 }
  .top-header .header-right .btn-action-sm { padding-inline: 8px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}


body { background: var(--bg-main); margin: 0 }
.admin-login, .admin-login * { box-sizing: border-box }
.admin-login {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  font-family: system-ui, sans-serif; background: radial-gradient(ellipse at top, #ffe5a0, #fffbf1 65%);
}
.login-card {
  width: min(100%, 440px); padding: clamp(22px, 5vw, 38px); background: #fffdf7;
  border: 1px solid var(--border); border-radius: 30px; box-shadow: 0 18px 50px #68451620;
}
.login-brand { display: inline-block; background: #ffe5a1; border-radius: 100px; padding: 7px 14px; text-decoration: none; color: #5c3801; font-weight: 850 }
.login-card h1 { margin: 18px 0 6px; font-size: clamp(24px, 6vw, 34px); letter-spacing: -.04em }
.login-card p, .login-home { color: var(--text-muted); line-height: 1.55 }
#admin-login-form { display: grid; gap: 10px; margin: 23px 0 12px }
#admin-login-form label { font-weight: 700 }
#admin-login-form .form-control,
#admin-login-form button { min-height: 48px; border: 1px solid var(--border); border-radius: 13px; padding: 0 14px; font: inherit }
#admin-login-form button { border: 0; border-radius: 100px; font-weight: 800; cursor: pointer }
#login-error { color: var(--danger); font-size: 14px }
#login-error:empty { display: none }
.login-home { display: inline-block; margin-top: 4px }

.sidebar { background: #fff7e0 }
.brand-box { padding: 25px 18px; border-color: var(--border) }
.brand-icon { color: #533300; border-radius: 16px }
.nav-menu { padding: 10px 12px 18px }
.nav-item { border-radius: 13px; padding: 11px 12px }
.nav-item:hover, .nav-item.active { color: #633a02 }
.nav-item.active i { color: #865200 }
.nav-section-title { color: #766041 }
.sidebar-actions { display: flex; flex-wrap: wrap; gap: 8px }
.sidebar-footer .server-pill { background: #fffdf7; border-color: var(--border) }
.top-header { background: #fffaf0f5; border-color: var(--border); padding-inline: clamp(14px, 4vw, 36px) }
.btn-action-sm { border-radius: 999px; font-weight: 750 }
.btn-primary-sm { box-shadow: 0 2px 0 #b67500 }
.page-description { margin: 0 0 18px; color: var(--text-muted); line-height: 1.5 }
.overview-intro { border-radius: 24px }
.overview-intro h2 { font-weight: 820 }
.panel-card, .stat-card, .config-card { border-radius: 20px }
.panel-header { padding: clamp(14px, 3vw, 22px) }
.panel-title-box h3 { font-weight: 780 }
.stat-icon { background: #fff0c6; color: #7c4c00; border-radius: 14px }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start }
.workspace-form { display: grid; gap: 12px; padding: 18px 22px 22px }
.activation-form { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.activation-form > :first-child, .activation-form > button { grid-column: 1 / -1 }
#view-upgrade .config-card, #view-upgrade .panel-card { width: 100% }
#view-bot .form-grid { padding: 20px 22px; gap: 16px }
#view-announcement .simulator-container { grid-template-columns: minmax(0, 1fr) minmax(230px, .9fr) }
.table-responsive { overscroll-behavior-inline: contain }
.custom-table td, .custom-table th { padding-inline: clamp(10px, 2vw, 18px) }
@media (max-width: 700px) {
  .settings-layout, .activation-form, #view-announcement .simulator-container { grid-template-columns: 1fr }
  .workspace-form { padding-inline: 14px }
}
.list-search { display: grid; gap: 6px; max-width: 400px; margin: 0 0 16px; font-weight: 700 }
.list-search input { width: 100% }

/* Dashboard layout */
body { padding: 0; display: block; background: #f5f6f8 }
#login-overlay { background: #f5f6f8 }
#login-card-box { background: #fff; border-color: #e3e6eb; box-shadow: 0 12px 30px #20293812; border-radius: 18px }
#admin-dashboard { max-width: none }
.admin-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh }
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
  padding: 24px 14px;
  border-right: 1px solid #e3e6eb;
  background: #fff;
  color: #202938;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding-inline: 8px }
.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #382100;
  background: #ffcb56;
  font-size: 1.4rem;
}
.admin-brand strong, .admin-brand small { display: block }
.admin-brand small, .admin-nav-group > p { color: #606b7b }
.admin-nav { display: grid; gap: 15px }
.admin-nav-group { display: grid; gap: 3px }
.admin-nav-group > p { padding: 3px 10px; font-size: .74rem; font-weight: 700 }
.admin-nav .tab-btn {
  justify-content: flex-start;
  min-width: 0;
  min-height: 43px;
  padding: 9px 10px;
  gap: 9px;
  color: #374151;
  text-align: left;
  white-space: normal;
  box-shadow: none;
}
.admin-nav .tab-btn i { width: 17px; text-align: center }
.admin-nav .tab-btn:hover { color: #111827; background: #f2f4f7 }
.admin-nav .tab-btn.active { background: #fff2ce; color: #5e4105; box-shadow: none }
.admin-nav-count { margin-left: auto; font-size: .74rem; padding: 2px 6px; border-radius: 20px; background: #92815e55 }
.admin-home-link { display: flex; justify-content: space-between; margin-top: auto; padding: 10px; color: #4b5563; font-size: .86rem }
.admin-workspace {
  min-width: 0;
  --bg-card: #fff;
  --bg-card-inner: #f8f9fb;
  --border: #e3e6eb;
  --text: #202938;
  --text-muted: #586475;
  --text-dim: #586475;
  color: var(--text);
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px clamp(16px, 4vw, 45px);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.admin-topbar h1 { color: #2a2417; font-size: clamp(1.25rem, 3vw, 1.9rem); letter-spacing: -.035em }
.admin-content { margin: auto; max-width: 1440px; padding: clamp(16px, 3vw, 36px) }
.admin-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.admin-overview h2 { font-size: clamp(1.25rem, 3vw, 2rem); color: #382810 }
.admin-overview p { margin-top: 5px; color: #665432 }
.admin-layout .mode-badge { color: #28503c; border-color: #83ae99; background: #eff8e9 }
.admin-layout .mode-white { color: #2d4c77; border-color: #9db0ca; background: #eef4ff }
.admin-workspace .card, .admin-workspace .stat-card { background: var(--bg-card); border-color: var(--border); box-shadow: 0 2px 6px #31281308 }
.admin-workspace input, .admin-workspace select, .admin-workspace textarea, .admin-workspace select option {
  background: var(--bg-card-inner);
  color: var(--text);
  border-color: var(--border);
}
.admin-workspace input::placeholder, .admin-workspace textarea::placeholder { color: var(--text-muted); opacity: 1 }
.admin-workspace .btn-secondary { color: var(--text); background: var(--bg-card); border-color: var(--border) }
.admin-workspace .btn-secondary:hover { background: var(--bg-card-inner) }
.admin-workspace .card, .admin-workspace .stat-card { border-radius: 12px }
.admin-workspace .card-header { gap: 12px; border-color: var(--border) }
.admin-workspace .card-header h2, .admin-workspace .card-header h3 { color: var(--text); letter-spacing: -.02em }
.admin-nav-group > p { letter-spacing: .04em; text-transform: uppercase; font-size: .68rem }
.admin-layout .stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 12px }
.admin-layout .stat-card { padding: 14px; gap: 10px }
.admin-layout .stat-icon { width: 35px; height: 35px; color: #825300 !important }
.admin-layout .stat-num { color: #2a2417 !important }
.admin-quick-links, .admin-inline-actions { display: flex; flex-wrap: wrap; gap: 10px }
.admin-settings-grid, .admin-fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.admin-settings-form fieldset { min-width: 0 }
.admin-settings-form legend, .admin-system-card h2 { font-size: 1.05rem; font-weight: 800; color: #392d16 }
.admin-settings-form legend { padding-inline: 7px }
.admin-settings-form label, .admin-system-label { display: grid; gap: 5px; font-weight: 700; margin-block: 8px }
.admin-settings-form textarea { width: 100%; min-width: 0; resize: vertical }
.admin-settings-form input, .admin-system-label input, .admin-system-label textarea { width: 100%; min-width: 0 }
.admin-field-hint, .admin-system-card p { color: #6b5c44; font-size: .88rem; margin-block: 6px 12px }
.admin-rate { max-width: 250px }
.admin-save-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px }
.admin-save-bar p { color: #65563d; font-size: .88rem }
.admin-save-bar p[data-error="true"] { color: #9b2734 }
.admin-save-bar button:disabled { opacity: .55; cursor: default }
.admin-layout :focus-visible { outline: 2px solid #9b6210; outline-offset: 3px }
.caption-workspace { display: grid; gap: 18px; grid-template-columns: minmax(220px, .85fr) minmax(0, 2fr); align-items: start }
.caption-workspace .card { min-width: 0; padding: clamp(14px, 2vw, 22px) }
.caption-panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px }
.caption-workspace h2 { font-size: 1.15rem; color: var(--text) }
.caption-library > label, .caption-photo-label { display: block; color: var(--text-muted); font-size: .88rem; margin-bottom: 6px }
.caption-library > input { width: 100%; min-width: 0 }
.caption-template-list { display: grid; gap: 5px; align-content: start; max-height: min(65vh, 620px); overflow: auto; padding: 4px; margin: 8px -4px 0 }
.caption-template-list h3 { margin: 12px 0 3px; color: var(--text-muted); font-size: .87rem }
.caption-template {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.caption-template:hover { background: var(--bg-card-inner) }
.caption-template[aria-pressed="true"] { border-color: #ba8c42; background: #eadbbd }
.caption-swatch { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px; color: #fff; font-size: .9rem; text-shadow: 0 1px 3px #000 }
.caption-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 1fr); gap: 18px; margin-top: 14px }
.caption-preview-column { min-width: 0 }
.caption-preview {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end;
  justify-items: center; width: 100%; aspect-ratio: 1; padding: 10%;
  border-radius: 19px; background: radial-gradient(ellipse at 68% 20%, #dfc69d, #7e8e85 57%, #354448);
}
.caption-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1 }
.caption-preview-overlay {
  display: flex; align-items: center; gap: .4em; min-width: 0; max-width: 100%; padding: .52em .85em;
  border-radius: 14px; font-size: clamp(.85rem, 1.45vw, 1.18rem); font-weight: 700;
  line-height: 1.3; box-shadow: 0 3px 12px #201b2630;
}
.caption-preview-overlay[data-presentation="poll"] { display: grid; gap: 8px; width: min(100%, 280px) }
#caption-preview-options { display: grid; gap: 5px }
#caption-preview-options button {
  width: 100%; border: 1px solid #ffffff50; border-radius: 7px; padding: 6px 8px;
  background: #0003; color: inherit; text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere;
}
#caption-preview-options button[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -2px; background: #ffffff38 }
.caption-preview-overlay[data-presentation="ticker"] { display: block; width: 100%; overflow: hidden; border-radius: 8px }
#caption-preview-overlay[data-presentation="ticker"] #caption-preview-text {
  display: block; width: max-content; max-width: none; padding-left: 100%; white-space: nowrap;
  animation: caption-ticker var(--caption-speed, 8s) linear infinite;
}
#caption-preview-overlay[data-presentation="ticker"]:hover #caption-preview-text { animation-play-state: paused }
@keyframes caption-ticker {
  to { transform: translateX(-100%) }
}
@media (prefers-reduced-motion: reduce) {
  #caption-preview-overlay[data-presentation="ticker"] #caption-preview-text {
    animation: none; width: auto; padding: 0; overflow: hidden; text-overflow: ellipsis;
  }
}
#caption-preview-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--caption-lines, 1); overflow: hidden; overflow-wrap: anywhere }
.caption-photo-label { margin-top: 10px }
.caption-photo-label input { display: block; width: 100%; min-width: 0; margin-top: 4px; padding: 7px; font-size: .82rem }
.caption-editor fieldset { border: 0; padding: 0 }
.caption-editor fieldset legend { padding: 0 }
.caption-appearance { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px }
.caption-appearance summary { cursor: pointer; font-weight: 600 }
.caption-effect-hint { color: var(--text-muted); font-size: .85rem; line-height: 1.4; margin: 8px 0 }
#caption-poll-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px }
.caption-editor select { width: 100%; min-width: 0 }
.caption-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px }
.caption-colors label { font-size: .82rem }
.caption-colors input { height: 38px; padding: 3px 6px; cursor: pointer }
.caption-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px }
#caption-settings-status { color: var(--text-muted); font-size: .87rem; line-height: 1.45 }
.caption-editor [hidden] { display: none }
#caption-preview-options[hidden], #caption-poll-fields[hidden] { display: none }
@media (max-width: 1100px) {
  .caption-editor-grid { grid-template-columns: minmax(0, 1fr) }
  .caption-preview-column { max-width: 360px }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 186px minmax(0, 1fr) }
  .admin-settings-grid { grid-template-columns: 1fr }
}
@media (max-width: 680px) {
  .caption-workspace { grid-template-columns: minmax(0, 1fr) }
  .caption-template-list { max-height: 225px }
  .admin-layout { display: block }
  .admin-sidebar { position: static; height: auto; padding: 12px; gap: 10px }
  .admin-nav { display: flex; overflow-x: auto; gap: 8px; padding: 2px }
  .admin-nav-group { display: flex; align-items: center; gap: 3px }
  .admin-nav-group > p { display: none }
  .admin-nav .tab-btn { white-space: nowrap; min-height: 40px }
  .admin-home-link { align-self: start; gap: 6px; padding: 4px 8px }
}

/* Calm dark admin palette: reduce glare while keeping the existing amber actions. */
:root {
  color-scheme: dark;
  --bg-main: #151719;
  --bg-sidebar: #1a1c1f;
  --bg-card: #202327;
  --bg-card-hover: #292d32;
  --bg-card-inner: #1a1d20;
  --border: #343941;
  --text: #e5e7eb;
  --text-muted: #a3aab5;
  --text-dim: #858d99;
}
body, body.admin-layout { background: #151719; color: #e5e7eb; }
.admin-sidebar { background: #1a1c1f; color: #e5e7eb; border-color: #343941; }
.admin-brand small, .admin-nav-group > p, .admin-home-link { color: #9aa2ad; }
.admin-nav .tab-btn { color: #c3c8d0; }
.admin-nav .tab-btn:hover { color: #f3f4f6; background: #292d32; }
.admin-nav .tab-btn.active { color: #f8fafc; background: #383d44; }
.admin-workspace {
  --bg-card: #202327;
  --bg-card-inner: #1a1d20;
  --border: #343941;
  --text: #e5e7eb;
  --text-muted: #a3aab5;
  --text-dim: #858d99;
  background: #151719;
  color: #e5e7eb;
}
.admin-topbar, .admin-overview, .admin-workspace .card,
.admin-workspace .stat-card, .admin-workspace .panel-card,
.admin-workspace .config-card { background: #202327; border-color: #343941; color: #e5e7eb; }
.admin-topbar h1, .admin-overview h2, .admin-workspace h2,
.admin-workspace h3, .admin-workspace .stat-num { color: #f1f3f5 !important; }
.admin-overview p, .admin-workspace p, .admin-workspace label,
.admin-user-secondary, .admin-user-expiry { color: #a3aab5; }
.admin-workspace input, .admin-workspace select, .admin-workspace textarea,
.admin-workspace select option { background: #1a1d20; color: #e5e7eb; border-color: #414750; }
.admin-workspace table thead th { background: #292d32; color: #d7dbe1; }
.admin-workspace table tbody td, .admin-workspace table tbody th { border-color: #343941; }
.admin-workspace table tbody tr:hover td { background: #292d32; }
.admin-content-row { background: #1a1d20; border-color: #343941; }
.admin-user-avatar { background: #343941; color: #d1d5db; }
.admin-sidebar .admin-brand-mark { background: #3a3f46; color: #f5c451; }
.admin-member-content-fields, .admin-content-list { display: grid; gap: 10px }
.admin-content-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px }
.admin-content-heading h2 { font-size: 1.05rem; font-weight: 800 }
.admin-content-row { padding: 10px 12px; border: 1px solid #ece2ce; border-radius: 11px; background: #faf6ec }
.admin-content-row summary { cursor: pointer; font-weight: 700; overflow-wrap: anywhere }
.admin-content-row textarea { padding: 8px 10px; line-height: 1.45 }
.admin-workspace table thead th { background: #f8f9fb; color: #465364 }
.admin-workspace table tbody td,
.admin-workspace table tbody th { border-color: var(--border) }
.admin-users-table { min-width: 700px }
.admin-users-table td { padding: 9px 12px; vertical-align: middle }
.admin-user-identity, .admin-user-meta, .admin-user-actions { display: flex; align-items: center; gap: 8px }
.admin-user-name { overflow-wrap: anywhere }
.admin-user-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #edf0f4;
  color: #495668;
  font-weight: 800;
}
.admin-user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.admin-user-meta, .admin-user-secondary, .admin-user-expiry { color: var(--text-muted); font-size: .77rem }
.admin-user-secondary, .admin-user-expiry { display: block; margin-top: 3px }
.admin-user-note { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.admin-user-uid, .admin-user-actions button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #39465a;
  cursor: pointer;
}
.admin-user-uid { padding: 1px 5px; font: inherit; white-space: nowrap }
.admin-user-actions { gap: 4px }
.admin-user-actions button { min-width: 32px; min-height: 32px; padding: 3px 6px; white-space: nowrap }
.admin-user-actions button:hover, .admin-user-uid:hover { background: #f1f4f8 }
.admin-user-actions [data-user-action="delete"] { color: #973b3b }
.admin-user-state { display: inline-block; padding: 2px 7px; border-radius: 6px; background: #edf0f4; font-size: .76rem; font-weight: 750 }
.admin-user-state.is-active { background: #e7f3eb; color: #22653e }
.admin-user-state.is-blocked { background: #f9e9e9; color: #8b3737 }

/* Final dark overrides: the legacy light rules above must not wash out the UI. */
body, #admin-dashboard, .admin-workspace { background: #151719 !important; color: #e5e7eb; }
.admin-workspace .card, .admin-workspace .stat-card, .admin-workspace .panel-card,
.admin-workspace .config-card, .admin-topbar { background: #202327 !important; border-color: #343941 !important; color: #e5e7eb; }
.admin-workspace table thead th { background: #292d32 !important; color: #d7dbe1 !important; }
.admin-workspace table tbody td, .admin-workspace table tbody th { border-color: #343941 !important; }
.admin-workspace input, .admin-workspace select, .admin-workspace textarea,
.admin-workspace select option, .admin-user-uid, .admin-user-actions button {
  background: #1a1d20 !important; color: #e5e7eb !important; border-color: #414750 !important;
}
.admin-user-actions button:hover, .admin-user-uid:hover { background: #343941 !important; }

.filter-activity-card { margin-top: 22px; padding: 18px; border: 1px solid #343941; border-radius: 14px; background: #202327; }
.filter-activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter-activity-head h2 { margin: 0; font-size: 1.05rem; color: #f1f3f5; }
.filter-activity-head p { margin: 5px 0 0; color: #a3aab5; font-size: .82rem; }
.filter-activity-terminal { overflow: auto; max-height: 360px; border: 1px solid #343941; border-radius: 10px; background: #111315; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.activity-grid { display: grid; grid-template-columns: 70px minmax(105px,1.05fr) 105px minmax(155px,1.25fr) minmax(105px,1fr) 100px 42px; gap: 10px; align-items: center; }
.activity-grid-head { padding: 8px 12px; color: #7f8996; border-bottom: 1px solid #343941; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.activity-line { padding: 8px 12px; border-bottom: 1px solid #25292e; white-space: nowrap; font-size: 11px; }
.activity-line:last-child { border-bottom: 0; }
.activity-line:hover { background: #1c2024; }
.activity-line time, .activity-ip, .activity-ms { color: #858d99; }
.activity-user { color: #e1e5ea; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.activity-route { color: #aeb7c2; overflow: hidden; text-overflow: ellipsis; }
.activity-feature { color: #d7dbe1; overflow: hidden; text-overflow: ellipsis; }
.activity-feature small { display: block; overflow: hidden; color: #707985; font-size: 9px; text-overflow: ellipsis; }
.activity-kind { color: #b9a2ff; font-size: 10px; font-weight: 800; }
.activity-credit { color: #f5c451; text-align: center; }
.activity-result.ok { color: #6ee7b7; }
.activity-result.blocked, .activity-result.warn { color: #fbbf24; }
.activity-empty { padding: 22px; color: #858d99; text-align: center; }
.activity-error { color: #fca5a5; }
@media (max-width: 900px) {
  .activity-grid { grid-template-columns: 65px minmax(95px,1fr) 90px minmax(120px,1fr) 90px 70px 36px; gap: 5px; font-size: 10px; }
}
