@font-face { font-family: 'Tajawal'; font-weight: 400; src: url('../vendor/fonts/tajawal-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-weight: 700; src: url('../vendor/fonts/tajawal-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-weight: 400; src: url('../vendor/fonts/tajawal-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: 'Tajawal'; font-weight: 700; src: url('../vendor/fonts/tajawal-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF; }

:root {
    --brand: #0f4c81;
    --brand-dark: #0a3558;
    --brand-light: #e8f1fa;
    --accent: #f39c12;
    --bg: #f3f6fa;
    --border: #dfe6ee;
}

body { font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); font-size: 14px; color: #1f2d3d; }
a { text-decoration: none; }

/* ---------- header ---------- */
.app-header { background: linear-gradient(90deg, var(--brand-dark), var(--brand)); color: #fff; }
.app-header .brand { font-weight: 700; font-size: 1.1rem; color: #fff; display: flex; align-items: center; gap: .5rem; }
.app-header .brand .logo { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.15); display: grid; place-items: center; }
.app-header .brand .brand-logo { height: 38px; width: auto; background: #fff; border-radius: 8px; padding: 2px 6px; }
.app-header .hdr-link { color: rgba(255,255,255,.88); padding: .35rem .6rem; border-radius: 6px; }
.app-header .hdr-link:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- main menu (3 levels, mirrors the original navigation) ---------- */
.main-nav { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 2px 6px rgba(15,76,129,.06); position: sticky; top: 0; z-index: 1030; }
.main-nav > .container-fluid > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav > .container-fluid > ul > li > a { display: block; padding: .8rem .9rem; color: #1f2d3d; font-weight: 700; }
.main-nav > .container-fluid > ul > li:hover > a, .main-nav > .container-fluid > ul > li.active > a { color: var(--brand); background: var(--brand-light); }
.main-nav ul ul { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 250px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.08); list-style: none; padding: .35rem 0; z-index: 1000; }
.main-nav ul ul ul { top: -.4rem; inset-inline-start: 100%; max-height: 80vh; overflow-y: auto; }
.main-nav li:hover > ul { display: block; }
.main-nav ul ul a { display: flex; justify-content: space-between; align-items: center; padding: .45rem .9rem; color: #2c3e50; white-space: nowrap; }
.main-nav ul ul a:hover { background: var(--brand-light); color: var(--brand); }
.main-nav ul ul a.pending { color: #98a6b5; }
.main-nav ul ul a.pending::after { content: '•'; color: #f0b04a; margin-inline-start: .5rem; }
.main-nav .settings-menu > ul { inset-inline-start: auto; inset-inline-end: 0; }
.main-nav .settings-menu > ul ul { inset-inline-start: auto; inset-inline-end: 100%; }
.main-nav .ms-auto-li { margin-inline-start: auto; }
@media (max-width: 991px) {
    .main-nav > .container-fluid > ul { flex-direction: column; display: none; }
    .main-nav.open > .container-fluid > ul { display: flex; }
    .main-nav ul ul, .main-nav ul ul ul { position: static; box-shadow: none; border: 0; padding-inline-start: 1rem; }
}

/* ---------- page ---------- */
.page-wrap { padding: 1.25rem; }
.page-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.page-card > .page-head { padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.page-card > .page-head h1 { font-size: 1.15rem; font-weight: 700; margin: 0; color: var(--brand-dark); }
.page-card > .page-body { padding: 1.1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.table-app { margin: 0; }
.table-app thead th { background: #f5f8fb; color: #44546a; font-weight: 700; white-space: nowrap; border-bottom: 2px solid var(--border); font-size: 13px; vertical-align: middle; }
.table-app td { vertical-align: middle; }
.table-app tbody tr:hover { background: #fafcff; }
.table-app .num { font-variant-numeric: tabular-nums; }
.table-app th select.form-select { min-width: 120px; font-weight: 400; }

.form-section { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 1rem; }
.form-section > .fs-head { background: #f7f9fc; padding: .55rem .9rem; font-weight: 700; color: var(--brand-dark); border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.form-section > .fs-body { padding: .9rem; }
.form-label { font-weight: 700; color: #44546a; font-size: 13px; margin-bottom: .25rem; }
.form-label .req { color: #d63031; }

.history-table { font-size: 12.5px; }
.badge-soft { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.balance-debit { color: #c0392b; }
.balance-credit { color: #27ae60; }
.empty-state { text-align: center; color: #8795a1; padding: 2.5rem 1rem; }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #c3ced9; }

.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.pagination { margin: 0; }
.login-bg { min-height: 100vh; background: radial-gradient(circle at 20% 20%, #1b6bb0 0, var(--brand-dark) 60%); }
.login-card { max-width: 420px; border-radius: 16px; }

@media print {
    .app-header, .main-nav, .no-print, .toolbar, .pagination { display: none !important; }
    body { background: #fff; }
    .page-card { border: 0; box-shadow: none; }
}

/* Accounting Filter Forms - 1:1 Live Parity */
.title-bx { margin-bottom: 20px; border-bottom: 2px solid #28a745; padding-bottom: 8px; }
.title-bx h1 { font-size: 22px; font-weight: bold; color: #2c3e50; margin: 0; }
.box.round { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 25px; margin-bottom: 25px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
table.form { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
table.form td { padding: 6px 10px; vertical-align: middle; }
table.form td.col1 { width: 220px; font-weight: bold; color: #34495e; font-size: 14px; }
table.form td.col2 { }
table.form label { font-weight: 600; color: #4a5568; margin-bottom: 0; }
table.form select, table.form input[type="text"], table.form input[type="date"] {
    border: 1px solid #cbd5e0; border-radius: 4px; padding: 6px 12px; font-size: 14px; color: #2d3748; min-width: 250px;
}
table.form input.calendarsField { min-width: 180px; }
.btn-gren, .btn-gren.btn-success { background-color: #28a745 !important; border-color: #28a745 !important; color: #fff !important; font-weight: bold; padding: 8px 24px; border-radius: 4px; cursor: pointer; }
.btn-gren:hover { background-color: #218838 !important; }
.btn-yell, .btn-yell.btn-danger { background-color: #dc3545 !important; border-color: #dc3545 !important; color: #fff !important; font-weight: bold; padding: 8px 24px; border-radius: 4px; cursor: pointer; }
.btn-yell:hover { background-color: #c82333 !important; }
.btn-box { margin-top: 20px; display: flex; gap: 10px; }
