/* ==========================================================================
   RioMoney — light theme. Brand colours from the RioMoney logo (rionew.png).
   All fonts and icons are served locally (public/vendor) for offline use.
   ========================================================================== */
@font-face { font-family: 'Vazirmatn'; src: url('../vendor/vazirmatn/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../vendor/vazirmatn/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../vendor/vazirmatn/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }

:root {
  color-scheme: light;
  --rio-orange: #F7931E;
  --rio-orange-600: #E5820C;
  --rio-orange-700: #B9650A;
  --rio-orange-50: #FFF8EF;
  --rio-orange-100: #FEEFDC;
  --rio-orange-200: #FCDDB5;
  --rio-charcoal: #2F3134;
  --rio-bg: #F5F6F8;
  --rio-surface: #FFFFFF;
  --rio-surface-2: #FAFBFC;
  --rio-border: #E6E8EC;
  --rio-border-strong: #D5D9DF;
  --rio-text: #1E2329;
  --rio-text-2: #4B5563;
  --rio-muted: #6B7280;
  --rio-success: #12805C;
  --rio-danger: #C2361F;
  --rio-sidebar-w: 268px;
  --rio-sidebar-mini: 76px;
  --rio-topbar-h: 64px;
  --rio-radius: 12px;
  --rio-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --rio-shadow: 0 4px 16px rgba(16, 24, 40, .06);
  --rio-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  --bs-primary: var(--rio-orange);
  --bs-primary-rgb: 247, 147, 30;
  --bs-body-bg: var(--rio-bg);
  --bs-body-color: var(--rio-text);
  --bs-border-color: var(--rio-border);
  --bs-secondary-color: var(--rio-muted);
  --bs-link-color: var(--rio-orange-700);
  --bs-link-color-rgb: 185, 101, 10;
  --bs-link-hover-color: #8F4E07;
  --bs-border-radius: .55rem;
  --bs-focus-ring-color: rgba(247, 147, 30, .25);
}

html, body { background: var(--rio-bg); color: var(--rio-text); }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Vazirmatn', Arial, sans-serif; font-size: .9rem; -webkit-font-smoothing: antialiased; }
[dir="rtl"] body { font-family: 'Vazirmatn', Tahoma, Arial, sans-serif; }
::selection { background: var(--rio-orange-200); }
.num, .money, td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .num, [dir="rtl"] .money { direction: ltr; unicode-bidi: embed; }
.text-muted, .text-secondary { color: var(--rio-muted) !important; }

/* ---------- Buttons & controls ---------- */
.btn { font-weight: 500; border-radius: .55rem; }
.btn i.bi { line-height: 1; }
.btn-primary { --bs-btn-bg: var(--rio-orange); --bs-btn-border-color: var(--rio-orange); --bs-btn-hover-bg: var(--rio-orange-600); --bs-btn-hover-border-color: var(--rio-orange-600); --bs-btn-active-bg: var(--rio-orange-700); --bs-btn-active-border-color: var(--rio-orange-700); --bs-btn-disabled-bg: var(--rio-orange); --bs-btn-disabled-border-color: var(--rio-orange); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff; box-shadow: 0 1px 2px rgba(229, 130, 12, .25); }
.btn-outline-primary { --bs-btn-color: var(--rio-orange-700); --bs-btn-border-color: var(--rio-orange-200); --bs-btn-hover-bg: var(--rio-orange-50); --bs-btn-hover-border-color: var(--rio-orange); --bs-btn-hover-color: var(--rio-orange-700); --bs-btn-active-bg: var(--rio-orange-100); --bs-btn-active-border-color: var(--rio-orange); --bs-btn-active-color: var(--rio-orange-700); }
.btn-light { --bs-btn-bg: var(--rio-surface); --bs-btn-border-color: var(--rio-border); --bs-btn-hover-bg: var(--rio-surface-2); --bs-btn-hover-border-color: var(--rio-border-strong); --bs-btn-color: var(--rio-text-2); }
.btn-dark { --bs-btn-bg: var(--rio-charcoal); --bs-btn-border-color: var(--rio-charcoal); }
.text-bg-primary { background-color: var(--rio-orange) !important; color: #fff !important; }
.text-primary { color: var(--rio-orange-700) !important; }
.bg-primary { background-color: var(--rio-orange) !important; }
.form-control, .form-select { border-color: var(--rio-border-strong); border-radius: .55rem; }
.form-control:focus, .form-select:focus { border-color: var(--rio-orange); box-shadow: 0 0 0 .2rem rgba(247, 147, 30, .18); }
.form-label { font-weight: 500; color: var(--rio-text-2); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--rio-orange); border-color: var(--rio-orange); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(247, 147, 30, .18); border-color: var(--rio-orange); }
.input-group-text { background: var(--rio-surface-2); border-color: var(--rio-border-strong); color: var(--rio-muted); }
.page-link { color: var(--rio-orange-700); border-color: var(--rio-border); }
.active > .page-link, .page-link.active { background-color: var(--rio-orange); border-color: var(--rio-orange); }
.nav-tabs { border-bottom-color: var(--rio-border); gap: .25rem; }
.nav-tabs .nav-link { color: var(--rio-text-2); border: 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--rio-text); border-bottom-color: var(--rio-border-strong); }
.nav-tabs .nav-link.active { color: var(--rio-orange-700); background: transparent; border-bottom-color: var(--rio-orange); }
.nav-pills .nav-link.active { background: var(--rio-orange); }
.dropdown-menu { border-color: var(--rio-border); border-radius: .75rem; box-shadow: var(--rio-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: .45rem; padding: .45rem .7rem; color: var(--rio-text); }
.dropdown-item i.bi { color: var(--rio-muted); width: 1.1rem; display: inline-block; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--rio-orange-50); color: var(--rio-text); }
.dropdown-item.active, .dropdown-item:active { background: var(--rio-orange-100); color: var(--rio-orange-700); }
.dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rio-muted); }
[dir="rtl"] .dropdown-header { letter-spacing: 0; }
.badge { font-weight: 600; letter-spacing: .01em; }
.alert { border-radius: var(--rio-radius); border-width: 1px; }
.modal-content { border: 0; border-radius: 1rem; box-shadow: var(--rio-shadow-lg); }

