/* SoftN ERP — dashboard and login. Own design: deep navy with a gold accent. */
:root {
  --navy: #14213d;
  --navy-2: #1f3260;
  --gold: #c9a227;
  --gold-soft: #f6edd0;
  --bg: #eef1f6;
  --panel: #ffffff;
  --line: #d6dce8;
  --text: #1d2433;
  --muted: #5d6779;
  --link: #1f4fa8;
  --error: #b42318;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { flex: none; }

/* Layout: top bar, top menu, sidebar + content, status bar */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 20px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.35rem; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand .icon { color: var(--gold); width: 30px; height: 30px; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.user-box form { margin: 0; }
.link-button {
  background: none; border: 1px solid rgba(255, 255, 255, 0.5); color: #fff;
  padding: 4px 12px; border-radius: 4px; cursor: pointer; font: inherit;
}
.link-button:hover { background: rgba(255, 255, 255, 0.12); }

.topnav {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 0 12px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topnav a {
  padding: 10px 14px; color: var(--navy); font-weight: 600; font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}
.topnav a:hover { text-decoration: none; background: var(--bg); }
.topnav a.active { border-bottom-color: var(--gold); }

.workspace { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: 260px; flex: none; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.sidebar h2 { margin: 0; padding: 14px 18px; font-size: 1.05rem; color: var(--navy); border-bottom: 1px solid var(--line); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--text); }
.sidebar a:hover { text-decoration: none; background: var(--bg); }
.sidebar .icon { width: 20px; height: 20px; color: var(--navy-2); }
.sections { padding: 8px 0 !important; flex: 1; }
.modules { border-top: 1px solid var(--line); }
.modules a { font-weight: 600; color: var(--navy); border-bottom: 1px solid var(--line); }
.modules a.active { background: var(--gold-soft); border-left: 4px solid var(--gold); padding-left: 14px; }

.content { flex: 1; padding: 20px 24px; min-width: 0; }
.tab {
  display: inline-block; padding: 7px 22px; margin-bottom: 18px;
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 6px 6px 0 0;
  color: var(--navy); font-weight: 600;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card {
  display: flex; gap: 16px; padding: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(20, 33, 61, 0.08);
}
.card-icon {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--navy);
}
.card-icon .icon { width: 28px; height: 28px; }
.card h3 { margin: 4px 0 8px; font-size: 1.1rem; color: var(--navy); border-bottom: 2px solid var(--gold-soft); padding-bottom: 6px; }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding: 3px 0; }
.card li::before { content: "›"; color: var(--gold); font-weight: 700; margin-right: 8px; }
.empty { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; color: var(--muted); }

.statusbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  padding: 8px 20px; background: var(--navy); color: #e8ecf5; font-size: 0.85rem;
}

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--navy), var(--navy-2)); }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border-radius: 12px;
  padding: 28px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.login-brand .icon { width: 40px; height: 40px; color: var(--gold); }
