@font-face {
    font-family: "B Nazanin";
    src: local("B Nazanin"), local("BNazanin"), url("fonts/BNazanin.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: light;
    --navy-950: #081c2c;
    --navy-900: #102a43;
    --navy-800: #173f5f;
    --navy-700: #205472;
    --teal-700: #087267;
    --teal-600: #0f8a7b;
    --teal-500: #18a092;
    --teal-100: #dff4ef;
    --teal-50: #effaf7;
    --ivory: #f6f4ed;
    --ivory-deep: #ece8dc;
    --surface: #ffffff;
    --slate-950: #17232f;
    --slate-800: #34475a;
    --slate-700: #4b5f70;
    --slate-600: #647687;
    --slate-500: #81909e;
    --slate-300: #ced7de;
    --slate-200: #e1e7eb;
    --slate-100: #edf1f3;
    --slate-50: #f7f9fa;
    --gold-600: #a87116;
    --gold-100: #fbefd3;
    --blue-600: #2a72b5;
    --blue-100: #e2effb;
    --red-600: #b74646;
    --red-100: #fbe8e8;
    --amber-600: #a66b08;
    --amber-100: #fff0cc;
    --green-600: #2f7b56;
    --green-100: #def2e7;
    --sidebar-width: 264px;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 42, 67, .04), 0 6px 18px rgba(16, 42, 67, .035);
    --shadow-lg: 0 24px 70px rgba(8, 28, 44, .2);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--ivory);
    color: var(--slate-950);
    font-family: "B Nazanin", "BNazanin", Nazanin, Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .55; }

:focus-visible {
    outline: 3px solid rgba(24, 160, 146, .3);
    outline-offset: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ltr-number { direction: ltr; unicode-bidi: embed; display: inline-block; }
.muted { color: var(--slate-500); }

/* Application shell */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 16px 16px;
    color: rgba(255, 255, 255, .8);
    background:
        radial-gradient(circle at 10% 95%, rgba(24, 160, 146, .18), transparent 34%),
        linear-gradient(170deg, var(--navy-900), var(--navy-950));
    box-shadow: -10px 0 35px rgba(8, 28, 44, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 2px 8px 22px;
    color: #fff;
}

.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 20px; line-height: 1.35; letter-spacing: -.4px; }
.brand small { color: rgba(255, 255, 255, .52); font-size: 10.5px; }

.brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    padding: 9px;
    overflow: hidden;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
    box-shadow: 0 9px 20px rgba(8, 114, 103, .35);
}

.brand-mark::after {
    content: '';
    position: absolute;
    width: 33px; height: 17px;
    top: -9px; left: -7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    transform: rotate(-20deg);
}

.brand-mark i { width: 5px; border-radius: 4px 4px 1px 1px; background: #fff; opacity: .95; }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 13px; }

.nav-label {
    margin: 8px 12px 10px;
    color: rgba(255, 255, 255, .34);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}

.main-nav { display: flex; flex-direction: column; gap: 5px; }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 46px;
    padding: 0 13px;
    border-radius: 11px;
    font-weight: 600;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); transform: translateX(-2px); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(24, 160, 146, .28), rgba(24, 160, 146, .13)); }
.nav-item.is-active::before { content: ''; position: absolute; right: -16px; width: 3px; height: 26px; border-radius: 3px 0 0 3px; background: #47c9b8; }

.nav-icon {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, .68);
    font-size: 18px;
    line-height: 1;
}

