:root {
  color-scheme: light;
  --ink: #19332f;
  --muted: #71817c;
  --line: #e4eae6;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --green: #165c50;
  --green-dark: #113b35;
  --green-soft: #e6f1ed;
  --orange: #e49b45;
  --blue: #4774a8;
  --red: #c95d53;
  font-family: "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 0 0 auto; z-index: 4; display: flex; width: 250px; flex-direction: column; padding: 28px 18px 20px; background: var(--green-dark); color: #f3f8f5; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 40px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #6f9e8d; border-radius: 12px; background: #1d5c4d; color: #fff; font-size: 23px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 3px; color: #a9c5b9; font-size: 12px; }
.primary-nav { display: grid; gap: 7px; }
.nav-link { display: flex; min-height: 46px; align-items: center; gap: 13px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: #c0d3ca; text-align: right; font-size: 14px; transition: background .18s ease, color .18s ease; }
.nav-link:hover, .nav-link.is-active { background: #255c4f; color: #fff; }
.nav-link.is-active { box-shadow: inset -3px 0 #e8ad61; }
.nav-icon { display: grid; width: 23px; place-items: center; font-size: 19px; line-height: 1; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid #31584e; color: #b7cfc4; font-size: 12px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #78c69a; box-shadow: 0 0 0 3px #31584e; }
.main-area { min-height: 100vh; margin-right: 250px; }
.topbar { display: flex; min-height: 97px; align-items: center; justify-content: space-between; padding: 18px 38px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-title .eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 750; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--green); font-size: 19px; }
.icon-button:hover { border-color: #9ab9ac; background: var(--green-soft); }
.user-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #f5e8d6; color: #895b27; font-weight: 700; }
.view-container { max-width: 1440px; margin: auto; padding: 30px 38px 60px; }
.mobile-nav { display: none; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.welcome-row h2 { margin: 0; font-size: 20px; }
.welcome-row p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.button-primary, .button-secondary { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 700; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: #10493f; }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button-secondary:hover { background: var(--paper); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { min-height: 120px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 17px; }
.stat-card:nth-child(2) .stat-icon { background: #fbf0df; color: #b7792d; }
.stat-card:nth-child(3) .stat-icon { background: #eaf0f9; color: var(--blue); }
.stat-card:nth-child(4) .stat-icon { background: #fae9e7; color: var(--red); }
.stat-value { margin-top: 14px; font-size: 25px; font-weight: 750; line-height: 1; }
.stat-caption { margin-top: 7px; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .9fr); gap: 16px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.panel-heading { display: flex; min-height: 59px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-size: 14px; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; }
.empty-state { display: grid; min-height: 220px; align-content: center; justify-items: center; padding: 20px; color: var(--muted); text-align: center; }
.empty-symbol { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 12px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 20px; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state p { margin: 6px 0 0; font-size: 12px; }
.quick-actions { display: grid; padding: 6px 17px; }
.quick-action { display: flex; min-height: 57px; align-items: center; gap: 11px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: right; font-size: 13px; }
.quick-action:last-child { border-bottom: 0; }
.quick-action:hover { color: var(--green); }
.quick-action span:first-child { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 7px; background: var(--paper); color: var(--green); font-size: 17px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 12px; }
th { background: #fafbf9; color: var(--muted); font-weight: 600; }
td { color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
.table-empty { padding: 44px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.table-action { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--green); font-size: 11px; }
.table-action:hover { background: var(--green-soft); }
.table-action.delete-action { color: var(--red); }
.table-action.delete-action:hover { background: #fae9e7; }
.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 15px; }
.account-summary > div { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.account-summary span { color: var(--muted); font-size: 12px; }
.account-summary strong { font-size: 16px; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: #10251fcc; }
.dialog { width: min(100%, 520px); max-height: min(90vh, 760px); overflow: auto; border-radius: 9px; background: white; box-shadow: 0 20px 70px #10251f44; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 17px; }
.dialog-close { width: 32px; height: 32px; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 19px; }
.dialog-form { display: grid; gap: 14px; padding: 20px 21px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #52635e; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #dce5df; border-radius: 6px; outline: 0; background: white; color: var(--ink); font-size: 13px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #6fa293; box-shadow: 0 0 0 3px #e6f1ed; }
.form-actions { display: flex; justify-content: start; gap: 8px; margin-top: 4px; }
.dialog-note, .sync-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sync-form { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sync-status { padding: 10px 12px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 12px; }
.toast-region { position: fixed; z-index: 20; right: 24px; bottom: 24px; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 7px; background: var(--green-dark); color: white; box-shadow: 0 8px 25px #10251f30; font-size: 13px; }
.toast.error { background: #a43e37; }

@media (max-width: 1000px) {
  .sidebar { width: 220px; }
  .main-area { margin-right: 220px; }
  .topbar, .view-container { padding-right: 25px; padding-left: 25px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .main-area { margin-right: 0; padding-bottom: 68px; }
  .topbar { min-height: 76px; padding: 13px 17px; }
  .topbar h1 { font-size: 19px; }
  .view-container { padding: 22px 16px 30px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 64px; padding: 5px 5px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
  .mobile-nav .nav-link { min-height: 52px; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 1px; border-radius: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
  .mobile-nav .nav-link.is-active { background: var(--green-soft); color: var(--green); box-shadow: none; }
  .mobile-nav .nav-icon { font-size: 17px; }
  .welcome-row { align-items: start; flex-direction: column; margin-bottom: 18px; }
  .welcome-row .button-primary { width: 100%; }
  .stats-grid { gap: 9px; margin-bottom: 14px; }
  .stat-card { min-height: 106px; padding: 13px; }
  .stat-value { font-size: 22px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .account-summary { grid-template-columns: 1fr; gap: 8px; }
  .account-summary > div { grid-template-columns: 1fr auto; align-items: center; padding: 11px 13px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading .button-primary { width: 100%; }
  .toast-region { right: 14px; bottom: 78px; left: 14px; }
  .toast { text-align: center; }
}
@media (max-width: 380px) {
  .stat-top { align-items: start; gap: 5px; font-size: 11px; }
  .stat-icon { width: 27px; height: 27px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
}.user-avatar { padding: 0; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
