@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Tajawal', system-ui, sans-serif;
  color: #173032;
  background: #f4f7f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --primary: #0B7A53;
  --primary-dark: #075E40;
  --primary-soft: #E8F5EF;
  --border: #dfe8e8;
  --muted: #6c7f80;
  --danger: #b42318;
  --shadow: 0 12px 35px rgba(24, 62, 64, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f7f7; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
a { color: inherit; text-decoration: none; }

.full-loader { min-height: 100vh; display: grid; place-items: center; font-weight: 700; color: var(--primary); }
.app-shell { min-height: 100vh; display: flex; direction: rtl; }
.sidebar { width: 270px; background: #073F2E; color: white; padding: 22px 16px; position: fixed; right: 0; top: 0; bottom: 0; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 48px; height: 48px; object-fit: contain; background: white; border-radius: 14px; padding: 4px; flex: 0 0 auto; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: #a9c4c4; margin-top: 3px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; padding-top: 20px; overflow-y: auto; }
.nav-link { border: 0; background: transparent; color: #bed0d0; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; width: 100%; text-align: right; transition: .18s ease; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(52, 211, 191, .14); }
.nav-link.active { box-shadow: inset -3px 0 #36c7b5; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.logout { margin-top: 8px; }
.demo-badge { display: block; padding: 8px 10px; text-align: center; border-radius: 9px; background: rgba(245, 158, 11, .15); color: #fbd38d; font-size: 13px; }
.main-area { margin-right: 270px; width: calc(100% - 270px); min-height: 100vh; }
.topbar { height: 72px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar-title { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #28484a; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { text-align: left; }
.user-chip span, .user-chip small { display: block; }
.user-chip span { font-weight: 700; }
.user-chip small { color: var(--muted); }
.page-container { padding: 28px; max-width: 1680px; margin: 0 auto; }
.menu-button, .mobile-close { display: none !important; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 28px; color: #17393b; }
.page-heading p { margin: 6px 0 0; color: var(--muted); }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 10px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; }
.primary-button { background: var(--primary); color: white; box-shadow: 0 6px 14px rgba(15,118,110,.18); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { background: white; color: #285456; border: 1px solid var(--border); }
.secondary-button:hover { background: #f7fbfb; }
.danger-button { background: #fff0ee; color: var(--danger); border: 1px solid #ffd3ce; }
.full { width: 100%; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: white; color: #38595a; padding: 0; }
.icon-button:hover { background: #f1f8f7; }
.icon-button.danger { color: var(--danger); }
.text-button { background: none; border: none; color: var(--primary); display: inline-flex; gap: 6px; align-items: center; padding: 0; font-weight: 700; }
.row-actions { display: flex; gap: 6px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 46px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); border-radius: 13px; }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { font-size: 22px; margin-top: 4px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.panel { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.panel-header h2, .panel-header h3 { margin: 0; }
.simple-list > div { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #edf2f2; }
.simple-list > div:last-child { border-bottom: 0; }
.simple-list span, .simple-list small { display: block; }
.simple-list small { color: var(--muted); margin-top: 3px; }

.toolbar, .filter-panel { display: flex; align-items: end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .filter-panel select, .filter-panel input { min-width: 190px; }
.search-box { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; }
.search-box input { border: 0; outline: none; width: 100%; padding: 11px 0; background: transparent; }

.table-wrap { background: white; border: 1px solid var(--border); border-radius: 15px; overflow-x: auto; box-shadow: 0 8px 25px rgba(24, 62, 64, .05); }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 12px 13px; text-align: right; border-bottom: 1px solid #ebf0f0; white-space: nowrap; }
th { background: #f7fafa; color: #527071; font-size: 13px; font-weight: 800; }
tbody tr:hover { background: #fbfdfd; }
tfoot th { background: #eef7f6; }
.cell-subtitle { display: block; color: var(--muted); margin-top: 3px; }
.compact table { min-width: 700px; }
.compact th, .compact td { padding: 8px; text-align: center; }
.compact td:first-child, .compact th:first-child { text-align: right; }
.compact input, .compact select { min-width: 110px; }
.status, .recon-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status.approved, .recon-status.matched { background: #e8f8ef; color: #137547; }
.status.draft { background: #fff7dc; color: #8c6500; }
.status.cancelled, .recon-status.difference, .recon-status.invalid_balance, .recon-status.invalid_number { background: #ffefed; color: #b42318; }
.recon-status.missing_in_system, .recon-status.missing_in_company, .recon-status.duplicate_in_file { background: #fff4e5; color: #a15c00; }
.balance-debit { color: #b54708; }
.balance-credit { color: #175cd3; }
.balance-ok { color: #137547; }
.balance-error { color: #b42318; }
.empty-state { padding: 30px; text-align: center; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 29, 31, .56); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-card { width: min(620px, 100%); max-height: 92vh; overflow: auto; border-radius: 17px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.modal-wide { width: min(1050px, 100%); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: white; z-index: 2; }
.modal-header h2 { margin: 0; font-size: 21px; }
.modal-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
label { color: #36595a; font-weight: 700; font-size: 14px; }
label input, label select, label textarea, .toolbar select { display: block; width: 100%; margin-top: 6px; border: 1px solid #cedddd; border-radius: 9px; padding: 10px 11px; outline: none; background: white; color: #163638; }
label input:focus, label select:focus, label textarea:focus { border-color: #46a59e; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
label textarea { min-height: 82px; resize: vertical; }
label small { display: block; color: var(--muted); font-weight: 400; margin-top: 5px; }
.span-2 { grid-column: 1 / -1; }
.checkbox-label { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 9px; }
.checkbox-label input { width: auto; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }
.error-box, .info-box { padding: 11px 13px; border-radius: 9px; font-size: 14px; }
.error-box { background: #fff0ee; color: #a51c13; border: 1px solid #ffd1cc; }
.info-box { background: #eef8ff; color: #175f8c; border: 1px solid #cce9fa; margin-bottom: 18px; }
.permissions-wrap h3 { margin: 6px 0 12px; }
.general-lines { padding: 10px 0; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top right, #d9f2ef, transparent 38%), linear-gradient(135deg, #f8fbfb, #e9f2f2); }
.login-card { width: min(440px, 100%); background: white; border: 1px solid var(--border); border-radius: 22px; padding: 34px; box-shadow: 0 25px 70px rgba(24, 62, 64, .14); text-align: center; }
.login-brand-logo { width: min(260px, 78%); max-height: 150px; object-fit: contain; margin: 0 auto 16px; display: block; }
.login-card h1 { margin: 0; }
.login-card > p { color: var(--muted); margin: 8px 0 22px; }
.login-card label { text-align: right; }
.input-with-icon { display: flex; align-items: center; gap: 8px; border: 1px solid #cedddd; border-radius: 10px; padding: 0 11px; margin-top: 6px; }
.input-with-icon input { border: 0; padding: 11px 0; margin: 0; box-shadow: none; }


.install-button { width: 100%; border: 1px solid #b8decf; background: var(--primary-soft); color: var(--primary-dark); border-radius: 11px; padding: 10px 14px; margin: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.install-button:hover { background: #d8eee5; }
.compact-install { width: auto; margin: 0; padding: 8px 12px; white-space: nowrap; }
.ios-install-help { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #b8decf; border-radius: 10px; padding: 10px 12px; margin: 0 0 18px; font-size: 14px; font-weight: 600; }

.barcode-card { display: flex; flex-direction: column; align-items: center; gap: 12px; overflow: auto; }
.scanner-box { min-height: 300px; }
.muted { color: var(--muted); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--border); background: var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.summary-strip > div { background: white; padding: 15px; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--muted); font-size: 13px; }
.summary-strip strong { margin-top: 5px; font-size: 17px; }

.upload-panel { display: grid; grid-template-columns: 310px 1fr; gap: 18px; margin-bottom: 18px; }
.file-drop { background: white; border: 2px dashed #a9cfcc; border-radius: 16px; padding: 25px; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--primary); cursor: pointer; }
.file-drop input { display: none; }
.file-drop span { color: var(--muted); margin-top: 4px; }
.column-mapping { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.empty-card { padding: 55px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--muted); }
.empty-card h3 { color: #345556; margin-bottom: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.settings-grid .panel > svg { color: var(--primary); }
.settings-grid code { display: block; direction: ltr; text-align: left; background: #102c2e; color: #d5fffa; padding: 12px; border-radius: 9px; margin-top: 12px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-panel { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .sidebar { transform: translateX(110%); transition: .25s ease; }
  .sidebar-open { transform: translateX(0); }
  .main-area { width: 100%; margin-right: 0; }
  .menu-button, .mobile-close { display: inline-grid !important; }
  .mobile-close { margin-right: auto; background: transparent; border-color: rgba(255,255,255,.15); color: white; }
  .mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .topbar { padding: 0 15px; }
  .topbar-title { display: none; }
  .topbar-actions { gap: 8px; }
  .compact-install { padding: 7px 9px; }
  .user-chip small { display: none; }
  .page-container { padding: 18px 13px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .column-mapping { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .summary-strip { grid-template-columns: 1fr; }
  .login-card { padding: 25px 18px; }
  .page-heading h1 { font-size: 24px; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
}



/* البحث بالكتابة عن العميل */
.customer-combobox { position: relative; margin-top: 6px; font-weight: 400; min-width: 250px; }
.combobox-input-wrap { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #cedddd; border-radius: 9px; padding: 0 10px; }
.combobox-input-wrap:focus-within { border-color: #46a59e; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.combobox-input-wrap input { width: 100%; min-width: 0; border: 0 !important; outline: 0; margin: 0 !important; padding: 10px 0 !important; box-shadow: none !important; background: transparent; }
.combobox-clear { border: 0; background: transparent; color: var(--muted); padding: 3px; display: grid; place-items: center; }
.combobox-menu { position: absolute; z-index: 150; top: calc(100% + 5px); right: 0; left: 0; max-height: 260px; overflow-y: auto; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 35px rgba(24,62,64,.18); padding: 5px; }
.combobox-menu button { display: block; width: 100%; border: 0; background: white; text-align: right; padding: 9px 10px; border-radius: 7px; }
.combobox-menu button:hover { background: var(--primary-soft); }
.combobox-menu strong, .combobox-menu span { display: block; }
.combobox-menu span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.combobox-empty { color: var(--muted); text-align: center; padding: 16px 8px; }
.customer-combobox-compact { min-width: 230px; margin: 0; }
.customer-combobox-compact .combobox-input-wrap input { padding: 7px 0 !important; }
.customer-filter-label { min-width: min(500px, 100%); flex: 1; }

.serial-input { direction: ltr; text-align: center; font-weight: 800; color: var(--primary-dark); background: var(--primary-soft) !important; }
.form-side-action { display: flex; align-items: end; justify-content: flex-start; padding-bottom: 1px; }
.recent-transactions { border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; }
.recent-transactions table { min-width: 620px; }
.recent-transactions th, .recent-transactions td { padding: 8px 10px; }
.invoice-net-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.invoice-net-card span { background: #f8fbfb; padding: 12px; color: var(--muted); }
.invoice-net-card strong { display: block; color: #173032; margin-top: 4px; font-size: 17px; }

.details-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.details-grid > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fbfdfd; min-width: 0; }
.details-grid span, .details-grid strong, .details-grid small { display: block; overflow-wrap: anywhere; }
.details-grid span { color: var(--muted); font-size: 12px; }
.details-grid strong { margin-top: 4px; }
.details-grid small { color: var(--muted); margin-top: 4px; }
.preview-description { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.preview-description span { color: var(--muted); font-size: 12px; }
.preview-description p { margin: 5px 0 0; }
.audit-timeline { display: flex; flex-direction: column; gap: 10px; }
.audit-timeline article { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.audit-timeline header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.audit-timeline header span { color: var(--muted); font-size: 13px; }
.audit-timeline ul { margin: 10px 0 0; padding-right: 20px; }
.audit-timeline li { margin: 5px 0; }
.audit-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.audit-compare section { border: 1px solid var(--border); border-radius: 11px; padding: 14px; overflow: auto; }
.audit-compare h3 { margin-top: 0; }
.audit-compare section > div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; border-bottom: 1px solid #edf2f2; padding: 7px 0; }
.audit-compare code { direction: ltr; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }

.import-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.import-card > svg { color: var(--primary); }
.import-card h2 { margin-bottom: 7px; }
.import-card p { color: var(--muted); min-height: 66px; }
.import-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.import-actions button { flex: 1; }
.settings-status-grid { grid-template-columns: 1fr; }
.success-box { padding: 11px 13px; border-radius: 9px; background: #e8f8ef; color: #137547; border: 1px solid #bce7cf; margin-bottom: 16px; }

.previous-balance-row { background: #eef7f6; font-weight: 700; }
.print-report-header { display: none; }

@media (max-width: 1100px) {
  .import-grid { grid-template-columns: 1fr; }
  .import-card p { min-height: auto; }
  .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .invoice-net-card { grid-template-columns: 1fr; }
  .details-grid, .audit-compare { grid-template-columns: 1fr; }
  .form-side-action .secondary-button { width: 100%; }
  .customer-combobox { min-width: 0; }
}
@page { size: A4 landscape; margin: 8mm; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { width: 100%; background: white !important; color: #111; font-size: 9pt; }
  .sidebar, .topbar, .page-heading, .toolbar, .filter-panel, .modal-backdrop { display: none !important; }
  .main-area { margin: 0 !important; width: 100% !important; }
  .page-container { padding: 0 !important; max-width: none !important; }
  .print-report-header { display: flex !important; align-items: center; gap: 14px; margin-bottom: 8px; border-bottom: 2px solid #0B7A53; padding-bottom: 7px; }
  .print-report-header img { width: 95px; height: 55px; object-fit: contain; }
  .print-report-header h2 { margin: 0; font-size: 15pt; }
  .print-report-header p { margin: 3px 0 0; }
  .summary-strip { grid-template-columns: repeat(4, 1fr) !important; margin-bottom: 8px; break-inside: avoid; }
  .summary-strip > div { padding: 7px !important; }
  .summary-strip strong { font-size: 10pt !important; }
  .table-wrap { box-shadow: none !important; border: 0 !important; overflow: visible !important; border-radius: 0 !important; }
  table, table.report-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; font-size: 7.5pt; }
  th, td { padding: 4px 3px !important; white-space: normal !important; overflow-wrap: anywhere; line-height: 1.25; }
  th { background: #eaf4f0 !important; color: #173032 !important; }
  tr { break-inside: avoid; }
  .ledger-report .report-table th:nth-child(1), .ledger-report .report-table td:nth-child(1) { width: 8%; }
  .ledger-report .report-table th:nth-child(2), .ledger-report .report-table td:nth-child(2) { width: 12%; }
  .ledger-report .report-table th:nth-child(3), .ledger-report .report-table td:nth-child(3) { width: 11%; }
  .ledger-report .report-table th:nth-child(4), .ledger-report .report-table td:nth-child(4) { width: 11%; }
  .ledger-report .report-table th:nth-child(5), .ledger-report .report-table td:nth-child(5) { width: 25%; }
  .ledger-report .report-table th:nth-child(6), .ledger-report .report-table td:nth-child(6),
  .ledger-report .report-table th:nth-child(7), .ledger-report .report-table td:nth-child(7) { width: 10%; }
  .ledger-report .report-table th:nth-child(8), .ledger-report .report-table td:nth-child(8) { width: 13%; }
  .trial-balance-report .report-table { font-size: 6.8pt; }
  .trial-balance-report .report-table th:nth-child(2), .trial-balance-report .report-table td:nth-child(2) { width: 15%; }
  .trial-balance-report .report-table th:nth-child(3), .trial-balance-report .report-table td:nth-child(3) { width: 11%; }
  .empty-state { display: none; }
}

/* Final workflow enhancements */
.install-offer { position: relative; margin-bottom: 18px; }
.install-offer .install-button { margin: 0; padding-inline-end: 44px; }
.install-dismiss { position: absolute; inset-inline-end: 9px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--primary-dark); display: inline-flex; cursor: pointer; padding: 5px; }
.ios-install-help { position: relative; padding-inline-start: 38px; }
.ios-install-help button { position: absolute; inset-inline-start: 8px; top: 8px; border: 0; background: transparent; color: var(--primary-dark); cursor: pointer; }

.save-success-panel { text-align: center; padding: 10px 6px 4px; display: grid; gap: 12px; }
.save-success-panel h2, .save-success-panel p { margin: 0; }
.save-success-icon { width: 72px; height: 72px; border-radius: 50%; background: #e7f7ee; color: #0b7a53; font-size: 40px; font-weight: 900; display: grid; place-items: center; margin: 0 auto 4px; border: 2px solid #bfe8d4; }

.quick-pin-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: linear-gradient(160deg, #eff8f4 0%, #ffffff 55%, #e8f5ef 100%); }
.quick-pin-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 22px 60px rgba(10, 55, 42, .13); padding: 26px; }
.quick-pin-logo { width: 150px; height: 78px; object-fit: contain; display: block; margin: 0 auto 16px; }
.quick-pin-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; color: var(--primary-dark); }
.quick-pin-heading h1 { margin: 0 0 5px; font-size: 23px; }
.quick-pin-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.pin-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.pin-progress span { border-radius: 999px; background: #f1f4f3; color: var(--muted); padding: 7px 12px; font-size: 13px; font-weight: 800; }
.pin-progress span.active { background: var(--primary-soft); color: var(--primary-dark); }
.pin-progress span.done { background: #e8f8ef; color: #137547; }
.pin-hidden-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 22px; direction: ltr; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9db5ad; background: #fff; transition: .15s ease; }
.pin-dots span.filled { background: var(--primary); border-color: var(--primary); transform: scale(1.08); }
.pin-keypad { direction: ltr; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 310px; margin: 0 auto 18px; }
.pin-keypad button { height: 58px; border-radius: 15px; border: 1px solid #d5e3dd; background: #f8fbfa; color: #173f34; font-size: 23px; font-weight: 900; cursor: pointer; display: grid; place-items: center; }
.pin-keypad button:hover:not(:disabled) { background: var(--primary-soft); border-color: #9bd1bb; }
.pin-keypad button:disabled { opacity: .45; cursor: not-allowed; }
.pin-keypad .pin-empty { visibility: hidden; }
.quick-pin-submit { margin-top: 12px; }
.text-button { width: 100%; border: 0; background: transparent; color: var(--primary-dark); font-weight: 800; padding: 13px 8px 4px; cursor: pointer; }
.quick-pin-note { display: block; text-align: center; color: var(--muted); margin-top: 12px; line-height: 1.5; }

.reconciliation-mapping { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.default-representative-panel { margin-bottom: 18px; }
.default-representative-panel label { display: grid; gap: 8px; }
.default-representative-panel select { max-width: 520px; }
.default-representative-panel small { color: var(--muted); line-height: 1.6; }

@media (max-width: 1200px) {
  .reconciliation-mapping { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .quick-pin-card { padding: 20px 16px; border-radius: 18px; }
  .quick-pin-heading h1 { font-size: 20px; }
  .pin-keypad button { height: 54px; }
  .reconciliation-mapping { grid-template-columns: 1fr; }
}


/* Test v6 additions */
.warning-box { padding: 12px 14px; border-radius: 10px; background: #fff8e6; color: #8a5b00; border: 1px solid #f4d58a; line-height: 1.6; }
.missing-code { display: inline-flex; margin-top: 4px; padding: 3px 7px; border-radius: 999px; background: #fff1d6; color: #9a5d00; font-size: 11px; font-weight: 800; }
.install-settings-card { margin-bottom: 18px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.install-settings-card h2 { margin: 0 0 6px; }
.install-settings-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.install-settings-card .primary-button { min-width: 175px; }
.danger-zone { border-color: #f2b8b2; background: #fffafa; }
.danger-zone > svg, .danger-zone h2 { color: var(--danger) !important; }
.danger-zone p { color: #7c4b47; line-height: 1.7; }
.reconciliation-rep-filter { margin-bottom: 16px; }
.reconciliation-rep-filter label { display: grid; gap: 7px; }
.reconciliation-rep-filter select { max-width: 560px; }
.reconciliation-rep-filter small { color: var(--muted); font-weight: 400; }
.adjustment-action-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.adjustment-action-panel h3 { margin: 0 0 5px; }
.adjustment-action-panel p { margin: 0; color: var(--muted); }
.aging-section { margin: 22px 0; break-inside: avoid-page; }
.aging-section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-radius: 13px 13px 0 0; border: 1px solid var(--border); border-bottom: 0; }
.aging-section-title h2 { margin: 0; font-size: 20px; }
.aging-bad .aging-section-title { background: #fff0ee; color: #9d2118; border-color: #ffd1cc; }
.aging-average .aging-section-title { background: #fff8e6; color: #8a5b00; border-color: #f4d58a; }
.aging-excellent .aging-section-title { background: #eaf8f0; color: #137547; border-color: #bce7cf; }
.aging-section .table-wrap { border-radius: 0 0 15px 15px; }
.daily-activity-report .status.cancelled { background: #ffefed; color: #b42318; }
.daily-activity-report .status.approved { background: #e8f8ef; color: #137547; }

@media (max-width: 760px) {
  .install-settings-card, .adjustment-action-panel { grid-template-columns: 1fr; display: grid; }
  .install-settings-card .primary-button, .adjustment-action-panel .primary-button { width: 100%; }
  .aging-section-title { align-items: flex-start; flex-direction: column; }
}

@media print {
  .aging-section { margin: 10px 0 14px; break-inside: avoid-page; }
  .aging-section-title { padding: 6px 8px; }
  .aging-section-title h2 { font-size: 11pt; }
  .aging-report .report-table { font-size: 6.7pt; }
  .aging-report .report-table th:nth-child(1), .aging-report .report-table td:nth-child(1) { width: 18%; }
  .aging-report .report-table th:nth-child(2), .aging-report .report-table td:nth-child(2) { width: 12%; }
  .aging-report .report-table th:nth-child(3), .aging-report .report-table td:nth-child(3),
  .aging-report .report-table th:nth-child(4), .aging-report .report-table td:nth-child(4),
  .aging-report .report-table th:nth-child(5), .aging-report .report-table td:nth-child(5),
  .aging-report .report-table th:nth-child(6), .aging-report .report-table td:nth-child(6),
  .aging-report .report-table th:nth-child(7), .aging-report .report-table td:nth-child(7) { width: 9%; }
  .aging-report .report-table th:nth-child(8), .aging-report .report-table td:nth-child(8) { width: 10%; }
  .aging-report .report-table th:nth-child(9), .aging-report .report-table td:nth-child(9) { width: 15%; }
  .daily-activity-report .report-table { font-size: 6.2pt; }
  .daily-activity-report .report-table th:last-child, .daily-activity-report .report-table td:last-child { display: none !important; }
  .daily-activity-report .report-table th:nth-child(1), .daily-activity-report .report-table td:nth-child(1) { width: 13%; }
  .daily-activity-report .report-table th:nth-child(2), .daily-activity-report .report-table td:nth-child(2) { width: 7%; }
  .daily-activity-report .report-table th:nth-child(3), .daily-activity-report .report-table td:nth-child(3) { width: 13%; }
  .daily-activity-report .report-table th:nth-child(4), .daily-activity-report .report-table td:nth-child(4) { width: 10%; }
  .daily-activity-report .report-table th:nth-child(5), .daily-activity-report .report-table td:nth-child(5) { width: 17%; }
  .daily-activity-report .report-table th:nth-child(6), .daily-activity-report .report-table td:nth-child(6),
  .daily-activity-report .report-table th:nth-child(7), .daily-activity-report .report-table td:nth-child(7),
  .daily-activity-report .report-table th:nth-child(8), .daily-activity-report .report-table td:nth-child(8),
  .daily-activity-report .report-table th:nth-child(9), .daily-activity-report .report-table td:nth-child(9) { width: 8%; }
  .daily-activity-report .report-table th:nth-child(10), .daily-activity-report .report-table td:nth-child(10) { width: 10%; }
}