.nav-item.is-active .nav-icon { color: #65dccd; background: rgba(255, 255, 255, .07); }
.sidebar-footer { margin-top: auto; padding-top: 28px; }

.sidebar-help {
    display: flex;
    gap: 10px;
    padding: 13px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 13px;
    background: rgba(255, 255, 255, .035);
}

.sidebar-help > div, .company-chip > div { min-width: 0; display: flex; flex-direction: column; }
.sidebar-help strong, .company-chip strong { color: #fff; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-help small, .company-chip small { color: rgba(255, 255, 255, .43); font-size: 9.5px; }
.help-icon { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; color: var(--navy-950); background: #83d9cf; font-weight: 800; }

.company-chip { display: flex; align-items: center; gap: 10px; padding: 11px 8px 4px; }
.company-avatar, .user-avatar { display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #617a8c, #3f5668); font-weight: 800; }
.company-avatar { width: 34px; height: 34px; flex: 0 0 34px; }

.app-main { min-height: 100vh; margin-right: var(--sidebar-width); }

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 34px;
    border-bottom: 1px solid rgba(206, 215, 222, .65);
    background: rgba(246, 244, 237, .9);
    backdrop-filter: blur(16px);
}

.topbar-start, .topbar-actions, .user-menu { display: flex; align-items: center; }
.topbar-start { gap: 13px; }
.topbar-start h1 { margin: 0; font-size: 20px; line-height: 1.25; color: var(--navy-900); }
.topbar-start p { margin: 2px 0 0; color: var(--slate-500); font-size: 11px; }
.topbar-actions { gap: 12px; }

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    color: var(--slate-700);
    background: rgba(255, 255, 255, .62);
}

.notification-button > span { width: 16px; height: 17px; border: 2px solid var(--slate-600); border-radius: 8px 8px 5px 5px; font-size: 0; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border: 2px solid var(--ivory); border-radius: 50%; background: #e05a54; }

.user-menu { gap: 9px; padding-right: 3px; }
.user-avatar { width: 38px; height: 38px; background: linear-gradient(145deg, var(--teal-500), var(--teal-700)); box-shadow: 0 5px 14px rgba(15, 138, 123, .2); }
.user-copy { min-width: 92px; display: flex; flex-direction: column; line-height: 1.35; }
.user-copy strong { font-size: 12.5px; color: var(--navy-900); }
.user-copy small { font-size: 10px; color: var(--slate-500); }
.logout-form { margin: 0; }
.logout-link { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; border-radius: 9px; color: var(--slate-500); font: inherit; font-size: 18px; transition: .18s ease; }
.logout-link:hover { color: var(--red-600); background: var(--red-100); }

.menu-toggle { display: none; padding: 10px; }
.menu-toggle span { width: 18px; height: 2px; margin: 2px 0; border-radius: 2px; background: var(--slate-700); }
.sidebar-backdrop { display: none; }

.page-content { max-width: 1660px; margin: 0 auto; padding: 30px 34px 48px; }

/* Messages and common sections */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px;
    margin-bottom: 20px;
    border: 1px solid #bbdfd2;
    border-radius: 12px;
    color: #245f48;
    background: #ecf8f1;
    box-shadow: var(--shadow-sm);
}

.flash-error { color: #943c3c; border-color: #edc6c6; background: #fdf0f0; }
.flash-symbol { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 50%; color: #fff; background: var(--green-600); font-weight: 800; }
.flash-error .flash-symbol { background: var(--red-600); }
.flash button { margin-right: auto; padding: 2px 7px; border: 0; color: currentColor; background: transparent; font-size: 21px; }
.flash { transition: opacity .18s ease, transform .18s ease; }

.toast-region { position: fixed; z-index: 160; left: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.client-toast { max-width: min(360px, calc(100vw - 40px)); padding: 10px 14px; border: 1px solid var(--slate-200); border-radius: 11px; color: #fff; background: var(--navy-900); box-shadow: 0 12px 34px rgba(8, 28, 44, .22); font-size: 11px; opacity: 0; transform: translateY(8px); transition: .2s ease; }
.client-toast.is-visible { opacity: 1; transform: none; }
.client-toast.toast-error { background: #943f3f; }
.image-unavailable { min-height: 80px; object-fit: contain !important; background: repeating-linear-gradient(135deg, var(--slate-100), var(--slate-100) 8px, var(--slate-50) 8px, var(--slate-50) 16px); }

.welcome-strip, .page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}

.welcome-strip h2, .page-heading h2 { margin-bottom: 5px; color: var(--navy-900); font-size: clamp(23px, 2vw, 30px); line-height: 1.35; letter-spacing: -.45px; }
.welcome-strip p, .page-heading p { margin: 0; color: var(--slate-600); }
.eyebrow { display: block; margin-bottom: 5px; color: var(--teal-700); font-size: 10px; font-weight: 800; letter-spacing: .2px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 700;
    line-height: 1.2;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #fff; border-color: var(--teal-700); background: linear-gradient(145deg, var(--teal-600), var(--teal-700)); box-shadow: 0 8px 18px rgba(15, 138, 123, .17); }
.button-primary:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(15, 138, 123, .25); }
.button-secondary { color: var(--navy-800); border-color: #c8d5dc; background: rgba(255, 255, 255, .7); }
.button-secondary:hover:not(:disabled) { border-color: #99adb9; background: #fff; }
.button-ghost { color: var(--slate-700); border-color: var(--slate-200); background: transparent; }
.button-ghost:hover:not(:disabled) { background: var(--slate-50); }
.button-small { min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 12px; }

.panel {
    border: 1px solid rgba(206, 215, 222, .8);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .84);
    box-shadow: var(--shadow-sm);
}

.panel-header, .panel-toolbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--slate-100);
}

.panel-header h2, .panel-toolbar h2 { margin: 0 0 2px; color: var(--navy-900); font-size: 16px; }
.panel-header p, .panel-toolbar p { margin: 0; color: var(--slate-500); font-size: 11px; }
.text-link { color: var(--teal-700); font-size: 12px; font-weight: 700; }
.text-link:hover { color: var(--teal-500); }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }

.stat-card {
    position: relative;
    min-height: 154px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(206, 215, 222, .82);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-sm);
}

.stat-card::after { content: ''; position: absolute; width: 80px; height: 80px; left: -30px; bottom: -35px; border-radius: 50%; background: rgba(15, 138, 123, .04); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--teal-700); background: var(--teal-100); font-size: 18px; font-weight: 800; }
.stat-expense .stat-icon { color: var(--red-600); background: var(--red-100); }
.stat-people .stat-icon { color: var(--blue-600); background: var(--blue-100); }
.stat-pending .stat-icon { color: var(--amber-600); background: var(--amber-100); }
.stat-card > p { margin: 0 0 2px; color: var(--slate-600); font-size: 11.5px; }
.stat-card > strong { display: block; margin-bottom: 1px; color: var(--navy-900); font-size: clamp(19px, 2vw, 25px); line-height: 1.45; letter-spacing: -.4px; }
.stat-card > strong small { font-size: 11px; font-weight: 500; color: var(--slate-500); }
.stat-card > small { color: var(--slate-500); font-size: 9.5px; }
.stat-card > a { position: relative; z-index: 1; color: var(--teal-700); font-size: 10px; font-weight: 700; }

.trend { padding: 3px 7px; border-radius: 15px; font-size: 9px; font-weight: 800; }
.trend-up { color: var(--green-600); background: var(--green-100); }
.trend-down { color: var(--red-600); background: var(--red-100); }
.trend-warning { color: var(--amber-600); background: var(--amber-100); }
.trend-neutral { color: var(--slate-600); background: var(--slate-100); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(270px, .8fr); gap: 18px; }
.recent-panel, .quick-panel { min-width: 0; }

.quick-actions { padding: 8px 14px 15px; }
.quick-actions button, .quick-actions a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--slate-100); text-align: right; color: var(--slate-800); background: transparent; }
.quick-actions button:last-child, .quick-actions a:last-child { border-bottom: 0; }
.quick-actions button:hover, .quick-actions a:hover { color: var(--teal-700); }
.quick-actions > * > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.quick-actions strong { font-size: 12px; }
.quick-actions small { color: var(--slate-500); font-size: 9.5px; }
.quick-actions i { color: var(--slate-300); font-style: normal; font-size: 17px; }
.quick-icon { width: 34px; height: 34px; display: grid !important; place-items: center; flex: 0 0 34px !important; border-radius: 10px; font-size: 16px; font-weight: 700; }
.quick-icon.is-teal, .summary-icon.is-teal { color: var(--teal-700); background: var(--teal-100); }
.quick-icon.is-blue, .summary-icon.is-blue { color: var(--blue-600); background: var(--blue-100); }
.quick-icon.is-gold, .summary-icon.is-gold { color: var(--gold-600); background: var(--gold-100); }
.quick-icon.is-slate { color: var(--slate-700); background: var(--slate-100); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 11px 17px; text-align: right; color: var(--slate-500); background: rgba(247, 249, 250, .7); font-size: 10px; font-weight: 700; }
.data-table td { padding: 13px 17px; border-top: 1px solid var(--slate-100); color: var(--slate-700); font-size: 11.5px; vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(239, 250, 247, .45); }
.roomy-table td { padding-top: 15px; padding-bottom: 15px; }

