:root {
  --bg: #0a0a0a;
  --bg-soft: #0e0e0e;
  --sidebar: #0d0d0d;
  --panel: #111111;
  --panel-raised: #151515;
  --panel-hover: #1a1a1a;
  --line: rgba(255, 255, 255, .10);
  --line-soft: rgba(255, 255, 255, .07);
  --text: #f5f5f5;
  --text-soft: #c4c4c4;
  --muted: #888888;
  --muted-dark: #5f5f5f;
  --accent: #22c55e;
  --accent-strong: #22c55e;
  --accent-ink: #031008;
  --green: #22c55e;
  --amber: #f7bf62;
  --red: #ff737a;
  --blue: #7ab8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius: 12px;
  --sidebar-width: 238px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Karla", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.dashboard-page {
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 60px 60px;
}
.dashboard-page::before {
  content: "";
  position: fixed;
  z-index: 0;
  top: -270px;
  left: 50%;
  width: 900px;
  height: 600px;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(34,197,94,.10), transparent 68%);
  transform: translateX(-35%);
}
.dashboard-page .app-shell { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
::selection { background: rgba(34, 197, 94, .25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262626; border: 3px solid transparent; background-clip: padding-box; border-radius: 99px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: rgba(13, 13, 13, .96);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 1px 7px 28px; }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  background: transparent;
  border-radius: 10px;
  filter: drop-shadow(0 0 16px rgba(34, 197, 94, .10));
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-mark.large { width: 42px; height: 42px; border-radius: 12px; }
.brand strong,
.login-brand > span,
.mobile-login-brand > strong {
  display: block;
  color: var(--accent);
  background: linear-gradient(135deg, #22c55e, #4ade80, #86efac, #22c55e);
  background-size: 180% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 14px;
  letter-spacing: -.01em;
}
.brand span { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 12px;
  color: #929ca8;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  transition: color .16s ease, background .16s ease;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text); background: #121212; }
.nav-item.active { color: var(--text); background: #171717; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.nav-item.active svg { color: var(--accent); }
.sidebar-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 3px 12px;
  padding: 12px;
  color: var(--muted);
  background: #101010;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.sidebar-card-icon { display: grid; width: 31px; height: 31px; place-items: center; color: var(--green); background: rgba(93,226,154,.09); border-radius: 9px; }
.sidebar-card-icon svg { width: 16px; height: 16px; }
.sidebar-card strong { display: block; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.sidebar-card span { display: block; margin-top: 1px; font-size: 10px; }
.logout-form { margin: 0; }
.logout-button { color: var(--muted); }
.mobile-backdrop { display: none; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 81px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 34px;
  background: rgba(10, 10, 10, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(18px) saturate(160%);
}
.topbar::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent 12%, rgba(34,197,94,.22), transparent 72%); }
.topbar-heading { display: flex; align-items: center; gap: 13px; }
.eyebrow { display: block; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 2px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search, .compact-search {
  display: flex;
  align-items: center;
  color: var(--muted);
  background: #101010;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.global-search { width: 236px; height: 39px; padding: 0 10px 0 12px; }
.global-search:focus-within, .compact-search:focus-within { border-color: #275536; box-shadow: 0 0 0 3px rgba(34,197,94,.06); }
.global-search svg, .compact-search svg { flex: 0 0 auto; width: 16px; height: 16px; }
.global-search input, .compact-search input {
  min-width: 0;
  width: 100%;
  padding: 0 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}
.global-search input::placeholder, .compact-search input::placeholder { color: var(--muted-dark); }
kbd { padding: 1px 6px 2px; color: var(--muted); background: #1a1a1a; border: 1px solid #292929; border-radius: 5px; font-family: inherit; font-size: 10px; }
.mobile-menu { display: none !important; }

.content-wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 31px 34px 60px; }
.section-heading, .panel-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2, .panel-header h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.section-heading p, .panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions, .panel-header-actions { display: flex; align-items: center; gap: 9px; }
.last-updated { color: var(--muted-dark); font-size: 11px; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.button svg { width: 16px; height: 16px; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { color: #020b05; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 20px rgba(34,197,94,.22), 0 7px 24px rgba(34,197,94,.10); }
.button-primary:hover:not(:disabled) { background: #4ade80; box-shadow: 0 0 28px rgba(34,197,94,.34), 0 8px 28px rgba(34,197,94,.14); }
.button-secondary { color: var(--text-soft); background: #151515; border-color: var(--line); }
.button-secondary:hover:not(:disabled) { color: var(--text); background: #1a1a1a; border-color: #303030; }
.button-warning { color: #241707; background: var(--amber); border-color: var(--amber); }
.button-danger { color: white; background: #e95760; border-color: #e95760; }
.button-danger-ghost { color: #ff8d93; background: rgba(255,115,122,.07); border-color: rgba(255,115,122,.24); }
.button-compact { min-height: 35px; padding: 0 12px; }
.full-width { width: 100%; }
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #141414;
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.icon-button:hover:not(:disabled) { color: var(--text); background: #1a1a1a; border-color: #303030; }
.icon-button:disabled { cursor: not-allowed; opacity: .35; }
.icon-button svg { width: 17px; height: 17px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 27px; }
.stat-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 41px 1fr;
  grid-template-rows: auto auto;
  gap: 0 12px;
  padding: 18px;
  color: inherit;
  text-align: left;
  background: linear-gradient(145deg, #121212, #101010);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.stat-card::before { content: ""; position: absolute; top: 0; right: 12%; left: 12%; height: 1px; background: linear-gradient(90deg, transparent, rgba(34,197,94,.22), transparent); }
.stat-card::after { content: ""; position: absolute; inset: auto -25px -55px auto; width: 100px; height: 100px; background: radial-gradient(circle, rgba(34,197,94,.06), transparent 68%); }
.stat-card:hover { transform: translateY(-2px); background: #141414; border-color: rgba(34,197,94,.20); }
.stat-icon { grid-row: 1 / 3; width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.neutral { color: var(--blue); background: rgba(122,184,255,.09); }
.stat-icon.positive { color: var(--green); background: rgba(93,226,154,.09); }
.stat-icon.warning { color: var(--amber); background: rgba(247,191,98,.09); }
.stat-icon.danger { color: var(--red); background: rgba(255,115,122,.09); }
.stat-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stat-copy span { color: var(--muted); font-size: 11px; font-weight: 550; }
.stat-copy strong { color: var(--text); font-size: 24px; font-weight: 690; letter-spacing: -.045em; }
.stat-trend { align-self: end; color: var(--muted-dark); font-size: 10px; }
.positive-text { color: #63c994; }
.warning-text { color: #cf9e54; }
.danger-text { color: #d2676c; }

.panel { position: relative; background: rgba(17,17,17,.88); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.12); overflow: hidden; backdrop-filter: blur(12px); }
.panel::before { content: ""; position: absolute; z-index: 2; top: 0; right: 0; left: 0; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(34,197,94,.28), transparent); }
.panel-header { padding: 21px 22px 18px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.filter-tabs { display: flex; align-items: center; gap: 3px; }
.filter-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.filter-tab span { min-width: 19px; padding: 1px 5px; color: var(--muted-dark); background: #191919; border-radius: 99px; font-size: 9px; text-align: center; }
.filter-tab:hover { color: var(--text-soft); }
.filter-tab.active { color: var(--text); background: #1b1b1b; }
.filter-tab.active span { color: var(--accent); background: rgba(34,197,94,.1); }
.toolbar-controls { display: flex; align-items: center; gap: 8px; }
.compact-search { width: 165px; height: 34px; padding: 0 8px 0 10px; border-radius: 8px; }
.compact-search input { font-size: 11px; }
.select-control {
  height: 35px;
  padding: 0 30px 0 10px;
  color: var(--text-soft);
  background: #121212;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 11px;
}
.select-control:focus { border-color: #3c4a3a; }
.table-scroll { min-height: 420px; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.users-table th { height: 43px; padding: 0 13px; color: var(--muted-dark); border-bottom: 1px solid var(--line-soft); font-size: 9px; font-weight: 700; letter-spacing: .085em; text-align: left; text-transform: uppercase; }
.users-table td { height: 65px; padding: 8px 13px; border-bottom: 1px solid var(--line-soft); color: var(--text-soft); font-size: 11px; vertical-align: middle; }
.users-table tbody tr { transition: background .13s ease; }
.users-table tbody tr.user-row:hover { background: rgba(255,255,255,.018); }
.users-table tbody tr.selected-row { background: rgba(34,197,94,.025); }
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 45px; text-align: center; }
.users-table th:nth-child(2) { width: 29%; }
.users-table th:nth-child(3) { width: 14%; }
.users-table th:nth-child(4) { width: 20%; }
.users-table th:nth-child(5) { width: 20%; }
.users-table th:nth-child(6) { width: 100px; }
.checkbox { width: 14px; height: 14px; margin: 0; accent-color: var(--accent-strong); }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar, .large-avatar { display: grid; flex: 0 0 auto; place-items: center; color: #86efac; background: #102016; border: 1px solid #1f4d2f; font-weight: 700; text-transform: uppercase; }
.avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; }
.large-avatar { width: 53px; height: 53px; border-radius: 15px; font-size: 17px; }
.user-primary { min-width: 0; }
.user-primary strong { display: block; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.user-primary span { display: block; overflow: hidden; margin-top: 2px; color: var(--muted-dark); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.status-pill::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 99px; box-shadow: 0 0 7px currentColor; }
.status-pill.active { color: var(--green); background: rgba(93,226,154,.08); }
.status-pill.expiring { color: var(--amber); background: rgba(247,191,98,.08); }
.status-pill.expired { color: var(--red); background: rgba(255,115,122,.08); }
.date-cell strong, .granted-cell strong { display: block; color: var(--text-soft); font-size: 11px; font-weight: 580; }
.date-cell span, .granted-cell span { display: block; margin-top: 2px; color: var(--muted-dark); font-size: 9px; }
.manage-button { min-height: 30px; padding: 0 10px; color: var(--text-soft); background: #171717; border: 1px solid #252525; border-radius: 8px; font-size: 10px; font-weight: 600; }
.manage-button:hover { color: var(--text); background: #1d1d1d; border-color: #313131; }
.empty-table { height: 355px !important; text-align: center; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); }
.empty-state svg { width: 27px; height: 27px; margin-bottom: 7px; color: var(--muted-dark); }
.empty-state strong { color: var(--text-soft); font-size: 12px; }
.empty-state span { font-size: 10px; }
.loading-row td { height: 355px; text-align: center; }
.table-loader { display: flex; justify-content: center; gap: 5px; }
.table-loader span { width: 6px; height: 6px; background: var(--accent); border-radius: 99px; animation: loader-bounce .8s infinite alternate; }
.table-loader span:nth-child(2) { animation-delay: .15s; }
.table-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes loader-bounce { to { opacity: .25; transform: translateY(-6px); } }
.table-footer { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 0 18px; color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination .icon-button { width: 30px; height: 30px; }

.bulk-bar {
  position: fixed;
  z-index: 55;
  left: calc(var(--sidebar-width) + 50%);
  bottom: 23px;
  width: min(600px, calc(100vw - var(--sidebar-width) - 40px));
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px 10px 17px;
  background: #1a1a1a;
  border: 1px solid #333333;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .18s ease, transform .18s ease;
}
.bulk-bar.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.bulk-bar > div { display: flex; align-items: center; gap: 10px; }
.bulk-bar strong { font-size: 11px; }
.bulk-bar > div > button:not(.button) { padding: 0; color: var(--muted); background: none; border: 0; font-size: 10px; }
.bulk-actions { display: flex; align-items: center; gap: 8px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.drawer-backdrop.visible { opacity: 1; pointer-events: auto; }
.user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(440px, 100vw);
  background: #0e0e0e;
  border-left: 1px solid var(--line);
  box-shadow: -25px 0 70px rgba(0,0,0,.35);
  transform: translateX(102%);
  transition: transform .24s cubic-bezier(.22,.8,.25,1);
}
.user-drawer.open { transform: translateX(0); }
.drawer-header { height: 67px; display: flex; align-items: center; justify-content: space-between; padding: 0 21px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.drawer-content { height: calc(100vh - 67px); padding: 22px; overflow-y: auto; }
.user-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; }
.user-hero h2 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.025em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 14px; padding: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.detail-grid > div { min-width: 0; padding: 13px; background: #121212; }
.detail-grid span, .detail-note span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.detail-grid strong { display: block; overflow: hidden; color: var(--text-soft); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.detail-note { margin-bottom: 20px; padding: 13px; background: #121212; border: 1px solid var(--line-soft); border-radius: 11px; }
.detail-note p { margin: 0; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.drawer-section { padding: 19px 0; border-top: 1px solid var(--line-soft); }
.drawer-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.drawer-section-heading h3, .danger-zone h3 { margin: 0; font-size: 12px; font-weight: 650; }
.drawer-section-heading span { color: var(--muted-dark); font-size: 9px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.quick-duration, .duration-option { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-soft); background: #141414; border: 1px solid var(--line); border-radius: 10px; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.quick-duration { min-height: 56px; }
.quick-duration:hover, .duration-option:hover, .duration-option.active { color: var(--accent); background: rgba(34,197,94,.055); border-color: #1f5c34; transform: translateY(-1px); }
.quick-duration strong, .duration-option strong { font-size: 13px; }
.quick-duration span, .duration-option span { margin-top: 1px; color: var(--muted); font-size: 9px; }
.stack-form { display: grid; gap: 10px; }
.danger-zone { margin: 8px 0 2px; padding: 17px; background: rgba(255,115,122,.035); border: 1px solid rgba(255,115,122,.14); border-radius: 12px; }
.danger-zone p { margin: 4px 0 13px; color: var(--muted); font-size: 10px; }
.danger-actions { display: flex; gap: 8px; }
.danger-actions .button { flex: 1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(2,4,7,.72); backdrop-filter: blur(7px); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-card { width: min(510px, 100%); max-height: calc(100vh - 40px); padding: 24px; background: #111111; border: 1px solid #292929; border-radius: 18px; box-shadow: var(--shadow); overflow-y: auto; transform: translateY(12px) scale(.985); transition: transform .2s ease; }
.modal-backdrop.open .modal-card { transform: translateY(0) scale(1); }
.compact-modal { width: min(470px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-kicker { display: block; margin-bottom: 5px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.modal-header h2, .confirm-card h2 { margin: 0; font-size: 19px; font-weight: 670; letter-spacing: -.03em; }
.modal-header p, .confirm-card > p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-form { display: grid; gap: 15px; }
.field { display: block; }
.field > span { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-soft); font-size: 10px; font-weight: 600; }
.field > span em { color: var(--muted-dark); font-size: 9px; font-style: normal; font-weight: 500; }
.field input, .field textarea, .currency-input input {
  width: 100%;
  color: var(--text);
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input { height: 40px; padding: 0 11px; }
.field textarea { padding: 10px 11px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #555555; }
.field input:focus, .field textarea:focus, .currency-input input:focus { border-color: #27673c; box-shadow: 0 0 0 3px rgba(34,197,94,.055); }
.duration-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.duration-option { min-height: 62px; }
.input-suffix, .currency-input { position: relative; }
.input-suffix > span { position: absolute; top: 50%; right: 11px; color: var(--muted); font-size: 10px; transform: translateY(-50%); }
.input-suffix input { padding-right: 45px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.price-field { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.price-field > span strong, .price-field > span small { display: block; }
.price-field > span strong { font-size: 11px; }
.price-field > span small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.currency-input { width: 120px; }
.currency-input > span { position: absolute; top: 50%; left: 10px; color: var(--muted); transform: translateY(-50%); }
.currency-input input { height: 38px; padding: 0 10px 0 25px; }
.confirm-card { width: min(430px, 100%); padding: 28px; text-align: center; }
.confirm-card > p { max-width: 340px; margin: 7px auto 20px; line-height: 1.65; }
.confirm-icon { width: 45px; height: 45px; display: grid; margin: 0 auto 14px; place-items: center; color: var(--amber); background: rgba(247,191,98,.09); border-radius: 13px; }
.confirm-icon.danger { color: var(--red); background: rgba(255,115,122,.09); }
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-card .modal-actions { justify-content: center; }
.delete-confirm-field { margin: 0 auto 4px; max-width: 330px; text-align: left; }
.delete-confirm-field strong { color: var(--red); }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 20px; width: min(340px, calc(100vw - 40px)); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; background: #171717; border: 1px solid #2d2d2d; border-radius: 12px; box-shadow: var(--shadow); animation: toast-in .23s ease both; }
.toast.leaving { animation: toast-out .2s ease both; }
.toast-icon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; color: var(--green); background: rgba(93,226,154,.09); border-radius: 8px; }
.toast.error .toast-icon { color: var(--red); background: rgba(255,115,122,.09); }
.toast-icon svg { width: 13px; height: 13px; }
.toast strong { display: block; font-size: 11px; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(15px); } }
.screen-loader { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: rgba(5,7,10,.42); opacity: 0; pointer-events: none; backdrop-filter: blur(2px); transition: opacity .15s ease; }
.screen-loader.visible { opacity: 1; pointer-events: auto; }
.screen-loader span { width: 28px; height: 28px; border: 2px solid #303030; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-page { min-height: 100vh; background: #0a0a0a; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 42px clamp(40px, 6vw, 90px); background: radial-gradient(circle at 18% 85%, rgba(34,197,94,.13), transparent 34%), #0a0a0a; border-right: 1px solid var(--line-soft); overflow: hidden; }
.login-brand-panel::before { content: ""; position: absolute; top: -30%; right: -40%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(34,197,94,.07), transparent 64%); }
.login-brand-panel::after { content: ""; position: absolute; inset: 0; opacity: .24; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 60px 60px; mask-image: linear-gradient(to bottom, transparent, black 20%, black 78%, transparent); pointer-events: none; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 680; }
.login-brand > span { font-size: 18px; }
.mobile-login-brand > strong { font-size: 17px; }
.login-pitch { position: relative; z-index: 1; max-width: 590px; margin: auto 0 46px; }
.login-pitch h1 { max-width: 540px; margin: 11px 0 18px; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(40px, 5.2vw, 66px); font-weight: 650; line-height: 1.02; letter-spacing: -.055em; }
.login-pitch p { max-width: 480px; margin: 0; color: #8d8d8d; font-size: 14px; line-height: 1.75; }
.login-feature-row { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; max-width: 590px; }
.login-feature-row > div { position: relative; padding: 15px 15px 15px 39px; background: rgba(17,17,17,.72); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; backdrop-filter: blur(12px); }
.feature-dot { position: absolute; top: 18px; left: 15px; width: 9px; height: 9px; background: var(--accent); border: 3px solid rgba(34,197,94,.18); border-radius: 50%; box-sizing: content-box; }
.login-feature-row strong, .login-feature-row small { display: block; }
.login-feature-row strong { font-size: 11px; }
.login-feature-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.login-version { position: absolute; z-index: 1; bottom: 17px; left: clamp(40px, 6vw, 90px); color: #505050; font-size: 9px; }
.login-form-panel { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 40px; background: radial-gradient(circle at 50% 42%, rgba(34,197,94,.055), transparent 34%); }
.login-form { width: min(370px, 100%); }
.login-form h2 { margin: 7px 0 7px; font-size: 27px; font-weight: 660; letter-spacing: -.04em; }
.login-subtitle { margin: 0 0 27px; color: var(--muted); font-size: 12px; }
.login-field { margin-bottom: 14px; }
.field-with-icon { position: relative; }
.field-with-icon svg { position: absolute; top: 50%; left: 12px; z-index: 1; width: 16px; height: 16px; color: var(--muted-dark); transform: translateY(-50%); }
.field-with-icon input { height: 46px; padding-left: 39px; }
.login-submit { width: 100%; min-height: 45px; margin-top: 7px; }
.login-submit svg { margin-left: auto; }
.login-help { margin: 15px 0 0; color: #555555; font-size: 9px; text-align: center; }
.login-error { margin: -9px 0 17px; padding: 10px 12px; color: #ff9ea3; background: rgba(255,115,122,.075); border: 1px solid rgba(255,115,122,.2); border-radius: 9px; font-size: 10px; }
.mobile-login-brand { display: none; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 190px; }
  .users-table th:nth-child(5), .users-table td:nth-child(5) { display: none; }
  .users-table th:nth-child(2) { width: 34%; }
  .users-table th:nth-child(3) { width: 17%; }
  .users-table th:nth-child(4) { width: 27%; }
}

@media (max-width: 860px) {
  :root { --sidebar-width: 0px; }
  .sidebar { width: 238px; transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(0,0,0,.5); border: 0; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .mobile-backdrop.visible { opacity: 1; pointer-events: auto; }
  .main-content { margin-left: 0; }
  .mobile-menu { display: inline-grid !important; }
  .topbar { padding: 0 20px; }
  .content-wrap { padding: 25px 20px 50px; }
  .bulk-bar { left: 50%; width: min(600px, calc(100vw - 30px)); }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 28px; }
  .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 55px; }
}

@media (max-width: 680px) {
  .topbar { height: auto; min-height: 72px; }
  .topbar-heading .eyebrow { display: none; }
  .topbar h1 { font-size: 16px; }
  .global-search { display: none; }
  .topbar-actions .button span { display: none; }
  .content-wrap { padding: 21px 14px 45px; }
  .overview-heading { align-items: flex-start; }
  .last-updated { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { grid-template-columns: 34px 1fr; padding: 13px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-copy { display: block; }
  .stat-copy span { display: block; }
  .stat-copy strong { display: block; margin-top: 1px; font-size: 20px; }
  .stat-trend { display: none; }
  .panel-header { align-items: flex-start; padding: 17px; }
  .desktop-new { display: none; }
  .table-toolbar { align-items: stretch; flex-direction: column; padding: 10px; }
  .filter-tabs { width: 100%; overflow-x: auto; }
  .filter-tab { flex: 1 0 auto; justify-content: center; }
  .toolbar-controls { width: 100%; }
  .compact-search { flex: 1; width: auto; }
  .select-control { max-width: 145px; }
  .table-scroll { min-height: 380px; }
  .users-table { min-width: 620px; }
  .users-table th:nth-child(5), .users-table td:nth-child(5) { display: table-cell; }
  .table-footer { padding: 0 12px; }
  .bulk-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .bulk-bar > div { justify-content: space-between; }
  .bulk-actions .select-control { max-width: none; flex: 1; }
  .user-drawer { width: 100%; }
  .drawer-content { padding: 18px; }
  .modal-card { padding: 19px; border-radius: 15px; }
  .duration-options { grid-template-columns: repeat(2, 1fr); }
  .danger-actions { flex-direction: column; }
  .login-form-panel { align-items: start; padding-top: 35px; }
}