/* ---------- App shell ---------- */
.rio-shell { min-height: 100vh; }
.rio-sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1045; width: var(--rio-sidebar-w);
  background: var(--rio-surface); border-inline-end: 1px solid var(--rio-border);
  display: flex; flex-direction: column; transition: width .18s ease, transform .2s ease;
}
.rio-brand { height: var(--rio-topbar-h); display: flex; align-items: center; gap: .65rem; padding: 0 1rem; border-bottom: 1px solid var(--rio-border); text-decoration: none; color: var(--rio-text); flex-shrink: 0; }
.rio-brand img { width: 34px; height: 38px; object-fit: contain; flex-shrink: 0; }
.rio-brand .name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.1; }
.rio-brand .name span { color: var(--rio-orange); }
.rio-brand .tag { font-size: .7rem; color: var(--rio-muted); white-space: nowrap; }
.rio-nav-search { padding: .75rem .85rem .35rem; }
.rio-nav-search .field { position: relative; }
.rio-nav-search .form-control { background: var(--rio-surface-2); font-size: .82rem; padding-inline-start: 2rem; padding-inline-end: 3.6rem; height: 36px; }
.rio-nav-search .bi { position: absolute; inset-inline-start: .7rem; top: 50%; transform: translateY(-50%); color: var(--rio-muted); font-size: .85rem; pointer-events: none; }
.rio-nav-search kbd { position: absolute; inset-inline-end: .45rem; top: 50%; transform: translateY(-50%); font-size: .64rem; padding: .1rem .35rem; background: var(--rio-surface); color: var(--rio-muted); border: 1px solid var(--rio-border); box-shadow: none; cursor: pointer; }
.rio-nav { flex: 1; overflow-y: auto; padding: .25rem .65rem 1rem; scrollbar-width: thin; }
.rio-nav-section { margin-top: .35rem; }
.rio-nav-section > button {
  width: 100%; display: flex; align-items: center; gap: .55rem; border: 0; background: transparent;
  padding: .55rem .55rem .35rem; font-size: .7rem; font-weight: 700; color: var(--rio-muted); text-transform: uppercase; letter-spacing: .07em; text-align: start;
}
[dir="rtl"] .rio-nav-section > button { letter-spacing: 0; font-size: .78rem; }
.rio-nav-section > button .chev { margin-inline-start: auto; transition: transform .15s ease; font-size: .7rem; }
.rio-nav-section.collapsed > button .chev { transform: rotate(-90deg); }
[dir="rtl"] .rio-nav-section.collapsed > button .chev { transform: rotate(90deg); }
.rio-nav-section.collapsed .rio-nav-items { display: none; }
.rio-nav a.item {
  display: flex; align-items: center; gap: .65rem; padding: .42rem .55rem; margin: 1px 0; border-radius: .6rem;
  color: var(--rio-text-2); text-decoration: none; font-weight: 500; position: relative; white-space: nowrap;
}
.rio-nav a.item .ic { width: 30px; height: 30px; border-radius: .5rem; display: grid; place-items: center; background: var(--rio-surface-2); border: 1px solid var(--rio-border); color: var(--rio-text-2); flex-shrink: 0; font-size: .95rem; }
.rio-nav a.item:hover { background: var(--rio-surface-2); color: var(--rio-text); }
.rio-nav a.item:hover .ic { border-color: var(--rio-border-strong); }
.rio-nav a.item.active { background: var(--rio-orange-50); color: var(--rio-orange-700); }
.rio-nav a.item.active .ic { background: var(--rio-orange); border-color: var(--rio-orange); color: #fff; box-shadow: 0 2px 6px rgba(247, 147, 30, .35); }
.rio-nav a.item.active::before { content: ''; position: absolute; inset-inline-start: -.65rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--rio-orange); }
.rio-nav a.item .count { margin-inline-start: auto; }
.rio-nav .no-match { display: none; padding: 1rem; font-size: .82rem; color: var(--rio-muted); text-align: center; }
.rio-sidebar-foot { border-top: 1px solid var(--rio-border); padding: .7rem .85rem; display: flex; align-items: center; gap: .6rem; font-size: .78rem; color: var(--rio-muted); flex-shrink: 0; }

