:root {
  --primary: #059669;
  --primary-dark: #047857;
  --bg: #f0fdf4;
  --card: #fff;
  --text: #064e3b;
  --muted: #6b7280;
  --danger: #dc2626;
  --border: #d1fae5;
  --safe-b: env(safe-area-inset-bottom, 0);
  --nav-h: 56px;
  --bottom-h: 62px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}
.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }

/* Login */
#screen-login { align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #ecfdf5, #d1fae5); }
.login-card {
  background: var(--card); border-radius: 20px; padding: 32px 24px;
  width: min(400px, 100%); box-shadow: 0 8px 32px rgba(5,150,105,.15);
}
.logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.login-card h1 { text-align: center; font-size: 1.5rem; }
.sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; font-family: inherit; font-weight: 600; cursor: pointer;
}
.auth-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-panel.hidden { display: none; }
.hidden { display: none !important; }
label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 1rem;
  background: #fff;
}
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap input { padding-inline-end: 44px; }
.pwd-toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.pwd-toggle:hover { color: var(--primary); background: rgba(5,150,105,.08); }
.pwd-toggle:active { opacity: .85; }
.pwd-icon { display: block; flex-shrink: 0; }
.pwd-toggle[aria-pressed="true"] .pwd-icon-show { display: none; }
.pwd-toggle[aria-pressed="true"] .pwd-icon-hide { display: block !important; }
.pwd-toggle[aria-pressed="false"] .pwd-icon-hide { display: none !important; }
textarea { min-height: 80px; resize: vertical; }
.error { color: var(--danger); text-align: center; font-size: .85rem; margin-top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: 10px;
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-wa { background: #25d366; color: #fff; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  height: var(--nav-h); padding: 0 16px;
  background: var(--primary); color: #fff;
  padding-top: env(safe-area-inset-top, 0);
}
.topbar h1 { flex: 1; font-size: 1.1rem; font-weight: 700; }
.icon-btn { background: none; border: none; color: inherit; font-size: 1.4rem; cursor: pointer; padding: 4px 8px; }
#userBadge { font-size: .75rem; opacity: .9; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-top {
  font-size: .72rem; font-weight: 700; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  color: #fff; font-family: inherit; cursor: pointer; flex-shrink: 0;
}
.logout-top:active { opacity: .85; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  margin-top: 8px;
}
.link-btn {
  background: none; border: none; color: var(--primary); font-family: inherit;
  font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: underline;
  padding: 0; display: inline-block;
}
a.link-btn { color: var(--primary); }
.success-msg { color: #059669; font-size: .88rem; text-align: center; margin-top: 8px; }
.success-msg.hidden { display: none; }
.server-hint {
  background: #fef3c7; color: #92400e; font-size: .82rem; padding: 10px 12px;
  border-radius: 10px; margin-bottom: 12px; text-align: center;
}
.server-hint.hidden { display: none; }
.login-hint { text-align: center; margin-top: 8px; }
.login-hint .link-btn { font-size: .9rem; }
.login-loading { opacity: .6; pointer-events: none; }
.trial-badge {
  font-size: .7rem;
  background: rgba(255, 193, 7, .25);
  color: #ffc107;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.trial-banner, .readonly-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; font-size: .82rem; flex-wrap: wrap;
}
.trial-banner { background: linear-gradient(90deg, #059669, #047857); color: #fff; }
.readonly-banner { background: linear-gradient(90deg, #b45309, #92400e); color: #fff; }
.trial-banner.hidden, .readonly-banner.hidden { display: none !important; }
.readonly-banner-text { display: flex; flex-direction: column; gap: 2px; }
.btn-light {
  background: #fff; color: #92400e; border: none; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.trial-banner .btn-light { color: #047857; }
.read-only .write-action { display: none !important; }
.read-only .main { pointer-events: auto; }

/* Side nav */
.side-nav { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.side-nav.open { pointer-events: auto; }
.nav-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: .25s; }
.side-nav.open .nav-overlay { opacity: 1; }
.nav-panel {
  position: absolute; top: 0; right: 0; width: min(280px, 85vw); height: 100%;
  background: #fff; transform: translateX(100%); transition: .25s;
  padding: 20px 0; overflow-y: auto;
  padding-top: calc(20px + env(safe-area-inset-top, 0));
}
.side-nav.open .nav-panel { transform: translateX(0); }
.nav-brand { padding: 8px 20px 16px; font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.nav-item {
  display: block; width: 100%; text-align: right; padding: 14px 20px;
  border: none; background: none; font-family: inherit; font-size: .95rem;
  cursor: pointer; color: var(--text);
}
.nav-item.active, .nav-item:active { background: var(--bg); color: var(--primary); font-weight: 700; }
.nav-item.danger { color: var(--danger); margin-top: 12px; border-top: 1px solid var(--border); }

/* Main */
.main {
  flex: 1; padding: 16px; padding-bottom: calc(var(--bottom-h) + var(--safe-b) + 16px);
  max-width: 900px; margin: 0 auto; width: 100%;
}

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  height: calc(var(--bottom-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: none; background: none; font-family: inherit; color: var(--muted);
  cursor: pointer; gap: 2px; font-size: .65rem;
}
.bn-item span { font-size: 1.25rem; }
.bn-item.active { color: var(--primary); font-weight: 700; }

/* Cards & stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: 14px; padding: 16px;
  border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-card .icon { font-size: 1.5rem; margin-bottom: 6px; }
.stat-card .val { font-size: 1.25rem; font-weight: 800; }
.stat-card .lbl { font-size: .75rem; color: var(--muted); }

.page-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.page-head h2 { flex: 1; font-size: 1.15rem; min-width: 120px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.print-layout-options { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.print-layout-opt { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.item-card {
  background: var(--card); border-radius: 12px; padding: 14px;
  border: 1px solid var(--border); cursor: pointer;
}
.item-card:active { background: var(--bg); }
.item-card .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.item-card .title { font-weight: 700; font-size: .95rem; }
.item-card .badge {
  font-size: .7rem; padding: 3px 8px; border-radius: 20px;
  background: var(--bg); color: var(--primary); white-space: nowrap;
}
.item-card .status-select {
  font-size: .7rem; padding: 4px 22px 4px 8px; border-radius: 20px;
  border: 1px solid transparent; font-family: inherit; font-weight: 600;
  cursor: pointer; max-width: 130px; white-space: nowrap;
  appearance: none; -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: left 6px center;
  background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23065f46' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}
.item-card .status-select:disabled { cursor: default; opacity: .85; }
.item-card .status-select[data-status="جديد"] { background-color: #d1fae5; color: #065f46; }
.item-card .status-select[data-status="قيد التجهيز"] { background-color: #fef3c7; color: #92400e; }
.item-card .status-select[data-status="جاهز للشحن"] { background-color: #dbeafe; color: #1e40af; }
.item-card .status-select[data-status="في الطريق"] { background-color: #e0e7ff; color: #3730a3; }
.item-card .status-select[data-status="مؤجل"] { background-color: #fce7f3; color: #9d174d; }
.item-card .status-select[data-status="تم التسليم"] { background-color: #bbf7d0; color: #14532d; }
.item-card .status-select[data-status="ملغي"] { background-color: #fee2e2; color: #991b1b; }
.order-details {
  margin-top: 10px; padding: 10px; background: var(--bg); border-radius: 10px;
  border: 1px solid var(--border); font-size: .8rem;
}
.order-card-clickable { cursor: pointer; }
.order-card-clickable:hover { background: #f0fdf4; }
.order-card-hint { font-size: .7rem; opacity: .7; }
.order-detail-modal .order-details { margin-top: 0; }

/* معاينة الفاتورة داخل النافذة */
.invoice-preview-shell {
  margin: -8px -4px;
  background: #f3f4f6;
  padding: 12px;
  border-radius: 12px;
  max-height: 65vh;
  overflow-y: auto;
}
.invoice-preview-shell .invoice-doc {
  transform-origin: top center;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}
.invoice-preview-shell .invoice-doc[dir="ltr"] {
  direction: ltr;
  text-align: left;
}
@media (max-width: 600px) {
  .invoice-preview-shell .inv-hero-inner,
  .invoice-preview-shell .inv-body { padding: 16px; }
  .invoice-preview-shell .inv-parties { grid-template-columns: 1fr; }
  .invoice-preview-shell .inv-company { font-size: 1.25rem; }
}
.od-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #d1fae5; }
.od-row:last-child { border-bottom: none; }
.od-row span:first-child { color: var(--muted); white-space: nowrap; }
.od-row span:last-child { text-align: left; font-weight: 600; }
.od-row.cod span:last-child { color: var(--primary); font-size: .75rem; }
.status-note-wrap { margin-top: 10px; }
.status-note-wrap.hidden { display: none; }
.status-note-input {
  width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: .85rem; resize: vertical;
}
.status-note-save { margin-top: 6px; }
.status-note-display {
  margin-top: 8px; padding: 8px 10px; background: #fef3c7; border-radius: 8px;
  font-size: .8rem; color: #92400e;
}
.receipt-box label { display: block; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.logo-upload-box{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:6px}
.logo-preview-wrap{width:80px;height:80px;border:1px dashed var(--border);border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fafafa}
.logo-preview{max-width:100%;max-height:100%;object-fit:contain}
.lang-switch{display:flex;gap:8px;justify-content:center;margin-bottom:16px}
.lang-btn{
  flex:1;padding:8px 12px;border:1px solid var(--border);border-radius:10px;
  background:#fff;font-family:inherit;font-weight:700;font-size:.85rem;cursor:pointer;color:var(--muted);
}
.lang-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}
html[dir="ltr"] .nav-panel{left:0;right:auto;transform:translateX(-100%)}
html[dir="ltr"] .side-nav.open .nav-panel{transform:translateX(0)}
html[dir="ltr"] .nav-item{text-align:left}
html[dir="ltr"] body{font-family:'Cairo',system-ui,sans-serif}
.logo-placeholder{font-size:.7rem;color:var(--muted);text-align:center;padding:4px}
.settings-section-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.help-tip-btn{
  width:22px;height:22px;border-radius:50%;border:1px solid var(--primary);background:#fff;
  color:var(--primary);font-weight:800;font-size:.85rem;line-height:1;cursor:pointer;padding:0;
  font-family:inherit;flex-shrink:0;
}
.help-tip-btn:hover{background:var(--bg)}
.backup-help-note{background:#f8fafc;border:1px solid var(--border);border-radius:10px;padding:10px 12px}
.receipt-box input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; }
.accounts-summary h3 { font-size: .95rem; margin: 0 0 10px; color: var(--primary); }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.account-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.acc-line { display: flex; justify-content: space-between; font-size: .8rem; margin-top: 4px; }
.acc-line.remain { font-weight: 700; color: #b45309; margin-top: 8px; }
.acc-totals { background: var(--bg); padding: 12px; border-radius: 10px; }
.collect-amt-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.acc-totals { background: var(--bg); padding: 12px; border-radius: 10px; }
.collect-amt-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.collect-amt-row input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; }
.locked-info {
  background: var(--bg); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px; margin: 8px 0; font-size: .85rem;
}
.locked-info small { color: var(--muted); font-weight: 400; }
.expense-card { cursor: default; }
.section-title { font-size: .95rem; margin: 0; color: var(--primary); }
.lines-table .pos { color: #059669; font-weight: 600; }
.pay-check-warn { color: #b45309; font-weight: 600; }
.pay-check-ok { color: #059669; font-weight: 600; }
.pay-check-row .form-grid { gap: 6px; }
.item-card .meta { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.item-card .amount { font-weight: 800; color: var(--primary); font-size: .95rem; }
.capital-badge {
  border: 2px solid var(--primary); background: #ecfdf5; color: var(--primary);
  font-weight: 800; font-size: .95rem; padding: 6px 12px; border-radius: 10px;
  cursor: pointer; font-family: inherit;
}
.capital-badge:hover { background: #d1fae5; }
.partner-balances { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.advance-badge {
  border: 2px solid #d97706; background: #fffbeb; color: #b45309;
  font-weight: 800; font-size: .95rem; padding: 6px 12px; border-radius: 10px;
  cursor: pointer; font-family: inherit;
}
.advance-badge:hover { background: #fef3c7; }
.badge-label { font-size: .65rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 2px; }
.ledger-summary { margin-bottom: 12px; font-size: .95rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th, .data-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: right; }
.data-table th { color: var(--muted); font-weight: 600; }
.contact-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contact-chip {
  font-size: .7rem; padding: 3px 8px; border-radius: 12px;
  background: #ecfdf5; color: #065f46; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.contact-type-row {
  display: flex; align-items: center; gap: 10px;
}
.contact-type-ico, .cm-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
}
.cm-ico-svg, .inv-ico-svg { width: 22px; height: 22px; display: block; }
.contact-type-row select { flex: 1; }
.contact-field { margin-top: 8px; }
.field-label-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.field-label-row label { margin: 0; font-weight: 600; color: var(--primary); }
.contact-field select {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; font-family: inherit; background: #fff;
}
.btn-add-mini {
  width: 28px; height: 28px; padding: 0; border-radius: 8px;
  border: 1px solid var(--primary); background: #ecfdf5; color: var(--primary);
  font-size: 1.1rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.btn-add-mini:active { background: #d1fae5; }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-bar select { flex: 1; min-width: 140px; }

.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .form-row-2 { grid-template-columns: 1fr; } }

.lines-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin: 12px 0; }
.lines-table th, .lines-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.lines-table th { background: var(--bg); font-size: .75rem; }

.summary-box {
  background: var(--bg); border-radius: 12px; padding: 14px; margin-top: 12px;
  font-size: .9rem;
}
.summary-box .line { display: flex; justify-content: space-between; padding: 4px 0; }
.summary-box .total { font-weight: 800; font-size: 1.05rem; color: var(--primary); border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-box {
  background: #fff; width: 100%; max-width: 600px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head { display: flex; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; font-size: 1.1rem; }
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-bottom: calc(12px + var(--safe-b)); }

.toast {
  position: fixed; bottom: calc(var(--bottom-h) + 16px + var(--safe-b)); left: 50%;
  transform: translateX(-50%) translateY(80px); opacity: 0;
  background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: .9rem; z-index: 400; transition: .3s; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.report-table { width: 100%; font-size: .75rem; border-collapse: collapse; overflow-x: auto; display: block; }
.report-table table { width: 100%; min-width: 500px; }
.report-table th, .report-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: right; }
.report-table th { background: var(--primary); color: #fff; }
.page-head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.budget-section { margin-top: 16px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.budget-section h3 { margin: 0 0 10px; font-size: .9rem; color: var(--primary); }
.budget-section-result { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.budget-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.budget-line:last-child { border-bottom: none; }
.budget-line-sub { color: var(--muted); padding-inline-start: 12px; }
.budget-line-total { font-weight: 700; font-size: .95rem; color: var(--text); }
html[dir="ltr"] .budget-line-sub { padding-inline-start: 0; padding-left: 12px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.budget-print-preview { margin-top: 12px; overflow-x: auto; }
.budget-print-preview .br-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.budget-print-preview .br-table thead th { background: var(--primary); color: #fff; padding: 10px 12px; font-weight: 700; text-align: right; border: 1px solid var(--primary); }
.budget-print-preview .br-table thead th.br-amt { text-align: left; width: 88px; }
.budget-print-preview .br-col-en { font-weight: 600; opacity: .85; font-size: .68rem; }
.budget-print-preview .br-table td { padding: 8px 12px; border: 1px solid var(--border); }
.budget-print-preview .br-section-head td { background: var(--bg); color: var(--primary); font-weight: 800; font-size: .8rem; border-top: 2px solid var(--primary); }
.budget-print-preview .br-indent td:first-child { padding-inline-start: 24px; color: var(--muted); }
.budget-print-preview .br-total td { border-top: 2px solid var(--border); font-weight: 800; }
.budget-print-preview .br-result td { background: color-mix(in srgb, var(--primary) 8%, var(--card)); font-weight: 800; color: var(--primary); }
.budget-print-preview .br-empty td { color: var(--muted); font-style: italic; font-size: .8rem; }
.budget-print-preview .br-amt { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 600; }
.budget-print-preview .br-dr { color: #b91c1c; }
.budget-print-preview .br-cr { color: #047857; }
.budget-print-preview .br-bal { color: #1e40af; font-weight: 700; }
.budget-print-preview .br-footer-row td { background: var(--bg); font-size: .75rem; color: var(--muted); text-align: center; border-top: 2px solid var(--border); padding: 10px 12px; }

.pa-days-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pa-days-input { width: 76px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; direction: ltr; text-align: center; }
.pa-days-input:focus { outline: none; border-color: var(--primary); }
.pa-days-save { padding: 4px 10px; font-size: .75rem; flex-shrink: 0; }

.pl-print-preview { margin-top: 12px; overflow-x: auto; }
.pl-print-preview .pl-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pl-print-preview .pl-table thead th { background: var(--primary); color: #fff; padding: 10px 12px; font-weight: 700; text-align: right; border: 1px solid var(--primary); }
.pl-print-preview .pl-table thead th.pl-amt { text-align: left; width: 120px; }
.pl-print-preview .pl-table td { padding: 8px 12px; border: 1px solid var(--border); }
.pl-print-preview .pl-section td { background: color-mix(in srgb, var(--primary) 10%, var(--card)); color: var(--primary); font-weight: 800; font-size: .8rem; border-top: 2px solid var(--primary); }
.pl-print-preview .pl-indent { padding-inline-start: 24px !important; color: var(--muted); }
.pl-print-preview .pl-sub { color: var(--muted); font-size: .8rem; font-style: italic; }
.pl-print-preview .pl-total-row td { border-top: 2px solid var(--border); }
.pl-print-preview .pl-total { font-weight: 800; }
.pl-print-preview .pl-result-row td { background: color-mix(in srgb, var(--primary) 8%, var(--card)); font-weight: 800; color: var(--primary); }
.pl-print-preview .pl-result { color: var(--primary); }
.pl-print-preview .pl-neg { color: #b91c1c; }
.pl-print-preview .pl-amt { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 600; }
.pl-print-preview .pl-bold { font-weight: 700; }
.pl-print-preview .pl-compare { color: #1e40af; font-weight: 700; font-size: .82rem; }

.install-banner {
  background: var(--primary); color: #fff; padding: 12px 16px; border-radius: 12px;
  margin-bottom: 16px; display: none; align-items: center; gap: 12px; font-size: .85rem;
}
.install-banner.show { display: flex; }