.login-brand h1 { margin: 0; font-size: 1.3rem; color: var(--navy); text-align: center; }
.login-card label { font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
.login-card input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.login-card input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.login-card button {
  margin-top: 14px; padding: 10px; border: none; border-radius: 6px; cursor: pointer;
  background: var(--navy); color: #fff; font: inherit; font-weight: 600;
}
.login-card button:hover { background: var(--navy-2); }
/* Show / Hide button inside a password box */
.password-box { position: relative; display: flex; }
.password-box input { flex: 1; min-width: 0; padding-right: 64px; }
.login-card .password-box .password-show {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin: 0;
  padding: 3px 9px; background: transparent; color: var(--navy); border: 1px solid var(--line);
  border-radius: 4px; font-size: 0.8rem; font-weight: 600;
}
.login-card .password-box .password-show:hover { background: var(--line); }
.login-card .password-box .password-show:focus-visible { outline: 2px solid var(--gold); }
.form-error { margin: 0; padding: 8px 10px; background: #fdecea; color: var(--error); border-radius: 6px; font-size: 0.88rem; }

/* Narrow screens (tablet / phone): sidebar goes above the cards */
@media (max-width: 800px) {
  .workspace { flex-direction: column; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sections { display: none; }
  .content { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
}

/* Company logo (uploaded in Company profile) */
.brand .logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.login-brand .logo { max-height: 80px; max-width: 220px; object-fit: contain; }

/* Pages inside the shell: headings, panels, tables, forms */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 1.4rem; color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button, .form button, .inline-form button {
  display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.button:hover, .form button:hover, .inline-form button:hover { background: var(--navy-2); text-decoration: none; }
.button.secondary { background: #fff; color: var(--navy); }
.button.secondary:hover { background: var(--bg); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 10px; font-size: 1.1rem; color: var(--navy); }
.muted { color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0 0 10px; }
.figures div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.figures dt { font-size: 0.8rem; color: var(--muted); }
.figures dd { margin: 4px 0 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.figures .highlight { background: var(--gold-soft); border: 1px solid var(--gold); }
.figures small { font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: var(--bg); color: var(--navy); font-size: 0.85rem; }
table.data .right { text-align: right; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .inline-form label { font-weight: 600; font-size: 0.88rem; }
.field input, .inline-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.field input:focus, .inline-form input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field-error { color: var(--error); font-size: 0.85rem; }
.form .form-error { margin-bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.messages { list-style: none; margin: 0 0 16px; padding: 0; }
.messages li { padding: 10px 14px; border-radius: 6px; background: #e8f5ec; color: #1d6b3a; border: 1px solid #b7dfc3; }
.messages li.error { background: #fdecea; color: var(--error); border-color: #f5c2bd; }
.messages li.warning { background: #fff7e0; color: #8a5a00; border-color: #f2d48a; }

/* Parties: badges, check boxes, detail lists, pager */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.badge.ok { background: #e8f5ec; color: #1d6b3a; border-color: #b7dfc3; }
.badge.danger { background: #fdecea; color: var(--error); border-color: #f5c2bd; }
.checks { display: flex; flex-wrap: wrap; gap: 18px; margin: -6px 0 18px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.field select, .field textarea, .inline-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.details dt { font-size: 0.8rem; color: var(--muted); }
.details dd { margin: 2px 0 0; }
.panel .page-head h2 { margin: 0; }
.pager { display: flex; gap: 14px; justify-content: center; margin: 14px 0 0; }
.link-danger { background: none; border: none; color: var(--error); cursor: pointer; font: inherit; padding: 0; }
.link-danger:hover { text-decoration: underline; }
.link { background: none; border: none; color: var(--navy); cursor: pointer; font: inherit; padding: 0; margin-right: 6px; }
.link:hover { text-decoration: underline; }
tr.muted td { color: var(--muted); }

/* ---- Compact layout (Nazim, 2026-10-21: less space, smaller form) ----
   Overrides the sizes above for every page inside the dashboard frame. */
body { font-size: 13.5px; }
.topbar { padding: 6px 16px; }
.brand { font-size: 1.1rem; }
.brand .icon { width: 24px; height: 24px; }
.brand .logo { height: 28px; }
.topnav a { padding: 7px 12px; font-size: 0.85rem; }
.sidebar { width: 220px; }
.sidebar h2 { padding: 10px 14px; font-size: 0.95rem; }
.sidebar a { padding: 6px 14px; gap: 8px; }
.sidebar .icon { width: 18px; height: 18px; }
.content { padding: 12px 16px; }
.statusbar { padding: 5px 16px; font-size: 0.78rem; }

.page-head { margin-bottom: 10px; gap: 8px; }
.page-head h1 { font-size: 1.15rem; }
.panel { padding: 12px 14px; margin-bottom: 12px; border-radius: 8px; }
.panel h2 { font-size: 0.95rem; margin: 10px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.panel h2:first-child, .panel .page-head h2 { margin-top: 0; border-bottom: none; padding-bottom: 0; }

.fields { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; margin-bottom: 8px; }
.field { gap: 2px; }
.field label, .inline-form label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .inline-form input, .inline-form select {
  padding: 4px 7px; font-size: 0.88rem; border-radius: 4px; min-height: 28px;
}
.field textarea { min-height: 28px; resize: vertical; }
.field small.muted { font-size: 0.72rem; line-height: 1.2; }
.field-error { font-size: 0.75rem; }
.checks { gap: 14px; margin: 0 0 8px; }
.check { font-size: 0.85rem; font-weight: 600; }
.form-actions { margin-top: 4px; }
.button, .form button, .inline-form button { padding: 5px 12px; font-size: 0.85rem; border-radius: 4px; }
.inline-form { gap: 6px; }
.muted { font-size: 0.82rem; }
p.muted { margin: 4px 0; }

table.data th, table.data td { padding: 5px 8px; font-size: 0.85rem; }
.badge { padding: 1px 6px; font-size: 0.72rem; }
.figures { gap: 8px; }
.figures div { padding: 7px 10px; }
.figures dd { font-size: 1.05rem; }
.details { gap: 6px 14px; }
.details dt { font-size: 0.74rem; }
.details dd { font-size: 0.88rem; }
.messages li { padding: 6px 10px; font-size: 0.85rem; }

.tab { padding: 5px 16px; margin-bottom: 12px; font-size: 0.9rem; }
.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { padding: 12px; gap: 12px; }
.card-icon { width: 40px; height: 40px; }
.card-icon .icon { width: 22px; height: 22px; }
.card h3 { font-size: 0.98rem; margin: 2px 0 6px; padding-bottom: 4px; }
.card li { padding: 2px 0; font-size: 0.88rem; }

.login-card { padding: 22px; gap: 6px; max-width: 340px; }
.login-card input { padding: 6px 9px; }
.login-card button { padding: 8px; }
.nominee-row { border: 1px dashed var(--line); border-radius: 6px; padding: 6px 8px 0; margin-bottom: 6px; }
.nominee-row:nth-child(even) { background: #fafbfd; }

/* POS sale page (step 9a): lines on the left, totals and payments on the right */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } }
.pos .panel { padding: 8px 10px; margin-bottom: 8px; }
.pos-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: end; }
.pos-row .field { min-width: 120px; flex: 1; }
.pos-row .field.wide { flex: 3; min-width: 220px; }
.pos-row input, .pos-row select { width: 100%; box-sizing: border-box; }
.pos-party { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.pos-party strong { color: var(--navy); }
.pos-scan input { font-size: 1.05rem; padding: 6px 10px; width: 220px; }
.pos table.data th, .pos table.data td { padding: 4px 6px; font-size: 0.85rem; }
.pos table.data input { width: 64px; padding: 2px 4px; font: inherit; text-align: right; }
.pos-side .field { margin-bottom: 6px; }
.pos-side .field input, .pos-side .field select { width: 100%; box-sizing: border-box; }
.pos-totals { width: 100%; font-variant-numeric: tabular-nums; }
.pos-totals td { padding: 2px 0; }
.pos-totals td:last-child { text-align: right; }
.pos-totals .grand td { font-size: 1.25rem; font-weight: 700; color: var(--navy); border-top: 1px solid var(--line); padding-top: 4px; }
.pos-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.pos-pay > * { width: 100%; box-sizing: border-box; }
.pos-post { width: 100%; margin-top: 8px; padding: 8px; font-size: 1rem; }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); max-height: 280px; overflow-y: auto; }
.suggest-list li { padding: 5px 8px; cursor: pointer; font-size: 0.85rem; }
.suggest-list li small { display: block; color: var(--muted); }
.suggest-list li.active, .suggest-list li:hover { background: var(--bg); }

/* POS look: navy and gold, big scan box and total, green Post */
.pos .panel { border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 33, 61, 0.08); }
.pos-customer { border-left: 4px solid var(--gold); }
.pos-scanbar { background: var(--navy); color: #fff; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pos-scanbar .pos-scan input { border: 2px solid var(--gold); border-radius: 6px; background: #fff; width: 240px; }
.pos-scanbar select, .pos-scanbar input { border-radius: 4px; border: 1px solid var(--navy-2); padding: 5px 6px; }
.pos-scanbar button { background: var(--gold); color: var(--navy); border: none; font-weight: 700; }
.pos table.data thead th { background: var(--navy); color: #fff; }
.pos table.data tbody tr:nth-child(even) { background: #f7f8fb; }
.pos table.data tbody tr:hover { background: var(--gold-soft); }
.pos-total-box { background: var(--navy); color: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.pos-total-box .pos-totals td { color: #dfe4ee; }
.pos-total-box .pos-totals .grand td { color: var(--gold); font-size: 1.6rem; border-top-color: rgba(255, 255, 255, 0.25); }
.pos-post { background: #1d7a3a !important; color: #fff; border: none; border-radius: 6px; font-weight: 700; letter-spacing: 0.5px; }
.pos-post:hover { background: #166030 !important; }
.pos-pay button { background: var(--gold) !important; color: var(--navy) !important; font-weight: 700; }

/* Invoice page: toolbar above the PDF itself */
.invoice-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.invoice-toolbar .spacer { flex: 1; }
.invoice-toolbar .tool { padding: 8px 16px; border-radius: 6px; border: none; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; color: #fff; }
.invoice-toolbar .print { background: var(--navy); }
.invoice-toolbar .pdf { background: #b42318; }
.invoice-toolbar .whatsapp { background: #25d366; }
.invoice-toolbar .plain { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.invoice-toolbar .invoice-number { align-self: center; font-weight: 700; color: var(--navy); }
.invoice-frame { width: 100%; height: calc(100vh - 160px); min-height: 600px; border: 1px solid var(--line); border-radius: 6px; background: #525659; }

.pos-scanbar .pos-scan input { width: 340px; max-width: 100%; }
.suggest-list { color: var(--text); min-width: 320px; }

/* Receipt / payment page: one clear amount, the party's balance before and after */
.money-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .money-grid { grid-template-columns: 1fr; } }
.money .panel { border-radius: 8px; padding: 14px 16px; }
.money.receipt .money-main { border-top: 4px solid #1d7a3a; }
.money.payment .money-main { border-top: 4px solid #b42318; }
.big-input { font-size: 1.15rem !important; padding: 8px 12px !important; width: 100%; box-sizing: border-box; }
.money-party { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.money-row { display: grid; grid-template-columns: 220px auto 200px 1fr; gap: 10px 14px; align-items: end; margin: 12px 0; }
@media (max-width: 1100px) { .money-row { grid-template-columns: 1fr 1fr; } }
.money-row .amount-field input { text-align: right; }
.pills { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 0.85rem; background: #fff; }
.pill input { margin: 0; }
.pill:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.money-more { margin: 4px 0 8px; }
.money-more summary { cursor: pointer; color: var(--link); font-size: 0.85rem; }
.money-summary { background: var(--navy); color: #dfe4ee; border-radius: 8px; padding: 14px 16px; }
.money-summary .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #aab4c8; }
.money-summary .value { font-size: 1.8rem; font-weight: 700; color: #fff; }
.money-summary .value.small { font-size: 1.4rem; }
.money-summary .value.receivable { color: #6fd08c; }
.money-summary .value.payable { color: #ff8a80; }
.money-summary .side { font-size: 0.85rem; }
.money-summary .metal { font-size: 0.8rem; color: var(--gold); margin-top: 2px; }
.money-summary hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.2); margin: 10px 0; }
.money-summary .row { display: flex; justify-content: space-between; }
.money-summary a { color: var(--gold); font-size: 0.85rem; display: inline-block; margin-top: 8px; }
.money-post { margin-top: 10px; padding: 12px; font-size: 1.05rem; }

/* Party statement: the trade's "ledger with base currency and quantity" */
.ledger-head { display: flex; justify-content: space-between; margin-bottom: 8px; line-height: 1.5; }
.ledger-title { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; color: var(--navy); }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.ledger-table th, .ledger-table td { border: 1px solid #333; padding: 4px 6px; white-space: nowrap; }
.ledger-table td { border-top: none; border-bottom: none; }
.ledger-table thead th { background: #fffac8; color: #000; text-align: center; }
.ledger-table .wide { min-width: 220px; }
.ledger-table .r { text-align: right; }
.ledger-table tr.opening td { font-weight: 600; border-bottom: 1px solid #333; }
.ledger-table tfoot td { background: #fffac8; font-weight: 700; border: 1px solid #333; }
.ledger-balance { margin-top: 10px; font-size: 1.15rem; font-weight: 700; color: var(--navy); }

.reverse-form { display: inline-flex; gap: 4px; align-items: center; }
.reverse-form input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; width: 200px; }

.aml-reminder { background: #fff7d6; border: 1px solid #e6c200; color: #5c4a00; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; font-size: 0.9rem; }
.aml-reminder a { color: var(--link); }

.kyc-checklist { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.kyc-checklist span { padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; border: 1px solid; }
.kyc-checklist .tick { background: #e8f5ec; color: #1d6b3a; border-color: #b7dfc3; }
.kyc-checklist .cross { background: #fdecea; color: var(--error); border-color: #f5c2bd; }

.status-active { color: #1d6b3a; font-weight: 600; }
.status-expiring { color: #b54708; font-weight: 600; }
.status-expired { color: var(--error); font-weight: 700; }
.expiry-alert { display: block; background: #fdecea; border: 1px solid #f5c2bd; color: var(--error); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; text-decoration: none; }

/* Documents fill their own forms (step 11c) */
.read-status { display: block; margin-top: 4px; color: #1d6b3a; font-weight: 600; }
.read-status.read-none { color: #b54708; }
.auto-filled { background: #fff8db !important; border-color: #e0b84a !important; }
/* Staff: passport, EID, visa, labour card, insurance side by side */
.staff-grid td.doc-cell { min-width: 120px; vertical-align: top; }
.staff-grid .doc-cell > span, .staff-grid .doc-cell > small { display: block; }
.staff-grid .doc-number { font-weight: 600; }
.staff-grid .doc-actions a { margin-right: 8px; font-size: 0.85em; }
.staff-grid .add-cell { color: var(--muted, #888); text-decoration: none; }
.staff-grid .add-cell:hover { text-decoration: underline; }

/* ---- One design for every form (Nazim, 2026-10-23: "same design, smart, easy for anyone, smooth") ----
   Compact as before; clearer labels, a * on boxes that must be filled, one focus colour,
   red boxes with the reason underneath, file boxes you can drop a file on, Save at the bottom right. */
.form .fields { gap: 10px 14px; margin-bottom: 10px; }
.field label { color: var(--text); font-size: 0.78rem; font-weight: 600; }
.field--required > label:first-child::after { content: " *"; color: var(--gold); font-weight: 700; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea,
.inline-form input:not([type=checkbox]):not([type=radio]), .inline-form select {
  width: 100%; min-height: 32px; padding: 5px 9px; border: 1px solid #c9d1df; border-radius: 6px;
  background: #fff; color: var(--text); font: inherit; font-size: 0.9rem;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.inline-form input:not([type=checkbox]):not([type=radio]), .inline-form select { width: auto; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #9aa6bd; }
.field input:focus, .field select:focus, .field textarea:focus,
.inline-form input:focus, .inline-form select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.field input:disabled, .field select:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.field textarea { min-height: 54px; }
.field-hint { color: var(--muted); font-size: 0.72rem; line-height: 1.3; }
.field--error input:not([type=checkbox]), .field--error select, .field--error textarea, .field--error .file-drop {
  border-color: var(--error); background: #fff6f5;
}
.field-error { color: var(--error); font-size: 0.75rem; font-weight: 600; }
.field-error::before { content: "⚠ "; }
/* Tick boxes: the box and its words on one line, the whole line clickable */
.field--check { justify-content: flex-end; }
.field--check > label { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px;
  border: 1px solid #c9d1df; border-radius: 6px; background: #fff; cursor: pointer; font-size: 0.85rem; }
.field--check > label:hover { border-color: #9aa6bd; }
.field--check input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); }
/* File boxes: click or drop a file */
.file-drop { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 46px; padding: 6px 10px; border: 1.5px dashed #b8c2d4; border-radius: 6px; background: #fafbfd;
  color: var(--muted); font-size: 0.82rem; font-weight: 400 !important; cursor: pointer; transition: all .15s; }
.file-drop:hover, .file-drop.dragging { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.file-drop.has-file { border-style: solid; border-color: #7fb894; background: #f1f9f4; }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop__text strong { color: var(--navy); }
.file-drop__name { color: #1d6b3a; font-weight: 600; word-break: break-all; }
.file-drop__name:empty { display: none; }
/* Section titles inside a form */
.form h2 { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.form h2::before { content: ""; width: 4px; height: 1em; border-radius: 2px; background: var(--gold); }
/* Buttons: one main colour, a light second choice, a clear "busy" look */
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.button, .form button, .inline-form button { min-height: 32px; transition: background-color .15s, opacity .15s; }
.form-actions button[type=submit], .form-actions button:not([type]) { min-width: 110px; }
.form button:disabled, .button[aria-disabled=true] { opacity: .6; cursor: progress; }
.form .form-error { display: flex; align-items: center; gap: 6px; border: 1px solid #f5c2bd; font-weight: 600; }
.form .form-error::before { content: "⚠"; }

/* Fixed / Unfixed switch on the sale and purchase pages (step 12) */
.fix-switch { margin: 0 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfd; }
.fix-switch.is-unfixed { border-color: var(--gold); background: var(--gold-soft); }
.fix-switch .check { margin: 2px 0; }
.fix-switch p.muted { margin: 4px 0 0; font-size: 0.75rem; }
.pill input[type=radio] { width: auto; min-height: 0; accent-color: var(--gold); }

/* After posting: the voucher stays on screen with Print · PDF · WhatsApp · + New (2026-10-24) */
.posted-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px;
  background: #e8f5ec; border: 1px solid #b7dfc3; border-radius: 8px; }
.posted-bar .posted-tick { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: #1d6b3a; color: #fff; font-weight: 700; }
.posted-bar .spacer { flex: 1; }
.posted-bar .tool { padding: 6px 14px; border-radius: 6px; border: none; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; color: #fff; min-height: 0; }
.posted-bar .print { background: var(--navy); }
.posted-bar .pdf { background: #b42318; }
.posted-bar .whatsapp { background: #25d366; }
.posted-bar .new { background: var(--gold); color: var(--navy); }
.posted-bar .posted-new { margin: 0; }
.posted-bar .email, .invoice-toolbar .email { background: #475467; }
.posted-email { display: inline-flex; gap: 4px; margin: 0; align-items: center; }
.posted-email input[type="email"] { width: 200px; padding: 5px 8px; }

/* Journal lines: boxes the same height, typed into straight in the table */
.journal-lines td { padding: 4px 4px; }
.journal-lines select { min-height: 30px; }
.journal-lines input[type=text] { width: 100%; min-height: 30px; padding: 4px 6px; box-sizing: border-box;
  border: 1px solid #c9d1df; border-radius: 6px; font: inherit; }

/* Metal payment: purity and factor of a lot's line, changeable on a draft */
.line-purity { gap: 4px; flex-wrap: nowrap; }
.line-purity select { min-width: 80px; }
.line-purity input { width: 78px !important; }
.pos-scanbar .pos-scan-hint { color: #c9d1e3; font-size: 0.78rem; }

/* Journals (Nazim, 2026-10-25): account and party found by typing, two amount columns, lines added */
.journal-lines { width: 100%; margin-top: 8px; }
.journal-lines td { vertical-align: top; }
.journal-lines .account-box { width: 100%; min-width: 240px; }
.journal-lines .party-box { width: 100%; min-width: 200px; }
.journal-lines .party-box:disabled { background: var(--bg, #f2f4f7); color: #98a2b3; }
.journal-lines input.amount { width: 130px; text-align: right; }
.journal-lines .mc-side { width: 140px; }
.journal-lines tfoot td, .journal-lines tfoot th { padding-top: 10px; }
.journal-narration { margin-top: 14px; max-width: 720px; }
.journal-form .form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.journal-form .form-actions .muted { color: #b42318; }
.journal-lines th:first-child { width: 38%; }
.journal-lines .who-details { display: block; margin-top: 2px; font-size: 0.78rem; }
.journal-lines .line-narration { min-width: 200px; }
.journal-lines .suggest { display: block; width: 100%; }
.journal-lines .suggest input { width: 100%; box-sizing: border-box; }
.journal-lines .remove-line { background: none; border: none; color: #b42318; padding: 4px 8px; font-size: 1rem;
                              cursor: pointer; box-shadow: none; }
.journal-lines .remove-line:hover { background: #fdecea; }

/* The voucher popup (Nazim, 2026-10-25): a floating window over the list, medium size, a coloured
   title bar with a gold line, the list dimmed and blurred behind, a short opening animation */
.popup-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
                  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); padding: 12px; }
.popup-backdrop[hidden] { display: none; }
.popup-window { position: relative; display: flex; flex-direction: column; width: min(940px, 94vw);
                height: min(680px, calc(100vh - 24px)); background: #f6f7fb; border-radius: 16px; overflow: hidden;
                box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.popup-in .popup-window { animation: popup-in 0.18s ease-out; }
@keyframes popup-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.popup-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; color: #fff;
             background: linear-gradient(100deg, #101a3d 0%, #1f2f6b 60%, #2b3f8f 100%);
             border-bottom: 3px solid var(--gold, #d4a017); }
.popup-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
              border-radius: 8px; background: rgba(212, 160, 23, 0.18); color: var(--gold, #d4a017); }
.popup-mark svg { width: 16px; height: 16px; }
.popup-title { font-size: 1rem; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-company { margin-left: auto; font-size: 0.8rem; color: rgba(255, 255, 255, 0.65); white-space: nowrap; }
.popup-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
               background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 0.9rem; line-height: 1; cursor: pointer;
               padding: 0; transition: background 0.15s; }
.popup-close:hover { background: #b42318; border-color: #b42318; }
.popup-window iframe { flex: 1; width: 100%; border: 0; display: block; background: #f6f7fb; }
body.popup-open { overflow: hidden; }
.popup-page { padding: 14px 18px; min-height: 100vh; box-sizing: border-box; background: #f6f7fb; }
.popup-page .page-head h1 { font-size: 1.15rem; }
/* Inside the popup the voucher keeps its side panel (total and Post) beside the lines */
.popup-page .pos { grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; }

/* Inside the popup everything fits on one screen, no scrolling (Nazim, 2026-10-25): tighter boxes and
   gaps, field hints only on hover, the purchase form four across, and only the lines scroll when many */
.popup-page { padding: 10px 14px; }
.popup-page .page-head { margin-bottom: 6px; }
.popup-page .page-head h1 { font-size: 1.05rem; margin: 0; }
.popup-page .panel { padding: 8px 10px; margin-bottom: 7px; }
.popup-page .panel h2 { margin: 0 0 4px; }
.popup-page .messages { margin-bottom: 6px; }
.popup-page .fields { gap: 4px 10px; margin-bottom: 4px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.popup-page .pos-side .fields, .popup-page .journal-form .fields { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.popup-page .field input, .popup-page .field select, .popup-page .field textarea,
.popup-page .inline-form input, .popup-page .inline-form select { min-height: 26px; padding: 3px 6px; font-size: 0.85rem; }
.popup-page .field label { font-size: 0.74rem; }
.popup-page .field-hint, .popup-page .field small.muted { display: none; }
.popup-page details > summary { padding: 2px 0; }
.popup-page .form-actions { margin-top: 2px; }
.popup-page .form-actions button { padding: 5px 14px; }
.popup-page .pos-scanbar { padding: 7px 10px; }
.popup-page .pos-side .field { margin-bottom: 3px; }
.popup-page .pos-side .panel { padding: 7px 10px; }
.popup-page .pos-total-box { padding: 7px 10px; margin-bottom: 6px; }
.popup-page .pos-total-box .pos-totals .grand td { font-size: 1.3rem; }
.popup-page .pos-totals td { padding: 1px 0; }
.popup-page .pos-post { margin-top: 5px; padding: 6px; }
.popup-page .pos-main .table-wrap, .popup-page .journal-lines-wrap { max-height: 34vh; overflow: auto; }
.popup-page .posted-bar { padding: 6px 10px; margin-bottom: 7px; }
.popup-page input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .popup-page select {
  min-height: 26px; padding-top: 3px; padding-bottom: 3px; font-size: 0.85rem; }
.popup-page .pos-scanbar .pos-scan input { font-size: 0.95rem; }
.popup-page .pos-side .muted { margin: 0; }
.popup-page .pos-pay .pos-totals .grand td, .popup-page .pos-side .pos-totals .grand td { font-size: 1.1rem; }
/* Sale in the popup: the side boxes two to a row (salesman, rates, discount), fewer lines of text */
.popup-page .pos-side > .panel:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; }
.popup-page .pos-side > .panel:first-child > .pos-pay { display: contents; }
.popup-page .pos-side > .panel:first-child > .fix-switch, .popup-page .pos-side > .panel:first-child > table { grid-column: 1 / -1; }
.popup-page .pos-side > .panel:first-child .field { margin-bottom: 0; }
.popup-page .no-payments, .popup-page .walk-in-note { display: none; }
.popup-page .pos-customer .pos-party:empty { display: none; }
/* Receipt / payment and fixing in the popup: the summary stays beside the form (the popup is narrower
   than 1000px, where the page would stack them), smaller big boxes and summary */
.popup-page .money-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
.popup-page .money .panel { padding: 8px 10px; }
/* In the popup the row wraps instead of squeezing: amount and "By" first, the bank and reference boxes take the
   rest of the line or go to the next one (2026-11-15: they overlapped the right edge) */
.popup-page .money-row { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; align-items: flex-end; }
.popup-page .money-row > .amount-field { flex: 0 0 130px; }
.popup-page .money-row > .field { min-width: 0; }
.popup-page .money-row > .bank-field, .popup-page .money-row > .field:last-child { flex: 1 1 150px; }
.popup-page .money-row > .field:last-child input, .popup-page .money-row > .bank-field select { width: 100%; box-sizing: border-box; }
.money-row .pill { white-space: nowrap; }
.money-row > [hidden] { display: none !important; }
.popup-page .big-input { font-size: 1rem !important; padding: 5px 9px !important; }
.popup-page .pill { padding: 3px 10px; font-size: 0.8rem; }
.popup-page .money-more { margin: 2px 0 4px; }
.popup-page .money-summary { padding: 9px 11px; }
.popup-page .money-summary .value { font-size: 1.3rem; }
.popup-page .money-summary .value.small { font-size: 1.1rem; }
.popup-page .money-summary hr { margin: 5px 0; }
.popup-page .money-summary a { margin-top: 4px; }
.popup-page .money-post { margin-top: 6px; padding: 7px; font-size: 0.95rem; }
/* The invoice in the popup: one row of buttons, the PDF fills the rest */
.popup-page .invoice-toolbar { flex-wrap: nowrap; gap: 5px; margin-bottom: 6px; align-items: center; }
.popup-page .invoice-toolbar .tool { padding: 5px 9px; font-size: 0.8rem; white-space: nowrap; }
.popup-page .invoice-toolbar .posted-email { display: flex; gap: 4px; }
.popup-page .invoice-toolbar .posted-email input { width: 150px; }
.popup-page .invoice-toolbar .inline-form input { width: 120px; }
.popup-page .invoice-toolbar .invoice-number { font-size: 0.85rem; white-space: nowrap; }
.popup-page .invoice-frame { height: calc(100vh - 62px); min-height: 0; }

/* Filter chips (e-invoice log) */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
        border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-size: 0.85rem; }
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count { font-size: 0.75rem; opacity: 0.75; }
.einvoice-status p { margin: 0 0 4px; }

/* Reports and statements, new coloured style (Nazim, 2026-10-25): a navy / gold header with the
   buttons and filters, summary cards, coloured debit and credit, a striped table */
.report-hero { background: linear-gradient(105deg, #101a3d 0%, #1f2f6b 58%, #2b3f8f 100%); color: #fff;
               border-radius: 14px; padding: 16px 18px 12px; margin-bottom: 12px; border-bottom: 4px solid var(--gold, #d4a017);
               box-shadow: 0 8px 24px rgba(16, 26, 61, 0.18); }
.report-hero .hero-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.report-hero .hero-kicker { text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.7rem; color: var(--gold, #d4a017); font-weight: 700; }
.report-hero h1 { margin: 2px 0 2px; font-size: 1.35rem; color: #fff; }
.report-hero .hero-sub { font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); }
.report-hero .hero-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.report-hero .tool { padding: 6px 13px; border-radius: 7px; border: none; font: inherit; font-size: 0.85rem; font-weight: 600;
                     cursor: pointer; text-decoration: none; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.report-hero .tool.print { background: #fff; color: #101a3d; }
.report-hero .tool.pdf { background: #b42318; }
.report-hero .tool.excel { background: #1d7a3a; }
.report-hero .tool.whatsapp { background: #25d366; }
.report-hero .tool.email { background: #475467; }
.report-hero .tool.plain { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.3); }
.report-hero .tool:hover { filter: brightness(1.08); }
.report-hero .posted-email input[type="email"] { width: 190px; padding: 5px 8px; border-radius: 6px; border: none; }
.report-hero .hero-filters { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 12px;
                             padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.report-hero .hero-filters label { font-size: 0.78rem; color: rgba(255, 255, 255, 0.75); font-weight: 600; }
.report-hero .hero-filters input, .report-hero .hero-filters select { padding: 4px 8px; border-radius: 6px; border: 1px solid transparent;
                                                                       font: inherit; font-size: 0.85rem; min-height: 28px; }
.report-hero .hero-filters button { background: var(--gold, #d4a017); color: #101a3d; border: none; border-radius: 6px;
                                    padding: 5px 16px; font-weight: 700; cursor: pointer; }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid #98a2b3; border-radius: 10px;
                padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05); }
.summary-card .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); font-weight: 700; }
.summary-card strong { font-size: 1.15rem; color: var(--navy, #1b2550); font-variant-numeric: tabular-nums; }
.summary-card small { color: var(--muted); font-variant-numeric: tabular-nums; }
.summary-card.dr { border-left-color: #1d7a3a; }
.summary-card.cr { border-left-color: #c2410c; }
.summary-card.closing { border-left-color: var(--gold, #d4a017); background: linear-gradient(135deg, #fffaf0, #fff); }
.summary-card.closing strong { font-size: 1.3rem; }

.amt-dr { color: #166534; }
.amt-cr { color: #c2410c; }
.report-table-panel { padding: 0; overflow: hidden; border-radius: 12px; }
.report-table-panel .table-wrap { margin: 0; }
.report-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report-table thead th { background: #1b2550; color: #fff; position: sticky; top: 0; z-index: 1; padding: 8px 10px; font-size: 0.82rem; }
.report-table thead th.grp-aed { background: #101a3d; border-bottom: 3px solid var(--gold, #d4a017); }
.report-table thead th.grp-gold { background: #7a5b06; }
.report-table thead th.grp-silver { background: #475467; }
.report-table tbody tr:nth-child(even) td { background: #f6f8fc; }
.report-table tbody tr:hover td { background: #fff6dd; }
.report-table td { padding: 6px 10px; border-bottom: 1px solid #eaecf0; }
.report-table td.bal { font-weight: 700; color: var(--navy, #1b2550); }
.report-table tfoot th, .report-table tfoot td { background: #eef1f8; font-weight: 700; padding: 8px 10px; border-top: 2px solid #1b2550; }
.report-table tr.opening td { background: #fffaf0 !important; font-style: italic; }
.report-table a { font-weight: 600; }
.summary-card .card-unit { font-size: 0.7rem; color: var(--muted); font-weight: 600; margin-right: 4px; }

.report-hero .hero-note { font-size: 0.75rem; color: rgba(255, 255, 255, 0.65); }
.report-hero input[type="file"] { color: #fff; font-size: 0.82rem; }
.button.small { padding: 3px 10px; font-size: 0.8rem; }
button.small { padding: 3px 10px; font-size: 0.8rem; }
.report-table td.file-name { font-size: 0.8rem; word-break: break-all; }
.report-table td.actions-cell { white-space: nowrap; }

/* The dashboard and my shortcuts (Nazim, 2026-10-25) */
.topnav .topnav-home { font-size: 1.1rem; }
.topnav .topnav-edit { margin-left: auto; opacity: 0.6; }
.topnav .topnav-edit:hover { opacity: 1; }
.user-box .user-settings { color: #fff; text-decoration: none; font-size: 1.1rem; margin-right: 6px; opacity: 0.8; }
.user-box .user-settings:hover { opacity: 1; }
/* One screen, no scrolling (Nazim, 2026-10-25): a one-line header, small cards, the charts and the
   alerts side by side, short lists */
.dash-hero { padding: 8px 14px; margin-bottom: 8px; border-radius: 10px; border-bottom-width: 3px; }
.dash-hero .hero-top { align-items: center; gap: 6px 14px; }
.dash-hero h1 { font-size: 1.05rem; margin: 0; }
.dash-hero .hero-sub { flex: 1; font-size: 0.8rem; }
.dash-hero .tool { padding: 4px 10px; font-size: 0.8rem; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; align-items: start; }
.part-today, .part-balances { grid-column: 1 / -1; }
.dash:not(:has(.part-charts)) .part-alerts, .dash:not(:has(.part-alerts)) .part-charts { grid-column: 1 / -1; }
@media (max-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.dash-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 4px; }
.dash-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 0; }
.dash-cards .summary-card { padding: 6px 10px; gap: 0; border-radius: 8px; }
.dash-cards .summary-card .label { font-size: 0.64rem; }
.dash-cards .summary-card strong, .dash-cards .summary-card.closing strong { font-size: 1.02rem; }
.dash-cards .summary-card small { font-size: 0.7rem; }
.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.dash-chart { padding: 6px 8px; margin: 0; }
.dash-chart-head { display: flex; justify-content: space-between; gap: 6px; font-size: 0.78rem; margin-bottom: 3px; white-space: nowrap; }
.dash-chart svg { width: 100%; height: 92px; display: block; background: linear-gradient(#fff, #f6f8fc); border-radius: 6px; }
.dash-chart .bar { fill: #1d7a3a; }
.dash-chart .bar-2 { fill: #c2410c; }
.dash-chart .rate-line { fill: none; stroke: #d4a017; stroke-width: 2.5; }
.dash-axis { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); }
.dash-alerts { display: flex; flex-direction: column; gap: 8px; }
.dash-alerts .panel { margin: 0; padding: 6px 10px; }
.dash-alerts h3 { margin: 0 0 3px; font-size: 0.85rem; }
.dash-alerts .report-table td { padding: 2px 6px; font-size: 0.8rem; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { padding: 2px 0; border-bottom: 1px solid #eef0f4; font-size: 0.8rem; }
.dash-list li.warn { color: #8a5a00; }
.dash-list li.bad { color: #b42318; }
.dash-list li.ok { color: #166534; }
.pref-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.pref-module h3 { margin: 6px 0 4px; font-size: 0.85rem; color: var(--navy); }
.pref-link { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 0.88rem; }
.pref-link span { flex: 1; }
.pref-order { width: 52px; padding: 2px 4px; }
.pref-parts { display: flex; flex-direction: column; gap: 4px; max-width: 360px; }
/* The unfixed note shows on hover in the popup, to keep the sale on one screen */
.popup-page .fix-switch { margin: 0; padding: 4px 8px; }
.popup-page .fix-switch p.muted { display: none; }

/* Party inquiry (Nazim, 2026-10-25): the search box with its suggestions, details beside the last vouchers */
.inquiry-search { position: relative; display: inline-block; }
.inquiry-search input { width: 300px; }
.inquiry-search .suggest-list { position: absolute; top: 100%; left: 0; z-index: 20; }
.inquiry-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .inquiry-grid { grid-template-columns: 1fr; } }
.inquiry-details h2 { margin: 0 0 6px; font-size: 1rem; }
.inquiry-details dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; margin: 0; font-size: 0.88rem; }
.inquiry-details dt { color: var(--muted); font-weight: 600; }
.inquiry-details dd { margin: 0; }
.inquiry-note { margin: 6px 10px; font-size: 0.82rem; }
.inquiry-matches { margin: 0; padding-left: 18px; line-height: 1.8; }

/* New / edit party (Nazim, 2026-10-25): a coloured bar for what the party is, who and contact side by
   side, the optional parts closed until wanted; it opens in the popup and fits one screen there */
.party-head h1 small { font-size: 0.8rem; font-weight: 500; }
.party-form .party-kind { background: linear-gradient(105deg, #101a3d 0%, #1f2f6b 60%, #2b3f8f 100%); color: #fff;
                          border: none; border-bottom: 3px solid var(--gold); }
.party-form .party-kind .field label, .party-form .party-kind .check { color: #fff; }
.party-form .party-kind .field-hint { color: rgba(255, 255, 255, 0.7); }
.party-form .party-kind .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.party-form .party-kind .checks { margin: 4px 0 0; }
.party-form .party-kind .check { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3);
                                 border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.party-form .party-kind .check:has(input:checked) { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.party-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 760px) { .party-grid { grid-template-columns: 1fr; } }
.party-grid .panel { margin-bottom: 12px; }
.party-who { border-top: 4px solid #1d7a3a; }
.party-contact { border-top: 4px solid var(--gold); }
.party-grid .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.party-more > summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.party-more[open] > summary { margin-bottom: 8px; }
.party-save button { background: #1d7a3a; min-width: 160px; font-weight: 700; }
.popup-page .party-grid { gap: 8px; }
.popup-page .party-grid .panel { margin-bottom: 7px; }
.popup-page .party-grid .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.popup-page .party-more { padding: 5px 10px; }
.popup-page .party-form .file-drop { padding: 4px 8px; min-height: 0; }

/* The public page a voucher's QR code opens (Nazim, 2026-10-25) */
.verify-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
               background: linear-gradient(135deg, #101a3d 0%, #1f2f6b 60%, #2b3f8f 100%); }
.verify-card { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 22px;
               box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); border-top: 5px solid var(--gold); }
.verify-company { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.verify-company .logo { height: 44px; width: auto; }
.verify-company .icon { width: 40px; height: 40px; color: var(--gold); }
.verify-company div { display: flex; flex-direction: column; }
.verify-company strong { font-size: 1.15rem; color: var(--navy); }
.verify-company span { font-size: 0.8rem; color: var(--muted); }
.verify-status { border-radius: 12px; padding: 14px 16px; font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.verify-status small { display: block; font-size: 0.85rem; font-weight: 500; margin-top: 2px; }
.verify-status.ok { background: #e7f6ec; color: #166534; border: 1px solid #b7e2c4; }
.verify-status.bad { background: #fdecea; color: #b42318; border: 1px solid #f4b4ae; }
.verify-facts { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; margin: 0 0 12px; }
.verify-facts dt { color: var(--muted); font-weight: 600; }
.verify-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.verify-note { font-size: 0.82rem; color: var(--muted); margin: 0; }

/* Administration -> Backups: automatic backup time (2026-11-01) */
.backup-schedule__form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.backup-schedule__form input[type=time] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.backup-schedule__status { margin: 10px 0 0; font-size: 0.85rem; }

/* HR (phase 3): the attendance month as a grid */
.attendance-grid th.att-day { text-align: center; padding: 2px 1px; font-size: 0.72rem; min-width: 34px; }
.attendance-grid td.att-cell { text-align: center; padding: 1px; }
.attendance-grid td.att-cell select { width: 34px; padding: 1px 0; min-height: 0; font-size: 0.78rem; border-color: transparent; background: transparent; }
.attendance-grid td.att-cell small { display: block; font-size: 0.65rem; color: var(--muted); }
.attendance-grid td.att-A, .attendance-grid td.att-U { background: #fdecea; }
.attendance-grid td.att-L, .attendance-grid td.att-S { background: #e8f0fb; }
.attendance-grid td.att-H, .attendance-grid td.att-W { background: #f1f1ee; }
