@font-face {
    font-family: "Vazirmatn";
    src: url("../lib/vazirmatn/Vazirmatn-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ink: #1d2433;
    --muted: #6b7385;
    --line: #e4e7ee;
    --paper: #f5f6f9;
    --panel: #ffffff;
    --brand: #23395b;
    --brand-2: #c08a2e;
    --pos: #1c7c54;
    --neg: #b3362f;

    --bs-body-font-family: "Vazirmatn", Tahoma, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 35, 57, 91;
    --bs-border-color: var(--line);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 35, 57, 91;
}

body {
    font-family: var(--bs-body-font-family);
    background: var(--paper);
    color: var(--ink);
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #1a2c47;
    --bs-btn-hover-border-color: #1a2c47;
    --bs-btn-active-bg: #142238;
    --bs-btn-active-border-color: #142238;
}

.form-control, .form-select { background-color: #fff; }

.form-control:focus, .form-select:focus {
    border-color: #7f93b3;
    box-shadow: 0 0 0 .2rem rgba(35, 57, 91, .15);
}

/* Numbers and dates keep a stable left-to-right shape inside RTL text. */
.num {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

td.num, th.num { unicode-bidi: plaintext; }

/* Header */
.app-header {
    background: var(--brand);
    border-bottom: 3px solid var(--brand-2);
}

.app-header .navbar-brand {
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.app-header .nav-link {
    white-space: nowrap;
    color: rgba(255, 255, 255, .75);
    border-radius: .375rem;
    padding: .4rem .75rem !important;
}

.app-header .nav-link:hover { color: #fff; }

.app-header .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.app-header .navbar-toggler {
    border-color: rgba(255, 255, 255, .4);
    filter: invert(1);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: var(--brand-2);
    color: #fff;
    font-weight: 800;
    font-family: Georgia, serif;
}

.brand-mark-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
}

.role-badge {
    font-size: .75rem;
    font-weight: 500;
    padding: .1rem .5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .15);
}

/* Page structure */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: 1.5rem;
    overflow: hidden;
}

.panel-title {
    font-weight: 700;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line);
}

.form-panel { max-width: 760px; }

.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
}

.hint {
    font-size: .875rem;
    color: var(--muted);
    background: #fff8ea;
    border: 1px solid #f0dfb8;
    border-radius: .5rem;
    padding: .75rem 1rem;
}

/* Tables */
.table { --bs-table-bg: transparent; margin: 0; }

.table thead th {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    background: #fafbfc;
    white-space: nowrap;
}

.table td, .table th { padding: .7rem 1rem; }

.table tfoot th { background: #fafbfc; }

.desc {
    max-width: 280px;
    color: var(--muted);
    font-size: .875rem;
}

.report-table .old { color: var(--neg); text-decoration: line-through; }
.report-table .new { color: var(--pos); font-weight: 600; }

/* Filter */
.filter-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.filter-bar .date-input { width: 15rem; max-width: 100%; }

.date-input { direction: ltr; text-align: right; }

/* In-page filter of the income/expense lists: a toolbar on top of the table panel. */
.panel > .list-filter {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    margin: 0;
    background: #fafbfc;
}

.list-filter .amount-input {
    width: 9rem;
    font-size: 1rem;
    font-weight: 400;
}

.list-filter .search-input { width: 14rem; max-width: 100%; }

.list-sum { white-space: nowrap; }
.list-sum strong { font-size: 1.1rem; }

.amount-input {
    direction: ltr;
    text-align: right;
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Report */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: .5rem;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: 1rem 1.25rem;
}

.stat-strong { border-top: 3px solid var(--brand-2); }

.stat-label { color: var(--muted); font-size: .875rem; margin-bottom: .35rem; }

.stat-value { font-size: 1.6rem; font-weight: 700; text-align: right; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

.share-bar {
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    margin-top: .35rem;
    overflow: hidden;
}

.share-bar span {
    display: block;
    height: 100%;
    background: var(--brand-2);
    margin-inline-start: 0;
}

/* Details & login */
.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .5rem 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; }

.login-wrap {
    min-height: calc(100vh - 6rem);
    display: grid;
    place-items: center;
}

.login-panel { width: 100%; max-width: 380px; }

/* Date picker uses the page font */
jdp-container { font-family: var(--bs-body-font-family); }

/* Daily report: amounts inside .privacy.masked show as ***** until the eye button is pressed. */
.privacy .mask { display: none; letter-spacing: .1em; color: var(--muted); }
.privacy.masked .mask { display: inline; }
.privacy.masked .real { display: none; }

.eye-toggle { display: inline-flex; align-items: center; gap: .5rem; }

.eye-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eye-toggle .eye-closed { display: none; }
.eye-toggle[aria-pressed="true"] .eye-open { display: none; }
.eye-toggle[aria-pressed="true"] .eye-closed { display: inline; }
