:root {
    --primary: #0366E7;
    --primary-dark: #034fb6;
    --primary-soft: #eaf2ff;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #172033;
    --muted: #6f7c91;
    --border: #e3e9f2;
    --success: #14885f;
    --success-soft: #e9f8f1;
    --danger: #d74646;
    --danger-soft: #fff0f0;
    --warning: #b77808;
    --warning-soft: #fff8e6;
    --info: #2369c9;
    --info-soft: #eaf3ff;
    --shadow: 0 14px 40px rgba(24, 42, 74, .08);
    --radius: 18px;
    --sidebar: 286px;
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0e1420;
    --surface: #161e2c;
    --surface-2: #1c2636;
    --text: #edf2fa;
    --muted: #9ba9bd;
    --border: #29364a;
    --primary-soft: #112f56;
    --success-soft: #13392e;
    --danger-soft: #442126;
    --warning-soft: #3d321c;
    --info-soft: #183454;
    --shadow: 0 18px 44px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.65; }
body, input, textarea, select, button { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { font-size: 14px; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 25px 0; }

.app-shell { min-height: 100vh; display: flex; direction: rtl; }
.sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
    width: var(--sidebar); background: #071d3b; color: #dfeaff;
    display: flex; flex-direction: column; overflow: hidden;
    transition: transform .25s ease, width .25s ease;
}
.brand {
    height: 88px; display: flex; align-items: center; gap: 13px; padding: 16px 20px;
    color: white; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand img { width: 50px; height: 50px; object-fit: contain; border-radius: 14px; background: white; padding: 5px; }
.brand span { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.brand b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: #8fa9cb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { padding: 14px 10px 20px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.nav-item, .nav-group summary {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 13px;
    color: #b8cae2; border-radius: 11px; cursor: pointer; user-select: none;
    list-style: none; transition: background .15s, color .15s;
}
.nav-item span, .nav-group summary span { width: 24px; text-align: center; font-size: 17px; }
.nav-item b, .nav-group summary b { flex: 1; font-weight: 600; font-size: 13px; }
.nav-item:hover, .nav-group summary:hover, .nav-item.active { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { box-shadow: inset -3px 0 var(--primary); }
.nav-group { margin-top: 3px; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary i { font-style: normal; color: #7792b6; transition: transform .2s; }
.nav-group[open] summary { color: white; }
.nav-group[open] summary i { transform: rotate(180deg); }
.nav-group > div { padding: 3px 43px 8px 8px; display: grid; gap: 2px; }
.nav-group > div a { color: #8fa9cb; padding: 7px 11px; border-radius: 8px; font-size: 12.5px; position: relative; }
.nav-group > div a::before { content: ""; position: absolute; right: -12px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #496789; }
.nav-group > div a:hover, .nav-group > div a.active { color: white; background: rgba(255,255,255,.07); }
.nav-group > div a.active::before { background: #55a3ff; box-shadow: 0 0 0 4px rgba(85,163,255,.15); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; }
.sidebar-footer a { color: #b8cae2; }
.sidebar-footer small { color: #6684a9; }
.sidebar-backdrop { display: none; }
body.sidebar-collapsed { --sidebar: 86px; }
body.sidebar-collapsed .brand { padding-inline: 18px; justify-content: center; }
body.sidebar-collapsed .brand span,
body.sidebar-collapsed .nav-item b,
body.sidebar-collapsed .nav-group summary b,
body.sidebar-collapsed .nav-group summary i,
body.sidebar-collapsed .nav-group > div,
body.sidebar-collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .nav-group summary { justify-content: center; }
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-group summary span { width: auto; }
body.sidebar-collapsed .main-nav { padding-inline: 12px; overflow: visible; }

.workspace { width: calc(100% - var(--sidebar)); margin-right: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; transition: all .25s ease; }
.topbar {
    position: sticky; top: 0; z-index: 40; height: 72px; background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-start { min-width: 0; flex: 1; }
.icon-btn {
    width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; font-size: 17px;
}
.icon-btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.notification-btn span { position: absolute; top: -5px; left: -5px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: white; display: grid; place-items: center; font-size: 10px; border: 2px solid var(--surface); }
.global-search { max-width: 560px; flex: 1; height: 42px; position: relative; display: flex; align-items: center; }
.global-search > span { position: absolute; right: 14px; color: var(--muted); font-size: 20px; }
.global-search input { width: 100%; height: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); padding: 0 43px 0 70px; outline: none; }
.global-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.global-search kbd { position: absolute; left: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 2px 7px; font-size: 10px; direction: ltr; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px; border-radius: 12px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; background: linear-gradient(145deg, var(--primary), #6f57e8); color: white; display: grid; place-items: center; font-weight: 800; }
.avatar.large { width: 88px; height: 88px; border-radius: 25px; font-size: 32px; margin: auto; }
.user-meta { display: flex; flex-direction: column; line-height: 1.35; }
.user-meta b { font-size: 12px; }
.user-meta small { color: var(--muted); font-size: 10px; }
.user-menu summary i { font-style: normal; color: var(--muted); }
.user-menu > div { position: absolute; top: calc(100% + 8px); left: 0; width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); padding: 7px; display: grid; }
.user-menu > div a { color: var(--text); padding: 9px 11px; border-radius: 8px; }
.user-menu > div a:hover { background: var(--surface-2); }
.mobile-only { display: none; }

.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px; flex: 1; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 18px 28px; color: var(--muted); border-top: 1px solid var(--border); font-size: 11px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 2px 0 5px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.5px; }
.page-head p { margin: 0; color: var(--muted); }
.dashboard-head h1 { font-size: 30px; }
.eyebrow { display: inline-block; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .4px; margin-bottom: 4px; }
.head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.back-link { color: var(--muted); font-size: 12px; display: inline-flex; margin-bottom: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 15px rgba(24,42,74,.035); padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.card-head h2 { margin: 0 0 3px; font-size: 16px; }
.card-head p { margin: 0; color: var(--muted); font-size: 11px; }
.card-head > a { font-size: 12px; font-weight: 700; }
.card-icon { width: 39px; height: 39px; background: var(--primary-soft); color: var(--primary); border-radius: 12px; display: grid; place-items: center; font-size: 18px; }

.btn { border: 0; min-height: 40px; border-radius: 11px; padding: 8px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .15s, background .15s, border .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 23%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: white; }
.btn.success { background: var(--success); color: white; }
.btn.wide { width: 100%; }
.btn.large { min-height: 48px; padding-inline: 25px; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.danger-text { color: var(--danger) !important; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 18px; }
.stats-grid.compact { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.stat-card { min-height: 126px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 16px; color: var(--text); position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(24,42,74,.035); }
.stat-card::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; left: -45px; top: -50px; opacity: .08; background: currentColor; }
.stat-card:hover { border-color: color-mix(in srgb, currentColor 30%, var(--border)); transform: translateY(-2px); transition: .2s; }
.stat-icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 23px; }
.stat-card > div { display: flex; flex-direction: column; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-card b { font-size: 28px; line-height: 1.3; letter-spacing: -.5px; }
.stat-card em { font-size: 10px; font-style: normal; color: var(--muted); }
.stat-card.violet { color: #6f57e8; }.stat-card.violet .stat-icon { background:#f0edff;color:#6f57e8; }
.stat-card.cyan { color: #0397b5; }.stat-card.cyan .stat-icon { background:#e6f9fc;color:#0397b5; }
.stat-card.amber { color: #c58209; }.stat-card.amber .stat-icon { background:#fff6df;color:#c58209; }
.stat-card.green { color: #15845d; }.stat-card.green .stat-icon { background:#e6f7ef;color:#15845d; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dashboard-grid .span-2 { grid-column: span 2; }
.bar-chart { min-height: 235px; display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; padding: 20px 8px 4px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0, transparent 44px, var(--border) 45px); }
.bar-column { flex: 1; height: 210px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar-column b { width: min(52px, 75%); min-height: 8px; background: linear-gradient(to top, var(--primary), #56a3ff); border-radius: 8px 8px 3px 3px; position: relative; transition: height .5s ease; }
.bar-column b span { position: absolute; top: -23px; width: 100%; text-align: center; color: var(--text); font-size: 10px; }
.bar-column small { color: var(--muted); font-size: 9px; direction: ltr; }
.financial-card { background: linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--primary-soft) 55%, var(--surface))); }
.money-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
.money-row span { color: var(--muted); }
.money-row.income b { color: var(--success); }.money-row.expense b { color: var(--danger); }
.balance-box { background: #071d3b; color: white; border-radius: 14px; padding: 17px; margin: 16px 0; display: flex; flex-direction: column; }
.balance-box span { color: #9ab1d0; font-size: 10px; }.balance-box strong { font-size: 22px; }
.financial-card > a { font-size: 11px; font-weight: 700; }
.compact-list { display: grid; }
.compact-list > a { display: flex; align-items: center; gap: 11px; padding: 11px 3px; color: var(--text); border-bottom: 1px solid var(--border); }
.compact-list > a:last-child { border-bottom: 0; }
.compact-list > a:hover b { color: var(--primary); }
.compact-list > a > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.compact-list b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-list small, .compact-list time { color: var(--muted); font-size: 9.5px; }
.list-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 5px var(--info-soft); }
.list-dot.danger { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }
.list-dot.warning { background: var(--warning); box-shadow: 0 0 0 5px var(--warning-soft); }
.mini-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--surface-2); color: var(--primary); display: grid; place-items: center; }
.recent-card { margin-bottom: 18px; }

.alert { display: flex; align-items: center; gap: 10px; border: 1px solid; border-radius: 12px; padding: 12px 15px; margin-bottom: 16px; position: relative; }
.alert > span:first-child { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.alert > button { margin-right: auto; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.alert.success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert.danger, .alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert.warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; border-radius: 20px; padding: 3px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }
.priority { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; white-space: nowrap; }
.priority::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.priority.low::before { background: #57a87b; }.priority.medium::before { background: #d1a337; }.priority.high::before { background: #e27845; }.priority.urgent::before { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.ref { font-family: Consolas, monospace; direction: ltr; display: inline-block; color: var(--primary); font-size: 11px; font-weight: 700; }

.filters { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.filters > label { min-width: 150px; margin: 0; }
.filters > label.search-field { flex: 1; min-width: 240px; }
.filters select { min-width: 145px; }
.search-field { position: relative; }
.search-field > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.search-field input { padding-right: 40px !important; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 11px; font-weight: 700; margin-bottom: 13px; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select {
    width: 100%; min-height: 42px; padding: 9px 12px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: none;
    transition: border .15s, box-shadow .15s; appearance: auto;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
input[type="color"] { height: 48px; padding: 4px; }
input[type="checkbox"] { width: 17px; min-height: 17px; height: 17px; accent-color: var(--primary); }
input[type="file"] { padding: 8px; }

.table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: right; color: var(--muted); background: var(--surface-2); font-size: 10px; padding: 11px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
th:first-child { border-radius: 0 10px 10px 0; border-right: 1px solid var(--border); }
th:last-child { border-radius: 10px 0 0 10px; border-left: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 11.5px; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 35%, transparent); }
.record-title { display: flex; flex-direction: column; color: var(--text); max-width: 320px; }
.record-title small { color: var(--muted); font-size: 9.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.row-actions a, .row-actions button { border: 0; background: transparent; padding: 4px; font-size: 10.5px; cursor: pointer; color: var(--primary); }
.mini-progress, .progress-line { width: 90px; height: 7px; border-radius: 9px; background: var(--border); overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 5px; }
.mini-progress i, .progress-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4ca3ff); border-radius: inherit; }
.progress-line { width: 140px; }
.pagination { display: flex; justify-content: center; gap: 5px; padding-top: 18px; flex-wrap: wrap; }
.pagination a { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; display: grid; place-items: center; }
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 25px; }
.empty-state > span { font-size: 30px; color: var(--primary); }
.empty-state h3 { color: var(--text); margin: 8px 0 2px; }
.empty-state p { margin: 0; }
.empty-state.compact { min-height: 90px; padding: 16px; font-size: 11px; }

.form-section { margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 19px; }
.section-title > span { width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 900; }
.section-title h2 { margin: 0 0 1px; font-size: 15px; }
.section-title p { margin: 0; font-size: 10px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
.file-drop { min-height: 145px; border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface)); border-radius: 14px; align-items: center; justify-content: center; text-align: center; cursor: pointer; position: relative; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop > span { font-size: 28px; color: var(--primary); }.file-drop small { color: var(--muted); }
.sticky-actions { position: sticky; bottom: 12px; z-index: 10; display: flex; justify-content: flex-end; gap: 9px; padding: 12px; background: color-mix(in srgb, var(--surface) 91%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); margin-top: 15px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 18px; }
.detail-main, .detail-side { display: grid; gap: 18px; align-content: start; }
.description-box { background: var(--surface-2); border-radius: 12px; padding: 16px; margin-bottom: 18px; color: var(--text); }
.details-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.details-list > div { padding: 12px 4px; border-bottom: 1px solid var(--border); }
.details-list > div.wide { grid-column: 1 / -1; }
.details-list dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.details-list dd { margin: 0; font-weight: 600; }
.attachments { display: grid; gap: 8px; }
.attachments > a { display: flex; align-items: center; gap: 11px; padding: 10px; color: var(--text); border: 1px solid var(--border); border-radius: 11px; }
.attachments > a:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.attachments > a div { flex: 1; display: flex; flex-direction: column; }.attachments small { color: var(--muted); font-size: 9px; }.attachments i { font-style: normal; color: var(--primary); font-size: 10px; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.comment-form textarea { min-height: 74px; margin: 0; }
.timeline { display: grid; gap: 14px; margin-top: 20px; }
.timeline > div { display: flex; gap: 10px; }
.timeline section { flex: 1; background: var(--surface-2); border-radius: 12px; padding: 11px 13px; }
.timeline header { display: flex; justify-content: space-between; gap: 8px; }.timeline time { color: var(--muted); font-size: 9px; }.timeline p { margin: 6px 0 0; }
.approval-card { background: linear-gradient(145deg, var(--surface), var(--primary-soft)); }
.approval-card h2 { margin: 0 0 5px; }.approval-card p { color: var(--muted); font-size: 11px; }
.approval-card form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.approval-list { display: grid; gap: 12px; }
.approval-list > div { padding-bottom: 11px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; }
.approval-list small { color: var(--muted); grid-column: 2; }.approval-list p { grid-column: 1 / -1; margin: 3px 0; font-size: 11px; }
.metadata-card dl, .profile-summary dl { margin: 0; display: grid; }
.metadata-card dl div, .profile-summary dl div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.metadata-card dt, .profile-summary dt { color: var(--muted); }.metadata-card dd, .profile-summary dd { margin: 0; font-weight: 600; }

.split-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(290px, .8fr); gap: 18px; }
.side-form { position: sticky; top: 92px; align-self: start; }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.user-cell div { display: flex; flex-direction: column; }.user-cell small { color: var(--muted); font-size: 9px; }
.token-code { display: block; direction: ltr; background: var(--surface); border: 1px dashed currentColor; padding: 8px; margin: 5px 0; user-select: all; }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 0; }

.roles-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.roles-list { display: grid; gap: 6px; position: sticky; top: 92px; }
.roles-list h2 { margin: 0 0 10px; }
.roles-list > a:not(.btn) { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); padding: 10px; border-radius: 10px; border: 1px solid transparent; }
.roles-list > a:not(.btn).active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 20%, var(--border)); color: var(--primary); }
.roles-list > a div { display: flex; flex-direction: column; }.roles-list small { color: var(--muted); font-size: 9px; }
.permissions-toolbar { display: flex; gap: 7px; margin-bottom: 10px; }
.permissions-table input { margin: auto; }
.permissions-table th:not(:first-child), .permissions-table td:not(:first-child) { text-align: center; }

.settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.settings-grid .form-section:nth-child(1), .settings-grid .form-section:nth-child(3) { grid-row: span 2; }
.logo-setting { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; }
.logo-setting img { width: 75px; height: 75px; object-fit: contain; border: 1px solid var(--border); border-radius: 16px; padding: 6px; background: white; }
.logo-setting label { flex: 1; margin: 0; }
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.profile-summary { text-align: center; align-self: start; }
.profile-summary h2 { margin: 14px 0 2px; }.profile-summary > p { margin: 0 0 20px; color: var(--muted); }

.dialog { width: min(480px, calc(100% - 24px)); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 18px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(4,13,28,.6); backdrop-filter: blur(4px); }
.dialog form { padding: 25px; text-align: center; }
.dialog-icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; font-size: 24px; font-weight: 900; }
.dialog-icon.danger { background: var(--danger-soft); color: var(--danger); }
.dialog h3 { margin: 4px 0; }.dialog p { margin: 0 0 15px; color: var(--muted); }.dialog label { text-align: right; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.notification-list { padding: 7px; }
.notification-list > a { display: flex; gap: 13px; color: var(--text); padding: 15px; border-radius: 13px; border-bottom: 1px solid var(--border); }
.notification-list > a:hover { background: var(--surface-2); }.notification-list > a.unread { background: var(--primary-soft); }
.notification-list > a > span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); font-size: 19px; }
.notification-list > a div { flex: 1; }.notification-list p { margin: 3px 0; color: var(--muted); }.notification-list small { color: var(--muted); font-size: 9px; }
.search-page-form { display: flex; gap: 8px; position: relative; }.search-page-form > span { position: absolute; right: 15px; top: 9px; font-size: 20px; color: var(--muted); }.search-page-form input { padding-right: 43px; min-height: 46px; }
.search-results { display: grid; margin-top: 20px; }
.search-results > a { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 14px 5px; border-bottom: 1px solid var(--border); }
.search-results > a > div { flex: 1; min-width: 0; }.search-results small { color: var(--primary); }.search-results b { display: block; }.search-results p { margin: 2px 0; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.backup-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.backup-card { text-align: center; }.backup-card > span { width: 58px; height: 58px; margin: auto; border-radius: 18px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 25px; }
.backup-card h2 { margin: 12px 0 4px; }.backup-card p { color: var(--muted); min-height: 44px; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.help-grid .card > span { width: 37px; height: 37px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 900; }
.help-grid h2 { margin: 12px 0 3px; }.help-grid p { color: var(--muted); min-height: 68px; }.help-grid a { font-size: 11px; font-weight: 800; }
.support-card { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.support-card > div { display: flex; align-items: center; gap: 13px; }.support-card > div:first-child > span { width: 50px; height: 50px; background: #071d3b; color: white; border-radius: 16px; display: grid; place-items: center; font-size: 25px; }.support-card h2,.support-card p{margin:0}.support-card p{color:var(--muted)}.support-card > div:last-child{flex-direction:column;align-items:flex-start}
.error-page { max-width: 650px; min-height: 60vh; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > span { width: 80px; height: 80px; border-radius: 25px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; font-size: 42px; font-weight: 900; }.error-page h1{margin:20px 0 5px}.error-page p{color:var(--muted);margin:0 0 20px}
pre { direction: ltr; text-align: left; background: var(--surface-2); border-radius: 10px; padding: 10px; max-width: 400px; overflow: auto; font-size: 10px; }

.login-body { min-height: 100vh; background: #f4f7fb; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.07fr .93fr; direction: ltr; }
.login-visual { direction: rtl; position: relative; overflow: hidden; color: white; padding: 46px clamp(35px, 6vw, 90px); background:
    radial-gradient(circle at 12% 15%, rgba(69,144,255,.32), transparent 32%),
    linear-gradient(145deg, #06162f 0%, #082b59 58%, #073c75 100%); display: flex; flex-direction: column; justify-content: space-between; }
.login-visual::after { content:""; position:absolute; inset:0; opacity:.14; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px);background-size:48px 48px;mask-image:linear-gradient(to bottom,black,transparent)}
.login-brand, .mobile-login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 13px; }
.login-brand img, .mobile-login-brand img { width: 55px; height: 55px; object-fit: contain; background: white; padding: 6px; border-radius: 16px; }
.login-brand span { display: flex; flex-direction: column; }.login-brand b { font-size: 17px; }.login-brand small { color: #9eb8da; }
.login-message { position: relative; z-index: 2; max-width: 620px; }
.login-message .eyebrow { color: #68b3ff; }
.login-message h1 { font-size: clamp(40px, 5vw, 68px); line-height: 1.25; margin: 12px 0 20px; letter-spacing: -2px; }
.login-message h1 em { color: #66b2ff; font-style: normal; }
.login-message p { max-width: 540px; color: #b4c8e2; font-size: 16px; }
.login-stats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; }
.login-stats div { display: flex; flex-direction: column; }.login-stats b { font-size: 19px; }.login-stats span { color: #8da8ca; font-size: 10px; }
.visual-orb { position: absolute; border-radius: 50%; filter: blur(1px); border: 1px solid rgba(255,255,255,.1); }
.orb-one { width: 300px; height: 300px; left: -120px; top: 20%; background: rgba(53,135,246,.09); }.orb-two { width: 500px; height: 500px; right: -250px; bottom: -250px; background: rgba(63,120,211,.08); }
.login-panel { direction: rtl; padding: 45px; display: grid; place-items: center; background: #fff; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 3px 0; color:#142039; font-size: 30px; }.login-card > p { margin: 0 0 25px; color:#718096; }
.login-card label { color:#26334b; }
.input-icon { position: relative; }.input-icon i { position:absolute;right:13px;top:11px;color:#8290a4;font-style:normal}.input-icon input{padding-right:40px;padding-left:65px;background:#f8fafc;color:#182237;border-color:#dfe5ee;min-height:48px}.input-icon button{position:absolute;left:9px;top:8px;border:0;background:transparent;color:#0366e7;font-size:10px;cursor:pointer}
.login-options { display:flex;justify-content:space-between;align-items:center;margin:3px 0 18px;font-size:11px}.login-options .check{flex-direction:row;align-items:center;margin:0;color:#44516a}.login-options a{font-weight:700}
.secure-note { text-align:center;color:#7b879a;font-size:10px;margin-top:14px}.public-link{display:block;text-align:center;margin-top:20px;font-size:11px}.mobile-login-brand{display:none}

.installer-body, .public-body { min-height:100vh;background:linear-gradient(145deg,#eef4fc,#f9fbff);padding:30px;color:#172033 }
.installer-shell { max-width:1150px;margin:auto }.installer-hero{display:flex;align-items:center;gap:16px;margin-bottom:25px}.brand-mark{width:65px;height:65px;border-radius:20px;background:linear-gradient(145deg,#0366e7,#074b9d);color:white;display:grid;place-items:center;font-size:30px;font-weight:900;box-shadow:0 12px 25px rgba(3,102,231,.25)}.installer-hero h1{margin:0}.installer-hero p{margin:0;color:#6f7c91}.installer-grid{display:grid;grid-template-columns:.65fr 1.35fr;gap:18px;align-items:start}.installer-card{background:white;border:1px solid #e3e9f2;border-radius:20px;padding:25px;box-shadow:var(--shadow)}.installer-card h2{margin:0 0 18px}.requirements{display:grid;gap:8px}.requirement{display:flex;align-items:center;gap:10px;padding:9px;border-radius:10px;background:#f8fafc}.requirement span{width:24px;height:24px;border-radius:50%;display:grid;place-items:center}.requirement.ok{color:#14885f}.requirement.ok span{background:#e9f8f1}.requirement.bad{color:#d74646}.requirement.bad span{background:#fff0f0}.success-card{text-align:center;max-width:600px;margin:80px auto}.success-icon{width:70px;height:70px;border-radius:50%;background:#e9f8f1;color:#14885f;display:grid;place-items:center;margin:auto;font-size:35px;font-weight:900}.success-card h2{margin-top:18px}.success-card .btn{margin-top:15px}.installer-body input,.installer-body select,.installer-body textarea,.public-body input,.public-body select,.public-body textarea{color:#172033;background:#fff;border-color:#dce4ef}
.public-shell{max-width:760px;margin:auto}.public-brand{color:#172033;height:auto;padding:0;margin-bottom:25px;border:0}.public-form-card{padding:32px}.public-form-card h1{font-size:30px;margin:3px 0}.public-form-card>p{color:#6f7c91;margin-top:0}.public-login{display:block;text-align:center;margin:20px}.reference-large{direction:ltr;display:block;background:#f4f7fb;border:1px dashed #0366e7;padding:14px;font-size:20px;user-select:all;margin:18px}

@media (max-width: 1180px) {
    :root { --sidebar: 255px; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid .span-2 { grid-column: span 2; }
    .dashboard-grid .financial-card { grid-column: span 2; }
    .form-grid.three { grid-template-columns: 1fr 1fr; }
    .help-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(100%); width: min(310px, 88vw); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { position:fixed;inset:0;z-index:45;background:rgba(1,12,28,.55);backdrop-filter:blur(3px) }
    .sidebar-backdrop.open { display:block; }
    .workspace { width:100%;margin-right:0 }
    .mobile-only { display:grid }.desktop-only{display:none}
    .content { padding:20px }
    .detail-grid,.split-layout,.settings-grid,.profile-layout { grid-template-columns:1fr }
    .side-form { position:static }
    .roles-layout { grid-template-columns:1fr }
    .roles-list { position:static;display:flex;overflow-x:auto }.roles-list h2{display:none}.roles-list>a{min-width:170px}
    .backup-actions { grid-template-columns:1fr 1fr }.backup-actions .backup-card:last-child{grid-column:span 2}
    .login-shell { grid-template-columns:1fr }.login-visual{display:none}.login-panel{min-height:100vh;padding:25px}.mobile-login-brand{display:flex;margin-bottom:30px;color:#142039}.mobile-login-brand img{width:48px;height:48px}
    .installer-grid{grid-template-columns:1fr}
}

@media (max-width: 640px) {
    .topbar { height:64px;padding:0 12px }.content{padding:15px}.app-footer{padding:15px;flex-direction:column}
    .global-search { display:none }.user-meta{display:none}.user-menu summary i{display:none}
    .page-head{align-items:flex-start;flex-direction:column}.head-actions{width:100%}.head-actions .btn{flex:1}
    .stats-grid,.stats-grid.compact{grid-template-columns:1fr 1fr;gap:10px}.stat-card{min-height:104px;padding:13px;gap:10px}.stat-icon{width:42px;height:42px;flex-basis:42px;border-radius:13px}.stat-card b{font-size:22px}
    .dashboard-grid{display:grid;grid-template-columns:1fr}.dashboard-grid .span-2,.dashboard-grid .financial-card{grid-column:1}
    .card{padding:15px;border-radius:15px}.filters{align-items:stretch}.filters>*{width:100%!important}.filters>label{min-width:100%}
    .form-grid,.form-grid.three{grid-template-columns:1fr}.form-grid .full{grid-column:1}.sticky-actions{bottom:6px}.sticky-actions .btn{flex:1}
    .details-list{grid-template-columns:1fr}.details-list>div.wide{grid-column:1}.comment-form{grid-template-columns:1fr}
    .backup-actions,.help-grid{grid-template-columns:1fr}.backup-actions .backup-card:last-child{grid-column:1}.support-card{flex-direction:column;align-items:flex-start}
    .login-panel{padding:20px}.login-card h2{font-size:26px}
    .installer-body,.public-body{padding:15px}.installer-hero{align-items:flex-start}.installer-card,.public-form-card{padding:18px}
    .dialog-actions{grid-template-columns:1fr}
    .app-footer{font-size:10px}
}

@media print {
    .sidebar,.topbar,.app-footer,.page-head .head-actions,.filters,.sticky-actions,.no-print{display:none!important}
    .workspace{width:100%;margin:0}.content{max-width:none;padding:0}.card{box-shadow:none;border-color:#bbb;break-inside:avoid}
    body{background:white;color:black;font-size:11px}.page-head{margin-bottom:15px}.page-head h1{font-size:22px}
}