.rio-main { margin-inline-start: var(--rio-sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; transition: margin .18s ease; }
.rio-topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--rio-topbar-h); background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--rio-border);
  display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem;
}
.rio-crumbs { display: flex; flex-direction: column; min-width: 170px; flex: 1 1 auto; line-height: 1.2; }
.rio-search-wide { display: none; }
.rio-search-compact .dropdown-menu .rio-search { flex: none; max-width: none; }
@media (min-width: 1600px) { .rio-search-wide { display: block; } .rio-search-compact { display: none; } }
@media (max-width: 575.98px) { .rio-crumbs { min-width: 0; } }
.rio-crumbs .trail { font-size: .74rem; color: var(--rio-muted); display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.rio-crumbs .trail .bi-chevron-right, .rio-crumbs .trail .bi-chevron-left { font-size: .6rem; }
.rio-crumbs .title { font-weight: 700; font-size: 1.02rem; color: var(--rio-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rio-search { position: relative; width: 260px; flex: 0 1 260px; min-width: 180px; }
.rio-search .bi-search { position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%); color: var(--rio-muted); font-size: .85rem; }
.rio-search input { padding-inline-start: 2.1rem; background: var(--rio-surface-2); border-color: var(--rio-border); height: 38px; font-size: .85rem; }
.rio-search input:focus { background: #fff; }
.rio-icon-btn {
  width: 38px; height: 38px; border-radius: .6rem; display: inline-grid; place-items: center; border: 1px solid var(--rio-border);
  background: var(--rio-surface); color: var(--rio-text-2); position: relative; flex-shrink: 0; font-size: 1.05rem;
}
.rio-icon-btn:hover { background: var(--rio-surface-2); border-color: var(--rio-border-strong); color: var(--rio-text); }
.rio-icon-btn .dot-count { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rio-danger); color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.rio-topbar .chip, .chip {
  display: inline-flex; align-items: center; gap: .4rem; height: 38px; border: 1px solid var(--rio-border); border-radius: .6rem;
  padding: 0 .75rem; font-size: .82rem; background: var(--rio-surface); color: var(--rio-text-2); white-space: nowrap; font-weight: 500;
}
.rio-topbar .chip:hover { border-color: var(--rio-border-strong); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; flex-shrink: 0; }
.chip .dot.up { background: #16A34A; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.chip .dot.down { background: #DC2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.chip .dot.fallback { background: var(--rio-orange); box-shadow: 0 0 0 3px rgba(247, 147, 30, .18); }
.rio-branch-select { height: 38px; font-size: .82rem; width: auto; min-width: 150px; max-width: 230px; background-color: var(--rio-surface); }
.rio-topbar .btn { white-space: nowrap; }
.rio-topbar > .ms-auto { flex-shrink: 0; }
.rio-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--rio-orange), var(--rio-orange-700)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.rio-user-btn { display: flex; align-items: center; gap: .55rem; border: 1px solid transparent; background: transparent; padding: .2rem .4rem .2rem .2rem; border-radius: 2rem; }
[dir="rtl"] .rio-user-btn { padding: .2rem .2rem .2rem .4rem; }
.rio-user-btn:hover { background: var(--rio-surface-2); border-color: var(--rio-border); }
.rio-user-btn .who { line-height: 1.15; text-align: start; }
.rio-user-btn .who .n { font-weight: 600; font-size: .84rem; color: var(--rio-text); }
.rio-user-btn .who .r { font-size: .72rem; color: var(--rio-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rio-notify-menu { width: 330px; }
.rio-notify-menu .n-item { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; border-radius: .55rem; text-decoration: none; color: var(--rio-text); }
.rio-notify-menu .n-item:hover { background: var(--rio-orange-50); }
.rio-notify-menu .n-ic { width: 34px; height: 34px; border-radius: .55rem; display: grid; place-items: center; flex-shrink: 0; }
.rio-quick-menu { width: 300px; }
.rio-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.rio-quick-grid a { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .3rem; border-radius: .6rem; text-decoration: none; color: var(--rio-text); font-size: .78rem; font-weight: 500; text-align: center; border: 1px solid transparent; }
.rio-quick-grid a i { font-size: 1.2rem; color: var(--rio-orange-700); width: 38px; height: 38px; border-radius: .6rem; background: var(--rio-orange-50); display: grid; place-items: center; }
.rio-quick-grid a:hover { background: var(--rio-surface-2); border-color: var(--rio-border); }

.rio-content { padding: 1.5rem; flex: 1; }
.rio-footer { padding: .9rem 1.5rem; color: var(--rio-muted); font-size: .78rem; border-top: 1px solid var(--rio-border); background: var(--rio-surface); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.rio-backdrop { display: none; }

/* Collapsed (icon-only) sidebar on desktop */
@media (min-width: 992px) {
  body.sidebar-mini .rio-sidebar { width: var(--rio-sidebar-mini); }
  body.sidebar-mini .rio-main { margin-inline-start: var(--rio-sidebar-mini); }
  body.sidebar-mini .rio-brand { justify-content: center; padding: 0; }
  body.sidebar-mini .rio-brand > div, body.sidebar-mini .rio-nav-search, body.sidebar-mini .rio-nav-section > button,
  body.sidebar-mini .rio-nav a.item span, body.sidebar-mini .rio-nav a.item .count, body.sidebar-mini .rio-sidebar-foot .txt { display: none; }
  body.sidebar-mini .rio-nav-section.collapsed .rio-nav-items { display: block; }
  body.sidebar-mini .rio-nav a.item { justify-content: center; padding: .35rem 0; }
  body.sidebar-mini .rio-nav-section { border-top: 1px dashed var(--rio-border); padding-top: .25rem; }
  body.sidebar-mini .rio-nav-section:first-child { border-top: 0; }
  body.sidebar-mini .rio-sidebar-foot { justify-content: center; }
}
@media (max-width: 991.98px) {
  .rio-sidebar { transform: translateX(-100%); box-shadow: var(--rio-shadow-lg); }
  [dir="rtl"] .rio-sidebar { transform: translateX(100%); }
  body.sidebar-open .rio-sidebar { transform: none; }
  body.sidebar-open .rio-backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .35); z-index: 1040; }
  .rio-main { margin-inline-start: 0 !important; }
  .rio-content { padding: 1rem; }
  .rio-topbar { padding: 0 .75rem; gap: .4rem; }
}
@media (max-width: 575.98px) {
  .rio-crumbs .trail { display: none; }
  .rio-live-slot { display: none; }
  .rio-topbar .ms-auto { gap: .35rem !important; }
  .page-header { align-items: flex-start; }
}
html, body { overflow-x: hidden; }

/* ---------- Command palette (Ctrl+K) ---------- */
.rio-palette .modal-dialog { max-width: 560px; margin-top: 10vh; }
.rio-palette .p-search { border: 0; border-bottom: 1px solid var(--rio-border); border-radius: 1rem 1rem 0 0; padding: 1rem 1.1rem 1rem 2.8rem; font-size: 1rem; box-shadow: none !important; }
[dir="rtl"] .rio-palette .p-search { padding: 1rem 2.8rem 1rem 1.1rem; }
.rio-palette .p-icon { position: absolute; inset-inline-start: 1.1rem; top: 1.15rem; color: var(--rio-muted); }
.rio-palette .p-list { max-height: 55vh; overflow-y: auto; padding: .5rem; }
.rio-palette .p-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rio-muted); padding: .55rem .6rem .25rem; font-weight: 700; }
.rio-palette .p-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: .55rem; color: var(--rio-text); text-decoration: none; }
.rio-palette .p-item i { width: 30px; height: 30px; border-radius: .5rem; display: grid; place-items: center; background: var(--rio-surface-2); border: 1px solid var(--rio-border); color: var(--rio-text-2); }
.rio-palette .p-item.sel, .rio-palette .p-item:hover { background: var(--rio-orange-50); }
.rio-palette .p-item.sel i { background: var(--rio-orange); border-color: var(--rio-orange); color: #fff; }
.rio-palette .p-foot { border-top: 1px solid var(--rio-border); padding: .55rem 1rem; font-size: .72rem; color: var(--rio-muted); display: flex; gap: 1rem; }

/* ---------- Cards, tables & page components ---------- */
.card { background: var(--rio-surface); border: 1px solid var(--rio-border); border-radius: var(--rio-radius); box-shadow: var(--rio-shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--rio-border); font-weight: 600; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-header > .bi:first-child { color: var(--rio-orange-700); }
.card-footer { background: var(--rio-surface-2); border-top-color: var(--rio-border); }
.card-body { padding: 1.1rem; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--rio-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .8rem; border-bottom-color: var(--rio-border); }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rio-muted); font-weight: 700; background: var(--rio-surface-2); border-bottom: 1px solid var(--rio-border); white-space: nowrap; }
[dir="rtl"] .table thead th { letter-spacing: 0; font-size: .78rem; }
.table tfoot td, .table tfoot th { background: var(--rio-surface-2); font-weight: 700; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--rio-orange-50); }
.table-responsive { border-radius: inherit; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: .55rem; }
.page-header .sub { color: var(--rio-muted); font-size: .85rem; margin-top: .2rem; }
.page-header .btn { display: inline-flex; align-items: center; gap: .35rem; }
.stat-card { padding: 1.05rem 1.15rem; position: relative; overflow: hidden; }
.stat-card .label { color: var(--rio-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
[dir="rtl"] .stat-card .label { letter-spacing: 0; font-size: .8rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; margin-top: .25rem; letter-spacing: -.01em; }
.stat-card .icon { width: 44px; height: 44px; border-radius: .7rem; display: grid; place-items: center; background: var(--rio-orange-50); color: var(--rio-orange-700); font-size: 1.25rem; border: 1px solid var(--rio-orange-100); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.kv dt { color: var(--rio-muted); font-weight: 500; }
dl.kv dd { margin: 0; font-weight: 500; }
.quote-box { background: var(--rio-orange-50); border: 1px dashed var(--rio-orange); border-radius: var(--rio-radius); padding: 1rem; }
.empty-state { text-align: center; color: var(--rio-muted); padding: 2.75rem 1rem; }
.empty-state i { font-size: 1.6rem; width: 56px; height: 56px; margin: 0 auto .75rem; display: grid; place-items: center; border-radius: 50%; background: var(--rio-surface-2); border: 1px solid var(--rio-border); color: var(--rio-muted); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(900px 500px at 0% 0%, rgba(247, 147, 30, .12), transparent 60%),
  radial-gradient(700px 400px at 100% 100%, rgba(47, 49, 52, .06), transparent 60%), var(--rio-bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--rio-surface); border: 1px solid var(--rio-border); border-radius: 1.1rem; padding: 2.1rem; box-shadow: var(--rio-shadow-lg); }
.auth-card .logo { width: 64px; height: 72px; object-fit: contain; display: block; margin: 0 auto .7rem; }

@media print {
  .rio-sidebar, .rio-topbar, .rio-footer, .rio-backdrop, .no-print { display: none !important; }
  .rio-main { margin: 0 !important; }
  .rio-content { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------- Currency & country flags (local SVGs in public/vendor/flags) ---------- */
.rio-flag { width: 1.3em; height: .975em; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(16, 24, 40, .12); vertical-align: -.14em; margin-inline-end: .38em; flex-shrink: 0; background: #eef0f3; }
.rio-flag-none { display: inline-block; }
.rio-cur { display: inline-flex; align-items: center; white-space: nowrap; }
.rio-cur .code { font-weight: 600; letter-spacing: .02em; }
.rio-cur .name { margin-inline-start: .35rem; color: var(--rio-muted); font-weight: 400; }
.rio-flag-select { position: relative; }
.rio-flag-select > .rio-flag { position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%); margin: 0; pointer-events: none; z-index: 5; }
.rio-flag-select > select.form-select { padding-inline-start: 2.6rem; }
.rio-flag-select > select.form-select-sm { padding-inline-start: 2.3rem; }
.rio-flag-select > select.form-select-sm ~ .rio-flag, .rio-flag-select > .rio-flag.sm { inset-inline-start: .55rem; }
.input-group > .rio-flag-select { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .rio-flag-select > select { border-radius: inherit; }

/* ---------- Searchable / multi-select dropdowns (Tom Select, local) ---------- */
.ts-wrapper { padding: 0; border: 0; background: none; box-shadow: none; min-height: 0; height: auto; }
.ts-wrapper .ts-control { border: 1px solid var(--rio-border-strong) !important; border-radius: .55rem; min-height: 38px; padding: .4rem .75rem; background-color: #fff; box-shadow: none; font-size: .9rem; color: var(--rio-text); display: flex; align-items: center; }
.ts-wrapper.rio-ts-sm .ts-control { min-height: 31px; padding: .2rem .55rem; font-size: .82rem; border-radius: .45rem; }
.ts-wrapper.rio-ts-lg .ts-control { min-height: 48px; font-size: 1.1rem; padding: .55rem 1rem; }
.ts-wrapper.single .ts-control .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-wrapper.single .ts-control { padding-inline-end: 2.2rem; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 14px 10px; }
[dir="rtl"] .ts-wrapper.single .ts-control { background-position: left .75rem center; }
.ts-wrapper.focus .ts-control { border-color: var(--rio-orange); box-shadow: 0 0 0 .2rem rgba(247, 147, 30, .18); }
.ts-wrapper.disabled .ts-control { background-color: var(--rio-surface-2); opacity: .8; }
.ts-wrapper.is-invalid .ts-control, .was-validated .ts-wrapper:invalid .ts-control { border-color: var(--bs-danger); }
.ts-wrapper .ts-control .item { display: inline-flex; align-items: center; }
.ts-wrapper.multi .ts-control { gap: .25rem; padding: .3rem .5rem; }
.ts-wrapper.multi .ts-control > .item { background: var(--rio-orange-50); color: var(--rio-orange-700); border: 1px solid var(--rio-orange-200); border-radius: .4rem; padding: .05rem .35rem; margin: 0; font-weight: 500; font-size: .82rem; }
.ts-wrapper.multi .ts-control > .item .remove { border-inline-start: 1px solid var(--rio-orange-200) !important; color: var(--rio-orange-700); margin-inline-start: .3rem; padding: 0 .3rem; }
.ts-wrapper.multi .ts-control > .item .remove:hover { background: var(--rio-orange-100); }
.ts-wrapper .clear-button { color: var(--rio-muted); }
.ts-dropdown { z-index: 2000; border: 1px solid var(--rio-border); border-radius: .65rem; box-shadow: var(--rio-shadow-lg); margin-top: .25rem; overflow: hidden; font-size: .9rem; }
.ts-dropdown .dropdown-input-wrap { padding: .45rem; border-bottom: 1px solid var(--rio-border); }
.ts-dropdown .dropdown-input { border: 1px solid var(--rio-border-strong); border-radius: .45rem; padding: .35rem .6rem; width: 100%; }
.ts-dropdown .dropdown-input:focus { outline: 0; border-color: var(--rio-orange); box-shadow: 0 0 0 .15rem rgba(247, 147, 30, .18); }
.ts-dropdown .option { padding: .45rem .75rem; }
.ts-dropdown .option.active { background: var(--rio-orange-50); color: var(--rio-text); }
.ts-dropdown .option.selected { color: var(--rio-orange-700); font-weight: 600; }
.ts-dropdown .no-results { padding: .6rem .75rem; color: var(--rio-muted); }
.ts-dropdown-content { max-height: 300px; }
.ts-wrapper .rio-flag, .ts-dropdown .rio-flag { margin-inline-end: .5rem; }
.input-group > .ts-wrapper { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .ts-wrapper:not(:first-child) .ts-control { border-start-start-radius: 0; border-end-start-radius: 0; }
.input-group > .ts-wrapper:not(:last-child) .ts-control { border-start-end-radius: 0; border-end-end-radius: 0; }
.filter-bar .ts-wrapper { min-width: 170px; }
.rio-branch-select.ts-wrapper .ts-control, .rio-topbar .ts-wrapper.rio-ts-sm .ts-control, .rio-topbar .ts-wrapper .ts-control { min-height: 38px; height: 38px; font-size: .82rem; }
.rio-topbar .ts-wrapper { min-width: 190px; }
.stat-card .value .rio-flag, .mr-huge .rio-flag, h1 .rio-flag { width: .85em; height: .64em; vertical-align: .05em; }

/* Page headers without a title (the top bar shows it): just a compact action row. */
.page-header:not(:has(h1)) { justify-content: flex-end; margin-bottom: .75rem; }
.page-header:not(:has(h1)) > div:only-child:has(> .sub) { flex: 1; }
.page-header:empty { display: none; }

/* Page-group tabs (Expenses, Compliance, Accounting, Settings): one menu entry, sub-pages as tabs. */
.rio-tabs { margin: -.25rem 0 1rem; background: var(--rio-surface); border: 1px solid var(--rio-border); border-radius: .85rem; padding: .3rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.rio-tabs-scroll { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: thin; scroll-behavior: smooth; }
.rio-tab { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; padding: .5rem .85rem; border-radius: .6rem; font-size: .86rem; font-weight: 600;
    color: var(--rio-text-2, var(--rio-muted)); text-decoration: none; position: relative; transition: background .15s ease, color .15s ease; }
.rio-tab i { font-size: .95rem; color: var(--rio-muted); transition: color .15s ease; }
.rio-tab:hover { background: var(--rio-surface-2); color: var(--rio-text); }
.rio-tab.active { background: var(--rio-orange-50); color: var(--rio-orange-700); }
.rio-tab.active i { color: var(--rio-orange); }
.rio-tab.active::after { content: ''; position: absolute; inset-inline: .85rem; bottom: .12rem; height: 2px; border-radius: 2px; background: var(--rio-orange); }
.rio-tab .badge { font-size: .65rem; }
@media (max-width: 575.98px) { .rio-tab { padding: .45rem .65rem; font-size: .8rem; } }

/* Navigation progress bar (app.js): instant feedback while the next page loads. */
.rio-progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none;
    background: linear-gradient(90deg, var(--rio-orange), #ffb35c); box-shadow: 0 0 8px rgba(247, 147, 30, .55); opacity: 0; }
.rio-progress.run { opacity: 1; animation: rio-progress 8s cubic-bezier(.08, .7, .2, 1) forwards; }
.rio-progress.done { opacity: 0; width: 100% !important; transition: opacity .25s ease .1s, width .15s ease; }
@keyframes rio-progress { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }
@media print { .rio-progress { display: none !important; } }
