/* Prizdale Montblanc Turquoise theme (from NewsDesk) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --teal-deep: #0e7490;
  --teal-mid: #0891b2;
  --teal-bright: #06b6d4;
  --teal-light: #67e8f9;
  --teal-pale: #cffafe;
  --teal-ice: #f0feff;
  --amber: #f59e0b;
  --amber-light: #fcd34d;
  --ink: #0c1a1f;
  --muted: #4a7a8a;
  --border: #b2e8f0;
  --card: #ffffff;
  --page: #f0feff;
  --good-green: #059669;
  --good-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  /* aliases for existing class names */
  --bg: var(--page);
  --text: var(--ink);
  --primary: var(--teal-deep);
  --ok: var(--good-green);
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
}

.app-header {
  background: var(--teal-deep);
  border-bottom: 3px solid var(--amber);
  box-shadow: 0 2px 12px rgba(14, 116, 144, 0.3);
  position: sticky;
  top: 0;
  z-index: 200;
  color: #fff;
}

.env-banner {
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-light) 100%);
  color: var(--ink);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.2rem 1rem;
  border-bottom: 1px solid #d97706;
}

.header-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.75rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: #fff;
  white-space: nowrap;
}

.brand p {
  margin: 0;
  font-size: 0.6rem;
  color: var(--teal-pale);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

#nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  background: #0c616e;
  border-radius: 4px;
  padding: 0.12rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#nav::-webkit-scrollbar { display: none; }

#nav a {
  color: var(--teal-pale);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 3px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

#nav a:hover { color: #fff; }

#nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--amber);
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--teal-pale);
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.user-bar .user-role {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--amber-light);
}

.user-bar .btn-logout {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.22rem 0.45rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.user-bar .btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.totp-secret code.selectable-secret {
  display: block;
  word-break: break-all;
  user-select: all;
  background: var(--teal-ice);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
}

.login-wrap {
  max-width: 420px;
  margin: 2.5rem auto;
}

.login-card h2 {
  margin: 0 0 0.35rem;
  font-family: 'Playfair Display', serif;
  color: var(--teal-deep);
}

.login-card .hint {
  margin-bottom: 1.25rem;
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.credential-inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.credential-inline input {
  min-width: 12rem;
  flex: 1;
}

.credential-result {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--good-light);
  border: 1px solid var(--good-green);
  border-radius: 4px;
}

.credential-result code,
#create-user-result code {
  user-select: all;
  font-weight: 700;
}

main {
  max-width: 1200px;
  margin: 0.75rem auto;
  padding: 0 0.85rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(14, 116, 144, 0.06);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 18px rgba(14, 116, 144, 0.1);
}

h2 {
  margin: 0 0 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--teal-deep);
  margin: 1rem 0 0.5rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.head-balance-hint {
  color: #666;
  font-size: 0.8em;
  margin-top: 0.25rem;
  min-height: 1.1em;
}

.voucher-badge {
  display: inline-block;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.date-range-fields {
  display: contents;
}

.form-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-section h3 {
  margin-top: 0;
}

.form-section .btn-sm {
  margin-top: 0.5rem;
}

#balance,
.balance-line {
  margin: 0.85rem 0 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--teal-ice);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

.voucher-form-actions {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.dash-tables .card > .btn {
  margin-top: 0.75rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.restore-diff-table {
  margin: 0.75rem 0;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-mid);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: var(--teal-ice);
  color: var(--teal-deep);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.45rem;
  text-align: left;
}

.totals-row th, .totals-row td {
  background: var(--teal-pale);
  font-weight: 700;
}

.btn {
  border: none;
  border-radius: 3px;
  padding: 0.55rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--teal-deep);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: #0c616e;
}

.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--teal-mid);
  color: var(--teal-deep);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 4px;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.alert-success {
  background: var(--good-light);
  color: #065f46;
  border-color: #6ee7b7;
}

