:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f7f8fc;
  --navy: #0b1220;
  --navy-soft: #131d31;
  --primary: #5546d9;
  --primary-dark: #4536c5;
  --primary-soft: #eeedff;
  --success: #12b76a;
  --success-soft: #ecfdf3;
  --warning: #f79009;
  --warning-soft: #fffaeb;
  --danger: #f04438;
  --danger-soft: #fef3f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, .button { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { display: flex; flex: 0 0 252px; flex-direction: column; min-height: 100vh; padding: 28px 18px 20px; color: #d0d5dd; background: var(--navy); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-sidebar { padding: 0 12px 38px; }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 31px; height: 31px; padding: 7px 6px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #7b6ff2, #35c7d7); box-shadow: 0 7px 18px #5546d955; }
.brand-mark span { display: block; width: 4px; border-radius: 8px; background: currentColor; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: .85; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.brand-copy strong { color: #fff; font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { color: #98a2b3; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-section-label { padding: 0 12px 10px; color: #667085; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: #98a2b3; font-size: 13px; font-weight: 600; transition: .2s ease; }
.nav-link svg { width: 18px; height: 18px; color: #667085; }
.nav-link:hover { color: #fff; background: #ffffff0d; }
.nav-link.is-active { color: #fff; background: linear-gradient(90deg, #5546d933, #5546d911); border-color: #7b6ff233; box-shadow: inset 3px 0 0 #7b6ff2; }
.nav-link.is-active svg { color: #9b92ff; }
.nav-link-danger:hover { color: #fda29b; }
.sidebar-spacer { flex: 1; min-height: 36px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding: 14px 10px 0; border-top: 1px solid #ffffff12; }
.sidebar-user { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.sidebar-user strong { overflow: hidden; color: #eaecf0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { color: #667085; font-size: 10px; }
.avatar { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 36px; height: 36px; border: 2px solid #fff; border-radius: 50%; color: #4338ca; background: #e0e7ff; font-size: 13px; font-weight: 800; }
.avatar-small { width: 32px; height: 32px; border: 0; color: #c7d2fe; background: #312e81; font-size: 11px; }
.avatar-table { width: 36px; height: 36px; border: 0; color: #5546d9; background: var(--primary-soft); }

.app-main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.topbar { display: flex; min-height: 80px; align-items: center; justify-content: space-between; padding: 0 48px; border-bottom: 1px solid var(--line); background: #ffffffcc; backdrop-filter: blur(12px); }
.topbar-context { display: flex; flex-direction: column; gap: 3px; }
.topbar-kicker { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.topbar-title { color: #344054; font-size: 13px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user-copy { display: flex; flex-direction: column; gap: 2px; }
.topbar-user-copy strong { color: #344054; font-size: 12px; }
.topbar-user-copy span { color: var(--subtle); font-size: 10px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: 6px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); transition: .2s ease; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { color: var(--danger); border-color: #fecdca; background: var(--danger-soft); }
.page-container { width: min(1440px, 100%); flex: 1; margin: 0 auto; padding: 42px 48px 36px; }
.app-footer { padding: 0 48px 24px; color: var(--subtle); font-size: 10px; }
.app-footer span { padding: 0 5px; color: #c7cdd6; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 6px 0 8px; color: var(--ink); font-size: clamp(25px, 3vw, 32px); font-weight: 750; letter-spacing: -.045em; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.eyebrow { display: inline-block; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; transition: .2s ease; }
.button svg { width: 16px; height: 16px; }
.button span { margin-left: 3px; font-size: 17px; line-height: 0; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px #5546d926; }
.button-primary:hover { background: var(--primary-dark); box-shadow: 0 9px 20px #5546d940; transform: translateY(-1px); }
.button-secondary { color: #475467; border-color: var(--line); background: var(--surface); }
.button-secondary:hover, .button-ghost:hover { color: var(--primary); border-color: #c9c5ff; background: var(--primary-soft); }
.button-ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button-wide { width: 100%; min-height: 50px; font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat-card { position: relative; overflow: hidden; min-height: 128px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px #10182806; }
.stat-card::after { position: absolute; right: -24px; bottom: -33px; width: 105px; height: 105px; border-radius: 50%; content: ""; opacity: .5; }
.stat-card-primary::after { background: #eeedff; }
.stat-card-success::after { background: #ecfdf3; }
.stat-card-warning::after { background: #fffaeb; }
.stat-card-danger::after { background: #fef3f2; }
.stat-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; border-radius: 9px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-card-primary .stat-icon { color: var(--primary); background: var(--primary-soft); }
.stat-card-success .stat-icon { color: var(--success); background: var(--success-soft); }
.stat-card-warning .stat-icon { color: var(--warning); background: var(--warning-soft); }
.stat-card-danger .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-card > strong { position: relative; z-index: 1; display: block; margin-top: 10px; color: var(--ink); font-size: 27px; letter-spacing: -.04em; }
.stat-card > small { position: relative; z-index: 1; display: block; margin-top: 3px; color: var(--subtle); font-size: 10px; }

.content-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px #10182806; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid #f0f2f5; }
.card-heading h2 { margin: 0 0 5px; color: #1d2939; font-size: 14px; letter-spacing: -.01em; }
.card-heading p { margin: 0; color: var(--subtle); font-size: 11px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 10px; font-weight: 600; }
.status-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-yellow { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot-red { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.soft-label { padding: 7px 10px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 24px; color: var(--subtle); background: #fcfcfd; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 24px; border-top: 1px solid #f0f2f5; color: #475467; font-size: 12px; white-space: nowrap; }
tbody tr { transition: background .2s ease; }
tbody tr:hover { background: #fafaff; }
tr.status-yellow { box-shadow: inset 3px 0 0 var(--warning); }
tr.status-red { box-shadow: inset 3px 0 0 var(--danger); }
.store-cell, .user-cell { display: flex; align-items: center; gap: 10px; min-width: 225px; }
.store-cell > div, .user-cell > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.store-cell strong, .user-cell strong { max-width: 260px; overflow: hidden; color: #344054; font-size: 12px; text-overflow: ellipsis; }
.store-cell small, .user-cell small { color: var(--subtle); font-size: 10px; }
.muted-cell { color: var(--muted); font-variant-numeric: tabular-nums; }
.branch-pill, .role-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 6px; color: #475467; background: #f2f4f7; font-size: 10px; font-weight: 700; }
.elapsed-time { color: #344054; font-size: 11px; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; }
.status-badge-green { color: #027a48; background: var(--success-soft); }
.status-badge-green i { background: var(--success); }
.status-badge-yellow { color: #b54708; background: var(--warning-soft); }
.status-badge-yellow i { background: var(--warning); }
.status-badge-red { color: #b42318; background: var(--danger-soft); }
.status-badge-red i { background: var(--danger); }
.role-badge { color: var(--muted); }
.role-admin { color: var(--primary); background: var(--primary-soft); }
.filter-toolbar { padding: 18px 24px; border-bottom: 1px solid #f0f2f5; background: #fcfcfd; }
.filter-alert { margin: 0 0 15px; }
.filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filter-field { display: grid; min-width: 250px; gap: 7px; color: #344054; font-size: 10px; font-weight: 800; }
.filter-field-branch { min-width: 145px; }
.filter-field input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid #d0d5dd; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; transition: .2s ease; }
.filter-field input::placeholder { color: #b0b8c5; }
.filter-field input:focus { border-color: #9b92ff; box-shadow: 0 0 0 4px #5546d914; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.filter-actions .button { min-height: 40px; }
.table-sort { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.table-sort span { color: #c0c6d0; font-size: 13px; line-height: 1; }
.table-sort:hover, .table-sort.is-active { color: var(--primary); }
.table-sort.is-active span { color: var(--primary); }
.empty-state { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 5px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 23px; }
.empty-state strong { color: #344054; font-size: 13px; }
.empty-state p { margin: 0; color: var(--subtle); font-size: 11px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 650px) 260px; align-items: start; gap: 18px; }
.form-card { padding-bottom: 24px; }
.form-stack { display: grid; gap: 18px; padding: 24px; }
.field { display: grid; gap: 7px; color: #344054; font-size: 11px; font-weight: 700; }
.field input, .input-wrap input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #d0d5dd; border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; transition: .2s ease; }
.field input::placeholder, .input-wrap input::placeholder { color: #b0b8c5; }
.field input:focus, .input-wrap:focus-within { border-color: #9b92ff; box-shadow: 0 0 0 4px #5546d914; }
.input-wrap { display: flex; align-items: center; border: 1px solid #d0d5dd; border-radius: 9px; transition: .2s ease; }
.input-wrap svg { flex: 0 0 auto; width: 17px; height: 17px; margin-left: 13px; color: #98a2b3; }
.input-wrap input { min-height: 45px; padding-left: 10px; border: 0; box-shadow: none; }
.checkbox-modern { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #eaecf0; border-radius: 9px; color: #344054; background: #fcfcfd; }
.checkbox-modern input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--primary); }
.checkbox-modern > span { display: grid; gap: 4px; }
.checkbox-modern strong { font-size: 12px; }
.checkbox-modern small { color: var(--subtle); font-size: 10px; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }
.form-aside { padding: 24px; border: 1px solid #dcd9ff; border-radius: 14px; color: #475467; background: linear-gradient(150deg, #f5f4ff, #fff); }
.aside-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 12px; color: var(--primary); background: #e4e2ff; }
.aside-icon svg { width: 20px; height: 20px; }
.form-aside h3 { margin: 0 0 8px; color: #344054; font-size: 14px; }
.form-aside p, .form-aside li { color: var(--muted); font-size: 11px; line-height: 1.7; }
.form-aside p { margin: 0; }
.form-aside ul { margin: 0; padding-left: 16px; }
.alert { display: flex; align-items: flex-start; gap: 9px; margin: 20px 24px 0; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; line-height: 1.5; }
.alert-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; font-size: 10px; font-weight: 800; }
.alert-error { color: #b42318; border-color: #fecdca; background: var(--danger-soft); }
.alert-error .alert-icon { color: #fff; background: var(--danger); }
.alert-warning { color: #b54708; border-color: #fedf89; background: var(--warning-soft); }
.alert-warning .alert-icon { color: #fff; background: var(--warning); }

.public-main { min-height: 100vh; }
.auth-page { background: #f7f8fc; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, 1.04fr) minmax(440px, .96fr); }
.auth-showcase { position: relative; display: flex; overflow: hidden; flex-direction: column; min-height: 100vh; padding: 42px 8%; color: #fff; background: radial-gradient(circle at 72% 14%, #5546d9 0, transparent 34%), linear-gradient(145deg, #111a2e, #0b1220 72%); isolation: isolate; }
.auth-showcase::before { position: absolute; z-index: -1; right: -12%; bottom: -20%; width: 80%; height: 70%; border: 1px solid #ffffff12; border-radius: 50%; content: ""; transform: rotate(-24deg); box-shadow: 0 0 0 35px #ffffff06, 0 0 0 70px #ffffff03; }
.brand-light .brand-copy small { color: #98a2b3; }
.showcase-content { position: relative; z-index: 1; max-width: 510px; margin: auto 0; padding: 35px 0 50px; }
.eyebrow-light { color: #a7a1ff; }
.showcase-content h1 { margin: 16px 0 20px; color: #f9fafb; font-size: clamp(38px, 5vw, 66px); font-weight: 750; letter-spacing: -.065em; line-height: 1.04; }
.showcase-content h1 span { color: #86e4e4; }
.showcase-content > p { max-width: 410px; margin: 0; color: #98a2b3; font-size: 15px; line-height: 1.7; }
.showcase-insight { display: flex; align-items: center; gap: 12px; max-width: 360px; margin-top: 44px; padding: 13px; border: 1px solid #ffffff16; border-radius: 12px; background: #ffffff0a; backdrop-filter: blur(10px); }
.insight-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: #86e4e4; background: #86e4e41a; }
.insight-icon svg { width: 18px; height: 18px; }
.showcase-insight div { display: grid; gap: 3px; }
.showcase-insight strong { color: #eaecf0; font-size: 11px; }
.showcase-insight div span { color: #667085; font-size: 10px; }
.showcase-orb { position: absolute; z-index: -1; border: 1px solid #ffffff14; border-radius: 50%; }
.orb-one { top: 21%; right: 12%; width: 100px; height: 100px; box-shadow: inset 0 0 35px #5546d966; }
.orb-two { right: 22%; bottom: 12%; width: 35px; height: 35px; border-color: #86e4e455; box-shadow: 0 0 30px #86e4e433; }
.showcase-grid { position: absolute; z-index: -1; right: -7%; bottom: 6%; width: 55%; height: 32%; opacity: .28; background-image: linear-gradient(#ffffff14 1px, transparent 1px), linear-gradient(90deg, #ffffff14 1px, transparent 1px); background-size: 28px 28px; transform: perspective(420px) rotateX(52deg) rotateZ(-10deg); mask-image: linear-gradient(to bottom, transparent, #000); }
.showcase-caption { position: absolute; bottom: 37px; color: #667085; font-size: 10px; letter-spacing: .04em; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 8%; background: #f7f8fc; }
.auth-panel-inner { width: min(100%, 410px); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 46px; }
.auth-heading { margin-bottom: 30px; }
.auth-heading h2 { margin: 11px 0 8px; color: var(--ink); font-size: 30px; letter-spacing: -.05em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 25px 0 0; color: var(--subtle); font-size: 10px; }
.auth-security svg { width: 14px; height: 14px; color: var(--success); }

@media (max-width: 1100px) {
  .sidebar { flex-basis: 220px; }
  .topbar, .page-container { padding-right: 30px; padding-left: 30px; }
  .app-footer { padding-right: 30px; padding-left: 30px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .sidebar { flex-basis: 74px; align-items: center; padding-right: 10px; padding-left: 10px; }
  .brand-sidebar { padding-right: 0; padding-left: 0; }
  .brand-sidebar .brand-copy, .sidebar-section-label, .nav-link span, .sidebar-footer .sidebar-user { display: none; }
  .sidebar-nav { width: 100%; }
  .nav-link { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; width: 100%; padding-right: 0; padding-left: 0; }
  .topbar-user-copy { display: none; }
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { display: none; }
}

@media (max-width: 640px) {
  .auth-shell { display: block; }
  .auth-showcase { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px; }
  .auth-mobile-brand { display: flex; }
  .topbar { min-height: 68px; padding: 0 18px; }
  .topbar-title { font-size: 11px; }
  .topbar-kicker { font-size: 8px; }
  .page-container { padding: 28px 18px; }
  .app-footer { padding: 0 18px 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-heading .button { align-self: stretch; }
  .filter-form { align-items: stretch; flex-direction: column; }
  .filter-field, .filter-field-branch { min-width: 0; }
  .filter-actions { align-items: stretch; }
  .filter-actions .button { flex: 1; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 112px; padding: 14px; }
  .stat-card > strong { font-size: 23px; }
  .stat-card-top { font-size: 10px; }
  .card-heading { align-items: flex-start; flex-direction: column; padding: 18px; }
  .filter-toolbar { padding: 16px 18px; }
  th { padding: 12px 18px; }
  td { padding: 13px 18px; }
  .table-wrap { margin: 0; }
  .form-stack { padding: 18px; }
  .alert { margin-right: 18px; margin-left: 18px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}