.transaction-title, .person-cell { display: flex; align-items: center; gap: 10px; }
.transaction-title > span:last-child, .person-cell > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.transaction-title strong, .person-cell strong { max-width: 240px; overflow: hidden; color: var(--slate-800); font-size: 11.5px; text-overflow: ellipsis; }
.transaction-title small, .person-cell small { color: var(--slate-500); font-size: 9.5px; }
.transaction-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 31px; border-radius: 9px; font-size: 16px; font-weight: 800; }
.transaction-icon.is-fund { color: var(--green-600); background: var(--green-100); }
.transaction-icon.is-expense { color: var(--red-600); background: var(--red-100); }
.person-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; border: 1px solid #cae4df; border-radius: 11px; color: var(--teal-700); background: var(--teal-50); font-weight: 800; }
.amount { direction: ltr; text-align: right; font-weight: 800; }
.amount-positive { color: var(--green-600) !important; }
.amount-negative { color: var(--red-600) !important; }
.balance-value { color: var(--navy-800); font-size: 12px; }
.balance-value small { color: var(--slate-500); font-size: 9px; font-weight: 500; }
.balance-value.is-negative { color: var(--red-600); }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 15px; color: var(--slate-600); background: var(--slate-100); font-size: 9px; font-weight: 800; }
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-approved, .status-active, .status-paid { color: var(--green-600); background: var(--green-100); }
.status-pending, .status-submitted, .status-draft { color: var(--amber-600); background: var(--amber-100); }
.status-rejected, .status-inactive { color: var(--red-600); background: var(--red-100); }

.row-actions { text-align: left; }
.mini-action { padding: 5px 8px; border: 1px solid #beded9; border-radius: 8px; color: var(--teal-700); background: var(--teal-50); font-size: 9.5px; font-weight: 700; }
.icon-more { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--slate-500); font-size: 18px; }
.icon-more:hover { background: var(--slate-100); }
.approval-actions { display: flex; justify-content: flex-end; gap: 4px; }
.approval-actions form { margin: 0; }
.approve-button, .reject-button { width: 29px; height: 29px; padding: 0; border: 0; border-radius: 8px; font-weight: 900; }
.approve-button { color: var(--green-600); background: var(--green-100); }
.reject-button { color: var(--red-600); background: var(--red-100); }
.location-cell { display: inline-flex; align-items: center; gap: 6px; }
.location-cell i { color: var(--slate-500); font-style: normal; }

.receipt-mini { position: relative; width: 36px; height: 36px; padding: 0; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 8px; background: var(--slate-100); }
.receipt-mini img { width: 100%; height: 100%; object-fit: cover; }
.receipt-mini span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(8, 28, 44, .55); opacity: 0; transition: opacity .15s; }
.receipt-mini:hover span { opacity: 1; }

/* Toolbars and summaries */
.summary-band { display: flex; align-items: center; gap: 26px; padding: 16px 20px; margin-bottom: 18px; border: 1px solid rgba(206, 215, 222, .8); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .68); box-shadow: var(--shadow-sm); }
.summary-band > div { display: flex; align-items: center; gap: 10px; }
.summary-band > i { width: 1px; height: 34px; background: var(--slate-200); }
.summary-band > div > span:last-child { display: flex; flex-direction: column; }
.summary-band small { color: var(--slate-500); font-size: 9.5px; }
.summary-band strong { color: var(--navy-900); font-size: 13px; }
.summary-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 17px; font-style: normal; }