.alert-error {
  background: var(--danger-light);
  color: #7f1d1d;
  border-color: #fecaca;
}

.alert-info {
  background: var(--teal-pale);
  color: #0a4a55;
  border-color: var(--border);
}

.match-ok { color: var(--good-green); font-weight: 600; }
.match-bad { color: var(--bad); font-weight: 600; }

.line-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: end;
}

.head-combobox {
  position: relative;
}

.head-combobox-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.head-combobox-option {
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.head-combobox-option:hover,
.head-combobox-option.active {
  background: var(--teal-ice);
  color: var(--teal-deep);
}

.head-combobox-invalid .head-combobox-input {
  border-color: var(--danger);
}

/* Pending approvals — condensed, queue-style rows */
.pending-approvals { padding: 0.85rem 1rem; }

.pending-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pending-head h2 {
  margin: 0 0 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pending-count {
  display: inline-block;
  min-width: 1.55rem;
  text-align: center;
  background: var(--amber);
  color: #3b2600;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.02rem 0.45rem;
}

.pending-sub { margin: 0; }

.pending-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pending-head-actions .approver-as {
  margin: 0;
  white-space: nowrap;
  font-size: 0.78rem;
}

#pending-queue-hint { margin: 0.25rem 0 0; font-size: 0.78rem; }
#pending-queue-hint:empty { display: none; }

.pending-queue {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.pending-card.pending-row {
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  padding: 0.35rem 0.5rem;
  margin: 0;
  background: #fff;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.pending-card.pending-row:hover { background: var(--teal-ice); }
.pending-card.pending-row.pending-row-done { opacity: 0; transform: translateX(14px); }

.pending-row-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pending-summary {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  background: none;
  border: 0;
  padding: 0.1rem 0.15rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pending-summary-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.pending-type {
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 0.02rem 0.32rem;
  border-radius: 3px;
  background: var(--teal-pale);
  color: var(--teal-deep);
}

.pending-type-contra { background: #e0e7ff; color: #3730a3; }
.pending-num { font-weight: 700; font-size: 0.82rem; color: var(--teal-deep); flex: 0 0 auto; }
.pending-date { font-size: 0.76rem; color: var(--muted); flex: 0 0 auto; }

.pending-party {
  font-weight: 600;
  font-size: 0.86rem;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-amount {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  margin-left: auto;
}

.pending-subline { font-size: 0.76rem; color: var(--muted); }

.pending-narr {
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pending-heads {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-row-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.pending-row-actions .btn {
  padding: 0.32rem 0.6rem;
  font-size: 0.76rem;
}

.pending-awaiting { margin: 0.35rem 0 0; }

.pending-detail {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
}

.pending-detail .voucher-card {
  margin: 0;
  border: 0;
  box-shadow: none;
  background: #fff;
}

.reject-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.reject-form input { width: 100%; }

.pending-edit-form {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
}

.pending-edit-form .form-row { margin-bottom: 0.5rem; }

.pending-empty {
  margin: 0.6rem 0 0;
  padding: 0.85rem;
  text-align: center;
  color: #065f46;
  background: var(--good-light);
  border: 1px solid #6ee7b7;
  border-radius: 4px;
  font-weight: 600;
}

.pending-recent {
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.pending-recent h3 {
  margin: 0 0 0.35rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.pending-recent-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--teal-ice);
}

.pending-recent-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-recent .hint { margin: 0.4rem 0 0; font-size: 0.76rem; }

.report-totals, .totals-footer {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--teal-ice);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.92rem;
}

.totals-row.grand {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--teal-ice);
  color: var(--teal-deep);
  text-transform: capitalize;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.move-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.move-wrap select {
  max-width: 160px;
  font: inherit;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.table-wrap {
  overflow-x: auto;
}

.match-ok { color: var(--ok, #15803d); font-weight: 600; }
.match-bad { color: var(--danger); font-weight: 600; }
.muted { color: var(--muted); font-size: 0.9rem; }

.report-totals strong, .totals-footer strong {
  display: block;
  font-size: 1.05rem;
  color: var(--teal-deep);
  margin-top: 0.2rem;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--teal-deep);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border-bottom: 3px solid var(--amber);
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 4px 16px rgba(14, 116, 144, 0.35);
}

.toast.alert-error {
  background: var(--danger);
  border-bottom-color: #fca5a5;
}

.toast.toast-with-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast .toast-undo {
  background: var(--amber);
  color: #3b2600;
  border: none;
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  flex: 0 0 auto;
}

.loading {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.conn-status {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 0.26rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.conn-online { background: var(--good-light); color: #065f46; border: 1px solid #6ee7b7; }
.conn-offline { background: var(--danger-light); color: #7f1d1d; border: 1px solid #fecaca; }
.conn-checking { background: var(--teal-pale); color: var(--teal-deep); border: 1px solid var(--border); }

.save-confirm {
  border: 2px solid #6ee7b7;
  background: var(--good-light);
  color: #065f46;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.save-confirm strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; }

.save-failed {
  border: 2px solid #fecaca;
  background: var(--danger-light);
  color: #7f1d1d;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin: 0.75rem 0;
}

.btn-saving { opacity: 0.7; pointer-events: none; }

@media (max-width: 860px) {
  .header-row { flex-wrap: wrap; padding: 0.35rem 0.6rem; }
  .brand { flex: 1 1 auto; }
  #nav { order: 3; flex: 1 0 100%; width: 100%; justify-content: flex-start; }
  .user-bar { flex-wrap: wrap; }
  .pending-row-main { flex-wrap: wrap; }
  .pending-summary { flex: 1 1 100%; }
  .pending-narr { max-width: 100%; flex: 1 1 auto; }
  .pending-row-actions { width: 100%; justify-content: flex-end; }
  .reject-form { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .line-row { grid-template-columns: 1fr; }
  .report-export-toolbar { flex-direction: column; }
  .voucher-card-tables { grid-template-columns: 1fr; }
}

/* Report export toolbar */
.report-export-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--teal-ice);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.report-container { margin-top: 1rem; }

.print-only { display: none; }

.report-print-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--teal-deep);
}

.report-print-header h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--teal-deep);
}

.report-print-header p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.report-table { width: 100%; }

/* Daily Income & Expense — Excel-style day blocks, income | expenditure */
.die-register { margin-top: 0.5rem; }
.die-legend { font-size: 0.8rem; margin-bottom: 0.75rem; }
.die-day {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.6rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}
.die-day-alt {
  background: #eef6f4;
  border-color: #c5ddd6;
}
.die-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.35rem;
}
.die-day-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--teal-deep);
}
.die-open, .die-close {
  font-size: 0.8rem;
  color: var(--muted);
}
.die-close {
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--text);
}
.die-pair-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  table-layout: fixed;
}
.die-pair-table th,
.die-pair-table td {
  padding: 0.18rem 0.28rem;
  border: 1px solid #dde5e2;
  vertical-align: top;
  word-wrap: break-word;
}
.die-pair-table thead th {
  background: #f3f7f6;
  font-weight: 600;
  font-size: 0.72rem;
}
.die-head-income { background: #e3f2ea !important; text-align: center; color: var(--teal-deep); }
.die-head-expense { background: #fceee8 !important; text-align: center; color: #8a3b22; }
.die-gutter {
  width: 0.45rem;
  min-width: 0.45rem;
  max-width: 0.45rem;
  padding: 0 !important;
  border-left: none !important;
  border-right: none !important;
  background: transparent !important;
}
.die-col-heads th { font-size: 0.68rem; }
.die-v { width: 2.2rem; }
.die-st { width: 1.4rem; text-align: center; }
.die-party { width: 18%; }
.die-part { width: 22%; }
.die-pad { border: none !important; background: transparent !important; }
.die-foot-label { font-weight: 600; font-size: 0.72rem; }
.die-pair-table tfoot td {
  font-weight: 600;
  background: #f8faf9;
  border-top: 2px solid #c5d5cf;
}
.die-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0 0.22rem;
  border-radius: 2px;
  background: #dceee7;
  color: var(--teal-deep);
  vertical-align: middle;
}
.die-razorpay .die-tag,
tr.die-razorpay td { background: #fff6eb; }
.die-liability td { background: #f3f5ff; }
.die-contra td { background: #f5f5f5; font-style: italic; }
.die-period-totals {
  margin-top: 0.75rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  background: var(--teal-ice);
  border-radius: 4px;
  font-weight: 500;
}

.import-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.import-subnav a {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
}
.import-subnav a.active {
  background: var(--teal-deep);
  color: #fff;
  border-color: var(--teal-deep);
}
.import-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.import-hub-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--teal-ice);
}
.import-hub-card h3 { margin: 0 0 0.35rem; color: var(--teal-deep); }
.import-hub-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.iq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.iq-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.iq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-start;
}
.iq-row-secondary {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}
.iq-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.iq-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.iq-field-src { flex: 0 0 auto; }
.iq-field-date { flex: 0 0 9rem; }
.iq-field-type { flex: 0 0 6rem; }
.iq-field-amt { flex: 0 0 7rem; }
.iq-field-mode { flex: 0 0 9rem; }
.iq-field-ref { flex: 1 1 12rem; min-width: 10rem; }
.iq-field-narr { flex: 1 1 14rem; min-width: 12rem; }
.iq-field-paid { flex: 1 1 10rem; min-width: 8rem; }
.iq-field-head { flex: 1 1 14rem; min-width: 12rem; }
.iq-field-head select { width: 100%; }
.iq-field-paid input { width: 100%; }
.iq-list textarea { width: 100%; min-width: 0; font: inherit; }
.iq-bank-text {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: none;
  white-space: pre-wrap;
  margin-bottom: 0.25rem;
}
.iq-actions {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
  align-self: flex-end;
  margin-left: auto;
}
.iq-actions .btn { margin: 0; }

.iq-income-lines { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.25rem 0; }
.iq-income-line { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.iq-income-line select { flex: 1 1 10rem; min-width: 8rem; }
.iq-income-line .iq-line-amt { flex: 0 0 7rem; width: 7rem; }
.iq-field-lines { flex: 1 1 18rem; min-width: 14rem; }
.iq-lines-balance { margin: 0.25rem 0 0; font-size: 0.85rem; }
.dup-badge.dup-settlement,
.dup-count.dup-settlement {
  background: #fff3cd;
  color: #856404;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
.dup-row-settlement td { background: #fffbf0; }

.dc-table { font-size: 0.82rem; }
.dc-table thead th {
  background: #eef6f4;
  font-size: 0.72rem;
  text-align: center;
  white-space: nowrap;
}
.dc-table tbody td:first-child { font-weight: 600; white-space: nowrap; }
.dc-table tr.dc-alt td { background: #eef6f4; }
.dc-table tfoot td {
  font-weight: 600;
  background: #e3f2ea;
  border-top: 2px solid #c5d5cf;
}

@media print {
  .die-day { break-inside: avoid; page-break-inside: avoid; }
  .die-day-alt { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .die-head-income, .die-head-expense, .die-pair-table thead th, .die-pair-table tfoot td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .dc-table tr.dc-alt td, .dc-table thead th, .dc-table tfoot td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Voucher cards & print layout */
.voucher-card {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--teal-ice);
}

.voucher-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.voucher-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.status-posted, .status-approved { background: var(--good-light); color: #065f46; }
.status-pending_approval { background: #fef3c7; color: #92400e; }
.status-rejected { background: var(--danger-light); color: #7f1d1d; }

.badge-reversal {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: #7c2d12;
  color: #fff;
  margin-left: 0.35rem;
}

.badge-modified {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: #1e40af;
  color: #fff;
  margin-left: 0.35rem;
}

.reversal-form textarea { width: 100%; min-height: 4rem; margin-top: 0.35rem; }

.voucher-card-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.75rem 0;
}

.voucher-card-tables h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--teal-deep);
}

.voucher-print-doc {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  padding: 0;
  max-width: 180mm;
}

.voucher-print-header { text-align: center; margin-bottom: 1rem; }
.voucher-print-header h1 { margin: 0; font-size: 1.1rem; color: var(--teal-deep); }
.voucher-print-header h2 { margin: 0.25rem 0; font-size: 0.95rem; font-weight: 600; }
.voucher-print-meta { font-size: 0.8rem; color: var(--muted); }

.voucher-print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.voucher-print-table th,
.voucher-print-table td {
  border: 1px solid #ccc;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.voucher-print-table th { background: var(--teal-pale); }
.voucher-print-table .amt { text-align: right; }
.voucher-print-table .total-row td { border-top: 2px solid var(--teal-deep); }

.voucher-print-modes { font-size: 0.8rem; margin: 0.5rem 0; }
.voucher-print-modes ul { margin: 0.25rem 0; padding-left: 1.25rem; }

.voucher-print-sigs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.75rem;
}

.voucher-print-sigs .sig-line {
  border-top: 1px solid #333;
  margin-top: 2.5rem;
}

.voucher-print-footer {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
}

.backup-card .backup-last {
  padding: 0.75rem 1rem;
  background: var(--teal-ice);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1rem 0;
}

.backup-card .backup-actions {
  margin: 1rem 0;
}

.backup-table .backup-row-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-card h3 {
  margin-top: 0;
}

.modal-card .modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.restore-diff-table {
  margin: 1rem 0;
}

.restore-modal input[type="text"] {
  width: 100%;
  margin-top: 0.35rem;
}

.pending-detail .voucher-card {
  background: #fff;
  margin-top: 0;
}

.dashboard-grid,
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dash-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.dash-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.dashboard-kpi,
.dash-metric,
.card-sm {
  background: var(--teal-ice);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.dash-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dash-label,
.dashboard-kpi .kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.dashboard-kpi .kpi-value,
.dash-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--teal-deep);
}

.dash-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-kpi .kpi-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--teal-deep);
}

.dashboard-kpi.clickable {
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.dashboard-kpi.clickable:hover {
  box-shadow: 0 2px 8px rgba(14, 116, 144, 0.15);
}

.dashboard-section {
  margin-top: 1.5rem;
}

.dashboard-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.dashboard-tx-table td.amt,
.dashboard-tx-table th.amt {
  text-align: right;
  white-space: nowrap;
}

.dashboard-tx-row {
  cursor: pointer;
}

.dashboard-tx-row:hover {
  background: var(--teal-ice);
}

.date-preset-bar,
.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.date-preset-bar .preset-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.btn-preset {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
}

.btn-preset.active,
.btn-preset:hover {
  background: var(--teal-pale);
  border-color: var(--teal-mid);
}

.amount-field-wrap,
.amount-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.amount-field input.amount-input {
  width: 100%;
}

.amount-input.amount-invalid {
  border-color: var(--danger, #c0392b);
  background: #fff5f5;
}

.student-lookup-wrap {
  position: relative;
}

.student-lookup-list {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  max-height: 10rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.student-lookup-list li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.student-lookup-list li:hover,
.student-lookup-list li.active {
  background: var(--teal-pale);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(12, 26, 31, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel,
.modal-card {
  position: relative;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 42rem;
  width: 100%;
  padding: 1.25rem 1.5rem 1.5rem;
  margin-top: 2vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-right: 2rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
}

.modal-close:hover {
  color: var(--ink);
}

.report-view-all {
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
}

.report-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
  align-items: center;
}
.report-filter-input { min-width: 12rem; flex: 1; }
.report-filter-select { min-width: 8rem; }
.voucher-date-presets { margin-bottom: 0.75rem; }
.voucher-date-presets .date-presets { margin: 0; }
.audit-table .audit-diff { font-size: 0.8rem; max-width: 24rem; word-break: break-word; }
.student-actions { margin-bottom: 0.75rem; display: flex; gap: 0.5rem; }
#student-import-csv { width: 100%; font-family: inherit; margin: 0.5rem 0; }

@media print {
  .app-header,
  #nav,
  .conn-status,
  .env-banner,
  #toast,
  .no-print,
  .report-export-toolbar,
  .form-row,
  #run-report,
  .pending-actions,
  .pending-row-actions,
  .pending-detail,
  .pending-recent,
  .pending-head-actions,
  .reject-form,
  .btn-voucher-pdf,
  .btn,
  .head-combobox-list {
    display: none !important;
  }

  .print-only { display: block !important; }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
  }

  main#app { padding: 0; max-width: none; }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    page-break-inside: auto;
  }

  table th, table td {
    border: 1px solid #999;
    padding: 0.25rem 0.4rem;
  }

  table th { background: #e8f4f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .totals-footer {
    background: #f0feff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid #999;
    margin-top: 0.5rem;
    padding: 0.5rem;
    font-size: 9pt;
  }

  .report-container { margin: 0; }

  .voucher-print-doc { max-width: none; }

  .report-print-header h1 { font-size: 14pt; margin: 0 0 0.25rem; }
  .report-print-header p { font-size: 9pt; margin: 0 0 0.5rem; }
  .report-totals { page-break-inside: avoid; }
  tr { page-break-inside: avoid; }
}
.import-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin:.75rem 0; }
.table-scroll { overflow-x:auto; }
.import-table input, .import-table select { font-size:.85rem; padding:.35rem .45rem; min-width:100px; }
.import-table .narr { min-width:200px; }
.tag { background:#fef3c7; color:#92400e; font-size:.75rem; padding:.1rem .35rem; border-radius:.25rem; }
.import-rules-form .kw-row { margin-bottom:.5rem; }

.duplicate-summary { display:flex; flex-wrap:wrap; gap:.5rem; margin:.75rem 0; }
.dup-count { font-size:.85rem; padding:.2rem .55rem; border-radius:4px; font-weight:600; }
.dup-count.dup-new { background:#e8f5e9; color:#2e7d32; }
.dup-count.dup-already_imported { background:#ffebee; color:#c62828; }
.dup-count.dup-likely_existing { background:#fff3e0; color:#e65100; }
.dup-count.dup-possible_contra { background:#fff8e1; color:#f57f17; }

.dup-badge { font-size:.75rem; padding:.15rem .4rem; border-radius:3px; font-weight:600; white-space:nowrap; }
.dup-badge.dup-new { background:#e8f5e9; color:#2e7d32; }
.dup-badge.dup-already_imported { background:#ffcdd2; color:#b71c1c; }
.dup-badge.dup-likely_existing { background:#ffe0b2; color:#e65100; }
.dup-badge.dup-possible_contra { background:#fff9c4; color:#f57f17; }
.tier-badge { font-size:.75rem; padding:.15rem .45rem; border-radius:3px; font-weight:600; white-space:nowrap; }
.tier-badge.tier-1 { background:#e8f5e9; color:#2e7d32; }
.tier-badge.tier-2 { background:#fff3e0; color:#e65100; }
.tier-badge.tier-3 { background:#e3f2fd; color:#1565c0; }
.tier-badge.tier-4 { background:#ffebee; color:#c62828; }
tr.tier-row-flag { background:#fff8f8; }
.form-row-wrap { flex-wrap: wrap; }

.dup-row-already_imported { background:#fff5f5; }
.dup-row-likely_existing { background:#fff8f0; }
.dup-row-possible_contra { background:#fffef5; }
.inline-check { display:inline-flex; align-items:center; gap:.35rem; margin-right:1rem; font-size:.9rem; }
.inline-check input { width:auto; }
