:root {
    --navy-950: #07111f;
    --navy-900: #0b1728;
    --navy-800: #122238;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-100: #dbeafe;
    --slate-950: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --green-600: #16a34a;
    --red-600: #dc2626;
    --amber-500: #f59e0b;
    --violet-600: #7c3aed;
    --white: #fff;
    --sidebar-width: 272px;
    --radius: 16px;
    --shadow: 0 10px 32px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--slate-50); }
body { margin: 0; min-height: 100%; color: var(--slate-800); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-body { background: #f5f7fb; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: var(--sidebar-width); flex-direction: column; overflow-y: auto; color: #d8e1ec; background: linear-gradient(180deg, var(--navy-950), #0a1626 60%, #0d1b2e); box-shadow: 10px 0 35px rgba(7, 17, 31, .08); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--blue-500), var(--blue-700)); box-shadow: 0 8px 24px rgba(37,99,235,.35); font-size: 20px; font-weight: 900; }
.sidebar-brand > span:last-child, .login-brand > span:last-child { display: flex; flex-direction: column; }
.sidebar-brand strong, .login-brand strong { color: #fff; font-size: 18px; line-height: 1.15; letter-spacing: -.02em; }
.sidebar-brand small, .login-brand small { margin-top: 4px; color: #8494a9; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 18px 14px 24px; }
.nav-label { margin: 18px 10px 7px; color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.nav-label:first-child { margin-top: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; color: #9dacbf; font-size: 13.5px; font-weight: 550; transition: .18s ease; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: #fff; border-color: rgba(96,165,250,.16); background: linear-gradient(90deg, rgba(37,99,235,.28), rgba(37,99,235,.12)); box-shadow: inset 3px 0 var(--blue-500); }
.nav-item-highlight:not(.is-active) { color: #bfdbfe; border-color: rgba(59,130,246,.18); background: rgba(37,99,235,.09); }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.13); }
.sidebar-user { display: flex; min-width: 0; align-items: center; gap: 10px; }
.user-avatar { display: grid; flex: 0 0 auto; width: 37px; height: 37px; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; color: #bfdbfe; background: rgba(37,99,235,.2); font-size: 13px; font-weight: 800; }
.sidebar-user > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user strong { max-width: 130px; overflow: hidden; color: #f8fafc; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { margin-top: 3px; color: #718198; font-size: 10px; text-transform: capitalize; }
.logout-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: #8090a5; background: transparent; transition: .2s; }
.logout-button:hover { color: #fecaca; background: rgba(220,38,38,.16); }
.logout-button svg { width: 18px; height: 18px; }

.app-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid #e7ebf1; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title span { color: var(--slate-400); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-title strong { margin-top: 4px; color: var(--slate-950); font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-create { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; color: #fff; background: var(--blue-600); font-size: 12.5px; font-weight: 700; box-shadow: 0 7px 18px rgba(37,99,235,.2); }
.topbar-create span { font-size: 18px; line-height: 1; }
.topbar-date { padding-left: 16px; border-left: 1px solid var(--slate-200); color: var(--slate-500); font-size: 12px; font-weight: 650; }
.mobile-menu-button { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; }
.mobile-menu-button svg { width: 21px; }
.mobile-overlay { display: none; }
.main-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 30px 32px 50px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 5px 0 6px; color: var(--slate-950); font-size: clamp(25px, 2.2vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
.page-heading p { max-width: 720px; margin: 0; color: var(--slate-500); font-size: 14px; line-height: 1.6; }
.eyebrow { display: inline-block; color: var(--blue-600); font-size: 10.5px; font-weight: 850; letter-spacing: .13em; }
.eyebrow.light { color: #93c5fd; }
.heading-actions { display: flex; gap: 10px; }
.compact-heading { align-items: flex-start; }
.back-link { display: inline-flex; margin-bottom: 12px; color: var(--blue-600); font-size: 12px; font-weight: 700; }

.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 12.5px; font-weight: 750; transition: .18s; }
.btn-primary { color: #fff; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 8px 20px rgba(37,99,235,.18); }
.btn-primary:hover { border-color: var(--blue-700); background: var(--blue-700); transform: translateY(-1px); }
.btn-secondary { color: var(--slate-700); border-color: var(--slate-200); background: #fff; }
.btn-secondary:hover { border-color: var(--slate-300); background: var(--slate-50); }
.btn-block { width: 100%; }
.btn-lg { min-height: 49px; padding: 12px 19px; font-size: 14px; }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 11.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; min-width: 0; align-items: center; gap: 15px; padding: 19px; border: 1px solid #e7ebf1; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-icon { display: grid; flex: 0 0 auto; width: 48px; height: 48px; place-items: center; border-radius: 14px; }
.stat-icon svg { width: 23px; height: 23px; }
.stat-icon.blue { color: var(--blue-600); background: #eff6ff; }
.stat-icon.violet { color: var(--violet-600); background: #f5f3ff; }
.stat-icon.green { color: var(--green-600); background: #f0fdf4; }
.stat-icon.amber { color: #d97706; background: #fffbeb; }
.stat-card > div { display: grid; min-width: 0; grid-template-columns: 1fr auto; align-items: baseline; }
.stat-card small { grid-column: 1; color: var(--slate-500); font-size: 11px; font-weight: 700; }
.stat-card strong { grid-column: 1; margin-top: 2px; color: var(--slate-950); font-size: 27px; letter-spacing: -.03em; }
.stat-card div span { grid-column: 1 / -1; margin-top: 2px; overflow: hidden; color: var(--slate-400); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .7fr); gap: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }
.panel-card { border: 1px solid #e5eaf1; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid #edf0f4; }
.card-header h2 { margin: 0; color: var(--slate-950); font-size: 15px; letter-spacing: -.01em; }
.card-header p { margin: 4px 0 0; color: var(--slate-400); font-size: 10.5px; }
.card-header > a { color: var(--blue-600); font-size: 11.5px; font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 18px; color: var(--slate-400); background: #fbfcfe; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 18px; border-top: 1px solid #edf0f4; color: var(--slate-600); vertical-align: middle; white-space: nowrap; }
.data-table td strong { display: block; color: var(--slate-800); font-size: 12px; }
.data-table td small { display: block; max-width: 250px; margin-top: 4px; overflow: hidden; color: var(--slate-400); font-size: 10px; text-overflow: ellipsis; }
.data-table tbody tr:hover { background: #fafcff; }
.table-search input { width: 210px; padding: 9px 12px; border: 1px solid var(--slate-200); border-radius: 9px; outline: 0; color: var(--slate-700); background: var(--slate-50); font-size: 11px; }
.table-search input:focus { border-color: #93c5fd; background: #fff; box-shadow: 0 0 0 3px #dbeafe; }
.status-badge, .code-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; color: var(--slate-600); background: var(--slate-100); font-size: 9.5px; font-weight: 800; text-transform: capitalize; }
.code-badge { border-radius: 6px; color: var(--blue-700); background: #eff6ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-active, .status-issued, .status-sent, .status-delivered, .status-paid { color: #15803d; background: #dcfce7; }
.status-draft, .status-not_scheduled, .status-unpaid { color: #a16207; background: #fef9c3; }
.status-failed, .status-overdue, .status-cancelled, .status-void { color: #b91c1c; background: #fee2e2; }
.status-processing, .status-scheduled, .status-partially_paid { color: var(--blue-700); background: var(--blue-100); }
.quick-actions { padding: 8px 12px 14px; }
.quick-actions a { display: flex; align-items: center; gap: 11px; padding: 11px 8px; border-bottom: 1px solid #eff2f6; }
.quick-actions a:last-child { border-bottom: 0; }
.quick-actions a:hover { background: var(--slate-50); }
.quick-icon { display: grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 850; }
.quick-icon.blue { color: var(--blue-600); background: #eff6ff; }
.quick-icon.violet { color: var(--violet-600); background: #f5f3ff; }
.quick-icon.green { color: var(--green-600); background: #f0fdf4; }
.quick-actions a > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.quick-actions strong { color: var(--slate-800); font-size: 11.5px; }
.quick-actions small { margin-top: 2px; color: var(--slate-400); font-size: 9.5px; }
.quick-actions b { color: var(--slate-300); font-size: 22px; font-weight: 400; }
.attention-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px; border-radius: var(--radius); color: #fff; background: linear-gradient(140deg, #b45309, #ea580c); box-shadow: 0 12px 28px rgba(234,88,12,.2); }
.attention-card span { font-size: 9px; font-weight: 850; letter-spacing: .1em; opacity: .75; }
.attention-card strong { display: block; margin-top: 4px; font-size: 31px; }
.attention-card p { margin: 2px 0 0; font-size: 10px; opacity: .75; }
.attention-card a { padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,.4); font-size: 10px; font-weight: 750; white-space: nowrap; }

.empty-state { display: flex; min-height: 330px; align-items: center; justify-content: center; flex-direction: column; padding: 40px 20px; text-align: center; }
.empty-state.compact { min-height: 300px; }
.empty-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 17px; color: var(--blue-600); background: #eff6ff; font-size: 20px; font-weight: 900; }
.empty-state h3 { margin: 15px 0 5px; color: var(--slate-800); font-size: 15px; }
.empty-state p { max-width: 360px; margin: 0 0 16px; color: var(--slate-500); font-size: 12px; line-height: 1.6; }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.alert ul { margin: 7px 0 0; padding-left: 18px; }
.alert-success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.alert-error { color: #991b1b; border-color: #fecaca; background: #fff1f2; }

.form-page { display: flex; flex-direction: column; gap: 17px; }
.form-section { padding: 0 22px 24px; }
.form-section-title { display: flex; align-items: center; gap: 12px; margin: 0 -22px 22px; padding: 18px 22px; border-bottom: 1px solid #edf0f4; }
.form-section-title > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--blue-600); background: #eff6ff; font-size: 10px; font-weight: 850; }
.form-section-title h2 { margin: 0; color: var(--slate-900); font-size: 14px; }
.form-section-title p { margin: 3px 0 0; color: var(--slate-400); font-size: 10.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-group { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.form-group > span { color: var(--slate-700); font-size: 11.5px; font-weight: 700; }
.form-group > span small { color: var(--slate-400); font-weight: 500; }
.form-group > small { color: var(--slate-400); font-size: 9.5px; }
.form-control { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe5ec; border-radius: 9px; outline: none; color: var(--slate-800); background: #fff; font-size: 12px; transition: .16s; }
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px #dbeafe; }
.form-control::placeholder { color: #b0bac8; }
.form-control-lg { min-height: 48px; padding: 12px 13px; font-size: 13px; }
.col-2 { grid-column: 1 / -1; }
.check-card { display: flex; align-items: center; gap: 10px; min-height: 67px; padding: 12px; border: 1px solid #dfe5ec; border-radius: 10px; cursor: pointer; }
.check-card input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.check-card span { display: flex; flex-direction: column; }
.check-card strong { color: var(--slate-700); font-size: 11.5px; }
.check-card small { margin-top: 3px; color: var(--slate-400); font-size: 9.5px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 7px 0 20px; }

.stepper { display: grid; grid-template-columns: 1fr 50px 1fr 50px 1fr; align-items: center; max-width: 760px; margin: 0 auto 24px; }
.stepper > i { height: 1px; background: var(--slate-200); }
.step { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; }
.step > span { display: grid; grid-row: 1 / 3; width: 36px; height: 36px; place-items: center; border: 1px solid var(--slate-200); border-radius: 50%; color: var(--slate-400); background: #fff; font-size: 11px; font-weight: 800; }
.step strong { align-self: end; color: var(--slate-500); font-size: 11px; }
.step small { color: var(--slate-400); font-size: 9px; }
.step.is-current > span { color: #fff; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 7px 16px rgba(37,99,235,.25); }
.step.is-current strong { color: var(--slate-800); }
.setup-required { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; }
.setup-required > span { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: #92400e; background: #fef3c7; font-weight: 900; }
.setup-required > div { flex: 1; }
.setup-required strong { color: #78350f; font-size: 12px; }
.setup-required p { margin: 4px 0 0; color: #a16207; font-size: 10.5px; }
.invoice-start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.next-package-note { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px; border-radius: 11px; background: #f1f5ff; }
.next-package-note > span { padding: 5px 8px; border-radius: 999px; color: var(--blue-700); background: #dbeafe; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.next-package-note strong { display: block; color: var(--slate-700); font-size: 11px; }
.next-package-note p { margin: 3px 0 0; color: var(--slate-500); font-size: 10px; line-height: 1.5; }
.preview-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.preview-strip > div { display: flex; align-items: baseline; gap: 9px; padding: 16px; border: 1px solid #e5eaf1; border-radius: 12px; background: #fff; }
.preview-number { color: var(--slate-900); font-size: 21px; font-weight: 850; }
.preview-strip small { color: var(--slate-400); font-size: 10px; }

.logic-note { display: flex; align-items: center; gap: 14px; margin-bottom: 17px; padding: 15px 17px; border: 1px solid #bfdbfe; border-radius: 13px; background: linear-gradient(120deg, #eff6ff, #f8fbff); }
.logic-note > span { display: grid; flex: 0 0 auto; width: 39px; height: 39px; place-items: center; border-radius: 11px; color: #1d4ed8; background: #dbeafe; font-size: 20px; font-weight: 850; }
.logic-note strong { color: var(--slate-800); font-size: 12px; }
.logic-note p { margin: 3px 0 0; color: var(--slate-500); font-size: 10.5px; line-height: 1.55; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.role-card { background: #fbfcfe; }
.role-card:has(input:checked) { border-color: #93c5fd; background: #f4f8ff; box-shadow: inset 0 0 0 1px #dbeafe; }
.role-badges { display: flex; max-width: 230px; flex-wrap: wrap; gap: 5px; }
.role-badge { padding: 4px 7px; border-radius: 999px; font-size: 8.5px; font-weight: 800; white-space: nowrap; }
.role-own { color: #1d4ed8; background: #dbeafe; }
.role-buy { color: #6d28d9; background: #ede9fe; }
.role-sell { color: #047857; background: #d1fae5; }
.role-foreign { color: #9a3412; background: #ffedd5; }
.table-action { display: inline-flex; padding: 6px 9px; border: 1px solid #dbeafe; border-radius: 7px; color: var(--blue-700); background: #f8fbff; font-size: 9.5px; font-weight: 750; }
.direction-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.direction-picker label { position: relative; cursor: pointer; }
.direction-picker input { position: absolute; opacity: 0; pointer-events: none; }
.direction-picker label > span { display: flex; min-height: 74px; justify-content: center; flex-direction: column; padding: 14px 16px; border: 1px solid #dfe5ec; border-radius: 12px; background: #fff; transition: .16s; }
.direction-picker strong { color: var(--slate-800); font-size: 12.5px; }
.direction-picker small { margin-top: 4px; color: var(--slate-400); font-size: 10px; }
.direction-picker input:checked + span { border-color: #60a5fa; background: #eff6ff; box-shadow: 0 0 0 2px #dbeafe; }
.direction-picker input:checked + span strong { color: #1d4ed8; }
.tax-notice { display: flex; align-items: center; gap: 12px; margin-top: 17px; padding: 13px 14px; border: 1px solid #dbeafe; border-radius: 11px; background: #f8fbff; }
.tax-notice > span { display: grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #1d4ed8; background: #dbeafe; font-size: 13px; font-weight: 900; }
.tax-notice strong { color: var(--slate-700); font-size: 11px; }
.tax-notice p { margin: 3px 0 0; color: var(--slate-500); font-size: 9.7px; line-height: 1.5; }
.tax-notice.is-zero-tax { border-color: #a7f3d0; background: #f0fdf4; }
.tax-notice.is-zero-tax > span { color: #047857; background: #d1fae5; }
.inline-actions { margin-top: 13px; padding-bottom: 0; }
.price-preview { display: flex; justify-content: center; flex-direction: column; padding: 12px 15px; border: 1px solid #bfdbfe; border-radius: 11px; background: linear-gradient(135deg, #eff6ff, #f8fbff); }
.price-preview small { color: var(--blue-700); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.price-preview strong { margin: 4px 0 2px; color: var(--slate-900); font-size: 22px; }
.price-preview span { color: var(--slate-400); font-size: 8.7px; }
.form-control.is-calculated { color: #1d4ed8; background: #f8fbff; font-weight: 750; }
.btn:disabled { cursor: not-allowed; opacity: .5; }

.module-placeholder { display: flex; min-height: 480px; align-items: center; justify-content: center; flex-direction: column; padding: 40px; text-align: center; }
.module-orbit { display: grid; width: 82px; height: 82px; place-items: center; border: 1px dashed #93c5fd; border-radius: 50%; background: #eff6ff; box-shadow: 0 0 0 10px #f8fbff; }
.module-orbit span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: #fff; background: var(--blue-600); font-size: 19px; font-weight: 850; }
.module-placeholder h2 { margin: 27px 0 8px; color: var(--slate-900); font-size: 21px; }
.module-placeholder > p { max-width: 570px; margin: 0; color: var(--slate-500); font-size: 12.5px; line-height: 1.7; }
.module-checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 25px; }
.module-checks span { padding: 8px 11px; border: 1px solid #dbeafe; border-radius: 999px; color: var(--blue-700); background: #f5f9ff; font-size: 10px; font-weight: 650; }
.error-page { display: flex; min-height: calc(100vh - 150px); align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.error-page > span { color: #dbeafe; font-size: 100px; font-weight: 950; letter-spacing: -.07em; line-height: 1; }
.error-page h1 { margin: -10px 0 8px; color: var(--slate-900); font-size: 26px; }
.error-page p { margin: 0 0 20px; color: var(--slate-500); font-size: 13px; }

.guest-body { background: #fff; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(430px, .9fr) minmax(500px, 1.1fr); }
.login-visual { position: relative; display: flex; overflow: hidden; min-height: 100vh; flex-direction: column; padding: 38px 46px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(59,130,246,.32), transparent 34%), radial-gradient(circle at 10% 80%, rgba(37,99,235,.2), transparent 36%), linear-gradient(145deg, #07111f, #0c1c32 62%, #102b4c); }
.login-visual::before, .login-visual::after { position: absolute; content: ""; border: 1px solid rgba(147,197,253,.1); border-radius: 50%; }
.login-visual::before { right: -220px; bottom: -240px; width: 620px; height: 620px; }
.login-visual::after { right: -100px; bottom: -120px; width: 380px; height: 380px; }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.login-visual-content { position: relative; z-index: 2; max-width: 580px; margin: auto 0; padding: 60px 0; }
.login-visual h1 { max-width: 560px; margin: 13px 0 18px; font-size: clamp(38px, 4vw, 58px); line-height: 1.06; letter-spacing: -.045em; }
.login-visual-content > p { max-width: 520px; margin: 0; color: #aebdd0; font-size: 15px; line-height: 1.75; }
.login-features { display: grid; gap: 12px; margin-top: 32px; color: #dce8f5; font-size: 12px; }
.login-features i { display: inline-grid; width: 21px; height: 21px; margin-right: 8px; place-items: center; border-radius: 50%; color: #93c5fd; background: rgba(59,130,246,.15); font-style: normal; font-size: 10px; }
.login-visual-footer { position: relative; z-index: 2; color: #61748d; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.login-panel { display: grid; place-items: center; padding: 50px; background: #fff; }
.login-form-wrap { width: 100%; max-width: 410px; }
.login-form-wrap h2 { margin: 8px 0 7px; color: var(--slate-950); font-size: 31px; letter-spacing: -.035em; }
.login-form-wrap > p { margin: 0; color: var(--slate-500); font-size: 13px; line-height: 1.6; }
.login-form { display: grid; gap: 18px; margin-top: 30px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 67px; }
.password-field button { position: absolute; top: 50%; right: 9px; padding: 6px 7px; border: 0; border-radius: 6px; color: var(--blue-600); background: transparent; font-size: 10px; font-weight: 750; transform: translateY(-50%); }
.login-help { margin-top: 25px !important; padding-top: 18px; border-top: 1px solid var(--slate-100); color: var(--slate-400) !important; font-size: 10.5px !important; text-align: center; }
.login-help code { color: var(--slate-600); }
.mobile-login-brand { display: none; }

.installer-body { min-height: 100vh; background: radial-gradient(circle at 50% 0, #dbeafe, transparent 38%), #f6f8fc; }
.installer-shell { display: grid; min-height: 100vh; place-items: center; padding: 35px 18px; }
.installer-card { width: 100%; max-width: 520px; padding: 34px; border: 1px solid #e1e7ef; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.1); }
.installer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.installer-brand > div { display: flex; flex-direction: column; }
.installer-brand strong { color: var(--slate-950); font-size: 16px; }
.installer-brand small { margin-top: 2px; color: var(--slate-400); font-size: 10px; }
.installer-card h1 { margin: 8px 0 8px; color: var(--slate-950); font-size: 27px; letter-spacing: -.03em; }
.installer-card > p { margin: 0 0 22px; color: var(--slate-500); font-size: 12px; line-height: 1.65; }
.installer-form { display: grid; gap: 15px; margin-top: 24px; }
.security-notice { margin: 20px 0; padding: 13px; border: 1px solid #fde68a; border-radius: 10px; color: #92400e; background: #fffbeb; font-size: 11px; line-height: 1.55; }
.install-success-icon, .install-lock-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; color: #fff; background: var(--green-600); font-size: 25px; font-weight: 900; }
.install-lock-icon { color: #92400e; background: #fef3c7; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .mobile-overlay.is-open { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(7,17,31,.52); backdrop-filter: blur(2px); }
    .app-shell { margin-left: 0; }
    .mobile-menu-button { display: grid; }
    .topbar { height: 68px; padding: 0 18px; }
    .topbar-title { margin-right: auto; margin-left: 12px; }
    .main-content { padding: 23px 18px 40px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; padding: 28px; }
    .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 45px; }
    .mobile-login-brand .brand-mark { width: 37px; height: 37px; border-radius: 11px; font-size: 17px; }
}

@media (max-width: 680px) {
    .topbar-create, .topbar-date { display: none; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading > .btn, .heading-actions, .heading-actions .btn { width: 100%; }
    .heading-actions { flex-direction: column-reverse; }
    .stats-grid, .dashboard-side, .form-grid, .invoice-start-grid, .preview-strip, .role-grid, .direction-picker { grid-template-columns: 1fr; }
    .col-2 { grid-column: auto; }
    .card-header { align-items: flex-start; flex-direction: column; }
    .table-search, .table-search input { width: 100%; }
    .stepper { grid-template-columns: 1fr; gap: 8px; }
    .stepper > i { display: none; }
    .step { display: none; }
    .step.is-current { display: grid; }
    .setup-required { align-items: flex-start; flex-wrap: wrap; }
    .setup-required .btn { width: 100%; }
    .form-section { padding-right: 16px; padding-left: 16px; }
    .form-section-title { margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .installer-card { padding: 25px 20px; }
    .login-panel { padding: 22px; }
}