.toolbar-controls { display: flex; align-items: center; gap: 8px; }
.search-box { min-width: 240px; min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--slate-200); border-radius: 10px; color: var(--slate-500); background: #fff; }
.search-box:focus-within { border-color: #8ac9c1; box-shadow: 0 0 0 3px rgba(15, 138, 123, .08); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--slate-800); background: transparent; font-size: 11.5px; }
.table-empty-filter { margin: 0; padding: 25px; text-align: center; color: var(--slate-500); }

.filter-panel { margin-bottom: 17px; }
.filter-form { display: flex; align-items: flex-end; gap: 9px; padding: 15px; flex-wrap: wrap; }
.filter-search { min-width: min(320px, 100%); min-height: 40px; flex: 1; }
.compact-field { display: flex; flex-direction: column; gap: 3px; }
.compact-field > span { color: var(--slate-500); font-size: 9px; font-weight: 700; }
.compact-field select, .compact-field input { min-width: 135px; height: 40px; padding: 0 10px; border: 1px solid var(--slate-200); border-radius: 10px; outline: 0; color: var(--slate-700); background: #fff; font-size: 10.5px; }
.compact-field select:focus, .compact-field input:focus { border-color: #8ac9c1; box-shadow: 0 0 0 3px rgba(15, 138, 123, .08); }
.clear-filter { min-height: 36px; display: inline-flex; align-items: center; padding: 7px; color: var(--red-600); font-size: 10px; font-weight: 700; }

/* Standalone Persian date picker */
.jalali-date-control {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
}
.jalali-date-control.is-compact { min-width: 158px; }
.field .jalali-date-display,
.compact-field .jalali-date-display {
    width: 100%;
    padding-left: 42px;
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: right;
    cursor: pointer;
    caret-color: transparent;
}
.jalali-date-control.has-value .jalali-date-display { padding-left: 70px; }
.jalali-date-display[readonly] { color: var(--navy-800); background: #fff; }
.jalali-date-display::placeholder { direction: rtl; color: var(--slate-500); text-align: right; }
.jalali-date-open,
.jalali-date-clear {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    transform: translateY(-50%);
}
.jalali-date-open {
    left: 5px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--teal-700);
    background: var(--teal-50);
    font-size: 17px;
}
.jalali-date-open:hover { background: var(--teal-100); }
.jalali-date-clear {
    left: 40px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: var(--slate-500);
    background: var(--slate-100);
    font-size: 16px;
}
.jalali-date-clear:hover { color: var(--red-600); background: var(--red-100); }
.jalali-date-clear[hidden] { display: none; }

.jalali-picker-layer[hidden] { display: none; }
.jalali-picker-layer {
    position: fixed;
    z-index: 180;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 28, 44, .67);
    backdrop-filter: blur(7px);
}
.jalali-picker {
    width: min(390px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modal-in .18s ease both;
}
.jalali-picker-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 13px;
    border-bottom: 1px solid var(--slate-100);
}
.jalali-picker-heading h2 { margin: 1px 0 0; color: var(--navy-900); font-size: 18px; }
.jalali-picker-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    color: var(--slate-600);
    background: var(--slate-50);
    font-size: 20px;
}
.jalali-picker-navigation {
    display: grid;
    grid-template-columns: 36px minmax(112px, 1fr) minmax(92px, .75fr) 36px;
    gap: 7px;
    padding: 14px 18px 11px;
}
.jalali-picker-navigation button,
.jalali-picker-navigation select {
    height: 38px;
    min-width: 0;
    padding: 0 8px;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    outline: 0;
    color: var(--navy-800);
    background: #fff;
    font-size: 11px;
    font-weight: 700;
}
.jalali-picker-navigation button { padding: 0; color: var(--teal-700); background: var(--teal-50); font-size: 21px; }
.jalali-picker-navigation button:hover { background: var(--teal-100); }
.jalali-picker-navigation select:focus { border-color: #78bfb6; box-shadow: 0 0 0 3px rgba(15, 138, 123, .08); }
.jalali-weekdays,
.jalali-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    direction: rtl;
}
.jalali-weekdays { padding: 0 18px 5px; color: var(--slate-500); text-align: center; font-size: 10px; font-weight: 800; }
.jalali-weekdays span:last-child { color: var(--red-600); }
.jalali-days { gap: 3px; padding: 0 18px 14px; }
.jalali-day-spacer,
.jalali-day { aspect-ratio: 1; min-height: 38px; }
.jalali-day {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--slate-800);
    background: transparent;
    font-size: 11.5px;
    font-weight: 700;
}
.jalali-day:hover { border-color: #b9ddd8; color: var(--teal-700); background: var(--teal-50); }
.jalali-day.is-today { border-color: var(--teal-500); color: var(--teal-700); }
.jalali-day.is-today::after { content: ''; position: absolute; right: 50%; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateX(50%); }
.jalali-day.is-selected,
.jalali-day.is-selected:hover { border-color: var(--teal-700); color: #fff; background: var(--teal-700); box-shadow: 0 5px 13px rgba(8, 114, 103, .22); }
.jalali-picker-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--slate-100);
}
.jalali-picker-clear { margin-left: auto; padding: 6px 4px; border: 0; color: var(--red-600); background: transparent; font-size: 10px; font-weight: 700; }
.jalali-picker-clear[hidden] { display: none; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 310px; padding: 45px 20px; text-align: center; }
.compact-empty { min-height: 230px; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 17px; color: var(--teal-700); background: var(--teal-100); font-size: 25px; }
.empty-state h3 { margin-bottom: 4px; color: var(--navy-900); font-size: 15px; }
.empty-state p { max-width: 380px; margin-bottom: 15px; color: var(--slate-500); font-size: 11px; }

