﻿/* Aqari Smart V2 - Desktop-only ERP shell */

/* 1. variables */
:root{
  --bg:#F7F5EF;
  --card:#FFFFFF;
  --sidebar:#FFFFFF;
  --gold:#B88A3B;
  --gold-soft:#EFE2C2;
  --gold-bg:#FFF7E6;
  --gold-dark:#7C5A20;
  --text:#1F2933;
  --muted:#6B7280;
  --border:#E5DED0;
  --success:#1F8A5B;
  --success-bg:#EAF7F1;
  --warning:#D97706;
  --warning-bg:#FFF4DE;
  --danger:#DC2626;
  --danger-bg:#FFF0F0;
  --info:#2563EB;
  --info-bg:#EEF4FF;
  --neutral-bg:#F4F1EA;
  --sidebar-width:312px;
  --radius:18px;
  --radius-lg:24px;
  --shadow:0 14px 34px rgba(31,41,51,.07);
  --shadow-soft:0 8px 20px rgba(31,41,51,.045);
}

/* UPDATE 20: Light Pro operating theme */
:root{
  --bg:#F4F7FB;
  --card:#FFFFFF;
  --sidebar:#FFFFFF;
  --surface:#FFFFFF;
  --surface-2:#F8FAFC;
  --surface-3:#EEF4FA;
  --text:#152033;
  --muted:#607089;
  --border:#DDE6F0;
  --border-strong:#C8D5E3;
  --gold:#C9972B;
  --gold-soft:#F5E7BE;
  --gold-bg:#FFF8E6;
  --gold-dark:#7A5516;
  --primary:#123A5F;
  --primary-2:#1D5F89;
  --primary-soft:#E7F0F8;
  --success:#11845B;
  --success-bg:#E9F7F1;
  --warning:#D97706;
  --warning-bg:#FFF3DF;
  --danger:#C93A3A;
  --danger-bg:#FFF0F0;
  --info:#2563EB;
  --info-bg:#EEF5FF;
  --neutral-bg:#F1F5F9;
  --sidebar-width:304px;
  --radius:8px;
  --radius-lg:8px;
  --shadow:0 18px 46px rgba(15,32,51,.08);
  --shadow-soft:0 8px 22px rgba(15,32,51,.055);
  --focus-ring:0 0 0 3px rgba(37,99,235,.18);
}

