:root {
  color-scheme: light;
  --background: #f4f5fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #171724;
  --muted: #6f7587;
  --line: #e3e5ed;
  --nav: #090913;
  --nav-soft: #151522;
  --primary: #120bff;
  --primary-soft: #edecff;
  --red: #e5293f;
  --red-soft: #fff0f2;
  --green: #168865;
  --green-soft: #e6f7f1;
  --orange: #b66a0b;
  --orange-soft: #fff3df;
  --blue: #2868bf;
  --blue-soft: #e9f2ff;
  --shadow: 0 18px 45px rgba(21, 25, 44, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--background); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--background); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
input, select, textarea { outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(18, 11, 255, .1); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
.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; }

.button { min-height: 40px; border: 1px solid transparent; border-radius: 11px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; transition: transform .16s, background .16s, border-color .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { background: linear-gradient(135deg, #120bff, #3731ff 75%, #d91e42 145%); color: #fff; box-shadow: 0 8px 22px rgba(18, 11, 255, .2); }
.button-secondary, .button-quiet { background: var(--surface); border-color: var(--line); }
.button-quiet { min-height: 36px; padding: 7px 11px; }
.button-danger { background: var(--red); color: #fff; }
.button-block { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--primary); font-weight: 750; padding: 7px 0; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background:
  radial-gradient(circle at 16% 12%, rgba(18, 11, 255, .22), transparent 28%),
  radial-gradient(circle at 92% 85%, rgba(229, 41, 63, .15), transparent 30%),
  #090913; }
.auth-card { width: min(440px, 100%); padding: 34px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; background: rgba(255, 255, 255, .98); box-shadow: 0 35px 100px rgba(0, 0, 0, .38); }
.auth-brand { display: grid; gap: 4px; margin-bottom: 26px; }
.auth-brand img { width: 178px; height: 51px; object-fit: contain; object-position: left center; }
.auth-brand span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.security-chip { width: max-content; max-width: 100%; margin-bottom: 18px; border-radius: 999px; padding: 7px 10px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.auth-card h1 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.04em; }
.auth-card > p { margin-bottom: 22px; color: var(--muted); }
.auth-form { display: grid; gap: 15px; }
.auth-form label, .form-grid label, .reason-field, .confirmation-field { display: grid; gap: 6px; color: #4f5668; font-size: 12px; font-weight: 750; }
.auth-form input, .form-grid input, .form-grid select, .form-grid textarea, .reason-field textarea, .confirmation-field input, .toolbar input, .toolbar select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); padding: 11px 12px; }
.password-field { display: grid; grid-template-columns: 1fr 44px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.password-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18, 11, 255, .1); }
.password-field input { border: 0; border-radius: 0; box-shadow: none !important; }
.icon-button { border: 0; border-left: 1px solid var(--line); background: var(--surface-soft); }
.form-message { margin: 0; border-radius: 9px; padding: 10px 12px; color: #a52a3a; background: var(--red-soft); font-size: 12px; }
.auth-note { display: block; margin-top: 18px; color: var(--muted); text-align: center; }
.mfa-enrollment { padding: 14px; display: grid; gap: 10px; border: 1px solid #d8d5ff; border-radius: 12px; background: var(--primary-soft); }
.mfa-enrollment > strong { color: var(--primary); }
.mfa-enrollment > p { margin: 0; color: #555c70; font-size: 12px; }
.mfa-enrollment > img { width: 180px; height: 180px; margin: 2px auto; border-radius: 10px; background: #fff; }
.secret-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.secret-copy code { overflow-wrap: anywhere; border-radius: 8px; padding: 9px; color: var(--ink); background: #fff; font-size: 12px; letter-spacing: .06em; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 248px; padding: 24px 17px; display: flex; flex-direction: column; color: #fff; background: var(--nav); }
.sidebar-brand { padding: 0 9px 21px; display: grid; gap: 4px; }
.sidebar-brand img { width: 170px; height: 50px; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
.sidebar-brand span { color: #7f8599; font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-context { margin: 0 3px 22px; padding: 12px; display: grid; grid-template-columns: 9px 1fr; column-gap: 9px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: var(--nav-soft); }
.sidebar-context > span { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #31d59b; box-shadow: 0 0 0 4px rgba(49, 213, 155, .1); }
.sidebar-context strong, .sidebar-context small { grid-column: 2; }
.sidebar-context small { color: #7f8599; }
.navigation { display: grid; gap: 5px; }
.navigation button { width: 100%; min-height: 44px; border: 0; border-radius: 11px; padding: 10px 11px; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 9px; color: #8e94a8; background: transparent; text-align: left; font-weight: 700; }
.navigation button > span { font-size: 17px; text-align: center; }
.navigation button:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.navigation button.active { color: #fff; background: linear-gradient(90deg, rgba(18, 11, 255, .42), rgba(229, 41, 63, .1)); box-shadow: inset 3px 0 0 var(--red); }
.navigation button b { min-width: 23px; border-radius: 999px; padding: 3px 6px; color: #fff; background: var(--red); font-size: 10px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 17px 8px 0; display: grid; grid-template-columns: 39px minmax(0, 1fr); gap: 10px; align-items: center; border-top: 1px solid rgba(255, 255, 255, .09); }
.admin-avatar { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--primary), #5d58ff); font-weight: 850; }
.sidebar-footer > span:last-child { min-width: 0; display: grid; }
.sidebar-footer small { overflow: hidden; color: #777f94; text-overflow: ellipsis; }
.main-shell { grid-column: 2; min-width: 0; }
.topbar { min-height: 70px; padding: 0 28px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.page-identity { display: grid; }
.page-identity small { color: #989eae; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-identity strong { font-size: 15px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.live-state { display: flex; align-items: center; gap: 7px; margin-right: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.live-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.content { width: min(1540px, 100%); margin: 0 auto; padding: 30px 30px 64px; }
.view { display: none; }
.view.active { display: block; }
.page-heading { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 2px 0 4px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.045em; }
.page-heading p { margin-bottom: 0; color: var(--muted); }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.last-update { color: var(--muted); font-size: 11px; }

.stats-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 116px; padding: 17px; display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.stat-card.green .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-card.orange .stat-icon { color: var(--orange); background: var(--orange-soft); }
.stat-card.red .stat-icon { color: var(--red); background: var(--red-soft); }
.stat-copy { min-width: 0; display: grid; }
.stat-copy small { color: var(--muted); }
.stat-copy strong { font-size: 25px; letter-spacing: -.04em; }
.stat-copy span { color: var(--muted); font-size: 10px; }
.dashboard-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { min-height: 74px; padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin-bottom: 2px; font-size: 17px; }
.panel-header p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.compact-list, .activity-list { padding: 7px 18px 14px; }
.compact-row, .activity-row { min-height: 60px; padding: 11px 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.row-button { width: 100%; color: inherit; background: transparent; border: 0; text-align: left; }
.row-button:hover { background: var(--surface-soft); }
.compact-row:last-child, .activity-row:last-child { border-bottom: 0; }
.row-mark { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-weight: 850; }
.row-copy { min-width: 0; display: grid; }
.row-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-copy small { color: var(--muted); }
.compact-row time, .activity-row time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.activity-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.activity-row .row-mark { width: 35px; height: 35px; background: var(--surface-soft); }
.empty-state { padding: 34px 18px; color: var(--muted); text-align: center; }

.approval-list { display: grid; gap: 14px; }
.approval-card { padding: 19px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.approval-main { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 13px; align-items: center; }
.venue-logo { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; overflow: hidden; color: var(--primary); background: var(--primary-soft); font-weight: 850; }
.venue-logo img { width: 100%; height: 100%; object-fit: cover; }
.approval-main span { min-width: 0; display: grid; }
.approval-main strong { font-size: 16px; }
.approval-main small, .approval-meta small { color: var(--muted); }
.approval-meta { display: grid; gap: 3px; }
.approval-actions, .row-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.mini-button { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fff; font-size: 11px; font-weight: 750; }
.mini-button.approve { border-color: #bce8d8; color: var(--green); background: var(--green-soft); }
.mini-button.danger { border-color: #f0c6cc; color: var(--red); background: var(--red-soft); }

.toolbar { min-height: 72px; padding: 14px 17px; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); }
.toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.toolbar .search-field { width: min(430px, 100%); }
.toolbar .record-count { margin-left: auto; padding-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: #fafbfc; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfe; }
.entity-cell { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: center; }
.entity-avatar { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 850; }
.entity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.entity-cell > span { min-width: 0; display: grid; }
.entity-cell small, .muted-cell { color: var(--muted); font-size: 11px; }
.entity-cell strong, .entity-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; border-radius: 999px; padding: 5px 8px; color: #62697a; background: #eef0f5; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.status-badge:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.approved, .status-badge.active { color: var(--green); background: var(--green-soft); }
.status-badge.pending { color: var(--orange); background: var(--orange-soft); }
.status-badge.rejected, .status-badge.suspended, .status-badge.archived { color: var(--red); background: var(--red-soft); }
.role-badge { display: inline-block; border-radius: 999px; padding: 5px 8px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 850; text-transform: uppercase; }

.system-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.system-card { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.system-card header { margin-bottom: 20px; display: flex; justify-content: space-between; gap: 10px; }
.system-card h2 { margin-bottom: 3px; font-size: 15px; }
.system-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.system-value { font-size: 25px; font-weight: 850; letter-spacing: -.04em; }
.system-value.ok { color: var(--green); }
.security-panel { padding: 20px; display: flex; align-items: center; gap: 15px; }
.security-illustration { width: 50px; height: 50px; flex: 0 0 auto; border-radius: 15px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.security-panel h2 { margin-bottom: 3px; font-size: 17px; }
.security-panel p { margin-bottom: 0; color: var(--muted); }

dialog { max-width: none; border: 0; padding: 0; color: var(--ink); background: transparent; }
dialog::backdrop { background: rgba(6, 7, 15, .68); backdrop-filter: blur(5px); }
.detail-dialog { width: min(940px, calc(100% - 28px)); }
.dialog-shell { max-height: calc(100vh - 32px); overflow: hidden; display: flex; flex-direction: column; border-radius: 21px; background: var(--surface); box-shadow: 0 35px 100px rgba(0, 0, 0, .3); }
.dialog-shell-small { width: min(680px, calc(100vw - 28px)); }
.dialog-header { padding: 20px 22px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 2px 0; font-size: 23px; }
.dialog-header p { margin-bottom: 0; color: var(--muted); }
.dialog-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 22px; }
.detail-loading { padding: 60px 20px; color: var(--muted); text-align: center; }
.dialog-content { overflow-y: auto; padding: 20px 22px; }
.detail-summary { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-cell { padding: 12px; display: grid; border-radius: 11px; background: var(--surface-soft); }
.summary-cell small { color: var(--muted); }
.summary-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { margin-bottom: 17px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; padding: 10px 13px; color: var(--muted); background: transparent; font-weight: 750; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-pane { display: none; }
.detail-pane.active { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid textarea, .reason-field textarea { resize: vertical; }
.input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.input-suffix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18, 11, 255, .1); }
.input-suffix input { border: 0; border-radius: 0; box-shadow: none !important; }
.input-suffix span { padding: 0 10px; color: var(--muted); font-size: 11px; }
.reason-field { margin-top: 14px; padding: 13px; border-radius: 12px; background: var(--primary-soft); }
.reason-field textarea { background: #fff; }
.operations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.operations-grid > section { min-width: 0; border: 1px solid var(--line); border-radius: 13px; }
.operations-grid h3 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dialog-footer { padding: 15px 22px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); background: #fbfbfd; }
.action-dialog { width: min(530px, calc(100% - 28px)); }
.action-form { overflow: hidden; border-radius: 19px; background: #fff; box-shadow: 0 35px 100px rgba(0, 0, 0, .3); }
.action-form > header { padding: 21px; display: grid; grid-template-columns: 46px 1fr; gap: 13px; border-bottom: 1px solid var(--line); }
.action-form h2 { margin-bottom: 3px; font-size: 19px; }
.action-form header p { margin-bottom: 0; color: var(--muted); }
.action-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); font-size: 20px; font-weight: 850; }
.action-form > label, .action-form > .form-message { margin: 16px 21px 0; }
.confirmation-field strong { color: var(--red); }
.action-form > footer { padding: 16px 21px 20px; display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border-radius: 11px; color: #fff; background: #111522; box-shadow: 0 15px 50px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #a61f32; }
.mobile-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(6, 7, 15, .5); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .system-grid { grid-template-columns: repeat(2, 1fr); }
  .approval-card { grid-template-columns: minmax(0, 1fr) auto; }
  .approval-meta { grid-column: 1; }
  .approval-actions { grid-column: 2; grid-row: 1 / 3; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main-shell { grid-column: 1; }
  .menu-button { display: block; margin-right: 8px; }
  .content { padding: 24px 16px 52px; }
  .topbar { padding: 0 15px; }
  .live-state { display: none; }
  .dashboard-grid, .operations-grid { grid-template-columns: 1fr; }
  .detail-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .auth-card { padding: 27px 22px; }
  .topbar-actions .button:first-of-type { display: none; }
  .page-heading { display: block; }
  .last-update { display: block; margin-top: 8px; }
  .stats-grid, .system-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .search-field { width: 100%; }
  .toolbar .record-count { margin-left: 0; padding: 2px; }
  .approval-card { grid-template-columns: 1fr; }
  .approval-meta, .approval-actions { grid-column: 1; grid-row: auto; }
  .approval-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
  .dialog-content, .dialog-header, .dialog-footer { padding-left: 16px; padding-right: 16px; }
  .compact-row, .activity-row { grid-template-columns: 38px minmax(0, 1fr); }
  .compact-row time, .activity-row time { grid-column: 2; }
  .toast { right: 16px; bottom: 16px; }
}