/* Forms and modals */
.modal[hidden], .lightbox[hidden] { display: none; }
.modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 28, 44, .62);
    backdrop-filter: blur(7px);
}

.modal-panel { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid rgba(255, 255, 255, .6); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg); animation: modal-in .22s ease both; }
.modal-wide .modal-panel { width: min(920px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(13px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-header { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid var(--slate-100); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 0 0 3px; color: var(--navy-900); font-size: 19px; }
.modal-header p { max-width: 580px; margin: 0; color: var(--slate-500); font-size: 10.5px; }
.modal-close { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 1px solid var(--slate-200); border-radius: 10px; color: var(--slate-600); background: var(--slate-50); font-size: 21px; }
.modal-body { padding: 20px 22px 22px; }

.stack-form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: var(--slate-700); }
.field > span:first-child { font-size: 10.5px; font-weight: 700; }
.field b { color: var(--red-600); }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--slate-200); border-radius: 10px; outline: 0; color: var(--slate-800); background: #fbfcfc; font-size: 12px; transition: border .15s, box-shadow .15s, background .15s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #78bfb6; background: #fff; box-shadow: 0 0 0 3px rgba(15, 138, 123, .08); }
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid { border-color: #d98787; box-shadow: 0 0 0 3px rgba(183, 70, 70, .07); }
.field-hint { color: var(--slate-500); font-size: 9px; }
.field-hint.is-warning { color: var(--amber-600); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 17px; border-top: 1px solid var(--slate-100); }
.expense-form-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 20px; }

.upload-card { display: flex; flex-direction: column; gap: 9px; }
.receipt-dropzone { position: relative; min-height: 330px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; padding: 20px; overflow: hidden; border: 1.5px dashed #a9c8c4; border-radius: 14px; text-align: center; color: var(--slate-500); background: var(--teal-50); cursor: pointer; transition: border .18s, background .18s; }
.receipt-dropzone:hover, .receipt-dropzone.is-dragover { border-color: var(--teal-600); background: #e6f7f3; }
.receipt-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.receipt-dropzone strong { color: var(--navy-800); font-size: 12px; }
.receipt-dropzone > span { font-size: 9.5px; }
.receipt-dropzone em { margin-top: 7px; padding: 6px 12px; border: 1px solid #add2cc; border-radius: 8px; color: var(--teal-700); background: #fff; font-size: 10px; font-style: normal; font-weight: 700; }
.receipt-dropzone small { max-width: 90%; overflow: hidden; color: var(--teal-700); text-overflow: ellipsis; white-space: nowrap; }
.upload-illustration { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 15px; color: var(--teal-700); background: #d4eee8; font-size: 24px !important; }
.receipt-dropzone img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); border-radius: 10px; object-fit: contain; background: #fff; }
.receipt-dropzone.has-preview > :not(input):not(img):not(small) { opacity: 0; }
.receipt-dropzone.has-preview small { position: absolute; z-index: 2; right: 12px; bottom: 12px; left: 12px; padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(8, 28, 44, .72); }
.upload-tip { display: flex; gap: 6px; margin: 0; color: var(--slate-500); font-size: 9px; }
.upload-tip span { width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 17px; border-radius: 50%; color: var(--blue-600); background: var(--blue-100); font-size: 9px; font-weight: 800; }

/* Users and access control */
.user-access-guide { margin-bottom: 17px; }
.access-role-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 15px 18px 18px; }
.access-role-list > div { min-width: 0; display: flex; align-items: flex-start; flex-direction: column; gap: 7px; padding: 11px; border: 1px solid var(--slate-200); border-radius: 11px; background: var(--slate-50); }
.access-role-list small { color: var(--slate-500); font-size: 9px; line-height: 1.7; }
.role-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 15px; color: var(--slate-700); background: var(--slate-100); font-size: 9px; font-weight: 800; }
.role-admin { color: #765315; background: var(--gold-100); }
.role-accountant { color: var(--blue-600); background: var(--blue-100); }
.role-approver { color: #74508c; background: #f1e7f6; }
.role-custodian { color: var(--teal-700); background: var(--teal-100); }
.role-viewer { color: var(--slate-600); background: var(--slate-100); }
.credential-value { color: var(--navy-800); font-size: 11px; }
.linked-holder { display: inline-flex; align-items: center; gap: 5px; color: var(--teal-700); font-size: 10.5px; font-weight: 700; }
.linked-holder > span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; background: var(--teal-100); }
.user-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.mini-action-secondary { color: var(--slate-600); border-color: var(--slate-200); background: var(--slate-50); }
.modal-user-name { color: var(--teal-700); }
.compact-password input { min-height: 43px; padding-right: 38px; }
.checkbox-field { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 11px; color: var(--slate-700); background: var(--slate-50); cursor: pointer; }
.checkbox-field input[type="hidden"] { display: none; }
.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--teal-700); }
.checkbox-field > span { display: flex; flex-direction: column; }
.checkbox-field strong { color: var(--slate-800); font-size: 10.5px; }
.checkbox-field small { color: var(--slate-500); font-size: 9px; }
.user-access-note { margin: -4px 0 0; }
.field.is-context-disabled { opacity: .58; }

/* Receipts gallery */
.view-note { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-500); font-size: 9.5px; }
.view-note span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--blue-600); background: var(--blue-100); font-size: 9px; font-weight: 800; }
.receipts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.receipt-card { min-width: 0; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 14px; background: #fff; transition: transform .18s, box-shadow .18s; }
.receipt-card:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(16, 42, 67, .1); }
.receipt-image { position: relative; width: 100%; height: 210px; display: block; padding: 0; overflow: hidden; border: 0; background: #e9ecea; }
.receipt-image > img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.receipt-card:hover .receipt-image > img { transform: scale(1.025); }
.image-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(8, 28, 44, .52); font-size: 11px; font-weight: 700; opacity: 0; transition: opacity .18s; }
.receipt-image:hover .image-overlay { opacity: 1; }
.receipt-number { position: absolute; top: 10px; right: 10px; padding: 3px 7px; border-radius: 7px; color: #fff; background: rgba(8, 28, 44, .72); font-size: 9px; }
.pdf-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--red-600); background: linear-gradient(145deg, #fdf4f4, #e8ecef); }
.pdf-placeholder strong { font-size: 28px; letter-spacing: 1px; }
.pdf-placeholder small { color: var(--slate-500); }
.receipt-body { padding: 14px; }
.receipt-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--slate-100); }
.receipt-title-row > div { min-width: 0; }
.receipt-title-row h3 { margin: 0; overflow: hidden; color: var(--navy-900); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-title-row p { margin: 1px 0 0; overflow: hidden; color: var(--slate-500); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.receipt-meta div { min-width: 0; }
.receipt-meta dt { color: var(--slate-500); font-size: 8.5px; }
.receipt-meta dd { margin: 0; overflow: hidden; color: var(--slate-700); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-meta .receipt-amount { color: var(--navy-800); font-weight: 800; }
.download-link { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #bcded9; border-radius: 9px; color: var(--teal-700); background: var(--teal-50); font-size: 10px; font-weight: 700; }
.download-link:hover { border-color: var(--teal-500); }

.lightbox { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 45px; background: rgba(3, 15, 24, .9); backdrop-filter: blur(10px); }
.lightbox > button { position: absolute; top: 18px; left: 22px; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, .24); border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .08); font-size: 24px; }
.lightbox figure { width: min(880px, 100%); height: min(78vh, 900px); display: flex; align-items: center; flex-direction: column; margin: 0; }
.lightbox img, .lightbox iframe { width: 100%; min-height: 0; flex: 1; object-fit: contain; border: 0; border-radius: 8px; background: #fff; }
.lightbox figcaption { padding-top: 10px; color: rgba(255, 255, 255, .7); font-size: 11px; }

/* Reports */
.report-stats .stat-card { min-height: 135px; }
.reports-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; }
.bar-chart { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.bar-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--slate-700); font-size: 10.5px; }
.bar-label > span { display: flex; align-items: center; gap: 7px; }
.bar-label strong { color: var(--navy-800); font-size: 10.5px; }
.chart-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-600); }
.bar-track { height: 8px; overflow: hidden; border-radius: 6px; background: var(--slate-100); }
.bar-fill { width: var(--bar-size); height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--teal-700), var(--teal-500)); }
.fill-2, .dot-2 { background: #4b83b8; }
.fill-3, .dot-3 { background: #c89135; }
.fill-4, .dot-4 { background: #9a6db3; }
.fill-5, .dot-5 { background: #dc7164; }
.fill-6, .dot-6 { background: #698779; }
.rank-list { margin: 0; padding: 7px 17px 14px; list-style: none; }
.rank-list li { display: flex; align-items: center; gap: 8px; min-height: 60px; border-bottom: 1px solid var(--slate-100); }
.rank-list li:last-child { border-bottom: 0; }
.rank-number { width: 18px; color: var(--slate-500); text-align: center; font-size: 10px; font-weight: 800; }
.small-avatar { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; font-size: 10px; }
.rank-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.rank-copy strong { color: var(--slate-800); font-size: 10.5px; }
.rank-copy small { color: var(--slate-500); font-size: 8.5px; }
.rank-amount { color: var(--navy-800); font-size: 10px; text-align: left; }
.rank-amount small { color: var(--slate-500); font-size: 8px; font-weight: 500; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: 98px; padding: 8px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 10px; color: var(--slate-600); }
.settings-nav a:hover, .settings-nav a.is-active { color: var(--teal-700); background: var(--teal-50); }
.settings-nav a > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 8px; background: var(--slate-100); }
.settings-nav a.is-active > span:first-child { background: var(--teal-100); }
.settings-nav a > span:last-child { display: flex; flex-direction: column; }
.settings-nav strong { font-size: 10.5px; }
.settings-nav small { color: var(--slate-500); font-size: 8.5px; }
.settings-content { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.settings-section { scroll-margin-top: 98px; }
.settings-form { padding: 17px 20px 14px; }
.settings-form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; padding: 12px 20px; }
.detail-grid div { padding: 13px 0; border-bottom: 1px solid var(--slate-100); }
.detail-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-grid dt { color: var(--slate-500); font-size: 9px; }
.detail-grid dd { margin: 2px 0 0; color: var(--navy-800); font-size: 12px; font-weight: 700; }
.info-callout { display: flex; align-items: flex-start; gap: 8px; margin: 0 20px 18px; padding: 11px 12px; border: 1px solid #c9e0ed; border-radius: 10px; color: #426b81; background: #edf7fc; }
.info-callout span { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 19px; border-radius: 50%; color: #fff; background: var(--blue-600); font-size: 9px; font-weight: 800; }
.info-callout p { margin: 0; font-size: 9.5px; }
.count-pill { padding: 4px 8px; border-radius: 14px; color: var(--teal-700); background: var(--teal-100); font-size: 9px; font-weight: 700; }
.category-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 0; padding: 10px 20px 18px; list-style: none; }
.category-list li { display: flex; align-items: center; gap: 9px; min-height: 59px; border-bottom: 1px solid var(--slate-100); }
.category-list li > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.category-list strong { color: var(--slate-800); font-size: 10.5px; }
.category-list small { color: var(--slate-500); font-size: 8.5px; }
.category-list em { padding: 3px 6px; border-radius: 10px; color: var(--slate-500); background: var(--slate-100); font-size: 8px; font-style: normal; }
.category-symbol { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 9px; color: var(--teal-700); background: var(--teal-100); font-size: 9px; font-weight: 800; }
.symbol-2 { color: var(--blue-600); background: var(--blue-100); }
.symbol-3 { color: var(--gold-600); background: var(--gold-100); }
.symbol-4 { color: #7e539a; background: #f1e7f6; }
.symbol-5 { color: var(--red-600); background: var(--red-100); }
.symbol-6 { color: var(--slate-700); background: var(--slate-100); }
.system-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 20px 20px; }
.system-status-grid > div { position: relative; display: flex; align-items: center; gap: 9px; min-height: 69px; padding: 11px; border: 1px solid var(--slate-200); border-radius: 11px; background: var(--slate-50); }
.system-status-grid > div > span:nth-child(2) { display: flex; flex-direction: column; }
.system-status-grid small { color: var(--slate-500); font-size: 8.5px; }
.system-status-grid strong { color: var(--slate-800); font-size: 10px; }
.system-status-grid i { position: absolute; top: 8px; left: 8px; color: var(--green-600); font-size: 8px; font-style: normal; }
.system-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 31px; border-radius: 9px; color: var(--blue-600); background: var(--blue-100); font-size: 8px; font-weight: 900; }
.system-icon.is-ok { color: var(--green-600); background: var(--green-100); font-size: 14px; }

/* Login */
.auth-body { min-height: 100vh; background: #f7f5ef; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) minmax(480px, 56%); }
.auth-brand-panel { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: clamp(32px, 5vw, 68px); color: #fff; background: radial-gradient(circle at 16% 85%, rgba(24, 160, 146, .34), transparent 31%), radial-gradient(circle at 82% 8%, rgba(89, 157, 174, .2), transparent 24%), linear-gradient(155deg, #153d57, #081c2c 75%); }
.auth-brand-panel::before { content: ''; position: absolute; width: 440px; height: 440px; top: 38%; right: 44%; border: 1px solid rgba(255, 255, 255, .045); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255, 255, 255, .018), 0 0 0 140px rgba(255, 255, 255, .012); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand > span:last-child { display: flex; flex-direction: column; }
.auth-brand strong { font-size: 21px; }
.auth-brand small { color: rgba(255, 255, 255, .52); font-size: 10px; }
.large-mark { width: 45px; height: 45px; flex-basis: 45px; }
.auth-message { position: relative; z-index: 1; max-width: 510px; margin: auto 0 32px; }
.light-eyebrow { color: #70ded0; }
.auth-message h1 { margin-bottom: 18px; font-size: clamp(37px, 4.3vw, 61px); line-height: 1.28; letter-spacing: -1.8px; }
.auth-message p { max-width: 470px; color: rgba(255, 255, 255, .65); font-size: 13px; line-height: 2; }
.auth-benefits { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; margin: 0 0 35px; padding: 0; list-style: none; color: rgba(255, 255, 255, .78); font-size: 11.5px; }
.auth-benefits li { display: flex; align-items: center; gap: 8px; }
.auth-benefits span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #72d7cb; background: rgba(24, 160, 146, .16); font-size: 10px; }
.auth-copyright { position: relative; z-index: 1; color: rgba(255, 255, 255, .3); font-size: 9px; }
.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(430px, 100%); }
.auth-card header { margin-bottom: 27px; }
.auth-card h2 { margin: 0 0 7px; color: var(--navy-900); font-size: 28px; line-height: 1.45; }
.auth-card header p { margin: 0; color: var(--slate-500); font-size: 11.5px; }
.auth-mobile-brand { display: none; }
.auth-error { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin-bottom: 18px; border: 1px solid #efcaca; border-radius: 10px; color: #963f3f; background: #fdf0f0; }
.auth-error span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 23px; border-radius: 50%; color: #fff; background: var(--red-600); font-weight: 900; }
.auth-error p { margin: 0; font-size: 10.5px; }
.auth-form { display: flex; flex-direction: column; gap: 17px; }
.auth-form .field > span:first-child { font-size: 11px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon input { min-height: 49px; padding-right: 40px; padding-left: 65px; background: #fff; }
.input-with-icon i { position: absolute; z-index: 2; right: 13px; width: 19px; color: var(--slate-500); text-align: center; font-style: normal; font-weight: 700; }
.input-with-icon button { position: absolute; z-index: 2; left: 8px; padding: 5px 7px; border: 0; border-radius: 7px; color: var(--teal-700); background: var(--teal-50); font-size: 9px; font-weight: 700; }
.auth-submit { width: 100%; min-height: 50px; margin-top: 5px; font-size: 12.5px; }
.auth-submit span { margin-right: auto; font-size: 18px; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 18px 0 0; color: var(--slate-500); font-size: 9px; }
.auth-security span { color: var(--green-600); }

/* Responsive */
@media (max-width: 1220px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-status-grid { grid-template-columns: 1fr; }
    .access-role-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    .dashboard-grid, .reports-grid { grid-template-columns: 1fr; }
    .quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
    .filter-search { flex-basis: 100%; }
}

@media (max-width: 940px) {
    .sidebar { transform: translateX(105%); transition: transform .25s ease; }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; background: rgba(8, 28, 44, .55); opacity: 0; transition: .25s; }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .app-main { margin-right: 0; }
    .menu-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .topbar { padding: 0 22px; }
    .page-content { padding-right: 22px; padding-left: 22px; }
    .settings-layout { grid-template-columns: 1fr; }
    .access-role-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-nav { position: static; display: flex; overflow-x: auto; }
    .settings-nav a { min-width: 190px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; background: radial-gradient(circle at 10% 10%, rgba(15, 138, 123, .1), transparent 24%), var(--ivory); }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 45px; color: var(--navy-900); font-size: 18px; }
}

@media (max-width: 760px) {
    .topbar { height: 68px; padding: 0 15px; }
    .topbar-start h1 { font-size: 16px; }
    .topbar-start p, .user-copy { display: none; }
    .user-menu { gap: 5px; }
    .user-avatar { width: 35px; height: 35px; }
    .notification-button { display: none; }
    .page-content { padding: 21px 14px 36px; }
    .welcome-strip, .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
    .welcome-strip h2, .page-heading h2 { font-size: 23px; }
    .page-actions, .page-heading > .button { width: 100%; }
    .page-actions .button { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 145px; padding: 14px; }
    .stat-card > strong { font-size: 19px; }
    .panel-header, .panel-toolbar { align-items: flex-start; flex-direction: column; padding: 15px; }
    .toolbar-controls { width: 100%; }
    .search-box { min-width: 0; flex: 1; }
    .summary-band { align-items: stretch; flex-direction: column; gap: 12px; }
    .summary-band > i { width: 100%; height: 1px; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table { white-space: normal; }
    .data-table tbody { padding: 5px 12px 13px; }
    .data-table tr { margin-top: 10px; padding: 8px 11px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
    .data-table td { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px dashed var(--slate-200); text-align: left; }
    .data-table tr td:first-child { border-top: 0; }
    .data-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--slate-500); font-size: 9px; font-weight: 600; }
    .data-table td:first-child::before { display: none; }
    .data-table td:first-child { justify-content: flex-start; }
    .transaction-title { width: 100%; }
    .transaction-title > span:last-child { flex: 1; text-align: right; }
    .person-cell { margin-right: auto; }
    .row-actions { justify-content: flex-end !important; }
    .user-row-actions { margin-right: auto; flex-wrap: wrap; }
    .approval-actions { margin-right: auto; }
    .quick-actions { grid-template-columns: 1fr; }
    .filter-form { align-items: stretch; flex-direction: column; }
    .filter-search, .compact-field, .compact-field select, .compact-field input, .compact-field .jalali-date-control, .filter-form .button { width: 100%; }
    .receipts-grid { grid-template-columns: 1fr; padding: 12px; }
    .receipt-image { height: 260px; }
    .expense-form-layout { grid-template-columns: 1fr; }
    .receipt-dropzone { min-height: 240px; }
    .modal { align-items: end; padding: 0; }
    .modal-panel { width: 100% !important; max-height: 93vh; border-radius: 20px 20px 0 0; }
    .modal-header, .modal-body { padding-right: 16px; padding-left: 16px; }
    .modal-actions { position: sticky; z-index: 3; bottom: -22px; margin-right: -16px; margin-left: -16px; padding: 13px 16px 18px; background: #fff; }
    .report-filter { display: grid; grid-template-columns: 1fr 1fr; }
    .report-filter .button { grid-column: 1 / -1; }
    .category-list { grid-template-columns: 1fr; }
    .access-role-list { grid-template-columns: 1fr; padding: 12px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid div:nth-last-child(2) { border-bottom: 1px solid var(--slate-100); }
    .lightbox { padding: 60px 12px 25px; }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 137px; }
    .page-actions { flex-direction: column; }
    .page-actions .button { width: 100%; }
    .two-columns { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
    .toolbar-controls { align-items: stretch; flex-direction: column; }
    .summary-band { padding: 14px; }
    .receipt-image { height: 220px; }
    .receipt-meta { grid-template-columns: 1fr; }
    .report-filter { grid-template-columns: 1fr; }
    .report-filter .button { grid-column: auto; }
    .auth-form-panel { padding: 25px 18px; }
    .jalali-picker-layer { align-items: end; padding: 0; }
    .jalali-picker { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
    .jalali-picker-heading, .jalali-picker-navigation, .jalali-picker-actions { padding-right: 15px; padding-left: 15px; }
    .jalali-weekdays, .jalali-days { padding-right: 15px; padding-left: 15px; }
    .jalali-day-spacer, .jalali-day { min-height: 40px; }
    .auth-mobile-brand { margin-bottom: 35px; }
    .auth-card h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