body{
  background:
    linear-gradient(180deg,#F8FBFF 0%,#F4F7FB 38%,#F1F5F9 100%) fixed;
  color:var(--text);
  font-size:14px;
  line-height:1.62;
}

body.admin-body:not(.focus-mode) .main{
  padding:18px 26px 58px;
}

.sidebar{
  background:linear-gradient(180deg,#FFFFFF 0%,#F8FBFF 100%);
  border-left:1px solid var(--border);
  box-shadow:-18px 0 38px rgba(15,32,51,.07);
}

.brand{
  min-height:76px;
  margin-bottom:14px;
  padding:12px;
  border-color:var(--border);
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:var(--shadow-soft);
}

.brand-mark{
  width:44px;
  height:44px;
  flex-basis:44px;
  border-radius:8px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  box-shadow:0 12px 24px rgba(18,58,95,.2);
}

.brand b{
  color:var(--primary);
  font-size:15px;
  font-weight:900;
}

.brand small{
  color:var(--muted);
  font-size:11.5px;
  font-weight:800;
}

.nav{
  scrollbar-color:#B7C6D8 transparent;
}

.nav::-webkit-scrollbar-thumb{
  background:#B7C6D8;
}

.nav-group{
  margin-bottom:9px;
  padding:4px;
  border-color:var(--border);
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:none;
}

.nav-group[open]{
  border-color:#BFD0E2;
  background:#F8FBFF;
  box-shadow:0 8px 18px rgba(15,32,51,.045);
}

.nav-group summary{
  min-height:42px;
  padding:9px 11px;
  border-radius:7px;
  color:#314159;
  background:#F2F6FA;
  font-size:14.5px;
  font-weight:900;
  box-shadow:none;
}

.nav-group[open] summary{
  color:#FFFFFF;
  border-color:var(--primary);
  background:linear-gradient(135deg,var(--primary),#18527A);
  box-shadow:0 10px 20px rgba(18,58,95,.14);
}

.nav a,
.nav-disabled{
  min-height:38px;
  margin:3px 0;
  padding:8px 10px;
  border-radius:7px;
  color:#334155;
  font-size:13.5px;
  font-weight:800;
}

.nav-group[open] a,
.nav-group[open] .nav-disabled{
  color:#263447;
  background:#FFFFFF;
  border-color:#E7EEF6;
}

.nav a svg,
.nav-disabled svg{
  width:18px;
  height:18px;
  flex-basis:18px;
  color:#54708D;
  stroke-width:2;
}

.nav-group[open] a svg,
.nav-group[open] .nav-disabled svg{
  color:#255E82;
}

.nav a:hover{
  color:var(--primary);
  background:#EAF3FB;
  border-color:#C7D9E9;
  transform:none;
}

.nav a.active{
  color:#FFFFFF;
  border-color:var(--primary);
  background:linear-gradient(135deg,#123A5F,#1C6A96);
  box-shadow:0 12px 24px rgba(18,58,95,.16);
}

.nav a.active svg{
  color:#FFFFFF;
}

.nav a.active:after{
  inset:auto auto 8px 8px;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#F7C948;
}

.nav-subgroup{
  border-color:#E1EAF3;
  border-radius:8px;
  background:#F8FBFF;
}

.nav-children{
  border-inline-start-color:#C7D9E9;
}

.nav-group[open] .nav-child{
  border-radius:7px;
  background:#FFFFFF;
}

.topbar{
  position:sticky;
  top:0;
  z-index:60;
  align-items:center;
  margin:-18px -26px 16px;
  padding:14px 26px;
  border-bottom:1px solid rgba(200,213,227,.72);
  background:rgba(244,247,251,.92);
  backdrop-filter:blur(14px);
}

.topbar h1{
  color:var(--primary);
  font-size:24px;
  font-weight:950;
  letter-spacing:0;
}

.breadcrumb{
  color:#64748B;
  font-size:12px;
}

.breadcrumb b:last-child,
.eyebrow{
  color:#486581;
}

.topbar-actions,
.actions{
  gap:8px;
}

.topbar-icon,
.icon-btn,
.btn,
button,
input[type="submit"]{
  border-radius:8px!important;
}

.icon-btn.icon-only{
  width:42px;
  height:42px;
  min-width:42px;
  border:1px solid var(--border)!important;
  background:#FFFFFF!important;
  color:var(--primary)!important;
  box-shadow:var(--shadow-soft)!important;
}

.topbar-badge{
  top:-5px;
  left:-5px;
  min-width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border:2px solid #FFFFFF;
  border-radius:999px;
  background:#DC2626;
  color:#FFFFFF;
  font-size:11px;
  font-weight:950;
}

.topbar-dropdown{
  border:1px solid var(--border);
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:0 20px 52px rgba(15,32,51,.16);
}

.topbar-dropdown a,
.topbar-dropdown-form button{
  border-radius:6px;
}

.page-head{
  padding:16px 18px!important;
  border-color:var(--border)!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.page-head h2{
  color:var(--primary)!important;
  font-size:24px!important;
  font-weight:950!important;
}

.page-head p{
  color:var(--muted)!important;
  font-size:13.5px!important;
}

.panel,
.card,
.sub-card,
.page-state,
.record-panel div,
.smart-table,
.report-card,
.report-table-panel,
.report-methods-panel,
.report-summary-card{
  border-color:var(--border)!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.panel{
  padding:16px!important;
}

.panel h2{font-size:18px}
.panel h3{font-size:16px}

.grid.cards{
  gap:12px;
}

.card{
  min-height:96px;
  padding:14px!important;
}

.card:before{
  width:4px;
  background:var(--primary);
}

.card span{
  color:#64748B;
  font-size:12.5px;
  font-weight:850;
}

.card b,
.kpi-value,
.dashboard-card-value b{
  color:#102A43;
  font-size:22px;
  font-weight:950;
  letter-spacing:0;
}

.card .card-icon,
.metric-icon{
  border-radius:8px;
  background:var(--primary-soft);
  color:var(--primary);
}

.dashboard-card:hover{
  border-color:#BFD0E2!important;
  box-shadow:var(--shadow)!important;
  transform:translateY(-1px);
}

.metric-card,
.metric-panel,
.dashboard-metric,
.report-summary-card{
  overflow:hidden;
}

.is-profit b,
.amount-income,
.text-success,
.profit,
.income{
  color:var(--success)!important;
}

.is-expense b,
.amount-expense,
.expense{
  color:var(--warning)!important;
}

.is-loss b,
.amount-loss,
.loss,
.danger{
  color:var(--danger)!important;
}

.is-commission b,
.commission{
  color:#B7791F!important;
}

.smart-table-toolbar,
.toolbar,
.report-control-center{
  border-color:var(--border)!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.smart-table-tools{
  grid-template-columns:minmax(260px,1fr) minmax(160px,auto) minmax(100px,auto) auto;
}

.smart-table-scroll{
  border-color:var(--border);
  border-radius:8px;
  background:#FFFFFF;
}

table{
  background:#FFFFFF;
}

th,
td{
  padding:11px 12px!important;
  border-bottom-color:#E7EEF6!important;
  font-size:13.5px;
}

th{
  background:#EEF4FA!important;
  color:#243B53!important;
  font-size:12px;
  font-weight:950;
}

tbody tr:hover td{
  background:#F8FBFF;
}

.smart-table-scroll::-webkit-scrollbar-thumb{
  background:#B7C6D8;
}

.field input,
.field select,
.field textarea,
.smart-table-search,
.smart-table-filter,
.smart-table-size,
input,
select,
textarea{
  border-color:#CBD8E6!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  color:#162033!important;
  box-shadow:none!important;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.smart-table-search:focus,
.smart-table-filter:focus,
.smart-table-size:focus,
input:focus,
select:focus,
textarea:focus{
  border-color:#2B6CB0!important;
  box-shadow:var(--focus-ring)!important;
  outline:0!important;
}

.btn,
button,
input[type="submit"]{
  border:1px solid var(--primary)!important;
  background:var(--primary)!important;
  color:#FFFFFF!important;
  font-weight:900!important;
  box-shadow:0 10px 22px rgba(18,58,95,.13)!important;
}

.btn:hover,
button:hover,
input[type="submit"]:hover{
  background:#0F2F4E!important;
  border-color:#0F2F4E!important;
}

.btn.ghost,
.btn.secondary,
button.ghost,
button.secondary,
.icon-btn.ghost{
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  color:var(--primary)!important;
  box-shadow:none!important;
}

.btn.warning,
.smart-action.warning{
  border-color:var(--warning)!important;
  background:var(--warning)!important;
  color:#FFFFFF!important;
}

.btn.success,
.smart-action.success{
  border-color:var(--success)!important;
  background:var(--success)!important;
  color:#FFFFFF!important;
}

.badge{
  border-radius:999px!important;
  border-color:#D5E0EC!important;
  background:#F8FBFF!important;
  color:#314159!important;
  font-size:12px!important;
  font-weight:900!important;
}

.badge.success,
.badge.paid,
.badge.active{
  border-color:#BFE9D6!important;
  background:var(--success-bg)!important;
  color:var(--success)!important;
}

.badge.warning,
.badge.pending,
.badge.unpaid{
  border-color:#F7D9A8!important;
  background:var(--warning-bg)!important;
  color:#9A5A00!important;
}

.badge.danger,
.badge.cancelled,
.badge.overdue{
  border-color:#F3B9B9!important;
  background:var(--danger-bg)!important;
  color:var(--danger)!important;
}

.entity-workspace-tabs,
.building-profile-tabs{
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:var(--shadow-soft);
}

.entity-tabbar,
.building-tabbar{
  position:sticky;
  top:73px;
  z-index:45;
  border:1px solid var(--border);
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:var(--shadow-soft);
}

.entity-tab,
.building-tab{
  border-radius:7px!important;
  color:#425466!important;
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

.entity-tab.active,
.building-tab.active{
  background:var(--primary)!important;
  color:#FFFFFF!important;
}

.accounting-category-check,
.checkbox-field,
.meter-unit-check,
.allocation-settings,
.selected-accounting-category,
.expense-smart-profile,
.employee-commission-panel{
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
}

.meter-unit-summary{
  border-radius:8px;
  border-color:var(--border);
  background:#F8FBFF;
}

.unsaved-dialog{
  position:fixed!important;
  inset:0!important;
  display:none;
  place-items:center!important;
  padding:24px;
  background:rgba(15,23,42,.34)!important;
  backdrop-filter:blur(6px);
  z-index:5000!important;
}

.unsaved-dialog.open{
  display:grid!important;
}

.unsaved-card{
  width:min(460px,100%)!important;
  margin:0!important;
  border:1px solid var(--border)!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}

.unsaved-card h3{
  color:var(--primary)!important;
  font-size:20px!important;
}

.portal-header,
.portal-brand,
.portal-nav{
  border-radius:8px;
}

.portal-header{
  background:#FFFFFF;
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow-soft);
}

@media (max-width:1050px){
  :root{--sidebar-width:292px}
  body.admin-body:not(.focus-mode) .main{
    width:100%;
    margin:0;
    padding:16px 14px 72px;
  }
  body.admin-body:not(.focus-mode) .sidebar{
    transform:translateX(102%);
    transition:transform .18s ease;
  }
  body.admin-body:not(.focus-mode) .sidebar.open{
    transform:translateX(0);
  }
  .mobile-nav-toggle{
    display:inline-flex!important;
  }
  .topbar{
    margin:-16px -14px 14px;
    padding:12px 14px;
  }
  .topbar h1{
    font-size:20px;
  }
  .entity-tabbar,
  .building-tabbar{
    top:65px;
    overflow:auto;
  }
  .smart-table-toolbar,
  .smart-table-tools{
    grid-template-columns:1fr;
  }
  .smart-table-actions{
    justify-content:flex-start;
  }
}

/* UPDATE 23: final report table sizing after the legacy theme cascade */
body.admin-body .report-table-panel[data-report-table] .smart-table-scroll table{
  width:100%!important;
  min-width:var(--report-table-min-width, 760px)!important;
  table-layout:auto!important;
}

body.admin-body .report-table-panel[data-report-table] .smart-table-scroll tbody td{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  white-space:nowrap!important;
}

/* UPDATE 24: universal A4 document printing for details and statements */
.universal-print-header{
  display:none;
}

.page-print-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
}

.page-print-button svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media print{
  body.has-universal-print{
    background:#FFFFFF!important;
    color:#172033!important;
    font-family:"IBM Plex Sans Arabic","Tajawal","Segoe UI",Arial,sans-serif!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  body.has-universal-print .sidebar,
  body.has-universal-print .topbar,
  body.has-universal-print .portal-header,
  body.has-universal-print .mobile-nav-toggle,
  body.has-universal-print .premium-bottom-nav,
  body.has-universal-print .smart-table-toolbar,
  body.has-universal-print .smart-table-pagination,
  body.has-universal-print .smart-mobile-cards,
  body.has-universal-print .smart-table-empty,
  body.has-universal-print .actions,
  body.has-universal-print .toolbar,
  body.has-universal-print .flash,
  body.has-universal-print form,
  body.has-universal-print button,
  body.has-universal-print .btn,
  body.has-universal-print .icon-btn{
    display:none!important;
  }

  body.has-universal-print .app-shell,
  body.has-universal-print .main{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    background:#FFFFFF!important;
    box-shadow:none!important;
  }

  body.has-universal-print .universal-print-header{
    display:flex!important;
    align-items:flex-end;
    justify-content:space-between;
    gap:12mm;
    margin:0 0 7mm;
    padding:0 0 4mm;
    border-bottom:1.2mm solid #123A5F;
  }

  body.has-universal-print .universal-print-header > div{
    display:flex;
    flex-direction:column;
    gap:1mm;
  }

  body.has-universal-print .universal-print-header > div:last-child{
    align-items:flex-end;
    text-align:left;
  }

  body.has-universal-print .universal-print-header strong{
    color:#123A5F;
    font-size:17px;
    font-weight:950;
  }

  body.has-universal-print .universal-print-header b{
    color:#172033;
    font-size:13px;
    font-weight:950;
  }

  body.has-universal-print .universal-print-header span{
    color:#64748B;
    font-size:9px;
    font-weight:800;
  }

  body.has-universal-print .page-head{
    display:block!important;
    margin:0 0 5mm!important;
    padding:0 0 4mm!important;
    border:0!important;
    border-bottom:1px solid #CBD5E1!important;
    border-radius:0!important;
    background:#FFFFFF!important;
    box-shadow:none!important;
    page-break-inside:avoid;
  }

  body.has-universal-print .page-head h1,
  body.has-universal-print .page-head h2{
    margin:0 0 2mm!important;
    color:#0B2A4A!important;
    font-size:20px!important;
    line-height:1.3!important;
  }

  body.has-universal-print .page-head p{
    margin:0!important;
    color:#475569!important;
    font-size:10px!important;
    line-height:1.6!important;
  }

  body.has-universal-print .eyebrow{
    color:#8A5B14!important;
    font-size:9px!important;
  }

  body.has-universal-print .panel,
  body.has-universal-print .card,
  body.has-universal-print .sub-card,
  body.has-universal-print .record-panel,
  body.has-universal-print .page-state{
    margin:0 0 4mm!important;
    padding:3.5mm!important;
    border:1px solid #D6DEE8!important;
    border-radius:2mm!important;
    background:#FFFFFF!important;
    box-shadow:none!important;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  body.has-universal-print .grid,
  body.has-universal-print .cards{
    gap:3mm!important;
  }

  body.has-universal-print .smart-table,
  body.has-universal-print .smart-table-scroll{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    overflow:visible!important;
    border:0!important;
    box-shadow:none!important;
  }

  body.has-universal-print .smart-table-scroll table,
  body.has-universal-print table{
    display:table!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
    border-collapse:collapse!important;
    font-size:8.4px!important;
  }

  body.has-universal-print thead{
    display:table-header-group!important;
  }

  body.has-universal-print tfoot{
    display:table-row-group!important;
  }

  body.has-universal-print tr{
    break-inside:avoid;
    page-break-inside:avoid;
  }

  body.has-universal-print th,
  body.has-universal-print td{
    padding:3.5px 4px!important;
    border:1px solid #CBD5E1!important;
    background:#FFFFFF!important;
    color:#1F2937!important;
    font-size:8.4px!important;
    line-height:1.4!important;
    white-space:normal!important;
    vertical-align:top!important;
  }

  body.has-universal-print th{
    background:#E8EEF5!important;
    color:#0B2A4A!important;
    font-weight:950!important;
    text-align:center!important;
  }

  body.has-universal-print tbody tr:nth-child(even) td{
    background:#FAFBFD!important;
  }

  body.has-universal-print .amount{
    direction:ltr!important;
    text-align:left!important;
    white-space:nowrap!important;
    font-weight:900!important;
  }

  body.has-universal-print a{
    color:inherit!important;
    text-decoration:none!important;
  }

  body.has-universal-print a[href]:after{
    content:none!important;
  }
}

/* UPDATE 22: unified professional report tables and output actions */
.report-table-panel[data-report-table]{
  padding:0!important;
  overflow:hidden!important;
  border:1px solid #D6E2EE!important;
  background:#FFFFFF!important;
  box-shadow:0 14px 34px rgba(15,42,68,.08)!important;
}

.report-table-panel[data-report-table] > .table-panel-head,
.report-methods-panel[data-report-table] > .table-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:0!important;
  padding:18px 20px!important;
  border-bottom:1px solid #DCE6F0;
  background:linear-gradient(135deg,#F8FBFE 0%,#EEF4FA 100%);
}

.report-table-title h2{
  margin:0!important;
  color:#102A43!important;
  font-size:18px!important;
  font-weight:950!important;
}

.report-table-title .muted{
  color:#627D98!important;
  font-size:12.5px!important;
  font-weight:800!important;
}

.report-table-actions{
  flex-wrap:nowrap;
}

.report-table-actions .btn{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:40px!important;
  padding:9px 13px!important;
  border-radius:8px!important;
  white-space:nowrap;
  font-size:13px!important;
  font-weight:900!important;
}

.report-table-actions .btn svg,
.smart-table-export-button svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex:0 0 auto;
}

.report-table-export-btn{
  border-color:#B9D9C9!important;
  background:#F2FBF6!important;
  color:#11734B!important;
}

.report-table-print-btn{
  background:#123A5F!important;
  border-color:#123A5F!important;
  color:#FFFFFF!important;
  box-shadow:0 9px 20px rgba(18,58,95,.16)!important;
}

.report-table-panel .smart-table,
.report-table-panel .smart-table-scroll{
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}

.report-table-panel .smart-table-toolbar{
  margin:0!important;
  padding:12px 16px!important;
  border:0!important;
  border-bottom:1px solid #E2EAF2!important;
  border-radius:0!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
}

.report-table-panel .smart-table-tools{
  grid-template-columns:minmax(240px,1fr) minmax(150px,auto) minmax(105px,auto) auto;
}

.report-table-panel .smart-table-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:5px 10px;
  border-radius:999px;
  background:#EEF4FA;
  color:#334E68!important;
}

.report-table-panel .smart-table-scroll table{
  width:100%;
  min-width:max-content;
  border-collapse:separate!important;
  border-spacing:0!important;
}

body.admin-body .report-table-panel .smart-table-scroll thead th,
body.admin-body .report-table-panel .smart-table-scroll thead th:first-child,
body.admin-body .report-table-panel .smart-table-scroll thead th:last-child{
  position:sticky;
  top:0;
  z-index:4;
  padding:12px 13px!important;
  border-color:#315A7D!important;
  background:#123A5F!important;
  color:#FFFFFF!important;
  font-size:12px!important;
  font-weight:950!important;
  white-space:normal!important;
}

.report-table-panel .table-sort-button{
  width:100%;
  justify-content:flex-start;
  min-height:28px!important;
  padding:2px 0!important;
  color:#FFFFFF!important;
  text-align:right;
}

.report-table-panel .smart-table-scroll tbody td{
  padding:11px 13px!important;
  border-bottom:1px solid #E5ECF3!important;
  color:#243B53!important;
  line-height:1.5;
  white-space:nowrap;
}

.report-table-panel .smart-table-scroll tbody tr:nth-child(even) td{
  background:#F8FAFD!important;
}

.report-table-panel .smart-table-scroll tbody tr:hover td{
  background:#EDF5FC!important;
}

.report-table-panel .smart-table-scroll .amount{
  color:#0B2A4A!important;
  font-weight:900!important;
  white-space:nowrap!important;
}

.report-table-panel .smart-table-pagination{
  padding:12px 16px 16px!important;
  border-top:1px solid #EEF2F6;
}

.smart-table-export-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:40px!important;
  padding:9px 12px!important;
  white-space:nowrap;
}

.smart-table-export-button.is-excel{
  border-color:#B9D9C9!important;
  background:#F2FBF6!important;
  color:#11734B!important;
}

.smart-table-export-button.is-print{
  border-color:#C9D8E7!important;
  background:#F4F8FC!important;
  color:#123A5F!important;
}

body:not(.report-print-preview) .report-print-header{
  display:none!important;
}

@media (max-width:760px){
  .report-table-panel[data-report-table] > .table-panel-head,
  .report-methods-panel[data-report-table] > .table-panel-head{
    align-items:stretch;
    flex-direction:column;
    padding:15px!important;
  }

  .report-table-actions{
    width:100%;
  }

  .report-table-actions .btn{
    flex:1 1 0;
  }

  .report-table-panel .smart-table-toolbar,
  .report-table-panel .smart-table-tools{
    grid-template-columns:1fr!important;
  }

  .smart-table-actions{
    width:100%;
  }

  .smart-table-export-button{
    flex:1 1 0;
  }
}

/* UPDATE 21: compact, task-oriented sidebar subgroups */
.nav-group .nav-subgroup{
  margin:5px 0!important;
  padding:0!important;
  overflow:hidden;
  border:1px solid #DCE6F0!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
}

.nav-group .nav-subgroup > summary.nav-subgroup-summary{
  min-height:39px!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  padding:8px 10px!important;
  list-style:none;
  cursor:pointer;
  border:0!important;
  border-radius:7px!important;
  color:#314159!important;
  background:#F4F7FA!important;
  font-size:13.5px!important;
  font-weight:850!important;
  box-shadow:none!important;
}

.nav-group .nav-subgroup > summary.nav-subgroup-summary::-webkit-details-marker{
  display:none;
}

.nav-group .nav-subgroup > summary.nav-subgroup-summary:after{
  content:"";
  width:7px;
  height:7px;
  flex:0 0 7px;
  margin-inline-start:2px;
  border-inline-end:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg);
  opacity:.65;
  transition:transform .16s ease;
}

.nav-group .nav-subgroup[open] > summary.nav-subgroup-summary:after{
  transform:rotate(225deg);
}

.nav-subgroup-label{
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
  flex:1 1 auto;
}

.nav-subgroup-label svg{
  width:17px;
  height:17px;
  flex:0 0 17px;
  color:#54708D;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.nav-subgroup-count{
  min-width:23px;
  height:21px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border-radius:999px;
  color:#52657A;
  background:#E5EDF5;
  font-size:11px;
  font-weight:900;
}

.nav-group .nav-subgroup[open],
.nav-group .nav-subgroup.active{
  border-color:#BFD0E2!important;
  background:#F8FBFF!important;
}

.nav-group .nav-subgroup[open] > summary.nav-subgroup-summary,
.nav-group .nav-subgroup.active > summary.nav-subgroup-summary{
  color:#123A5F!important;
  background:#E8F1F8!important;
}

.nav-group .nav-subgroup.active .nav-subgroup-count{
  color:#FFFFFF;
  background:#0F766E;
}

.nav-group .nav-subgroup .nav-children{
  margin:0!important;
  padding:5px 9px 8px!important;
  border:0!important;
  background:#FFFFFF;
}

.nav-group .nav-subgroup .nav-child{
  min-height:35px!important;
  margin:2px 0!important;
  padding:7px 9px!important;
  border-radius:7px!important;
  font-size:13px!important;
  font-weight:750!important;
}

.nav-group .nav-subgroup .nav-subgroup-overview{
  color:#123A5F!important;
  background:#EEF5FA!important;
}

.meter-unit-checklist{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
    gap:6px;
    min-width:220px;
  }

  .meter-unit-tools{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:minmax(120px,1fr) auto auto;
    gap:6px;
    align-items:center;
  }

  .meter-unit-tools .mini-action{
    min-height:36px;
    padding:0 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#0B2A4A;
    color:#fff;
    font-size:12px;
    cursor:pointer;
    white-space:nowrap;
  }

  .meter-unit-tools .mini-action.secondary{
    background:#fff;
    color:#334155;
  }

  .meter-unit-options{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
    gap:6px;
    max-height:156px;
    overflow:auto;
    padding:2px;
  }

  .meter-unit-summary{
    grid-column:1/-1;
    padding:9px 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#F8FAFC;
    color:#334155;
    font-size:12.5px;
    line-height:1.5;
  }

  .meter-unit-summary b,
  .meter-unit-summary span{
    display:block;
  }

  .meter-unit-summary b{
    color:#0B2A4A;
    margin-bottom:2px;
  }

  .meter-scope-help{
    display:block;
    margin-top:5px;
    color:#64748B;
    font-size:11.5px;
    line-height:1.5;
    max-width:240px;
  }

.meter-unit-checklist select{
  grid-column:1/-1;
  width:100%;
  min-height:38px;
}

.meter-unit-check{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  font-size:12.5px;
  font-weight:800;
  color:#334155;
}

.meter-unit-check input{
  width:16px;
  height:16px;
  accent-color:#0B2A4A;
}

.meter-unit-check:has(input:checked){
  border-color:#0B2A4A;
  background:#EFF6FF;
  color:#0B2A4A;
}

.meter-unit-check:has(input:disabled){
  opacity:.74;
  background:#F8FAFC;
}

/* 2. reset/base */
*{box-sizing:border-box}
html{
  min-height:100%;
  background:var(--bg);
  color-scheme:light;
}
body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:"IBM Plex Sans Arabic","Tajawal","Segoe UI",Tahoma,Arial,sans-serif;
  font-size:15px;
  line-height:1.65;
  letter-spacing:0;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
svg{stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round}
img,svg{max-width:100%}
.latin,
.amount,
td,
th,
input,
select,
textarea,
.card b,
.kpi-value,
html[lang*="nu-latn"]{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum";
}
.muted{color:var(--muted)}
.section-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.section-title-row h2{
  margin:0 0 4px;
  font-size:18px;
}
.section-title-row p{
  margin:0;
}
.reports-section .grid.cards{
  margin-top:0;
}
.amount{
  direction:ltr;
  text-align:left!important;
  font-weight:800;
  white-space:nowrap;
}
.app-shell{min-height:100vh}

/* 3. desktop-only admin shell */
body.admin-body{
  background:var(--bg);
}
body.admin-body .app-shell{
  display:block;
  min-height:100vh;
}
body.admin-body:not(.focus-mode) .sidebar{
  position:fixed;
  inset:0 0 0 auto;
  z-index:100;
  width:var(--sidebar-width);
  height:100vh;
}
body.admin-body:not(.focus-mode) .main{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  min-height:100vh;
  width:calc(100% - var(--sidebar-width));
  max-width:none;
  margin:0 var(--sidebar-width) 0 0;
  padding:18px 24px 56px;
  overflow:visible;
}
body.admin-body.focus-mode .main{
  width:min(1180px,calc(100% - 48px));
  margin:0 auto;
  padding:18px 0 56px;
}
.mobile-nav-toggle,
.premium-bottom-nav,
.smart-mobile-cards{
  display:none!important;
}

/* 4. sidebar */
.sidebar{
  display:flex;
  flex-direction:column;
  padding:16px 14px;
  background:var(--sidebar);
  color:var(--text);
  border-left:1px solid var(--border);
  box-shadow:-14px 0 32px rgba(31,41,51,.065);
  overflow:hidden;
}
.brand{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 12px;
  padding:13px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:linear-gradient(180deg,#fff,#FFFDF8);
  box-shadow:var(--shadow-soft);
}
.brand-mark{
  width:46px;
  height:46px;
  flex:0 0 46px;
  display:grid;
  place-items:center;
  border-radius:16px;
  color:#fff;
  font-size:22px;
  font-weight:900;
  background:linear-gradient(135deg,#D6B46A,var(--gold));
  box-shadow:0 12px 26px rgba(184,138,59,.22);
}
.brand b{
  display:block;
  color:var(--text);
  font-size:16px;
  font-weight:800;
  line-height:1.25;
}
.brand small{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}
.nav{
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding:4px 4px 10px;
  scrollbar-width:thin;
  scrollbar-color:#D7C693 transparent;
}
.nav::-webkit-scrollbar{width:8px}
.nav::-webkit-scrollbar-thumb{
  background:#D7C693;
  border-radius:999px;
}
.nav-group{
  margin:0 0 10px;
  padding:5px;
  border:1px solid #E7DDC7;
  border-radius:18px;
  background:linear-gradient(180deg,#FFFFFF,#FFFCF4);
  box-shadow:0 7px 18px rgba(31,41,51,.035);
}
.nav-group summary{
  list-style:none;
  cursor:pointer;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 13px;
  border:1px solid transparent;
  border-radius:14px;
  color:#4B3412;
  font-size:15px;
  font-weight:950;
  background:#F8F3E7;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s;
}
.nav-group summary::-webkit-details-marker{display:none}
.nav-group summary:after{
  content:"";
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-inline-end:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg);
  opacity:.8;
  transition:transform .15s;
}
.nav-group[open]{
  border-color:#D8BF82;
  background:linear-gradient(180deg,#FFF9EA,#FFFFFF);
  box-shadow:0 12px 26px rgba(184,138,59,.11);
}
.nav-group[open] summary{
  color:#5D3F0F;
  background:linear-gradient(180deg,#FFF2CF,#FFE7A7);
  border-color:#D8BF82;
  box-shadow:0 8px 18px rgba(184,138,59,.12);
}
.nav-group[open] summary:after{
  transform:rotate(225deg);
}
.nav a,
.nav-disabled{
  min-height:42px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px 11px;
  margin:3px 0;
  border:1px solid transparent;
  border-radius:16px;
  color:#27313B;
  font-size:14.5px;
  font-weight:750;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s,transform .15s;
}
.nav-group[open] a,
.nav-group[open] .nav-disabled{
  color:#24313F;
  background:#FFFFFF;
  border-color:#F0E5CF;
}
.nav a svg,
.nav-disabled svg{
  width:19px;
  height:19px;
  flex:0 0 19px;
  color:#8A641C;
  stroke-width:1.9;
}
.nav-group[open] a svg,
.nav-group[open] .nav-disabled svg{
  color:#A36F12;
}
.nav a:hover{
  color:#5D3F0F;
  background:#FFF4D9;
  border-color:#E2C77F;
  transform:translateX(-1px);
}
.nav a.active{
  color:#442F0D;
  background:linear-gradient(180deg,#FFE9AE,#FFD875);
  border-color:#C9942B;
  box-shadow:0 10px 24px rgba(184,138,59,.14);
  font-weight:900;
  position:relative;
}
.nav a.active:after{
  content:"";
  position:absolute;
  right:-1px;
  top:9px;
  bottom:9px;
  width:4px;
  border-radius:999px;
  background:var(--gold);
}
.nav-subgroup{
  margin:7px 0;
  padding:6px;
  border:1px solid #EFE1C8;
  border-radius:14px;
  background:#FFFCF4;
}
.nav-subgroup-title{
  margin-top:0;
}
.nav-children{
  margin:4px 0 0;
  padding-inline-start:12px;
  border-inline-start:2px solid #E7D3A9;
}
.nav-group[open] .nav-child{
  min-height:34px;
  padding:7px 10px;
  border-radius:12px;
  font-size:13px;
  font-weight:650;
  background:#FFFDF8;
}
.nav-child svg{
  width:16px;
  height:16px;
  flex-basis:16px;
}
.nav-disabled{
  opacity:.55;
  cursor:not-allowed;
}
.accounting-category-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:10px;
}
.accounting-category-check{
  min-height:46px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #E6D8BE;
  border-radius:12px;
  background:#FFFFFF;
  color:#24313F;
  font-weight:750;
  cursor:pointer;
  transition:background .15s,border-color .15s,box-shadow .15s;
}
.accounting-category-check input{
  width:18px;
  height:18px;
  accent-color:#0F3D63;
}
.accounting-category-check.selected{
  background:#EEF7FF;
  border-color:#8CB7D7;
  box-shadow:0 8px 18px rgba(15,61,99,.08);
}
.selected-accounting-category{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin:0 0 16px;
  padding:12px;
  border:1px solid #D6E6F2;
  border-radius:12px;
  background:#F5FAFE;
}
.selected-accounting-category b{
  color:#0F3D63;
}
.selected-accounting-category span,
.selected-accounting-category em{
  color:#52616F;
  font-style:normal;
}
.expense-smart-profile{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(260px,1.4fr);
  gap:14px;
  align-items:start;
  margin:0 0 16px;
  padding:14px 16px;
  border:1px solid #D8E6D2;
  border-radius:12px;
  background:#F7FBF4;
}
.expense-smart-profile b{
  display:block;
  margin-bottom:4px;
  color:#14532D;
  font-size:16px;
}
.expense-smart-profile p{
  margin:0;
  color:#425466;
  line-height:1.7;
}
.expense-smart-profile ul{
  margin:0;
  padding:0 18px 0 0;
  color:#334155;
  line-height:1.75;
}
.expense-smart-profile li::marker{
  color:#16A34A;
}
.expense-field-hidden{
  display:none!important;
}
.employee-commission-panel{
  display:grid;
  grid-template-columns:minmax(220px,.85fr) minmax(280px,1fr) minmax(260px,1fr);
  gap:14px;
  align-items:start;
  margin:0 0 16px;
  padding:14px 16px;
  border:1px solid #F1C376;
  border-radius:12px;
  background:#FFF8E8;
}
.employee-commission-panel[hidden]{
  display:none!important;
}
.employee-commission-panel b{
  display:block;
  margin-bottom:4px;
  color:#7A4B0E;
}
.employee-commission-panel p{
  margin:0;
  color:#475569;
  line-height:1.65;
}
.employee-commission-summary{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:8px;
  color:#334155;
}
.employee-commission-summary > span,
.employee-commission-summary.warn{
  min-height:42px;
  padding:8px 10px;
  border:1px solid #F3D69B;
  border-radius:10px;
  background:#FFFFFF;
}
.employee-commission-summary b{
  margin:0;
  color:#92400E;
  font-size:12px;
}
.employee-commission-summary.warn b,
.employee-commission-summary.warn > span{
  grid-column:1 / -1;
}
.employee-commission-summary.warn > span{
  min-height:auto;
  padding:0;
  border:0;
  background:transparent;
  line-height:1.65;
}
.employee-commission-summary a{
  display:inline-flex;
  margin:5px 8px 0 0;
  color:#0F3D63;
  font-weight:800;
}
@media (max-width: 760px){
  .expense-smart-profile{
    grid-template-columns:1fr;
  }
  .employee-commission-panel{
    grid-template-columns:1fr;
  }
}
.accounting-flags,
.manual-allocation-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
  margin:16px 0;
}
.allocation-settings{
  margin:18px 0;
  padding:16px;
  border:1px solid #E6D8BE;
  border-radius:14px;
  background:#FFFCF4;
}
.allocation-settings h3{
  margin:0 0 6px;
  color:#10233A;
  font-size:18px;
}
.checkbox-field{
  min-height:44px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border:1px solid #E6D8BE;
  border-radius:12px;
  background:#fff;
  font-weight:750;
}
.checkbox-field input{
  width:18px;
  height:18px;
  accent-color:#0F3D63;
}
.nav-disabled em{
  margin-inline-start:auto;
  color:var(--gold-dark);
  font-size:11px;
  font-style:normal;
}

/* 5. page header */
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  min-height:0;
  margin:0 0 14px;
  padding:0;
  background:transparent;
  border:0;
}
.topbar h1{
  margin:2px 0 0;
  color:var(--text);
  font-size:28px;
  line-height:1.2;
  font-weight:850;
}
.topbar-actions,
.actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  flex-wrap:wrap;
}
.breadcrumb{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 2px;
  color:var(--muted);
  font-size:12.5px;
  font-weight:800;
}
.breadcrumb b:last-child{color:var(--gold-dark)}
.eyebrow{
  display:inline-flex;
  color:var(--gold-dark);
  font-size:12px;
  font-weight:900;
}
.page-head{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:0!important;
  margin:0 0 16px!important;
  padding:18px 20px!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius-lg)!important;
  background:linear-gradient(135deg,#fff,#FFF9EA)!important;
  box-shadow:var(--shadow-soft)!important;
}
.page-head > div:first-child{min-width:0}
.page-head h2{
  margin:4px 0 0!important;
  color:var(--text);
  font-size:27px;
  line-height:1.2;
  font-weight:850;
}
.page-head h2 svg{
  width:25px;
  height:25px;
  margin-inline-end:6px;
  color:var(--gold);
  vertical-align:-5px;
}
.page-head p{
  margin:7px 0 0!important;
  color:var(--muted);
  max-width:980px;
  font-size:14.5px;
}

/* 6. KPI/cards */
.grid{
  display:grid;
  gap:14px;
}
.grid.cards{
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}
@media (min-width:1500px){
  .grid.cards{grid-template-columns:repeat(5,minmax(0,1fr))}
}
.panel,
.card,
.sub-card,
.page-state,
.record-panel div,
.smart-table{
  background:var(--card)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius)!important;
  box-shadow:var(--shadow-soft)!important;
}
.panel{
  padding:18px!important;
  margin:0 0 16px!important;
}
.panel h2,
.panel h3,
.sub-card h3{
  margin:0 0 12px;
  color:var(--text);
  font-weight:850;
}
.panel h2{font-size:20px}
.panel h3{font-size:17px}
.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
}
.section-title h3{margin:4px 0 0}
.section-title b{
  flex:0 0 auto;
  color:var(--gold-dark);
  font-size:13px;
  font-weight:900;
}
.inline-form{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.inline-form input{
  width:min(180px,100%);
  min-height:36px;
}
.inline-form button{
  min-height:36px;
  padding:7px 12px;
}
.card{
  position:relative;
  min-height:106px;
  padding:16px!important;
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg,#D6B46A,var(--gold));
}
.card span{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.card b{
  display:block;
  margin-top:8px;
  color:var(--text);
  font-size:24px;
  line-height:1.25;
  font-weight:850;
  overflow-wrap:anywhere;
}
.dashboard-card{
  cursor:pointer;
  transition:background .15s,border-color .15s,box-shadow .15s,transform .15s;
}
.dashboard-card:hover{
  border-color:var(--gold-soft)!important;
  box-shadow:var(--shadow)!important;
  transform:translateY(-1px);
}
.dashboard-card:focus-visible{
  outline:3px solid rgba(184,138,59,.25);
  outline-offset:3px;
}
.dashboard-card-value{
  position:relative;
  z-index:2;
  display:inline-block;
}
.dashboard-card-value:hover b{
  color:var(--gold-dark);
  text-decoration:underline;
  text-underline-offset:4px;
}
.card .card-icon,
.metric-icon{
  width:38px;
  height:38px;
  display:inline-grid;
  place-items:center;
  margin-bottom:8px;
  border-radius:14px;
  background:var(--gold-bg);
  color:var(--gold-dark);
}

/* 7. tables */
.table-panel{
  overflow:visible!important;
}
.smart-table{
  overflow:hidden;
}
.smart-table-toolbar,
.toolbar{
  display:flex;
  align-items:end;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 14px!important;
  padding:13px!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius)!important;
  background:var(--card)!important;
  box-shadow:var(--shadow-soft)!important;
}
.smart-table-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
}
.smart-table-tools{
  display:grid;
  grid-template-columns:minmax(260px,1fr) minmax(170px,auto) minmax(110px,auto) auto;
  gap:8px;
  min-width:0;
}
.smart-table-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}
.smart-table-scroll{
  display:block!important;
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
}
table{
  width:100%;
  min-width:max-content;
  border:0!important;
  border-collapse:separate;
  border-spacing:0;
  background:var(--card);
}
th,
td{
  padding:12px 14px!important;
  border-bottom:1px solid #EEE8DC!important;
  color:var(--text);
  text-align:right;
  vertical-align:middle;
  white-space:nowrap;
  font-size:14px;
}
th{
  position:sticky;
  top:0;
  z-index:3;
  background:var(--gold-bg)!important;
  color:var(--gold-dark)!important;
  font-size:12.5px;
  font-weight:900;
}
tbody tr:last-child td{border-bottom:0!important}
tbody tr:hover td{background:#FFFDF7}
.table-sort-button{
  min-height:auto!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--gold-dark)!important;
  box-shadow:none!important;
  font:inherit;
  font-weight:900!important;
  cursor:pointer;
}
.smart-table-empty{
  display:none;
  padding:22px;
  color:var(--muted);
  text-align:center;
  font-weight:800;
}
.smart-table.is-empty .smart-table-empty{display:block}
.smart-table-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 2px 0;
}
.smart-table-page-controls{
  display:flex;
  gap:8px;
}
.smart-table-count{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.row-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  white-space:nowrap;
}

/* 8. forms */
.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
}
.field label{
  display:block;
  margin:0 0 6px;
  color:var(--text);
  font-size:13.5px;
  font-weight:850;
}
.field input,
.field select,
.field textarea,
.smart-table-search,
.smart-table-filter,
.smart-table-size,
td input,
td select{
  width:100%;
  min-height:46px;
  padding:10px 13px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font:inherit;
  box-shadow:none;
}
.field textarea{min-height:96px;resize:vertical}
.field input:focus,
.field select:focus,
.field textarea:focus,
.smart-table-search:focus,
.smart-table-filter:focus,
.smart-table-size:focus{
  outline:0;
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(184,138,59,.13);
}
.field input::placeholder,
.field textarea::placeholder,
.smart-table-search::placeholder{color:#9CA3AF}
.password-field{
  position:relative;
  display:block;
  width:100%;
}
.inline-form .password-field{
  width:min(180px,100%);
}
.password-field input{
  padding-inline-end:48px!important;
}
.password-toggle{
  position:absolute;
  inset-inline-end:6px;
  top:50%;
  width:34px;
  height:34px;
  min-height:34px!important;
  padding:0!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:var(--muted)!important;
  box-shadow:none!important;
  transform:translateY(-50%)!important;
}
.password-toggle:hover,
.password-toggle:focus{
  background:var(--neutral-bg)!important;
  color:var(--gold-dark)!important;
  box-shadow:none!important;
  transform:translateY(-50%)!important;
}
.password-toggle svg{
  width:19px;
  height:19px;
  stroke-width:2;
}
.duration-choice-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.duration-choice-list label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:46px;
  margin:0;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  font-weight:850;
}
.duration-choice-list input[type="radio"]{
  width:auto;
  min-height:0;
  padding:0;
  margin:0;
  border:0;
  box-shadow:none;
}
.confirm-check{
  display:flex;
  align-items:center;
  gap:10px;
  margin:14px 0;
  font-weight:850;
}
.confirm-check input{
  width:18px;
  height:18px;
  accent-color:var(--gold);
}

/* 9. buttons/actions */
.btn,
button,
.icon-btn{
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 14px;
  border:1px solid rgba(124,90,32,.22);
  border-radius:14px;
  background:linear-gradient(180deg,#C99A4A,var(--gold));
  color:#fff;
  font-family:inherit;
  font-size:14px;
  font-weight:850;
  line-height:1.2;
  cursor:pointer;
  box-shadow:0 10px 20px rgba(184,138,59,.18);
  transition:transform .15s,box-shadow .15s,background .15s,border-color .15s;
}
.btn:hover,
button:hover,
.icon-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 26px rgba(184,138,59,.24);
}
.btn.secondary,
button.secondary{
  background:var(--gold-bg);
  color:var(--gold-dark);
  border-color:#D6B46A;
  box-shadow:var(--shadow-soft);
}
.btn.ghost,
button.ghost,
.icon-btn.ghost{
  background:#fff;
  color:var(--gold-dark);
  border-color:var(--gold-soft);
  box-shadow:var(--shadow-soft);
}
.btn.danger,
button.danger,
.icon-btn.danger{
  background:var(--danger);
  color:#fff;
  border-color:var(--danger);
}
.btn.success,
button.success{background:var(--success);border-color:var(--success)}
.btn.warning,
button.warning{background:var(--warning);border-color:var(--warning)}
.btn.small,
.icon-btn.small{
  min-height:34px;
  padding:7px 11px;
  border-radius:12px;
  font-size:12.5px;
}
.icon-btn.icon-only{
  width:36px;
  height:36px;
  flex:0 0 36px;
  padding:0;
}
.icon-btn.icon-only svg{
  width:18px;
  height:18px;
  stroke-width:2;
}
.topbar-icon{
  position:relative;
  width:42px!important;
  height:42px!important;
  flex-basis:42px!important;
  border-radius:999px!important;
  overflow:visible!important;
}
.topbar-menu{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.topbar-badge{
  position:absolute;
  top:-2px;
  left:-2px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:17px;
  height:17px;
  padding:0 4px;
  border:2px solid #FFFFFF;
  border-radius:999px;
  background:#DC2626;
  color:#FFFFFF;
  font-size:10px;
  line-height:1;
  font-weight:900;
}
.topbar-dropdown{
  position:absolute;
  top:calc(100% + 9px);
  left:0;
  z-index:60;
  display:grid;
  min-width:230px;
  padding:8px;
  border:1px solid #D9E1EA;
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:0 18px 42px rgba(15,23,42,.16);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(4px);
  transition:opacity .14s,transform .14s,visibility .14s;
}
.topbar-menu:hover .topbar-dropdown,
.topbar-menu:focus-within .topbar-dropdown{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0);
}
.topbar-dropdown a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 10px;
  border-radius:7px;
  color:#0F172A;
  font-size:13px;
  font-weight:800;
  text-decoration:none;
}
.topbar-dropdown a:hover{
  background:#F8FAFC;
  color:#7A4B0E;
}
.inline-logout-form{
  display:inline-flex;
  align-items:center;
  margin:0;
}
.inline-logout-form button{
  white-space:nowrap;
}
.portal-logout-form{
  margin:0;
}
.portal-logout-form button{
  padding:8px 12px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:900;
  cursor:pointer;
}
.portal-logout-form button:hover{
  color:var(--gold-dark);
}
.topbar-dropdown-form{
  margin:0;
}
.topbar-dropdown-form button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  gap:12px;
  padding:9px 10px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#0F172A;
  font:inherit;
  font-size:13px;
  font-weight:800;
  text-align:right;
  cursor:pointer;
}
.topbar-dropdown-form button:hover{
  background:#F8FAFC;
  color:#7A4B0E;
}
.topbar-dropdown b{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:#EEF2FF;
  color:#1E3A8A;
  font-size:11px;
  font-weight:900;
}
button:disabled,
.btn.disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none!important;
}

/* Dashboard overview */
body[data-current-page="dashboard.php"] .topbar{
  align-items:center;
  margin-bottom:18px;
}
body[data-current-page="dashboard.php"] .topbar h1{
  margin-top:0;
  font-size:25px;
  font-weight:780;
  letter-spacing:0;
}
body[data-current-page="dashboard.php"] .topbar .eyebrow{
  color:#334155;
  font-size:13px;
  font-weight:850;
}
.dashboard-control-panel{
  display:grid;
  grid-template-columns:minmax(280px,1fr) minmax(420px,620px);
  align-items:start;
  gap:22px;
  margin:0 0 18px;
  padding:20px 22px;
  border:1px solid #D9E1EA;
  border-radius:8px;
  background:#FFFFFF;
  box-shadow:0 12px 28px rgba(15,23,42,.055);
}
.dashboard-control-panel > div:first-child{
  min-width:0;
  max-width:420px;
}
.dashboard-control-panel h2{
  margin:5px 0 4px;
  color:#0F172A;
  font-size:24px;
  line-height:1.25;
  font-weight:780;
}
.dashboard-control-panel p{
  margin:0;
  color:#64748B;
  font-size:14px;
}
.dashboard-portal-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.dashboard-portal-actions .btn{
  min-height:32px;
  padding:7px 12px;
  border-radius:7px;
  font-size:12px;
  box-shadow:none;
}
.dashboard-kicker{
  display:inline-flex;
  color:#2563EB;
  font-size:12px;
  font-weight:850;
}
.dashboard-filter{
  display:grid;
  grid-template-columns:repeat(2,minmax(150px,1fr));
  gap:10px;
  align-items:end;
  min-width:0;
  width:100%;
}
.dashboard-filter label{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}
.dashboard-filter label span{
  color:#475569;
  font-size:12px;
  font-weight:800;
}
.dashboard-filter select,
.dashboard-filter input{
  min-height:40px;
  border-color:#D6DEE8;
  border-radius:7px;
  background:#F8FAFC;
  color:#0F172A;
  font-size:14px;
  box-shadow:none;
}
.dashboard-filter .btn{
  min-height:40px;
  border-radius:7px;
  background:#0F172A;
  border-color:#0F172A;
  box-shadow:none;
}
.dashboard-period-strip{
  display:grid;
  grid-template-columns:1.2fr repeat(3,1fr);
  gap:12px;
  margin:0 0 18px;
}
.dashboard-period-strip div{
  min-height:64px;
  padding:12px 14px;
  border:1px solid #E2E8F0;
  border-radius:8px;
  background:#F8FAFC;
}
.dashboard-period-strip span{
  display:block;
  margin-bottom:2px;
  color:#64748B;
  font-size:12px;
  font-weight:800;
}
.dashboard-period-strip b{
  display:block;
  color:#0F172A;
  font-size:15px;
  font-weight:820;
  overflow-wrap:anywhere;
}
.dashboard-period-strip div:not(:first-child) b{
  direction:ltr;
  unicode-bidi:embed;
  text-align:right;
  font-size:14px;
}
.dashboard-metrics-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:14px;
  margin:0 0 22px;
}
.dashboard-metric-card{
  min-height:142px;
  padding:14px!important;
  border:0!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
  cursor:pointer;
  overflow:hidden;
  transition:background .15s,box-shadow .15s,transform .15s;
}
.dashboard-metric-card:before{display:none!important}
.dashboard-metric-card:hover{
  background:#F8FAFC!important;
  box-shadow:0 16px 34px rgba(15,23,42,.075)!important;
  transform:translateY(-1px);
}
.metric-row{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.metric-label{
  color:#111827!important;
  font-size:14px!important;
  line-height:1.25;
  font-weight:700!important;
}
.dashboard-metric-card .dashboard-card-value{
  display:block;
  width:max-content;
  max-width:100%;
}
.dashboard-metric-card b{
  margin:0!important;
  color:#0F172A!important;
  font-size:24px!important;
  line-height:1.05!important;
  font-weight:780!important;
  letter-spacing:0!important;
}
.dashboard-metric-card b.metric-value-blue{color:#0B2A4A!important}
.dashboard-metric-card b.metric-value-expense{color:#D97706!important}
.dashboard-metric-card b.metric-value-loss{color:#DC2626!important}
.dashboard-metric-card b.metric-value-profit{color:#0F8A4B!important}
.dashboard-metric-card b.metric-value-commission{
  color:#EAB308!important;
  text-shadow:
    0 1px 0 #111827,
    1px 0 0 #111827,
    0 -1px 0 #111827,
    -1px 0 0 #111827;
}
.metric-subline{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:22px;
  margin:6px 0 8px;
  color:#64748B;
  font-size:12px;
  white-space:normal;
}
.metric-change{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:850;
}
.metric-change.is-good{
  color:#047857;
  background:#DFF7EA;
}
.metric-change.is-bad{
  color:#DC2626;
  background:#FEE2E2;
}
.metric-change.is-neutral{
  color:#475569;
  background:#E2E8F0;
}
.metric-sparkline{
  display:block;
  width:100%;
  height:38px;
  margin-top:2px;
  overflow:visible;
}
.dashboard-profit-grid{
  grid-template-columns:repeat(auto-fit,minmax(360px,1fr));
}
body[data-current-page="dashboard.php"] .panel{
  border-radius:8px!important;
  border-color:#E2E8F0!important;
  box-shadow:none!important;
}
body[data-current-page="dashboard.php"] .panel h2{
  color:#111827;
  font-size:18px;
  font-weight:760;
}
@media (max-width:1180px){
  .dashboard-control-panel{
    grid-template-columns:1fr;
  }
  .dashboard-filter{
    width:100%;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-metrics-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .dashboard-period-strip{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:760px){
  .dashboard-metrics-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:560px){
  .dashboard-filter,
  .dashboard-metrics-grid,
  .dashboard-period-strip{
    grid-template-columns:1fr;
  }
}

/* 10. badges */
.badge,
.status-pill,
.label-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:5px 10px;
  border:1px solid transparent;
  border-radius:999px;
  background:var(--neutral-bg);
  color:var(--text);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.badge-ok,
.badge-success,
.status-pill.is-good{
  background:var(--success-bg);
  color:var(--success);
  border-color:#BCE8D2;
}
.badge-warn,
.status-pill.is-warning{
  background:var(--warning-bg);
  color:var(--warning);
  border-color:#F3D29A;
}
.badge-danger,
.status-pill.is-danger{
  background:var(--danger-bg);
  color:var(--danger);
  border-color:#FECACA;
}
.badge-info,
.status-pill.is-info{
  background:var(--info-bg);
  color:var(--info);
  border-color:#C7D7FE;
}
.badge-neutral{
  background:var(--neutral-bg);
  color:var(--muted);
  border-color:var(--border);
}
.row-danger td{
  background:#FFF1F2;
}

/* 11. details layout */
.record-panel dl{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:12px;
  margin:0;
}
.record-panel div{
  padding:13px;
  background:#FFFDF8!important;
  box-shadow:none!important;
}
.record-panel dt{
  margin:0 0 4px;
  color:var(--muted);
  font-size:12.5px;
  font-weight:850;
}
.record-panel dd{
  margin:0;
  color:var(--text);
  font-size:15px;
  font-weight:850;
}
.tabs,
.building-tabbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 14px;
  padding:0 0 10px;
  border-bottom:1px solid var(--border);
  background:transparent!important;
  position:static!important;
}
.tab,
.building-tab{
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--gold-soft);
  border-radius:999px;
  background:#fff;
  color:var(--gold-dark);
  box-shadow:none;
  font-weight:850;
}
.tab.active,
.building-tab.active{
  background:var(--gold);
  color:#fff;
  border-color:var(--gold);
}
.building-tab-panel{display:none}
.building-tab-panel.active{display:block}
.owner-schedule-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 0 14px;
}
.owner-schedule-summary section{
  min-height:88px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#FFFDF8;
}
.owner-schedule-summary span{
  display:block;
  margin:0 0 6px;
  color:var(--muted);
  font-size:12.5px;
  font-weight:850;
}
.owner-schedule-summary b{
  display:block;
  color:var(--text);
  font-size:18px;
  line-height:1.25;
  font-weight:850;
}
.owner-schedule-summary small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.5;
}
.owner-cheques-table-wrap{
  overflow-x:auto;
}
.owner-cheques-table th,
.owner-cheques-table td{
  white-space:nowrap;
}
@media (max-width:1100px){
  .owner-schedule-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:620px){
  .owner-schedule-summary{grid-template-columns:1fr}
}
.empty-state,
.page-empty-state,
.page-error-state{
  padding:22px;
  border-style:dashed!important;
  text-align:center;
}
.empty-state b,
.page-state h3{
  display:block;
  margin:4px 0 6px;
  color:var(--text);
  font-size:18px;
  font-weight:850;
}
.page-error-state{
  background:#FFF8F8!important;
  border-color:#FECACA!important;
}

/* 12. reports */
.report-card span{min-height:0}
.report-header,
.ui-report-header{
  margin:0 0 16px;
}

/* 13. maintenance workflow */
.maintenance-stepper,
.maintenance-flow{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
  margin:0 0 16px;
}
.maintenance-step{
  min-height:70px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  color:var(--muted);
  font-weight:850;
  box-shadow:var(--shadow-soft);
}
.maintenance-step-index{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  flex:0 0 30px;
  border-radius:50%;
  background:var(--gold-bg);
  color:var(--gold-dark);
  font-weight:900;
}
.maintenance-step.is-current{
  border-color:var(--gold);
  color:var(--gold-dark);
}
.maintenance-step.is-done{
  border-color:#BCE8D2;
  background:#F8FFFB;
  color:var(--success);
}

/* 14. tenant/broker portals */
body.portal-body,
body.login-page{
  background:
    linear-gradient(135deg,rgba(239,226,194,.52),rgba(247,245,239,0) 32%),
    var(--bg);
}
body.portal-body .app-shell{
  display:block;
  min-height:100vh;
}
body.portal-body .sidebar,
body.portal-body .premium-bottom-nav,
body.portal-body .mobile-nav-toggle{
  display:none!important;
}
.portal-header{
  position:sticky;
  top:0;
  z-index:50;
  width:min(1120px,calc(100% - 28px));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:12px auto 0;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow);
}
.portal-brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.portal-brand b{
  display:block;
  color:var(--text);
  font-size:17px;
  font-weight:850;
}
.portal-brand small{
  display:block;
  color:var(--muted);
  font-size:12px;
}
.portal-nav{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.portal-nav a{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border:1px solid transparent;
  border-radius:999px;
  color:var(--muted);
  font-weight:850;
}
.portal-nav a.active,
.portal-nav a:hover{
  color:var(--gold-dark);
  border-color:var(--gold-soft);
  background:var(--gold-bg);
}
body.portal-body .main{
  width:min(1120px,calc(100% - 28px));
  max-width:none;
  margin:0 auto;
  padding:16px 0 64px;
}
body.portal-body .topbar{
  margin:0 0 12px;
}
.login-page{
  display:grid;
  place-items:center;
  min-height:100vh;
  padding:24px;
}
.login-box{
  width:min(430px,100%);
  padding:24px;
  border:1px solid var(--border);
  border-radius:28px;
  background:#fff;
  box-shadow:0 24px 58px rgba(31,41,51,.11);
}

.unsaved-dialog{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(17,24,39,.44);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.unsaved-dialog.open{
  opacity:1;
  pointer-events:auto;
}
.unsaved-card{
  width:min(460px,100%);
  padding:22px;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:#fff;
  box-shadow:0 28px 72px rgba(15,23,42,.24);
  direction:rtl;
  text-align:right;
}
.unsaved-card h3{
  margin:0 0 8px;
  color:var(--text);
  font-size:20px;
  font-weight:900;
}
.unsaved-card p{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.8;
}
.unsaved-card .actions{
  display:flex;
  justify-content:flex-start;
  gap:8px;
  margin:0;
  padding:0;
}

/* 15. print */
@media print{
  @page{size:A4;margin:12mm}
  html,
  body{
    background:#fff!important;
    color:#111827!important;
    overflow:visible!important;
  }
  .sidebar,
  .portal-header,
  .mobile-nav-toggle,
  .premium-bottom-nav,
  .topbar-actions,
  .actions,
  .toolbar,
  .smart-table-toolbar,
  .smart-table-pagination,
  .work-overlay,
  .work-modal-overlay,
  .unsaved-dialog,
  button,
  .btn,
  .icon-btn{
    display:none!important;
  }
  .app-shell,
  .main{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  .topbar:before{
    content:"Aqari Smart V2 - Etlala Real Estate";
    display:block;
    margin:0 0 8px;
    color:#7C5A20;
    font-weight:900;
  }
  .panel,
  .card,
  .page-head,
  .smart-table,
  .smart-table-scroll,
  .record-panel div{
    box-shadow:none!important;
    border-color:#D1D5DB!important;
    border-radius:0!important;
    background:#fff!important;
  }
  table{
    width:100%!important;
    min-width:0!important;
    border-collapse:collapse!important;
  }
  th,
  td{
    border:1px solid #D1D5DB!important;
    padding:7px!important;
    white-space:normal!important;
  }
  th{
    background:#F3F4F6!important;
    color:#111827!important;
  }
}

/* 16. unsupported small screen notice */
@media (max-width:900px){
  body.admin-body{
    overflow:hidden!important;
    background:var(--bg)!important;
  }
  body.admin-body .sidebar,
  body.admin-body:not(.focus-mode) .main,
  body.admin-body.focus-mode .main,
  body.admin-body .premium-bottom-nav,
  body.admin-body .mobile-nav-toggle,
  body.admin-body .work-overlay,
  body.admin-body .work-modal-overlay{
    display:none!important;
  }
  body.admin-body .app-shell{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
  }
  body.admin-body .app-shell:before{
    content:"هذا النظام مخصص للاستخدام من الكمبيوتر أو اللابتوب. يرجى فتحه من شاشة أكبر لإدارة البيانات والتقارير بشكل صحيح.";
    width:min(620px,100%);
    display:block;
    padding:28px;
    border:1px solid var(--border);
    border-radius:24px;
    background:#fff;
    color:var(--text);
    box-shadow:var(--shadow);
    text-align:center;
    font-size:19px;
    font-weight:850;
    line-height:1.9;
  }
}

/* Responsive admin override: keep admin usable below 900px. */
@media (max-width:900px){
  body.admin-body{
    overflow:auto!important;
    background:var(--bg)!important;
  }
  body.admin-body .app-shell{
    min-height:100vh!important;
    display:block!important;
    place-items:initial!important;
    padding:0!important;
  }
  body.admin-body .app-shell:before{
    content:none!important;
    display:none!important;
  }
  body.admin-body:not(.focus-mode) .sidebar{
    display:block!important;
    position:fixed;
    top:0;
    right:0;
    bottom:0;
    width:min(86vw, var(--sidebar-width));
    max-width:var(--sidebar-width);
    transform:translateX(105%);
    transition:transform .22s ease;
    z-index:1100;
    box-shadow:-18px 0 42px rgba(31,41,51,.16);
  }
  body.admin-body:not(.focus-mode) .sidebar.open{
    transform:translateX(0);
  }
  body.admin-body:not(.focus-mode) .main,
  body.admin-body.focus-mode .main{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    max-width:none!important;
    min-height:100vh;
    margin:0!important;
    overflow-x:hidden;
  }
  body.admin-body:not(.focus-mode) .main{
    padding:72px 14px 28px!important;
  }
  body.admin-body.focus-mode .main{
    padding:18px 14px 28px!important;
  }
  body.admin-body .premium-bottom-nav,
  body.admin-body .work-overlay,
  body.admin-body .work-modal-overlay{
    display:none!important;
  }
  body.admin-body .mobile-nav-toggle{
    display:inline-flex!important;
    position:fixed;
    top:14px;
    right:14px;
    z-index:1200;
    width:46px;
    height:46px;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:5px;
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
    box-shadow:var(--shadow-sm);
  }
  body.admin-body.focus-mode .mobile-nav-toggle{
    display:none!important;
  }
  body.admin-body .mobile-nav-toggle span{
    width:18px;
    height:2px;
    border-radius:999px;
    background:var(--gold-dark);
  }
  body.admin-body .topbar{
    min-height:auto;
    padding:14px;
    gap:12px;
    align-items:flex-start;
  }
  body.admin-body:not(.focus-mode) .topbar{
    padding-right:70px;
  }
  body.admin-body .topbar h1{
    font-size:24px;
    line-height:1.25;
  }
  body.admin-body .topbar-actions,
  body.admin-body .actions,
  body.admin-body .toolbar{
    flex-wrap:wrap;
  }
  body.admin-body .form-grid,
  body.admin-body .kpi-grid,
  body.admin-body .cards,
  body.admin-body .grid{
    grid-template-columns:1fr!important;
  }
  body.admin-body .panel,
  body.admin-body .page-head,
  body.admin-body .toolbar,
  body.admin-body .table-panel{
    border-radius:18px;
  }
  body.admin-body .page-head{
    padding:18px;
    gap:14px;
  }
  body.admin-body .table-panel,
  body.admin-body .smart-table-scroll{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  body.admin-body .table-panel table,
  body.admin-body .smart-table-scroll table{
    min-width:760px!important;
  }
  body.admin-body .record-panel dl{
    grid-template-columns:1fr!important;
  }
}

/* Defensive visibility guard for desktop admin pages. */
@media (min-width:901px){
  body.admin-body .main,
  body.admin-body .page-head,
  body.admin-body .toolbar,
  body.admin-body .table-panel,
  body.admin-body .page-state,
  body.admin-body .smart-table,
  body.admin-body .panel{
    visibility:visible!important;
    opacity:1!important;
  }
  body.admin-body .table-panel > table,
  body.admin-body .smart-table-scroll > table{
    display:table!important;
    visibility:visible!important;
    opacity:1!important;
  }
  body.admin-body .table-panel tbody,
  body.admin-body .smart-table-scroll tbody{
    display:table-row-group;
  }
}

.post-save-confirmation{
  --post-save-accent:#2563eb;
  --post-save-bg:#eff6ff;
  --post-save-border:#bfdbfe;
  margin:0 0 18px;
  padding:18px;
  border:1px solid var(--post-save-border);
  border-right:6px solid var(--post-save-accent);
  border-radius:12px;
  background:var(--post-save-bg);
  box-shadow:0 12px 28px rgba(15,23,42,.08);
}
.post-save-confirmation.success{
  --post-save-accent:#15803d;
  --post-save-bg:#f0fdf4;
  --post-save-border:#bbf7d0;
}
.post-save-confirmation.warning{
  --post-save-accent:#ca8a04;
  --post-save-bg:#fffbeb;
  --post-save-border:#fde68a;
}
.post-save-confirmation.danger{
  --post-save-accent:#dc2626;
  --post-save-bg:#fef2f2;
  --post-save-border:#fecaca;
}
.post-save-confirmation.info{
  --post-save-accent:#2563eb;
  --post-save-bg:#eff6ff;
  --post-save-border:#bfdbfe;
}
.post-save-confirmation__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:14px;
}
.post-save-confirmation__eyebrow{
  display:block;
  margin-bottom:4px;
  color:#64748b;
  font-size:13px;
  font-weight:800;
}
.post-save-confirmation h2{
  margin:0;
  color:#0f172a;
  font-size:20px;
  line-height:1.35;
}
.post-save-confirmation__status{
  flex:0 0 auto;
  padding:6px 12px;
  border-radius:999px;
  background:#fff;
  color:var(--post-save-accent);
  border:1px solid var(--post-save-border);
  font-size:13px;
  font-weight:900;
}
.post-save-confirmation__items{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
}
.post-save-confirmation__item{
  min-height:78px;
  padding:12px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:10px;
  background:#fff;
}
.post-save-confirmation__item span{
  display:block;
  margin-bottom:7px;
  color:#64748b;
  font-size:13px;
  font-weight:800;
}
.post-save-confirmation__item b{
  display:block;
  color:#111827;
  font-size:15px;
  line-height:1.35;
}
.post-save-confirmation__item small{
  display:block;
  margin-top:6px;
  color:#64748b;
  line-height:1.4;
}
.post-save-confirmation__item.success{
  border-color:#bbf7d0;
}
.post-save-confirmation__item.warning{
  border-color:#fde68a;
}
.post-save-confirmation__item.danger{
  border-color:#fecaca;
}
.post-save-confirmation__item.info{
  border-color:#bfdbfe;
}
.post-save-confirmation__actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
@media (max-width:700px){
  .post-save-confirmation__head{
    display:block;
  }
  .post-save-confirmation__status{
    display:inline-flex;
    margin-top:10px;
  }
}

/* UPDATE 13: professional system polish */
:root{
  --bg:#F4F6F8;
  --border:#DDE3EA;
  --neutral-bg:#EEF2F6;
  --gold:#A87924;
  --gold-soft:#D8C184;
  --gold-bg:#FFF6DD;
  --gold-dark:#624411;
  --radius:12px;
  --radius-lg:16px;
  --shadow:0 16px 32px rgba(15,23,42,.08);
  --shadow-soft:0 8px 18px rgba(15,23,42,.055);
}
body{
  font-size:14.5px;
  color:#172033;
}
body.admin-body:not(.focus-mode) .main{
  padding:18px 24px 48px;
}
.brand,
.nav-group,
.panel,
.card,
.sub-card,
.page-head,
.smart-table,
.table-panel,
.toolbar,
.smart-table-toolbar,
.post-save-confirmation{
  border-radius:var(--radius)!important;
}
.brand-mark,
.card .card-icon,
.metric-icon{
  border-radius:12px;
}
.nav-group summary,
.nav a,
.nav-disabled,
.nav-subgroup,
.btn,
.icon-btn,
.field input,
.field select,
.field textarea,
.smart-table-search,
.smart-table-filter,
.smart-table-size,
td input,
td select{
  border-radius:10px!important;
}
.page-head{
  background:linear-gradient(135deg,#FFFFFF,#F8FAFC)!important;
}
.page-head h2,
.topbar h1{
  font-size:clamp(23px,2.2vw,30px);
  letter-spacing:0;
}
.panel{
  padding:16px!important;
}
.grid.cards{
  grid-template-columns:repeat(auto-fit,minmax(185px,1fr));
}
.card{
  min-height:116px;
  padding:16px!important;
}
.card span{
  font-size:12.5px;
  color:#64748B;
}
.card b{
  font-size:22px;
  color:#0F172A;
}
.report-filter-bar{
  display:grid;
  grid-template-columns:repeat(4,minmax(150px,1fr)) auto;
  align-items:end;
  gap:12px;
}
.period-chip{
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border:1px solid #BFD4E8;
  border-radius:10px;
  background:#F0F7FF;
  color:#0F3D63;
  font-weight:900;
  white-space:nowrap;
}
.table-panel{
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
.table-panel > table,
.smart-table-scroll > table{
  min-width:980px;
}
th,
td{
  padding:10px 12px!important;
  font-size:13.5px;
}
th{
  background:#F7F3E8!important;
  box-shadow:inset 0 -1px 0 #E8D8B8;
}
tbody tr:nth-child(even) td{
  background:#FCFDFE;
}
tbody tr:hover td{
  background:#F5FAFF;
}
.table-panel table th:first-child,
.table-panel table td:first-child,
.smart-table-scroll table th:first-child,
.smart-table-scroll table td:first-child{
  position:sticky;
  right:0;
  z-index:2;
  background:#FFFFFF;
  box-shadow:-1px 0 0 var(--border);
}
.table-panel table th:first-child,
.smart-table-scroll table th:first-child{
  z-index:5;
  background:#F7F3E8!important;
}
.smart-table-toolbar,
.toolbar{
  background:#FFFFFF!important;
}
.btn,
.icon-btn{
  min-height:40px;
  font-weight:850;
}
.btn.ghost,
.icon-btn.ghost{
  background:#FFFFFF!important;
}
.field label{
  color:#334155;
}
.field input,
.field select,
.field textarea,
.smart-table-search,
.smart-table-filter,
.smart-table-size,
td input,
td select{
  border-color:#D8E0EA;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.smart-table-search:focus,
.smart-table-filter:focus,
.smart-table-size:focus{
  border-color:#2563EB;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.dashboard-control-panel{
  background:linear-gradient(135deg,#FFFFFF,#F8FAFC)!important;
}
.dashboard-metric-card{
  border-color:#DDE3EA!important;
}
.dashboard-metric-card:hover{
  border-color:#93B7D8!important;
}
.workflow-note{
  margin:0 0 14px;
  padding:12px 14px;
  border:1px solid #BFD4E8;
  border-radius:10px;
  background:#F0F7FF;
  color:#0F3D63;
  font-weight:800;
}
.tenant-step-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:10px;
  margin:0 0 18px;
}
.tenant-step{
  min-height:48px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #D8E0EA;
  border-radius:10px;
  background:#FFFFFF;
  color:#334155;
  font-weight:850;
}
.tenant-step b{
  width:28px;
  height:28px;
  display:inline-grid;
  place-items:center;
  flex:0 0 28px;
  border-radius:999px;
  background:#0F3D63;
  color:#FFFFFF;
  font-size:13px;
  line-height:1;
}
.checkline{
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:9px 12px;
  border:1px solid #D8E0EA;
  border-radius:10px;
  background:#FFFFFF;
  color:#334155;
  font-weight:850;
}
.checkline input{
  width:18px;
  height:18px;
  accent-color:#0F3D63;
}
.commission-path-preview{
  display:grid;
  gap:6px;
  margin:8px 0 16px;
  padding:12px;
  border:1px solid #D9E7F2;
  border-radius:8px;
  background:#F8FCFF;
  color:#243348;
}
.commission-path-preview b{
  color:#123A5F;
  font-size:14px;
}
.commission-path-preview span,
.commission-path-preview small,
.commission-path-preview em{
  display:block;
  color:#526174;
  font-size:12.5px;
  line-height:1.6;
}
.commission-path-preview em{
  color:#B45309;
  font-style:normal;
  font-weight:800;
}
.review-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}
.review-grid > div{
  padding:12px;
  border:1px solid #D8E0EA;
  border-radius:10px;
  background:#FFFFFF;
}
.review-grid span{
  display:block;
  margin-bottom:5px;
  color:#64748B;
  font-size:12.5px;
  font-weight:800;
}
.review-grid b{
  color:#0F172A;
  font-size:15px;
}
.tenant-cheques-table .compact-input{
  min-width:130px;
}
@media (max-width:1180px){
  .report-filter-bar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .period-chip{
    justify-content:flex-start;
  }
}
@media (max-width:700px){
  .report-filter-bar{
    grid-template-columns:1fr;
  }
  .page-head{
    display:block!important;
  }
  .page-head .actions{
    margin-top:12px;
  }
}

/* UPDATE 14: full-system design finishing pass */
:root{
  --ui-control-h:42px;
  --ui-control-h-sm:36px;
  --ui-focus:rgba(37,99,235,.14);
}

.page-head{
  gap:14px;
}

.page-head h1{
  line-height:1.25;
}

.topbar,
.toolbar,
.smart-table-toolbar,
.report-filter-bar,
.dashboard-filter,
.panel form{
  gap:12px;
}

.topbar-actions{
  gap:10px;
}

.topbar-icon{
  position:relative;
}

.topbar-badge{
  min-width:18px;
  height:18px;
  padding:0 5px;
  display:inline-grid;
  place-items:center;
  position:absolute;
  top:-6px;
  left:-6px;
  border-radius:999px;
  background:#DC2626;
  color:#FFFFFF;
  border:2px solid #FFFFFF;
  font-size:10px;
  line-height:1;
  font-weight:900;
}

.topbar-dropdown{
  border:1px solid #DDE3EA!important;
  border-radius:12px!important;
  box-shadow:0 18px 38px rgba(15,23,42,.14)!important;
}

.topbar-dropdown a,
.topbar-dropdown button{
  min-height:38px;
  font-size:13.5px;
}

.btn.small,
.icon-btn.small,
.row-actions .btn,
.row-actions .icon-btn,
.smart-table-actions .btn,
.smart-table-actions .icon-btn,
td .btn,
td .icon-btn{
  min-width:var(--ui-control-h-sm);
  min-height:var(--ui-control-h-sm);
  padding:8px 11px;
  border-radius:8px;
  font-size:12.5px;
  line-height:1.15;
}

.row-actions,
.smart-table-actions,
td .actions{
  gap:7px;
  flex-wrap:wrap;
}

.field input,
.field select,
.field textarea,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea{
  min-height:var(--ui-control-h);
}

input[type="checkbox"],
input[type="radio"]{
  width:18px;
  height:18px;
  accent-color:#0F3D63;
}

.focus-mode .panel,
.focus-mode .card,
.focus-mode .table-panel{
  border-color:#DDE3EA!important;
}

.focus-mode .panel > h2,
.focus-mode .card > h2,
.focus-mode .table-panel > h2{
  padding-bottom:10px;
  margin-bottom:14px;
  border-bottom:1px solid #E6ECF2;
}

.focus-mode .form-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
}

.focus-mode .field label{
  margin-bottom:6px;
  font-size:12.5px;
}

.focus-mode .field small,
.field-help,
.hint{
  color:#64748B;
  font-size:12px;
  line-height:1.55;
}

.table-panel,
.smart-table-scroll{
  scrollbar-width:thin;
  scrollbar-color:#BFD4E8 #F8FAFC;
}

.table-panel::-webkit-scrollbar,
.smart-table-scroll::-webkit-scrollbar{
  height:10px;
}

.table-panel::-webkit-scrollbar-thumb,
.smart-table-scroll::-webkit-scrollbar-thumb{
  background:#BFD4E8;
  border-radius:999px;
}

.table-panel::-webkit-scrollbar-track,
.smart-table-scroll::-webkit-scrollbar-track{
  background:#F8FAFC;
}

.table-panel table,
.smart-table-scroll table{
  border-collapse:separate;
  border-spacing:0;
}

.table-panel td,
.table-panel th,
.smart-table-scroll td,
.smart-table-scroll th{
  vertical-align:middle;
}

.table-panel td:last-child,
.smart-table-scroll td:last-child{
  white-space:normal;
}

.table-sort-button{
  min-height:34px!important;
  min-width:34px!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:6px 8px!important;
  border-radius:7px!important;
  color:#1F2937;
  font:inherit;
  font-weight:900;
  background:transparent;
  border:1px solid transparent!important;
  cursor:pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible{
  background:#FFFFFF;
  border-color:#D8E0EA;
  box-shadow:0 0 0 3px var(--ui-focus);
  outline:0;
}

.table-panel .empty-state,
.panel .empty-state{
  margin:0;
}

.status-badge,
.badge,
.pill{
  line-height:1.2;
}

.metric-card,
.dashboard-metric-card,
.card{
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.metric-card:hover,
.dashboard-metric-card:hover,
.card:hover{
  transform:translateY(-1px);
}

.nav-child,
.nav-subgroup-title,
.nav a{
  line-height:1.35;
}

@media (max-width:900px){
  .topbar{
    align-items:flex-start;
  }
  .topbar-actions{
    width:100%;
    justify-content:flex-start;
  }
  .grid.cards,
  .kpi-grid,
  .dashboard-metrics-grid{
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;
  }
  .focus-mode .form-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:700px){
  .page-head h1{
    font-size:21px!important;
  }
  .topbar,
  .toolbar,
  .smart-table-toolbar,
  .dashboard-filter,
  .report-filter-bar{
    padding:12px!important;
  }
  .btn,
  .icon-btn,
  button{
    min-height:40px;
  }
  .btn.small,
  .icon-btn.small,
  .row-actions .btn,
  .row-actions .icon-btn,
  .smart-table-actions .btn,
  .smart-table-actions .icon-btn,
  td .btn,
  td .icon-btn{
    min-height:38px;
  }
  .panel,
  .card,
  .table-panel{
    border-radius:12px!important;
  }
  .table-panel,
  .smart-table-scroll{
    margin-inline:-2px;
  }
  th,
  td{
    font-size:12.75px;
    padding:9px 10px!important;
  }
}

/* UPDATE 15: Owner Command Center design applied to the live V2 shell */
:root{
  --bg:#F5F7FB;
  --card:#FFFFFF;
  --sidebar:#FFFFFF;
  --text:#132238;
  --muted:#637083;
  --border:#DCE3EA;
  --gold:#C99632;
  --gold-soft:#E5D1A4;
  --gold-bg:#FFF7E4;
  --gold-dark:#6B4A10;
  --success:#14804A;
  --success-bg:#EAF7EF;
  --warning:#D97706;
  --warning-bg:#FFF4E5;
  --danger:#C93A3A;
  --danger-bg:#FFF1F1;
  --info:#173B63;
  --info-bg:#EAF2FA;
  --neutral-bg:#EEF2F6;
  --sidebar-width:292px;
  --radius:8px;
  --radius-lg:10px;
  --shadow:0 16px 42px rgba(18,42,72,.08);
  --shadow-soft:0 8px 18px rgba(18,42,72,.055);
}

body.admin-body{
  background:linear-gradient(180deg,#F7F9FC 0,#F2F5F8 100%);
  color:var(--text);
}

body.admin-body:not(.focus-mode) .main{
  padding:18px 26px 48px;
}

.sidebar{
  border-left:1px solid var(--border);
  box-shadow:-18px 0 36px rgba(18,42,72,.06);
}

.brand{
  border-radius:10px!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
}

.brand-mark{
  border-radius:8px!important;
  background:linear-gradient(135deg,#123A5F,#0F766E)!important;
  box-shadow:none!important;
}

.nav-group{
  border-radius:8px!important;
  border-color:#EDF1F5!important;
  background:#FBFCFE!important;
  box-shadow:none!important;
}

.nav-group summary{
  min-height:42px;
  border-radius:7px!important;
  background:#F8FAFC!important;
  color:#334155!important;
  font-size:14px;
  box-shadow:none!important;
}

.nav-group[open]{
  border-color:#DCE3EA!important;
  box-shadow:none!important;
}

.nav-group[open] summary{
  background:#EAF2FA!important;
  border-color:#D4E4F1!important;
  color:#123A5F!important;
}

.nav a,
.nav-disabled,
.nav-subgroup-title,
.nav-child{
  min-height:38px;
  border-radius:7px!important;
  font-size:13.5px;
  font-weight:800;
}

.nav-group[open] a,
.nav-group[open] .nav-disabled{
  border-color:transparent;
  background:transparent;
}

.nav a:hover,
.nav-child:hover,
.nav-subgroup-title:hover{
  background:#EEF5FB!important;
  color:#123A5F!important;
}

.nav a.active,
.nav-child.active,
.nav-subgroup-title.active{
  background:#E6F0F8!important;
  border-color:#C9DAEA!important;
  color:#123A5F!important;
  box-shadow:none!important;
}

.nav a.active:after{
  background:#0F766E!important;
}

.topbar{
  position:sticky;
  top:0;
  z-index:80;
  align-items:center;
  min-height:72px;
  margin:-18px -26px 14px;
  padding:14px 26px;
  border-bottom:1px solid rgba(220,227,234,.9);
  background:rgba(245,247,251,.92);
  backdrop-filter:saturate(140%) blur(10px);
}

.topbar h1{
  font-size:22px!important;
  font-weight:900;
  color:#0F172A;
}

.breadcrumb{
  margin-bottom:1px;
  color:#64748B;
}

.eyebrow{
  color:#0F766E;
  font-size:11.5px;
  letter-spacing:0;
}

.smart-command-strip{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  margin:0 0 16px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(255,255,255,.88);
  box-shadow:var(--shadow-soft);
}

.smart-flow{
  min-width:0;
  display:flex;
  align-items:center;
  gap:6px;
  overflow:auto;
  scrollbar-width:thin;
}

.smart-flow-node{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  padding:7px 11px;
  border:1px solid transparent;
  border-radius:8px;
  color:#526174;
  font-size:12.5px;
  font-weight:850;
  white-space:nowrap;
}

.smart-flow-node span{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#C8D2DC;
}

.smart-flow-node:hover{
  background:#F0F7FF;
  color:#123A5F;
}

.smart-flow-node.active{
  background:#E6F0F8;
  color:#123A5F;
  border-color:#C9DAEA;
}

.smart-flow-node.active span{
  background:#0F766E;
}

.smart-command-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.smart-action{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#FFFFFF;
  color:#172033;
  font-size:12.5px;
  font-weight:900;
  white-space:nowrap;
  box-shadow:0 6px 14px rgba(18,42,72,.035);
}

.smart-action:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(18,42,72,.07);
}

.smart-action.primary{
  background:#123A5F;
  border-color:#123A5F;
  color:#FFFFFF;
}

.smart-action.success{
  background:#0F766E;
  border-color:#0F766E;
  color:#FFFFFF;
}

.smart-action.warning{
  background:#FFF7ED;
  border-color:#FED7AA;
  color:#9A4A06;
}

.page-head{
  border-radius:10px!important;
  background:linear-gradient(135deg,#FFFFFF,#F8FAFC)!important;
  box-shadow:var(--shadow-soft)!important;
}

.page-head h2{
  font-size:24px!important;
}

.panel,
.card,
.smart-table,
.table-panel,
.record-panel div,
.post-save-confirmation{
  border-color:var(--border)!important;
  border-radius:10px!important;
  box-shadow:var(--shadow-soft)!important;
}

.panel{
  padding:18px!important;
}

.grid.cards{
  grid-template-columns:repeat(auto-fit,minmax(178px,1fr));
}

@media (min-width:1500px){
  .grid.cards{grid-template-columns:repeat(5,minmax(0,1fr))}
}

.card{
  min-height:112px;
}

.card:before{
  width:4px;
  background:linear-gradient(180deg,#123A5F,#0F766E);
}

.card span{
  color:#637083;
  font-size:12.5px;
}

.card b{
  color:#132238;
  font-size:22px;
}

.amount{
  color:#173B63;
}

.row-danger .amount,
.amount.loss,
.money.loss{
  color:var(--danger)!important;
}

.money.income,
.metric-value-profit{
  color:var(--success)!important;
}

.money.expense,
.metric-value-expense{
  color:var(--warning)!important;
}

.metric-value-commission{
  color:#B88700!important;
  text-shadow:0 0 0 #111827;
}

.sidebar{
  background:#FFFFFF!important;
}

.nav{
  padding:8px 6px 14px!important;
}

.nav-group{
  margin-bottom:9px!important;
  border:1px solid #E1E8F0!important;
  border-radius:9px!important;
  background:#FFFFFF!important;
}

.nav-group summary{
  min-height:44px!important;
  padding:10px 12px!important;
  border-radius:8px!important;
  background:#F4F8FB!important;
  color:#18324A!important;
  font-size:15px!important;
  font-weight:900!important;
}

.nav-group[open] summary{
  background:#E7F1F7!important;
  border-color:#C9DCEB!important;
  color:#0E3A5A!important;
}

.nav a,
.nav-disabled,
.nav-subgroup-title,
.nav-child{
  min-height:39px!important;
  padding:9px 10px!important;
  border-radius:8px!important;
  color:#263849!important;
  font-size:14px!important;
}

.nav a svg,
.nav-disabled svg{
  color:#0F766E!important;
}

.nav a.active,
.nav-child.active,
.nav-subgroup-title.active{
  position:relative;
  background:#E8F3FA!important;
  border-color:#BDD5E8!important;
  color:#0E3A5A!important;
}

.nav a.active:before,
.nav-child.active:before,
.nav-subgroup-title.active:before{
  content:"";
  width:4px;
  align-self:stretch;
  border-radius:999px;
  background:#0F766E;
}

.nav-children{
  margin:4px 18px 8px 0!important;
  padding-right:8px!important;
  border-right:1px solid #E2EAF1!important;
}

.table-panel,
.smart-table-scroll{
  border-radius:10px!important;
}

th{
  background:#F7FAFC!important;
  color:#526174!important;
  font-size:12.5px!important;
}

td{
  color:#243044;
}

tbody tr:hover td{
  background:#F5FAFF!important;
}

.entity-workspace-tabs,
.building-profile-tabs{
  margin:0 0 16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#FFFFFF;
  box-shadow:var(--shadow-soft);
}

.entity-tabbar,
.building-tabbar{
  position:sticky!important;
  top:86px;
  z-index:55;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
  overflow:auto;
  margin:-2px -2px 14px;
  padding:2px 2px 12px;
  background:#FFFFFF!important;
}

.entity-tab,
.building-tab{
  flex:0 0 auto;
  min-height:36px;
  padding:8px 12px;
  border:1px solid #D8E4EF;
  border-radius:8px!important;
  background:#FFFFFF;
  color:#526174;
  font-size:12.5px;
  font-weight:900;
}

.entity-tab:hover,
.building-tab:hover{
  background:#F0F7FF;
  color:#123A5F;
}

.entity-tab.active,
.building-tab.active{
  background:#123A5F!important;
  border-color:#123A5F!important;
  color:#FFFFFF!important;
}

.entity-tab-panel,
.building-tab-panel{
  display:none;
  margin:0!important;
  box-shadow:none!important;
}

.entity-tab-panel.active,
.building-tab-panel.active{
  display:block;
}

.btn,
.icon-btn,
button{
  border-radius:8px!important;
}

.btn:not(.ghost):not(.secondary):not(.danger):not(.success):not(.warning),
button:not(.ghost):not(.secondary):not(.danger):not(.success):not(.warning):not(.table-sort-button):not(.entity-tab):not(.building-tab){
  background:#123A5F;
  border-color:#123A5F;
  color:#FFFFFF;
}

.btn.secondary,
button.secondary{
  background:#0F766E!important;
  border-color:#0F766E!important;
  color:#FFFFFF!important;
}

.btn.ghost,
.icon-btn.ghost{
  background:#FFFFFF!important;
  border-color:#DCE3EA!important;
  color:#172033!important;
}

.topbar-dropdown{
  border-radius:10px!important;
}

@media (max-width:1180px){
  .smart-command-strip{
    grid-template-columns:1fr;
  }
  .smart-command-actions{
    justify-content:flex-start;
  }
}

@media (max-width:700px){
  body.admin-body:not(.focus-mode) .main{
    padding-inline:14px;
  }
  .topbar{
    margin-inline:-14px;
    padding-inline:14px;
  }
  .smart-command-strip{
    padding:8px;
  }
  .smart-action,
  .smart-flow-node{
    min-height:34px;
    font-size:12px;
  }
  .entity-tabbar,
  .building-tabbar{
    top:0;
  }
}

/* UPDATE 16: strict finance and detail-workspace organization */
.financial-integrity-panel .section-title-row{
  align-items:center;
}

.integrity-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
}

.integrity-grid.compact{
  grid-template-columns:repeat(auto-fit,minmax(175px,1fr));
}

.integrity-check{
  min-height:96px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:7px;
  padding:12px;
  border:1px solid #DCE3EA;
  border-radius:8px;
  background:#FFFFFF;
  color:#172033;
}

.integrity-check span{
  color:#334155;
  font-size:12.5px;
  font-weight:900;
}

.integrity-check b{
  color:#123A5F;
  font-size:24px;
  line-height:1;
}

.integrity-check small{
  color:#64748B;
  font-size:12px;
  line-height:1.45;
}

.integrity-check.is-clean{
  border-color:#CDE8DA;
  background:#F6FCF8;
}

.integrity-check.is-clean b{
  color:#14804A;
}

.integrity-check.has-issue{
  border-color:#F7C6C6;
  background:#FFF6F6;
}

.integrity-check.has-issue b{
  color:#C93A3A;
}

.amount-link{
  color:inherit;
  display:inline-flex;
  justify-content:flex-end;
  min-width:86px;
  border-bottom:1px dotted rgba(14,116,144,.45);
  text-decoration:none;
}

.amount-link:hover,
.amount-link:focus{
  color:var(--accent);
  border-bottom-color:currentColor;
}

.drilldown-health-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-inline-start:4px solid var(--accent);
}

.drilldown-health-strip.is-clean{
  border-inline-start-color:#16A34A;
}

.drilldown-health-strip.has-issue{
  border-inline-start-color:#DC2626;
}

.drilldown-summary-grid .card b{
  font-variant-numeric:tabular-nums;
}

.entity-tab-panel > .panel,
.entity-tab-panel > .grid{
  margin-bottom:14px!important;
}

.entity-tab-panel > .panel:last-child,
.entity-tab-panel > .grid:last-child{
  margin-bottom:0!important;
}

.entity-tab-panel .panel{
  box-shadow:none!important;
}

a.card{
  text-decoration:none;
  color:inherit;
}

a.card:hover,
a.card:focus{
  border-color:#8CB7D7!important;
  background:#F8FCFF!important;
  transform:translateY(-1px);
}

/* UPDATE 17: unified report center and A4 print layout */
.report-center-launcher{
  border-inline-start:4px solid #123A5F;
}

.report-control-center{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
  align-items:end;
}

.report-control-center .actions{
  align-self:end;
}

.report-print-header{
  border-inline-start:4px solid #C99A4A;
}

.report-print-header h1{
  margin:4px 0 10px;
  color:#0B2A4A;
  font-size:24px;
  line-height:1.25;
}

.report-print-meta{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:8px 14px;
}

.report-print-meta span{
  color:#516173;
  font-size:12.5px;
  font-weight:800;
}

.report-print-meta b{
  color:#172033;
  font-weight:950;
}

.report-summary-cards{
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
}

.report-summary-card{
  min-height:104px;
  border-inline-start:4px solid #123A5F;
}

.report-summary-card span{
  color:#516173;
  font-size:12.5px;
  font-weight:900;
}

.report-summary-card b{
  display:block;
  margin-top:8px;
  color:#0B2A4A;
  font-size:22px;
  font-variant-numeric:tabular-nums;
}

.report-summary-card small{
  display:block;
  margin-top:6px;
  color:#64748B;
  font-size:12px;
}

.report-summary-card.is-profit{border-inline-start-color:#0F8A4B}
.report-summary-card.is-profit b{color:#0F8A4B}
.report-summary-card.is-loss{border-inline-start-color:#C93A3A}
.report-summary-card.is-loss b{color:#C93A3A}
.report-summary-card.is-expense{border-inline-start-color:#D97706}
.report-summary-card.is-expense b{color:#D97706}
.report-summary-card.is-commission{border-inline-start-color:#D6A21E}
.report-summary-card.is-commission b{color:#7A4B0E}
.report-summary-card.is-neutral{border-inline-start-color:#64748B}

.report-table-panel tfoot th,
.report-table-panel tfoot td{
  background:#F6F8FB!important;
  color:#0B2A4A;
  font-weight:950;
}

.report-methods-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}

.report-method-item{
  padding:12px;
  border:1px solid #DCE3EA;
  border-radius:8px;
  background:#FFFFFF;
}

.report-method-item span{
  display:block;
  color:#516173;
  font-size:12.5px;
  font-weight:900;
}

.report-method-item b{
  display:block;
  margin-top:8px;
  color:#0B2A4A;
  font-size:20px;
  font-variant-numeric:tabular-nums;
}

.report-print-control{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-inline-start:4px solid #D6A21E;
  background:#FFFDF7!important;
}

.report-print-control h2{
  margin:4px 0;
  color:#0B2A4A;
}

.report-output-actions{
  flex-wrap:wrap;
}

.screen-only{
  display:revert;
}

body.report-print-preview{
  background:#DDE3EA!important;
}

body.report-print-preview .sidebar,
body.report-print-preview .topbar,
body.report-print-preview .mobile-nav-toggle,
body.report-print-preview .premium-bottom-nav{
  display:none!important;
}

body.report-print-preview .app-shell{
  display:block!important;
  min-height:100vh!important;
  padding:26px 22px 42px!important;
  background:#DDE3EA!important;
}

body.report-print-preview .main{
  position:relative;
  width:297mm!important;
  min-height:210mm!important;
  max-width:calc(100vw - 44px)!important;
  margin:54px auto 0!important;
  padding:13mm 13mm 15mm!important;
  background:#FFFFFF!important;
  border:1px solid #C9D2DD!important;
  box-shadow:0 24px 80px rgba(15,23,42,.24)!important;
  overflow:visible!important;
}

body.report-print-preview .page-head,
body.report-print-preview .report-control-center,
body.report-print-preview .report-note{
  display:none!important;
}

body.report-print-preview .report-print-control{
  position:fixed;
  top:12px;
  left:50%;
  transform:translateX(-50%);
  width:min(297mm,calc(100vw - 44px));
  z-index:2000;
  margin:0!important;
  padding:10px 14px!important;
  border:1px solid #D6B466!important;
  border-inline-start:4px solid #D6A21E!important;
  border-radius:10px!important;
  box-shadow:0 18px 45px rgba(15,23,42,.18)!important;
}

body.report-print-preview .report-print-control h2{
  font-size:15px!important;
}

body.report-print-preview .report-print-control p{
  margin:0!important;
  font-size:12px!important;
}

body.report-print-preview .report-print-header{
  margin:0 0 8mm!important;
  padding:0 0 5mm!important;
  border:0!important;
  border-bottom:2px solid #111827!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
}

body.report-print-preview .report-print-header:before{
  content:"E";
  float:right;
  display:grid;
  place-items:center;
  width:15mm;
  height:15mm;
  margin:0 0 3mm 5mm;
  border:2px solid #C99A4A;
  border-radius:4mm;
  color:#123A5F;
  font-size:22px;
  font-weight:950;
}

body.report-print-preview .report-print-header h1{
  margin:2mm 0 3mm!important;
  color:#111827!important;
  font-size:20px!important;
}

body.report-print-preview .report-print-header .eyebrow{
  color:#7C5A20!important;
  font-size:10.5px!important;
}

body.report-print-preview .report-print-meta{
  grid-template-columns:repeat(4,1fr)!important;
  gap:2mm 4mm!important;
  clear:both;
}

body.report-print-preview .report-print-meta span{
  padding:2mm;
  border:1px solid #E5E7EB;
  background:#F9FAFB;
  color:#374151!important;
  font-size:10px!important;
}

body.report-print-preview .report-summary-cards{
  grid-template-columns:repeat(6,1fr)!important;
  gap:2.5mm!important;
  margin:0 0 6mm!important;
}

body.report-print-preview .report-summary-card{
  min-height:24mm!important;
  padding:3mm!important;
  border:1px solid #D1D5DB!important;
  border-inline-start:0!important;
  border-radius:2mm!important;
  box-shadow:none!important;
}

body.report-print-preview .report-summary-card span{
  font-size:9.5px!important;
}

body.report-print-preview .report-summary-card b{
  color:#111827!important;
  font-size:14px!important;
}

body.report-print-preview .report-summary-card small{
  font-size:8.5px!important;
}

body.report-print-preview .report-table-panel,
body.report-print-preview .report-methods-panel{
  margin:0 0 7mm!important;
  padding:0!important;
  border:0!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
  overflow:visible!important;
}

body.report-print-preview .report-table-panel .table-panel-head,
body.report-print-preview .report-methods-panel .table-panel-head{
  margin:0 0 2.5mm!important;
  padding:0!important;
}

body.report-print-preview .report-table-panel h2,
body.report-print-preview .report-methods-panel h2{
  color:#111827!important;
  font-size:14px!important;
}

body.report-print-preview table{
  width:100%!important;
  min-width:0!important;
  border-collapse:collapse!important;
  font-size:9px!important;
}

body.report-print-preview th,
body.report-print-preview td{
  padding:4px 5px!important;
  border:1px solid #D1D5DB!important;
  white-space:normal!important;
  vertical-align:top!important;
}

body.report-print-preview th{
  background:#EEF2F7!important;
  color:#111827!important;
  font-weight:950!important;
}

body.report-print-preview tfoot th,
body.report-print-preview tfoot td{
  background:#F8FAFC!important;
  color:#111827!important;
}

body.report-print-preview .badge{
  padding:2px 4px!important;
  border-radius:4px!important;
  font-size:8px!important;
}

body.report-print-preview .amount{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
}

body.report-print-preview .report-methods-grid{
  grid-template-columns:repeat(4,1fr)!important;
  gap:2.5mm!important;
}

body.report-print-preview .report-method-item{
  padding:2.5mm!important;
  border:1px solid #D1D5DB!important;
  border-radius:2mm!important;
  box-shadow:none!important;
}

body.report-print-preview .report-method-item span{
  font-size:9px!important;
}

body.report-print-preview .report-method-item b{
  color:#111827!important;
  font-size:12px!important;
}

@media (max-width:1050px){
  body.report-print-preview .main,
  body.report-print-preview .report-print-control{
    width:100%!important;
  }
  body.report-print-preview .report-summary-cards{
    grid-template-columns:repeat(2,1fr)!important;
  }
  body.report-print-preview .report-print-meta{
    grid-template-columns:repeat(2,1fr)!important;
  }
}

@media print{
  @page{size:A4 landscape;margin:9mm}
  body.admin-body{
    font-size:11px!important;
  }
  body.report-print-preview .main{
    width:100%!important;
    min-height:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
  }
  .report-control-center,
  .report-center-launcher,
  .screen-only,
  .report-note,
  .report-methods-panel .table-panel-head .muted{
    display:none!important;
  }
  .report-print-header{
    display:block!important;
    margin:0 0 8mm!important;
    padding:0 0 5mm!important;
    border:0!important;
    border-bottom:2px solid #111827!important;
  }
  .report-print-header .eyebrow{
    color:#7C5A20!important;
    font-size:10px!important;
  }
  .report-print-header h1{
    color:#111827!important;
    font-size:18px!important;
    margin:2mm 0 3mm!important;
  }
  .report-print-meta{
    grid-template-columns:repeat(2,1fr)!important;
    gap:2mm 5mm!important;
  }
  .report-print-meta span{
    color:#374151!important;
    font-size:10px!important;
  }
  .report-summary-cards{
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:3mm!important;
    margin:0 0 5mm!important;
  }
  .report-summary-card{
    min-height:0!important;
    padding:3mm!important;
    border:1px solid #D1D5DB!important;
    border-inline-start:0!important;
    page-break-inside:avoid;
  }
  .report-summary-card span{
    font-size:9.5px!important;
  }
  .report-summary-card b{
    margin-top:1.5mm!important;
    color:#111827!important;
    font-size:14px!important;
  }
  .report-summary-card small{
    font-size:9px!important;
  }
  .report-table-panel,
  .report-methods-panel{
    page-break-inside:auto;
    margin:0 0 5mm!important;
    padding:0!important;
    border:0!important;
  }
  .report-table-panel .table-panel-head,
  .report-methods-panel .table-panel-head{
    margin:0 0 2mm!important;
  }
  .report-table-panel h2,
  .report-methods-panel h2{
    font-size:13px!important;
    color:#111827!important;
  }
  .report-table-panel table{
    font-size:9.2px!important;
  }
  .report-table-panel th,
  .report-table-panel td{
    padding:4px!important;
    vertical-align:top!important;
  }
  .report-table-panel thead{
    display:table-header-group;
  }
  .report-table-panel tfoot{
    display:table-row-group;
  }
  .report-methods-grid{
    display:grid!important;
    grid-template-columns:repeat(4,1fr)!important;
    gap:2mm!important;
  }
  .report-method-item{
    border:1px solid #D1D5DB!important;
    border-radius:0!important;
    padding:2mm!important;
  }
  .report-method-item span{
    font-size:9px!important;
  }
  .report-method-item b{
    color:#111827!important;
    font-size:12px!important;
  }
}

/* UPDATE 18: executive A4 report paper polish */
body.report-print-preview,
body.report-print-preview *{
  font-family:"IBM Plex Sans Arabic","Tajawal","Segoe UI",Arial,sans-serif!important;
  letter-spacing:0!important;
}

body.report-print-preview .main{
  color:#111827!important;
  line-height:1.45!important;
}

body.report-print-preview .report-print-header{
  position:relative;
  min-height:23mm;
  border-bottom:1.4mm solid #123A5F!important;
}

body.report-print-preview .report-print-header:after{
  content:"تقرير داخلي - نسخة مخصصة للإدارة";
  position:absolute;
  left:0;
  bottom:2mm;
  color:#6B7280;
  font-size:9px;
  font-weight:800;
}

body.report-print-preview .report-print-header h1{
  font-weight:950!important;
  letter-spacing:0!important;
}

body.report-print-preview .report-print-meta span{
  border-color:#D7DEE8!important;
  border-radius:1.5mm!important;
}

body.report-print-preview .report-print-meta b{
  display:inline-block;
  margin-inline-start:2px;
  color:#0B2A4A!important;
  font-weight:950!important;
}

body.report-print-preview .report-summary-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,#FFFFFF 0%,#F8FAFC 100%)!important;
}

body.report-print-preview .report-summary-card:before{
  content:"";
  position:absolute;
  inset-inline-start:0;
  top:0;
  width:1.5mm;
  height:100%;
  background:#123A5F;
}

body.report-print-preview .report-summary-card.is-profit:before{background:#0F8A4B}
body.report-print-preview .report-summary-card.is-loss:before{background:#C93A3A}
body.report-print-preview .report-summary-card.is-expense:before{background:#D97706}
body.report-print-preview .report-summary-card.is-commission:before{background:#D6A21E}
body.report-print-preview .report-summary-card.is-neutral:before{background:#64748B}

body.report-print-preview .report-summary-card span{
  display:block;
  min-height:9mm;
  color:#4B5563!important;
  font-weight:950!important;
}

body.report-print-preview .report-summary-card b{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
  font-weight:950!important;
  line-height:1.1!important;
}

body.report-print-preview .report-table-panel h2,
body.report-print-preview .report-methods-panel h2{
  display:inline-flex;
  align-items:center;
  gap:2mm;
  margin:0!important;
  font-weight:950!important;
}

body.report-print-preview .report-table-panel h2:before,
body.report-print-preview .report-methods-panel h2:before{
  content:"";
  display:inline-block;
  width:2mm;
  height:7mm;
  border-radius:999px;
  background:#C99A4A;
}

body.report-print-preview .report-table-panel .muted,
body.report-print-preview .report-methods-panel .muted{
  color:#64748B!important;
  font-size:9px!important;
  font-weight:800!important;
}

body.report-print-preview table{
  table-layout:auto!important;
  border:1.2px solid #9CA3AF!important;
  border-radius:0!important;
  background:#FFFFFF!important;
}

body.report-print-preview thead{
  display:table-header-group;
}

body.report-print-preview tfoot{
  display:table-row-group;
}

body.report-print-preview tr{
  break-inside:avoid;
  page-break-inside:avoid;
}

body.report-print-preview th{
  background:#E7EEF6!important;
  color:#0F172A!important;
  font-size:8.6px!important;
  line-height:1.35!important;
  text-align:center!important;
}

body.report-print-preview td{
  color:#1F2937!important;
  font-size:8.7px!important;
  line-height:1.45!important;
}

body.report-print-preview tbody tr:nth-child(even) td{
  background:#FAFBFD!important;
}

body.report-print-preview tbody tr:hover td{
  background:inherit!important;
}

body.report-print-preview .amount,
body.report-print-preview td.amount,
body.report-print-preview th.amount{
  color:#0B2A4A!important;
  font-weight:900!important;
  white-space:nowrap!important;
}

body.report-print-preview tfoot th,
body.report-print-preview tfoot td{
  border-top:1.4px solid #111827!important;
  background:#EEF2F7!important;
  color:#0B2A4A!important;
  font-size:9px!important;
  font-weight:950!important;
}

body.report-print-preview .report-method-item{
  background:#FFFFFF!important;
  border-color:#D7DEE8!important;
}

body.report-print-preview .report-method-item b{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
  font-weight:950!important;
}

body.report-print-preview .badge{
  border:1px solid #D1D5DB!important;
  background:#FFFFFF!important;
  color:#374151!important;
  font-weight:900!important;
}

.report-table-title{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:4px;
}

.report-table-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin-inline-start:auto;
}

.report-table-print-btn{
  background:#0B2A4A!important;
  border-color:#0B2A4A!important;
  color:#FFFFFF!important;
  box-shadow:0 10px 24px rgba(11,42,74,.14);
}

.report-table-panel[data-report-table] table{
  border-collapse:separate;
  border-spacing:0;
}

.report-table-panel[data-report-table] th{
  white-space:nowrap;
}

.report-table-panel[data-report-table] td,
.report-table-panel[data-report-table] th{
  font-variant-numeric:tabular-nums;
}

@media print{
  html,
  body{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  body.report-print-preview{
    background:#FFFFFF!important;
  }
  body.report-print-preview .app-shell{
    padding:0!important;
    background:#FFFFFF!important;
  }
  body.report-print-preview .report-print-header{
    border-bottom:1.2mm solid #123A5F!important;
  }
  body.report-print-preview .report-summary-cards{
    grid-template-columns:repeat(6,1fr)!important;
    gap:2mm!important;
  }
  body.report-print-preview .report-summary-card{
    min-height:21mm!important;
    padding:2.5mm 3mm!important;
  }
  body.report-print-preview table{
    font-size:8.4px!important;
  }
  body.report-print-preview th{
    font-size:8px!important;
    padding:3.4px!important;
  }
  body.report-print-preview td{
    font-size:8.1px!important;
    padding:3.4px!important;
  }
  body.report-print-preview .report-table-panel,
  body.report-print-preview .report-methods-panel{
    margin-bottom:4.5mm!important;
  }

  body.report-table-printing{
    background:#FFFFFF!important;
  }

  body.report-table-printing .sidebar,
  body.report-table-printing .topbar,
  body.report-table-printing .mobile-nav-toggle,
  body.report-table-printing .premium-bottom-nav,
  body.report-table-printing .page-head,
  body.report-table-printing .report-control-center,
  body.report-table-printing .report-print-header,
  body.report-table-printing .report-summary-cards,
  body.report-table-printing .report-note,
  body.report-table-printing .screen-only{
    display:none!important;
  }

  body.report-table-printing .app-shell{
    display:block!important;
    min-height:0!important;
    padding:0!important;
    background:#FFFFFF!important;
  }

  body.report-table-printing .main{
    display:block!important;
    width:100%!important;
    min-height:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
    background:#FFFFFF!important;
    overflow:visible!important;
  }

  body.report-table-printing .main > *{
    display:none!important;
  }

  body.report-table-printing .main > .is-print-target{
    display:block!important;
  }

  body.report-table-printing .is-print-target{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:#FFFFFF!important;
    page-break-inside:auto!important;
  }

  body.report-table-printing .is-print-target .table-panel-head{
    display:flex!important;
    align-items:flex-end!important;
    justify-content:space-between!important;
    gap:8mm!important;
    margin:0 0 5mm!important;
    padding:0 0 3mm!important;
    border-bottom:2px solid #0B2A4A!important;
  }

  body.report-table-printing .is-print-target .table-panel-head h2{
    margin:0!important;
    color:#0B2A4A!important;
    font-size:17px!important;
    font-weight:950!important;
  }

  body.report-table-printing .is-print-target .table-panel-head .muted{
    display:block!important;
    margin-top:1.5mm!important;
    color:#4B5563!important;
    font-size:10px!important;
    font-weight:800!important;
  }

  body.report-table-printing table{
    width:100%!important;
    border-collapse:collapse!important;
    table-layout:auto!important;
    background:#FFFFFF!important;
    color:#111827!important;
    font-size:8.6px!important;
  }

  body.report-table-printing thead{
    display:table-header-group!important;
  }

  body.report-table-printing tfoot{
    display:table-row-group!important;
  }

  body.report-table-printing tr{
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }

  body.report-table-printing th,
  body.report-table-printing td{
    padding:4.2px 4.5px!important;
    border:1px solid #CBD5E1!important;
    text-align:right!important;
    vertical-align:top!important;
    line-height:1.35!important;
  }

  body.report-table-printing th{
    background:#E8EEF5!important;
    color:#0B2A4A!important;
    font-weight:950!important;
    text-align:center!important;
  }

  body.report-table-printing tbody tr:nth-child(even) td{
    background:#FAFBFD!important;
  }

  body.report-table-printing .amount,
  body.report-table-printing td.amount,
  body.report-table-printing th.amount{
    direction:ltr!important;
    text-align:left!important;
    white-space:nowrap!important;
    color:#0B2A4A!important;
    font-weight:950!important;
    font-variant-numeric:tabular-nums!important;
  }

  body.report-table-printing tfoot th,
  body.report-table-printing tfoot td{
    background:#DDE7F1!important;
    color:#0B2A4A!important;
    border-top:2px solid #0B2A4A!important;
    font-weight:950!important;
  }

  body.report-table-printing .badge{
    border:1px solid #CBD5E1!important;
    background:#FFFFFF!important;
    color:#334155!important;
    font-weight:900!important;
  }

  body.report-table-printing .report-methods-grid{
    display:grid!important;
    grid-template-columns:repeat(4,1fr)!important;
    gap:3mm!important;
  }

  body.report-table-printing .report-method-item{
    border:1px solid #CBD5E1!important;
    border-radius:0!important;
    padding:4mm!important;
    background:#FFFFFF!important;
  }

  body.report-table-printing .report-method-item span{
    color:#475569!important;
    font-size:10px!important;
    font-weight:900!important;
  }

  body.report-table-printing .report-method-item b{
    margin-top:2mm!important;
    color:#0B2A4A!important;
    font-size:15px!important;
    font-weight:950!important;
    font-variant-numeric:tabular-nums!important;
  }
}

/* UPDATE 20 final cascade: calm light SaaS look */
:root{
  --bg:#F4F7FB;
  --card:#FFFFFF;
  --sidebar:#FFFFFF;
  --text:#152033;
  --muted:#607089;
  --border:#DDE6F0;
  --gold:#C9972B;
  --gold-bg:#FFF8E6;
  --gold-dark:#7A5516;
  --primary:#123A5F;
  --primary-2:#1D5F89;
  --primary-soft:#E7F0F8;
  --success:#11845B;
  --success-bg:#E9F7F1;
  --warning:#D97706;
  --warning-bg:#FFF3DF;
  --danger:#C93A3A;
  --danger-bg:#FFF0F0;
  --sidebar-width:304px;
  --radius:8px;
  --radius-lg:8px;
  --shadow:0 18px 46px rgba(15,32,51,.08);
  --shadow-soft:0 8px 22px rgba(15,32,51,.055);
}

body:not(.report-print-preview):not(.report-table-printing){
  background:linear-gradient(180deg,#F8FBFF 0%,#F4F7FB 46%,#F1F5F9 100%) fixed!important;
  color:var(--text)!important;
  font-size:14px;
}

body.admin-body:not(.focus-mode) .main{
  padding:18px 26px 58px!important;
}

.sidebar{
  background:linear-gradient(180deg,#FFFFFF,#F8FBFF)!important;
  border-left:1px solid var(--border)!important;
  box-shadow:-18px 0 38px rgba(15,32,51,.07)!important;
}

.brand{
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.brand-mark{
  border-radius:8px!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-2))!important;
  box-shadow:0 12px 24px rgba(18,58,95,.2)!important;
}

.brand b,
.topbar h1,
.page-head h2{
  color:var(--primary)!important;
  font-weight:950!important;
}

.nav-group{
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:none!important;
}

.nav-group[open]{
  background:#F8FBFF!important;
  border-color:#BFD0E2!important;
  box-shadow:0 8px 18px rgba(15,32,51,.045)!important;
}

.nav-group summary{
  min-height:42px!important;
  border-radius:7px!important;
  color:#314159!important;
  background:#F2F6FA!important;
  font-size:14.5px!important;
  font-weight:900!important;
  box-shadow:none!important;
}

.nav-group[open] summary{
  color:#FFFFFF!important;
  background:linear-gradient(135deg,var(--primary),#18527A)!important;
  border-color:var(--primary)!important;
}

.nav a,
.nav-disabled{
  min-height:38px!important;
  border-radius:7px!important;
  color:#334155!important;
  font-size:13.5px!important;
  font-weight:800!important;
}

.nav-group[open] a,
.nav-group[open] .nav-disabled{
  background:#FFFFFF!important;
  border-color:#E7EEF6!important;
}

.nav a svg,
.nav-disabled svg{
  color:#54708D!important;
}

.nav a:hover{
  color:var(--primary)!important;
  background:#EAF3FB!important;
  border-color:#C7D9E9!important;
  transform:none!important;
}

.nav a.active{
  color:#FFFFFF!important;
  background:linear-gradient(135deg,#123A5F,#1C6A96)!important;
  border-color:var(--primary)!important;
  box-shadow:0 12px 24px rgba(18,58,95,.16)!important;
}

.nav a.active svg{
  color:#FFFFFF!important;
}

.topbar{
  position:sticky!important;
  top:0!important;
  z-index:60!important;
  align-items:center!important;
  margin:-18px -26px 16px!important;
  padding:14px 26px!important;
  border-bottom:1px solid rgba(200,213,227,.72)!important;
  background:rgba(244,247,251,.92)!important;
  backdrop-filter:blur(14px);
}

.topbar h1{
  font-size:24px!important;
}

.page-head,
.panel,
.card,
.sub-card,
.page-state,
.smart-table,
.report-card,
.report-table-panel,
.report-methods-panel,
.report-summary-card,
.toolbar,
.smart-table-toolbar{
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.page-head{
  background:#FFFFFF!important;
}

.panel{
  padding:16px!important;
}

.card{
  min-height:96px!important;
  padding:14px!important;
}

.card:before{
  width:4px!important;
  background:var(--primary)!important;
}

.card span{
  color:#64748B!important;
  font-size:12.5px!important;
  font-weight:850!important;
}

.card b,
.kpi-value,
.dashboard-card-value b{
  color:#102A43!important;
  font-size:22px!important;
  font-weight:950!important;
}

.card .card-icon,
.metric-icon{
  border-radius:8px!important;
  background:var(--primary-soft)!important;
  color:var(--primary)!important;
}

.smart-table-scroll{
  border-color:var(--border)!important;
  border-radius:8px!important;
  background:#FFFFFF!important;
}

.smart-table-scroll table th,
.smart-table-scroll table td,
table th,
table td{
  padding:11px 12px!important;
  border-color:#E7EEF6!important;
  font-size:13.5px!important;
}

.smart-table-scroll table th,
table th{
  background:#EEF4FA!important;
  color:#243B53!important;
  font-size:12px!important;
  font-weight:950!important;
}

body.admin-body .smart-table-scroll table th,
body.admin-body .smart-table-scroll table th:first-child,
body.admin-body .smart-table-scroll table th:last-child,
body.admin-body table th,
body.admin-body table th:first-child,
body.admin-body table th:last-child{
  background:#EEF4FA!important;
  color:#243B53!important;
  border-color:#DDE6F0!important;
}

tbody tr:hover td{
  background:#F8FBFF!important;
}

.field input,
.field select,
.field textarea,
.smart-table-search,
.smart-table-filter,
.smart-table-size,
input,
select,
textarea{
  border-radius:8px!important;
  border-color:#CBD8E6!important;
  background:#FFFFFF!important;
  color:#162033!important;
}

.btn,
button,
input[type="submit"]{
  border-radius:8px!important;
  border-color:var(--primary)!important;
  background:var(--primary)!important;
  color:#FFFFFF!important;
  font-weight:900!important;
  box-shadow:0 10px 22px rgba(18,58,95,.13)!important;
}

.btn.ghost,
.btn.secondary,
button.ghost,
button.secondary,
.icon-btn.ghost,
.icon-btn.icon-only{
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  color:var(--primary)!important;
  box-shadow:none!important;
}

.topbar-badge{
  background:#DC2626!important;
  color:#FFFFFF!important;
  border:2px solid #FFFFFF!important;
}

.is-profit b,
.amount-income,
.text-success,
.profit,
.income{color:var(--success)!important}

.is-expense b,
.amount-expense,
.expense{color:var(--warning)!important}

.is-loss b,
.amount-loss,
.loss,
.danger{color:var(--danger)!important}

.is-commission b,
.commission{color:#B7791F!important}

.badge{
  border-radius:999px!important;
  border-color:#D5E0EC!important;
  background:#F8FBFF!important;
  color:#314159!important;
  font-size:12px!important;
  font-weight:900!important;
}

.badge.success,
.badge.paid,
.badge.active{
  border-color:#BFE9D6!important;
  background:var(--success-bg)!important;
  color:var(--success)!important;
}

.badge.warning,
.badge.pending,
.badge.unpaid{
  border-color:#F7D9A8!important;
  background:var(--warning-bg)!important;
  color:#9A5A00!important;
}

.badge.danger,
.badge.cancelled,
.badge.overdue{
  border-color:#F3B9B9!important;
  background:var(--danger-bg)!important;
  color:var(--danger)!important;
}

.entity-tabbar,
.building-tabbar{
  position:sticky!important;
  top:73px!important;
  z-index:45!important;
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow-soft)!important;
}

.entity-tab.active,
.building-tab.active{
  background:var(--primary)!important;
  color:#FFFFFF!important;
}

.unsaved-dialog{
  position:fixed!important;
  inset:0!important;
  display:none;
  place-items:center!important;
  background:rgba(15,23,42,.34)!important;
  backdrop-filter:blur(6px);
  z-index:5000!important;
}

.unsaved-dialog.open{
  display:grid!important;
}

.unsaved-card{
  width:min(460px,100%)!important;
  margin:0!important;
  border-radius:8px!important;
  border-color:var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}

.login-page{
  display:grid!important;
  place-items:center!important;
  min-height:100vh!important;
  padding:24px!important;
}

.login-box{
  width:min(420px,100%)!important;
  border-radius:8px!important;
  border:1px solid var(--border)!important;
  background:#FFFFFF!important;
  box-shadow:var(--shadow)!important;
}

@media (max-width:1050px){
  :root{--sidebar-width:292px}
  body.admin-body:not(.focus-mode) .main{
    width:100%!important;
    margin:0!important;
    padding:16px 14px 72px!important;
  }
  body.admin-body:not(.focus-mode) .sidebar{
    transform:translateX(102%);
    transition:transform .18s ease;
  }
  body.admin-body:not(.focus-mode) .sidebar.open{
    transform:translateX(0);
  }
  .mobile-nav-toggle{
    display:inline-flex!important;
  }
  .topbar{
    margin:-16px -14px 14px!important;
    padding:12px 14px!important;
  }
  .topbar h1{
    font-size:20px!important;
  }
  .smart-table-toolbar,
  .smart-table-tools{
    grid-template-columns:1fr!important;
  }
}

/* UPDATE 23B: report sizing must win over the final legacy theme cascade */
body.admin-body .report-table-panel[data-report-table] .smart-table-scroll table{
  width:100%!important;
  min-width:var(--report-table-min-width, 760px)!important;
  table-layout:auto!important;
}

body.admin-body .report-table-panel[data-report-table] .smart-table-scroll tbody td{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  white-space:nowrap!important;
}

/* UPDATE 24C: final print safeguard after all legacy layout rules */
@media print{
  body.has-universal-print{
    min-width:0!important;
    background:#fff!important;
    color:#172033!important;
  }

  body.has-universal-print .sidebar,
  body.has-universal-print .topbar,
  body.has-universal-print .portal-header,
  body.has-universal-print .mobile-nav-toggle,
  body.has-universal-print .premium-bottom-nav,
  body.has-universal-print .smart-table-toolbar,
  body.has-universal-print .smart-table-pagination,
  body.has-universal-print .smart-mobile-cards,
  body.has-universal-print .actions,
  body.has-universal-print .toolbar,
  body.has-universal-print .flash,
  body.has-universal-print form,
  body.has-universal-print button,
  body.has-universal-print .btn,
  body.has-universal-print .icon-btn{
    display:none!important;
  }

  body.has-universal-print .app-shell,
  body.has-universal-print .main{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  body.has-universal-print .universal-print-header{
    display:flex!important;
  }
}

/* UPDATE 25: aligned table actions and softer print controls */
.smart-table-toolbar{
  align-items:end!important;
  gap:10px!important;
  padding:10px 12px!important;
}

.smart-table-tools{
  align-items:end!important;
  gap:8px!important;
}

.smart-table-actions{
  width:auto!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  gap:6px!important;
}

.smart-table-export-button,
.report-table-actions .btn,
.page-print-button,
.dashboard-portal-actions .btn{
  min-height:36px!important;
  padding:7px 11px!important;
  border-radius:9px!important;
  font-size:12.5px!important;
  line-height:1.2!important;
  box-shadow:none!important;
}

.smart-table-export-button svg,
.report-table-actions .btn svg,
.page-print-button svg{
  width:16px!important;
  height:16px!important;
  stroke-width:1.75!important;
}

.smart-table-export-button.is-print,
.report-table-print-btn,
.page-print-button,
.print-action-soft{
  border:1px solid #C9D7E4!important;
  background:#F8FBFE!important;
  color:#294A67!important;
  box-shadow:0 1px 2px rgba(15,42,68,.08)!important;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease!important;
}

.smart-table-export-button.is-print:hover,
.report-table-print-btn:hover,
.page-print-button:hover,
.print-action-soft:hover{
  border-color:#AFC3D5!important;
  background:#EEF5FB!important;
  color:#123A5F!important;
  transform:translateY(-1px);
}

.smart-table-export-button.is-print:focus-visible,
.report-table-print-btn:focus-visible,
.page-print-button:focus-visible,
.print-action-soft:focus-visible{
  outline:3px solid rgba(41,105,157,.18)!important;
  outline-offset:2px;
}

.dashboard-portal-actions{
  justify-content:flex-start!important;
  gap:7px!important;
  margin-top:14px!important;
  padding-top:12px;
  border-top:1px solid #E4EBF2;
}

.dashboard-portal-actions .dashboard-print-button{
  border-color:#C9D7E4!important;
  background:#F8FBFE!important;
  color:#294A67!important;
}

@media (min-width:761px) and (max-width:1050px){
  .smart-table-toolbar{
    grid-template-columns:minmax(0,1fr) auto!important;
  }

  .smart-table-tools{
    grid-template-columns:minmax(180px,1fr) minmax(130px,auto) minmax(90px,auto) auto!important;
  }

  .smart-table-actions{
    justify-self:start!important;
  }
}

@media (max-width:760px){
  .smart-table-toolbar{
    grid-template-columns:1fr!important;
    align-items:stretch!important;
  }

  .smart-table-tools{
    grid-template-columns:minmax(0,1fr) minmax(92px,110px)!important;
  }

  .smart-table-tools > .smart-table-search,
  .smart-table-tools > .smart-table-count{
    grid-column:1 / -1;
  }

  .smart-table-tools > .smart-table-count{
    justify-self:start;
  }

  .smart-table-actions{
    width:100%!important;
  }

  .smart-table-actions .smart-table-export-button{
    flex:1 1 0!important;
  }
}

