/**
 * CashCount Pro — UI Polish & Consistency Layer
 * Load LAST (after styles.css + main.css) to normalize all pages.
 * 
 * Fixes:
 *  - Unified border-radius (8/12/16 only)
 *  - Forced Inter font everywhere
 *  - Consistent button gradients & hover states
 *  - Uniform card, table, form styling
 *  - Professional micro-interactions
 *  - Better spacing rhythm
 *  - Consistent badge/chip/pill sizing
 */

/* ============================================
   1. GLOBAL RESETS & FONT ENFORCEMENT
   ============================================ */
*, *::before, *::after {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

code, pre, .denom-box, .font-mono, [style*="monospace"] {
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace !important;
}

/* Smooth scroll and text rendering */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* Prevent content layout shift from scrollbar */
html { overflow-y: scroll; }

/* ============================================
   2. UNIFIED RADIUS TOKENS
   Only 3 sizes across entire app:
   sm=8px (inputs, badges, small btns)
   md=12px (cards, panels, modals)  
   lg=16px (hero cards, nav dropdowns)
   ============================================ */
:root {
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

/* Cards */
.card,
.ccp-kpi-card,
.currency-card,
.ccp-panel,
.modal-content,
.ccp-nav-dd-menu {
  border-radius: var(--r-md) !important;
}

/* Inputs, selects, textareas */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.de-sel,
.de-inp {
  border-radius: var(--r-sm) !important;
}

/* Buttons */
button:not(.modal-close):not(.flash-dismiss),
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-ghost,
.btn-light,
.btn-export,
.btn-edit,
.btn-delete,
.btn-logout,
.btn-compact,
.btn-quick,
.de-add-btn {
  border-radius: var(--r-sm) !important;
}

/* Pills (user badge, nav toggles) */
.ccp-userbadge,
.ccp-ccy-chip,
.ccp-ccy-badge,
.accent-badge {
  border-radius: 999px !important;
}

/* Badges */
.badge,
.badge-buy, .badge-sell, .badge-account, .badge-adjustment,
.badge-active, .badge-inactive, .badge-out, .badge-in,
.chip {
  border-radius: 6px !important;
}

/* Tables */
table {
  border-radius: var(--r-sm) !important;
  overflow: hidden;
}

/* Flash messages */
.flash,
.notice {
  border-radius: var(--r-sm) !important;
}

/* ============================================
   3. UNIFIED COLOR SYSTEM
   Replace common hardcoded colors with tokens
   ============================================ */

/* Primary action buttons — vibrant blue */
.btn-primary,
.btn-indigo,
.ccp-actions .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled),
.btn-indigo:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

/* Secondary buttons — clean outline */
.btn-secondary,
.btn-light,
.btn-ghost {
  background: #fff !important;
  color: var(--gray-700) !important;
  border: 1.5px solid var(--gray-300) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-weight: 600;
}

html.dark .btn-secondary,
html.dark .btn-light,
html.dark .btn-ghost {
  background: var(--ds-card, #1e293b) !important;
  color: #e2e8f0 !important;
  border-color: rgba(148,163,184,0.3) !important;
}

.btn-secondary:hover:not(:disabled),
.btn-light:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-50) !important;
  border-color: var(--gray-400) !important;
  transform: translateY(-1px);
}

/* Success buttons */
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border: none !important;
}

/* Danger / delete buttons */
.btn-danger,
.btn-delete {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  border: none !important;
  font-size: var(--fs-sm) !important;
  padding: 0.35rem 0.65rem;
}

/* Edit buttons */
.btn-edit {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  font-size: var(--fs-sm) !important;
  padding: 0.35rem 0.65rem;
}

/* Logout */
.btn-logout {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ============================================
   4. CARD POLISH
   ============================================ */
.card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

/* Consistent card heading style */
.card h3,
.card h2 {
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}

html.dark .card h3,
html.dark .card h2 {
  color: #e2e8f0;
  border-bottom-color: rgba(148,163,184,0.15);
}

/* ============================================
   5. TABLE POLISH
   ============================================ */
table {
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

th {
  background: #f1f5f9 !important;
  color: var(--gray-700) !important;
  font-weight: 700 !important;
  font-variant-caps: all-small-caps; text-transform: none;
  letter-spacing: 0.03em;
  font-size: 0.7rem !important;
  border-bottom: 2px solid var(--gray-200) !important;
  border-top: none !important;
  white-space: nowrap;
}

html.dark th {
  background: #334155 !important;
  color: #f1f5f9 !important;
  border-bottom-color: rgba(148,163,184,0.3) !important;
}

td {
  border-color: var(--gray-100) !important;
}

html.dark td {
  border-color: rgba(148,163,184,0.1) !important;
}

/* Hover row highlight */
tbody tr:hover td {
  background: rgba(79, 70, 229, 0.04) !important;
}

html.dark tbody tr:hover td {
  background: rgba(96, 165, 250, 0.06) !important;
}

/* Zebra striping */
tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.5);
}

html.dark tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   6. FORM INPUT POLISH
   ============================================ */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border: 1.5px solid var(--gray-300) !important;
  padding: 0.5rem 0.65rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  background: #fff;
}

html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  background: #0f172a;
  border-color: rgba(148,163,184,0.3) !important;
  color: #e2e8f0;
}

input:focus:not([type="checkbox"]):not([type="radio"]),
select:focus,
textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

/* Labels — consistent weight and size */
label {
  font-weight: 700 !important;
  font-size: 11px !important;
  color: #64748b !important;
  letter-spacing: 0.04em;
}

html.dark label {
  color: #cbd5e1 !important;
}

/* ============================================
   7. BADGE / CHIP CONSISTENCY
   ============================================ */
.badge,
.badge-buy, .badge-sell, .badge-account, .badge-adjustment,
.badge-active, .badge-inactive, .badge-out, .badge-in {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  padding: 0.2rem 0.55rem !important;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ============================================
   8. NOTICE / ALERT CONSISTENCY
   ============================================ */
.notice,
.alert {
  padding: 0.75rem 1rem !important;
  font-size: var(--fs-sm) !important;
  font-weight: 600;
  border-left-width: 4px !important;
  border-left-style: solid !important;
}

/* ============================================
   9. NAVBAR POLISH
   ============================================ */

/* Navbar brand — slightly larger, bolder */
.ccp-navbar__brand {
  font-weight: 900 !important;
  font-size: 1.1rem !important;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Nav items — consistent sizing */
.ccp-nav-menu > li > a,
.ccp-nav-menu > li > .ccp-nav-dd-toggle {
  font-weight: 600 !important;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Active nav item — stronger indicator */
.ccp-nav-menu > li > a.is-active,
.ccp-nav-menu > li > .ccp-nav-dd-toggle.is-active {
  background: rgba(255, 255, 255, 0.22) !important;
  font-weight: 700 !important;
}

/* ============================================
   10. PAGE HEADER (breadcrumb strip) POLISH
   ============================================ */
.ccp-page-header {
  padding: 0.75rem 1.25rem !important;
}

.ccp-page-header__title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.ccp-page-header__crumb {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  opacity: 0.75;
}

/* ============================================
   11. FOOTER CONSISTENCY
   ============================================ */
.bd-footer {
  font-size: 0.78rem !important;
  padding: 0.65rem 1rem !important;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
}

html.dark .bd-footer {
  border-top-color: rgba(148,163,184,0.15);
  color: rgba(226,232,240,0.6);
}

/* ============================================
   12. KPI DASHBOARD CARDS — polished
   ============================================ */
.ccp-kpi-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ccp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.ccp-kpi-card__value {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   13. VIEW TRANSACTION — receipt-style polish
   ============================================ */
.view-transaction-card {
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================
   14. SCROLLBAR STYLING (webkit)
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

html.dark ::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.3);
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(148,163,184,0.5);
}

/* ============================================
   15. TRANSITIONS — subtle globally
   ============================================ */
a, button, .btn, .card, input, select, textarea, .badge {
  transition: all 0.15s ease;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   16. STANDALONE PAGES — force design system
   (cleanup.php, rate_limit error, etc.)
   ============================================ */

/* When body has no header.php context, still match palette */
body:not(.compact) {
  background: var(--ds-bg, #f1f5f9);
}

/* ============================================
   17. QUICK ACTION BUTTONS — uniform pill style
   ============================================ */
.qa {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-quick {
  font-weight: 700 !important;
  font-size: var(--fs-sm) !important;
  padding: 0.45rem 0.85rem !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-quick:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ============================================
   18. SUBNAV — reports & settings tabs
   ============================================ */
.ccp-subnav {
  border-bottom-width: 2px;
  margin-bottom: 1.25rem;
}

.ccp-subnav__item {
  font-weight: 600;
  padding: 0.6rem 1rem;
  position: relative;
}

.ccp-subnav__item.is-active {
  font-weight: 700;
}

.ccp-subnav__item.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-gradient);
  border-radius: 1px;
}

/* ============================================
   19. EMPTY STATES — professional
   ============================================ */
.ccp-empty-state {
  padding: 3rem 1.5rem;
}

.ccp-empty-state__icon {
  font-size: 3rem;
  opacity: 0.35;
  margin-bottom: 1rem;
}

.ccp-empty-state__title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ============================================
   20. SELECTION HIGHLIGHT — brand color
   ============================================ */
::selection {
  background: rgba(79, 70, 229, 0.15);
  color: inherit;
}

/* ============================================
   21. MODAL POLISH
   ============================================ */
.modal-content {
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  border: 1px solid var(--ds-border, rgba(148,163,184,0.2));
}

/* ============================================
   22. DENOMINATION CARDS — polished grid
   ============================================ */
.currency-card,
.denom-ccy-grid .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.currency-card:hover,
.denom-ccy-grid .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.currency-card::before {
  background: var(--brand-gradient) !important;
  height: 3px !important;
}

/* ============================================
   23. PRINT — clean professional output
   ============================================ */
@media print {
  * {
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  
  .card {
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
  
  th {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================
   PHASE 2B — COMPACT & COLOURFUL UI OVERHAUL
   Appended to polish.css (loads last = highest specificity)
   Target: all 6 pages shown in screenshots
   ============================================================ */

/* ── 1. Global spacing tightening ─────────────────────────── */
:root {
  --spacing-xs: 0.2rem;
  --spacing-sm: 0.4rem;
  --spacing-md: 0.65rem;
  --spacing-lg: 0.9rem;
  --spacing-xl: 1.2rem;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

.dt-main, .main-content { padding: 0.65rem 1rem 1.5rem !important; }

/* ── 2. Card compact ───────────────────────────────────────── */
.card {
  padding: 0.85rem 1rem !important;
  margin-bottom: 0.65rem !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(15,23,42,.06) !important;
  border: 1px solid rgba(15,23,42,.08) !important;
}
.card h3, .card h2 { margin-bottom: 0.55rem !important; font-size: .93rem !important; }

/* ── 3. Dashboard KPI cards — colourful left border ───────── */
.ccp-kpi-card {
  padding: 0.8rem 0.95rem !important;
  border-radius: 12px !important;
  border-left-width: 4px !important;
  border-left-style: solid !important;
  transition: transform .18s, box-shadow .18s !important;
}
.ccp-kpi-card:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 24px rgba(0,0,0,.1) !important; }

/* Unified KPI surface: white card + colored left accent only */
.ccp-kpi-card--sell,
.ccp-kpi-card--buy,
.ccp-kpi-card--profit,
.ccp-kpi-card--vault,
.ccp-kpi-card--tx {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}
.ccp-kpi-card--sell  { border-left-color: #16a34a !important; }
.ccp-kpi-card--buy   { border-left-color: #2563eb !important; }
.ccp-kpi-card--profit { border-left-color: #7c3aed !important; }
.ccp-kpi-card--vault { border-left-color: #d97706 !important; }
.ccp-kpi-card--tx    { border-left-color: #0284c7 !important; }
html.dark .ccp-kpi-card--sell,
html.dark .ccp-kpi-card--buy,
html.dark .ccp-kpi-card--profit,
html.dark .ccp-kpi-card--vault,
html.dark .ccp-kpi-card--tx {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
.ccp-kpi-card__value { font-size: 1.4rem !important; font-weight: 900 !important; }
.ccp-kpi-card__label { font-size: .75rem !important; font-weight: 800 !important; }
.ccp-kpi-card__sub   { font-size: .68rem !important; }

/* ── 4. Tables — compact + colourful header ────────────────── */
th {
  background: linear-gradient(135deg,#f8fafc,#f1f5f9) !important;
  padding: 7px 10px !important;
  font-size: .69rem !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  color: #475569 !important;
  border-bottom: 2px solid #e2e8f0 !important;
  white-space: nowrap !important;
}
td { padding: 6px 10px !important; font-size: .82rem !important; }
tbody tr:hover td { background: rgba(79,70,229,.04) !important; }

/* ── 5. Form inputs compact ────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  padding: 6px 9px !important;
  font-size: .82rem !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
}
input:focus:not([type="checkbox"]):not([type="radio"]),
select:focus, textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,.1) !important;
}
label { font-size: .7rem !important; font-weight: 700 !important; }

/* ── 6. Buttons compact ────────────────────────────────────── */
.btn, button.btn { padding: 5px 13px !important; font-size: .79rem !important; }
.btn-sm          { padding: 3px 9px  !important; font-size: .73rem !important; }

/* ── 7. Transaction type badges — colourful ─────────────────── */
.badge-buy,   [class*="Trading"][class*="Buy"]   { background:#dcfce7 !important; color:#166534 !important; border:1px solid #bbf7d0 !important; }
.badge-sell,  [class*="Trading"][class*="Sell"]  { background:#fee2e2 !important; color:#991b1b !important; border:1px solid #fecaca !important; }
.badge-account, [class*="Account"]              { background:#dbeafe !important; color:#1e40af !important; border:1px solid #bfdbfe !important; }
.badge-adjustment, [class*="Adjustment"]        { background:#fef3c7 !important; color:#92400e !important; border:1px solid #fde68a !important; }

/* ── 8. Deal entry / Quotation section headers — unified clean style ── */
.de-sect-hd,
.de-sect-hd.dsh-txn,
.de-sect-hd.dsh-pty,
.de-sect-hd.dsh-cur,
.de-sect-hd.dsh-pay,
.de-sect-hd.dsh-gst,
.de-sect-hd.dsh-rmk {
  background: #f1f5f9 !important;
  color: #374151 !important;
  text-shadow: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 6px 13px 6px 11px !important;
  font-size: .70rem !important;
  font-weight: 800 !important;
  letter-spacing: .07em !important;
  border-left: 3px solid transparent !important;
}
.dsh-txn,
.dsh-pty,
.dsh-cur,
.dsh-gst,
.dsh-pay { border-left-color: #2563eb !important; }
.dsh-rmk  { border-left-color: #64748b !important; }

html.dark .de-sect-hd,
html.dark .de-sect-hd.dsh-txn,
html.dark .de-sect-hd.dsh-pty,
html.dark .de-sect-hd.dsh-cur,
html.dark .de-sect-hd.dsh-pay,
html.dark .de-sect-hd.dsh-gst,
html.dark .de-sect-hd.dsh-rmk {
  background: rgba(15,23,42,0.6) !important;
  color: #cbd5e1 !important;
  border-bottom-color: rgba(148,163,184,0.15) !important;
}

/* ── 9. Quotation section headers — same clean style ── */
.qsect-hd,
.qsect-hd.sh-basic,
.qsect-hd.sh-entry,
.qsect-hd.sh-chrg,
.qsect-hd.sh-pay,
.qsect-hd.sh-prev {
  background: #f1f5f9 !important;
  color: #374151 !important;
  text-shadow: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 6px 13px 6px 11px !important;
  font-size: .70rem !important;
  font-weight: 800 !important;
  letter-spacing: .07em !important;
  border-left: 3px solid transparent !important;
}
.sh-basic,
.sh-entry,
.sh-chrg,
.sh-pay { border-left-color: #2563eb !important; }
.sh-prev  { border-left-color: #64748b !important; }

/* ── 10. Quotation page — entry table matches deal entry ────── */
.etbl thead th {
  background: linear-gradient(135deg,#f8fafc,#f1f5f9) !important;
  padding: 7px 9px !important;
  font-size: .69rem !important;
  font-weight: 800 !important;
  color: #475569 !important;
  border-bottom: 2px solid #e2e8f0 !important;
  letter-spacing: .05em !important;
}
.etbl tbody td { padding: 5px 5px !important; }
.etbl select, .etbl input { height: 31px !important; padding: 0 8px !important; font-size: .8rem !important; }

.quot-bdf-wrap { overflow-x: hidden; border-radius: 8px; }
.quot-bdf-etbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.quot-bdf-etbl thead th { background: #f8fafc; padding: 5px 5px; font-size: 11px; font-weight: 700; font-variant-caps: all-small-caps; text-transform: none; color: #64748b; letter-spacing: .04em; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.quot-bdf-etbl tbody td { padding: 3px 4px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.quot-bdf-etbl tbody tr:last-child td { border-bottom: none; }
.quot-bdf-etbl .quot-row-num { font-size: 11px; font-weight: 600; color: #94a3b8; text-align: center; width: 26px; }
.quot-bdf-etbl select, .quot-bdf-etbl input { width: 100%; height: 34px; padding: 0 8px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 13px; font-weight: 500; color: #0f172a; background: #fff; box-sizing: border-box; appearance: auto; -webkit-appearance: auto; }
.quot-bdf-etbl select:focus, .quot-bdf-etbl input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
.quot-bdf-etbl input[readonly]:not(.inr-value) { background: #f8fafc; color: #16a34a; font-weight: 700; }
.quot-bdf-etbl input.inr-value { font-weight: 600; color: #0f172a; background: #eff6ff; border-color: #bfdbfe; }
.quot-act-cell { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: nowrap; }
.quot-ico-add { width: 28px; height: 28px; border-radius: 6px; border: none; cursor: pointer; background: #dcfce7; color: #166534; font-size: 14px; font-weight: 800; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.quot-ico-add:hover { filter: brightness(.95); }
.quot-ico-del { width: 30px; height: 30px; border-radius: 7px; border: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: #fee2e2; color: #dc2626; font-size: 13px; font-weight: 700; line-height: 1; flex-shrink: 0; }
.quot-ico-del:hover { filter: brightness(.95); }
.quot-addline { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; background: #fff; color: #2563eb; border: 1px dashed #93c5fd; border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .12s, border-color .12s; }
.quot-addline:hover { background: #eff6ff; border-color: #2563eb; }
.quot-addline svg { flex-shrink: 0; }

/* ── 11. Calendar pending task cards — priority colours ─────── */
/* Priority color border on task rows */
.card table tbody tr td:first-child { position: relative; }

/* Task rows inside calendar pending list */
.card .btn-danger.btn-sm.btn-delete + * { padding-left: 4px; }

/* Colourful activity priority indicators */
[data-priority="High"]   .fa-circle, .priority-high   { color: #dc2626 !important; }
[data-priority="Medium"] .fa-circle, .priority-medium { color: #f59e0b !important; }
[data-priority="Low"]    .fa-circle, .priority-low    { color: #16a34a !important; }

/* Calendar notification header */
.cal-notif-strip, .cal-notif {
  background: linear-gradient(135deg,#fef3c7,#fff7ed) !important;
  border: 1px solid #fde68a !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: .79rem !important;
  font-weight: 700 !important;
  color: #92400e !important;
}

/* KPI mini-cards inside calendar */
.value { font-size: 1.6rem !important; font-weight: 900 !important; }

/* ── 12. Dashboard recent transactions colourful badges ─────── */
.ccp-recent-row .badge,
.ccp-recent-row [class*="badge-"] {
  font-size: .68rem !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
}

/* ── 13. Opening Balance page ──────────────────────────────── */
/* Summary header gradient panel */
.ob-total-panel, [class*="opening-total"] {
  background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 50%, #06b6d4 100%) !important;
  color: #fff !important;
  border-radius: 14px !important;
  padding: 1rem 1.25rem !important;
}

/* ── 14. Adjustment report ─────────────────────────────────── */
/* Outstanding balance cards coloured by direction */
.adj-card-paid      { border-left: 4px solid #dc2626 !important; background: #fef2f2 !important; }
.adj-card-received  { border-left: 4px solid #16a34a !important; background: #f0fdf4 !important; }

/* ── 15. Page titles compact ───────────────────────────────── */
h1.ccp-page-title, .page-title, h1 {
  font-size: 1.1rem !important;
  font-weight: 900 !important;
  letter-spacing: -.02em !important;
  margin-bottom: .4rem !important;
}
.ccp-breadcrumb, .breadcrumb { font-size: .7rem !important; }

/* ── 16. "New transaction" / primary action button ─────────── */
.btn-new, a.btn-new,
button[class*="new-transaction"],
.btn[href*="deal_entry_v2.php"] {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: none !important;
  padding: 7px 18px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(79,70,229,.35) !important;
}

/* ── 17. Quotation – add a de-facto Payment section wrapper ── */
/* Already handled via .sh-pay above */
.quot-hd {
  background: linear-gradient(135deg,#4f46e5,#06b6d4) !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  margin-bottom: 12px !important;
}

/* ── 18. Section gap reduction ─────────────────────────────── */
.de-sect, .qsect { margin-bottom: 10px !important; }
.de-sect-body, .qsect-body { padding: 10px 12px !important; }

/* ── 19. Summary row (quotation charges) ───────────────────── */
.srow { padding: 3px 0 !important; font-size: .8rem !important; }
.slbl { font-size: .78rem !important; }
.sval { font-size: .82rem !important; font-weight: 700 !important; }
.sval.grand { font-size: .92rem !important; color: #1e40af !important; font-weight: 900 !important; }

/* ── 20. Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   RECENT TRANSACTIONS TABLE — compact & colourful
   Added to polish.css so it always loads correctly.
   ============================================================ */

#recentTxnCard {
  padding: 12px 14px !important;
}

.rtxn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.rtxn-title {
  margin: 0 !important;
  font-size: .9rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  border: none !important;
  padding: 0 !important;
}
.rtxn-viewall {
  font-size: .72rem;
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
}
.rtxn-viewall:hover { text-decoration: underline; }

/* Table wrapper — horizontal scroll on mobile */
.rtxn-wrap { overflow-x: auto; }

.rtxn-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  border: none !important;
  box-shadow: none !important;
}

/* Header */
.rtxn-tbl thead th {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
  padding: 7px 10px !important;
  font-size: .67rem !important;
  font-weight: 800 !important;
  letter-spacing: .07em !important;
  font-variant-caps: all-small-caps !important; text-transform: none !important;
  color: #64748b !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border-top: none !important;
  white-space: nowrap;
}
.rtxn-th-r { text-align: right !important; }

/* Rows */
.rtxn-tbl tbody td {
  padding: 7px 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
}
.rtxn-tbl tbody tr:last-child td { border-bottom: none !important; }

/* Row colour backgrounds */
.rtxn-sell   td { background: #fff5f5 !important; }
.rtxn-buy    td { background: #f0fff4 !important; }
.rtxn-acct   td { background: #f0f7ff !important; }
.rtxn-adjin  td { background: #fffdf0 !important; }
.rtxn-adjout td { background: #fff8f0 !important; }

.rtxn-tbl tbody tr:hover td {
  filter: brightness(.97);
}

/* Ref # link */
.rtxn-ref a {
  font-weight: 800 !important;
  color: #2563eb !important;
  text-decoration: none;
  font-size: .76rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.rtxn-ref a:hover { text-decoration: underline; }

/* Date */
.rtxn-date {
  color: #64748b !important;
  font-size: .75rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

/* Currency */
.rtxn-ccy {
  font-weight: 800 !important;
  font-size: .74rem !important;
  color: #475569 !important;
  letter-spacing: .04em;
}

/* Amount */
.rtxn-amt {
  font-weight: 900 !important;
  font-size: .83rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  text-align: right !important;
}
.rtxn-sell   .rtxn-amt { color: #dc2626 !important; }
.rtxn-buy    .rtxn-amt { color: #16a34a !important; }
.rtxn-acct   .rtxn-amt { color: #2563eb !important; }
.rtxn-adjin  .rtxn-amt { color: #d97706 !important; }
.rtxn-adjout .rtxn-amt { color: #f97316 !important; }

/* Type badges */
.rtxn-bdg {
  display: inline-block;
  font-size: .62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: .03em;
  font-variant-caps: all-small-caps; text-transform: none;
  white-space: nowrap;
}
.rtxn-bdg-sell   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.rtxn-bdg-buy    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.rtxn-bdg-acct   { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.rtxn-bdg-adjin  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.rtxn-bdg-adjout { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }

.rtxn-sub {
  font-size: .62rem;
  color: #64748b;
  font-weight: 600;
  margin-left: 4px;
}

/* Footer */
.rtxn-foot { margin-top: 10px; }
.rtxn-newbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff !important;
  font-size: .78rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(79,70,229,.3);
  transition: filter .15s, transform .12s;
}
.rtxn-newbtn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Dark mode */
html.dark .rtxn-tbl thead th { background: #1e293b !important; color: #94a3b8 !important; border-bottom-color: rgba(148,163,184,.25) !important; }
html.dark .rtxn-tbl tbody td { border-bottom-color: rgba(148,163,184,.1) !important; }
html.dark .rtxn-sell   td { background: rgba(220,38,38,.08) !important; }
html.dark .rtxn-buy    td { background: rgba(22,163,74,.08) !important; }
html.dark .rtxn-acct   td { background: rgba(37,99,235,.08) !important; }
html.dark .rtxn-adjin  td { background: rgba(245,158,11,.07) !important; }
html.dark .rtxn-adjout td { background: rgba(249,115,22,.07) !important; }
html.dark .rtxn-ref a  { color: #60a5fa !important; }
html.dark .rtxn-date, html.dark .rtxn-ccy { color: #94a3b8 !important; }
html.dark .rtxn-title  { color: #e2e8f0 !important; }


/* ============================================================
   PAYMENT GRID — IN / OUT directional layout
   ============================================================ */

/* Golden rule banner */
.de-pay-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg,#f0fdf4,#eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.de-pay-rule-eq {
  font-weight: 900;
  font-size: .82rem;
  letter-spacing: .01em;
  color: #0f172a;
}
.de-pay-in  { color: #16a34a; }
.de-pay-out { color: #dc2626; }
.de-pay-rule-note {
  font-size: .7rem;
  color: #64748b;
  font-weight: 600;
}

/* Grid wrapper */
.de-pay-grid-wrap { overflow-x: auto; margin-bottom: 10px; }

.de-pay-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: none !important;
}

.de-pay-grid thead th {
  padding: 8px 12px !important;
  font-size: .68rem !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  border-bottom: 2px solid #e2e8f0 !important;
}
.de-pay-in-hd  { background: #f0fdf4 !important; color: #166534 !important; text-align:center !important; }
.de-pay-out-hd { background: #fef2f2 !important; color: #991b1b !important; text-align:center !important; }
.de-pay-mode-lbl { background: #f8fafc !important; }

.de-pay-row td { padding: 6px 8px !important; border-bottom: 1px solid #f1f5f9 !important; }
.de-pay-mode {
  font-weight: 700;
  font-size: .79rem;
  color: #374151;
  white-space: nowrap;
  background: #f8fafc !important;
  padding: 6px 12px !important;
}

/* IN inputs — green tint */
.de-pay-inp-in {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
  font-weight: 700 !important;
  text-align: right;
}
.de-pay-inp-in:focus { border-color: #16a34a !important; box-shadow: 0 0 0 3px rgba(22,163,74,.15) !important; }

/* OUT inputs — red tint */
.de-pay-inp-out {
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  font-weight: 700 !important;
  text-align: right;
}
.de-pay-inp-out:focus { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

/* Total row */
.de-pay-total-row td { border-top: 2px solid #e2e8f0 !important; font-weight: 900 !important; }
.de-pay-in-total  { color: #166534 !important; font-size: .85rem !important; text-align:center !important; }
.de-pay-out-total { color: #991b1b !important; font-size: .85rem !important; text-align:center !important; }

/* Summary row */
.de-pay-summary-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 4px 0;
}
.de-pay-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.de-pay-sum-lbl {
  font-size: .67rem;
  font-weight: 700;
  color: #64748b;
  font-variant-caps: all-small-caps; text-transform: none;
  letter-spacing: .05em;
}
.de-pay-sum-val {
  font-size: .88rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.de-pay-sum-excess  { color: #16a34a !important; }
.de-pay-sum-shortfall { color: #dc2626 !important; }
.de-pay-sum-match   { color: #2563eb !important; }

/* Transactions table new columns */
.cash-in-cell  { color: #166634 !important; font-weight: 700 !important; }
.cash-out-cell { color: #991b1b !important; font-weight: 700 !important; }

/* ============================================================
   PHASE 3 — PROFESSIONAL GLOBAL REDESIGN
   Unified headers, colourful section separators, compact forms.
   ============================================================ */

/* ── 1. Page header strip — gradient accent bar ────────────── */
.ccp-page-header {
  border-left: 4px solid transparent !important;
  border-image: var(--brand-gradient) 1 !important;
  padding: 0.6rem 1rem !important;
  background: linear-gradient(90deg, rgba(79,70,229,.04) 0%, transparent 60%) !important;
}
.ccp-page-header__title {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
  letter-spacing: -.03em !important;
}
html.dark .ccp-page-header__title {
  background: linear-gradient(135deg,#818cf8,#22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── 2. Section sub-header (dt-subheader) — polished ──────── */
.dt-subheader {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: .5rem !important;
  padding: .6rem .9rem !important;
  border-bottom: 1px solid rgba(148,163,184,.15) !important;
  background: linear-gradient(90deg,rgba(79,70,229,.035) 0%,transparent 55%) !important;
}
.dt-section-title {
  font-size: .88rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  letter-spacing: -.01em !important;
  margin: 0 !important;
}
html.dark .dt-section-title { color: #e2e8f0 !important; }
html.dark .dt-subheader { background: linear-gradient(90deg,rgba(99,102,241,.07) 0%,transparent 55%) !important; border-color: rgba(148,163,184,.12) !important; }

/* ── 3. Report hero section — refined ─────────────────────── */
.ccp-report-hero {
  border-radius: 12px !important;
  border: 1px solid rgba(79,70,229,.12) !important;
  background: linear-gradient(135deg,rgba(79,70,229,.06) 0%,rgba(6,182,212,.04) 100%) !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: .75rem !important;
}
.ccp-report-hero--compact { padding: .75rem 1rem !important; }
.ccp-report-hero__eyebrow {
  font-size: .6rem !important; font-weight: 800 !important;
  font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .1em !important;
  color: #4f46e5 !important; display: block; margin-bottom: 3px;
}
.ccp-report-hero__title {
  font-size: 1.15rem !important; font-weight: 900 !important;
  color: #0f172a !important; letter-spacing: -.03em !important; margin: 0 !important;
}
.ccp-report-hero__desc { font-size: .79rem !important; color: #64748b !important; margin: 3px 0 0 !important; }
.ccp-report-hero__label { font-size: .62rem !important; font-weight: 700 !important; color: #94a3b8 !important; display:block; margin-bottom:2px; }
.ccp-report-hero__value { font-size: .88rem !important; font-weight: 900 !important; color: #0f172a !important; }
.ccp-report-hero__stat { text-align: center; }
html.dark .ccp-report-hero { background: linear-gradient(135deg,rgba(99,102,241,.1) 0%,rgba(8,145,178,.06) 100%) !important; border-color: rgba(99,102,241,.2) !important; }
html.dark .ccp-report-hero__title { color: #f1f5f9 !important; }
html.dark .ccp-report-hero__value { color: #e2e8f0 !important; }

/* ── 4. Filter bar / form — clean pill style ──────────────── */
.ccp-filter-form {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .5rem !important;
  align-items: flex-end !important;
}
.dt-filter-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  flex: 1 !important;
  min-width: 110px !important;
}
.dt-filter-field label {
  font-size: .6rem !important; font-weight: 800 !important;
  font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .07em !important;
  color: #64748b !important;
}
.dt-filter-field input, .dt-filter-field select {
  height: 32px !important; padding: 0 8px !important;
  font-size: .79rem !important; border-radius: 7px !important;
}

/* ── 5. Deal-entry section headers — per-section colors ──────
   Specificity: 0,2,1 — beats polish.css section 8 (0,1,1)
   but yields to inline html .deal-entry-card .de-sect-hd (0,3,1)
   so these only apply to quotation / other pages using .de-sect-hd */
.deal-entry-card .de-sect-hd.dsh-txn { border-left-color: #4f46e5 !important; }
.deal-entry-card .de-sect-hd.dsh-cur { border-left-color: #0891b2 !important; }
.deal-entry-card .de-sect-hd.dsh-pay { border-left-color: #7c3aed !important; }
.deal-entry-card .de-sect-hd.dsh-rmk { border-left-color: #64748b !important; }

/* ── 6. Badge colours — sharper ───────────────────────────── */
.badge-buy    { background: #dcfce7 !important; color: #14532d !important; border: 1px solid #86efac !important; font-weight: 800 !important; }
.badge-sell   { background: #fee2e2 !important; color: #7f1d1d !important; border: 1px solid #fca5a5 !important; font-weight: 800 !important; }
.badge-account{ background: #dbeafe !important; color: #1e3a8a !important; border: 1px solid #93c5fd !important; font-weight: 800 !important; }
.badge-adjustment { background: #fef3c7 !important; color: #78350f !important; border: 1px solid #fcd34d !important; font-weight: 800 !important; }
.badge-in     { background: #d1fae5 !important; color: #064e3b !important; border: 1px solid #6ee7b7 !important; font-weight: 800 !important; }
.badge-out    { background: #ffe4e6 !important; color: #881337 !important; border: 1px solid #fda4af !important; font-weight: 800 !important; }

/* ── 7. Table row color accents for report pages ─────────── */
.row-buy    td { border-left: 2px solid #86efac !important; }
.row-sell   td { border-left: 2px solid #fca5a5 !important; }
.row-account td { border-left: 2px solid #93c5fd !important; }
.row-adjustment-in  td { border-left: 2px solid #6ee7b7 !important; }
.row-adjustment-out td { border-left: 2px solid #fda4af !important; }
/* Only apply to first td to avoid double border */
.row-buy    td + td, .row-sell    td + td,
.row-account td + td, .row-adjustment-in  td + td,
.row-adjustment-out td + td { border-left: none !important; }

/* ── 8. Cards — subtle gradient top border ────────────────── */
.card::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--brand-gradient);
  border-radius: 12px 12px 0 0;
  margin: -0.85rem -1rem 0.75rem;
  opacity: 0;
  transition: opacity .2s;
}
.card:hover::before { opacity: 1; }

/* ── 9. Success/danger text colours ────────────────────────── */
.text-success { color: #16a34a !important; }
.text-danger  { color: #dc2626 !important; }

/* ── 10. Compact action row alignment ─────────────────────── */
.dt-actions-right {
  display: flex !important;
  align-items: center !important;
  gap: .4rem !important;
  flex-wrap: wrap !important;
}

/* ── 11. Dark mode: report hero + filter bar ──────────────── */
html.dark .rpt-stat-card { background: #1e293b !important; border-color: #334155 !important; }
html.dark .rpt-stat-card .sc-value { color: #f1f5f9 !important; }
html.dark .rpt-filter-bar { background: #0f172a !important; border-color: #334155 !important; }
html.dark .rpt-filter-field input, html.dark .rpt-filter-field select { background: #1e293b !important; border-color: #475569 !important; color: #e2e8f0 !important; }

/* ════════════════════════════════════════════════════════════════════════
   PHASE 4 — GLOBAL PAGE POLISH (All Report + Utility Pages)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page header: tighter ───────────────────────────────────────────── */
.ccp-page-header { padding: .75rem 0 .85rem !important; }
.ccp-page-header__breadcrumb { font-size: .67rem !important; margin-bottom: .2rem !important; opacity: .75; }
.ccp-page-header__title { font-size: 1.45rem !important; font-weight: 900 !important; letter-spacing: -.03em !important; line-height: 1.1 !important; }

/* ── Compact filter bars ────────────────────────────────────────────── */
.rpt-filter-bar { padding: .6rem .9rem !important; gap: .4rem !important; }
.rpt-filter-field { display: flex; flex-direction: column; gap: 2px; }
.rpt-filter-field label { font-size: .6875rem !important; font-weight: 700 !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .05em !important; color: #64748b !important; margin: 0 !important; }
.rpt-filter-field input,
.rpt-filter-field select,
.rpt-filter-bar input[type="text"],
.rpt-filter-bar input[type="date"],
.rpt-filter-bar input[type="number"],
.rpt-filter-bar select {
  height: 34px !important; padding: 0 10px !important;
  font-size: .8125rem !important; font-weight: 500 !important;
  border: 1px solid #e2e8f0 !important; border-radius: 8px !important;
  background: #fff !important; color: #1e293b !important;
}
.rpt-filter-field input:focus,
.rpt-filter-field select:focus { border-color: #6366f1 !important; box-shadow: 0 0 0 2px rgba(99,102,241,.1) !important; outline: none !important; }

/* ── Compact stat strip ─────────────────────────────────────────────── */
.rpt-stat-strip { gap: .45rem !important; margin-bottom: .65rem !important; }
.rpt-stat-card { border-radius: 10px !important; padding: .55rem .85rem !important; }
.rpt-stat-card .sc-label { font-size: .58rem !important; margin-bottom: 1px !important; }
.rpt-stat-card .sc-value { font-size: .9rem !important; font-weight: 900 !important; letter-spacing: -.02em !important; }

/* ── Tables: compact + consistent ──────────────────────────────────── */
.table-scroll, .table-container {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 10px; border: 1px solid rgba(148,163,184,.18);
}
.table { font-size: .76rem !important; }
.table thead th {
  background: #f1f5f9 !important;
  font-size: .61rem !important; font-weight: 800 !important;
  font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .07em !important;
  color: #475569 !important; padding: 5px 9px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  white-space: nowrap; vertical-align: middle !important;
}
.table tbody td {
  padding: 5px 9px !important; vertical-align: middle !important;
  border-bottom: 1px solid rgba(241,245,249,.8) !important;
  font-size: .76rem !important; color: #1e293b !important;
}
.table tbody tr:last-child td { border-bottom: none !important; }
.table tbody tr:hover td { background: rgba(99,102,241,.025) !important; }
.table tfoot td {
  padding: 5px 9px !important; font-size: .76rem !important;
  font-weight: 800 !important; border-top: 2px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card { border-radius: 12px !important; border: 1px solid rgba(148,163,184,.18) !important; box-shadow: 0 1px 6px rgba(15,23,42,.04) !important; }
.card-body { padding: .9rem 1rem !important; }
.card-header { padding: .65rem 1rem !important; font-size: .78rem !important; font-weight: 700 !important; border-bottom: 1px solid rgba(148,163,184,.18) !important; background: #f8fafc !important; border-radius: 12px 12px 0 0 !important; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn { font-size: .77rem !important; font-weight: 700 !important; border-radius: 8px !important; letter-spacing: .01em !important; }
.btn-sm { height: 30px !important; font-size: .72rem !important; padding: 0 11px !important; border-radius: 7px !important; }
.btn-xs, .btn.btn-xs { height: 24px !important; font-size: .64rem !important; padding: 0 8px !important; border-radius: 6px !important; }
.btn-lg { height: 40px !important; font-size: .84rem !important; padding: 0 20px !important; border-radius: 9px !important; }

/* ── Form controls ──────────────────────────────────────────────────── */
.form-control, .form-select {
  height: 34px !important; font-size: .8125rem !important;
  border-radius: 8px !important; border: 1px solid #e2e8f0 !important;
  padding: 0 10px !important; color: #1e293b !important;
}
textarea.form-control { height: auto !important; padding: 7px 10px !important; }
.form-control:focus, .form-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1) !important; outline: none !important;
}
.form-label { font-size: .6875rem !important; font-weight: 700 !important; color: #64748b !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .05em !important; margin-bottom: 3px !important; }

/* ── Headings rhythm ────────────────────────────────────────────────── */
h2 { font-size: 1.25rem !important; font-weight: 900 !important; letter-spacing: -.02em !important; }
h3 { font-size: 1.05rem !important; font-weight: 800 !important; }
h4 { font-size: .88rem !important; font-weight: 800 !important; }
h5 { font-size: .76rem !important; font-weight: 800 !important; }
h6 { font-size: .68rem !important; font-weight: 800 !important; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge { font-size: .61rem !important; font-weight: 800 !important; padding: 2px 7px !important; border-radius: 999px !important; letter-spacing: .03em !important; }

/* ── Alerts / notices ───────────────────────────────────────────────── */
.notice, .alert { font-size: .77rem !important; padding: 7px 11px !important; border-radius: 8px !important; }

/* ── Summary page stat table headers ───────────────────────────────── */
.ccp-summary-table th { background: #f1f5f9 !important; font-size: .61rem !important; font-weight: 800 !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .07em !important; color: #475569 !important; }
.ccp-summary-table td { font-size: .76rem !important; }

/* ── Daily report compact ───────────────────────────────────────────── */
.ccp-report-page .table-scroll td { font-size: .74rem !important; }
.ccp-report-page .table-scroll th { font-size: .61rem !important; }

/* ── Report tabs: tighter ───────────────────────────────────────────── */
.rpt-tab { padding: 8px 16px !important; font-size: .76rem !important; }

/* ── Currency stock page ────────────────────────────────────────────── */
.stock-up   { color: #16a34a !important; font-weight: 700 !important; }
.stock-down { color: #dc2626 !important; font-weight: 700 !important; }

/* ── Denominations: remove excess nesting ──────────────────────────── */
.denom-table-wrap { border-radius: 10px; overflow: hidden; }
.denom-box { border-radius: 8px !important; padding: 6px 10px !important; font-size: .76rem !important; }

/* ── Quotation page ─────────────────────────────────────────────────── */
.etbl thead th { font-size: .61rem !important; font-weight: 800 !important; }
.etbl tbody td { font-size: .75rem !important; }

/* ── Calendar page ──────────────────────────────────────────────────── */
.calendar-grid th { font-size: .6rem !important; font-weight: 800 !important; padding: 5px 6px !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .06em !important; }
.calendar-grid td { font-size: .7rem !important; padding: 5px 6px !important; vertical-align: top !important; }
.cal-day-num { font-size: .68rem !important; font-weight: 800 !important; }
.cal-event, .cal-amount { font-size: .61rem !important; }

/* ── Dashboard ──────────────────────────────────────────────────────── */
.dash-kpi-card, .summary-kpi { border-radius: 12px !important; padding: .75rem 1rem !important; }
.dash-kpi-label { font-size: .59rem !important; font-weight: 800 !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .08em !important; color: #94a3b8 !important; }
.dash-kpi-value { font-size: 1.3rem !important; font-weight: 900 !important; letter-spacing: -.03em !important; }

/* ── Holding cost ───────────────────────────────────────────────────── */
.hc-row { font-size: .76rem !important; }
.hc-label { font-size: .65rem !important; font-weight: 700 !important; color: #64748b !important; }

/* ── Opening balance ────────────────────────────────────────────────── */
.ob-table th { font-size: .61rem !important; }
.ob-table td { font-size: .75rem !important; padding: 4px 7px !important; }

/* ── Dark mode ──────────────────────────────────────────────────────── */
html.dark .table thead th { background: #1e293b !important; color: #94a3b8 !important; border-bottom-color: #334155 !important; }
html.dark .table tbody td { border-bottom-color: #1e293b !important; color: #e2e8f0 !important; }
html.dark .table tbody tr:hover td { background: rgba(99,102,241,.05) !important; }
html.dark .table tfoot td { background: #1e293b !important; border-top-color: #334155 !important; color: #e2e8f0 !important; }
html.dark .table-scroll,
html.dark .table-container { border-color: #334155 !important; }
html.dark .card { background: #1e293b !important; border-color: #334155 !important; }
html.dark .card-body { background: transparent !important; }
html.dark .card-header { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
html.dark .form-control,
html.dark .form-select { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
html.dark .form-label { color: #94a3b8 !important; }
html.dark h2, html.dark h3, html.dark h4, html.dark h5 { color: #f1f5f9 !important; }
html.dark .rpt-tab { color: #94a3b8 !important; }
html.dark .rpt-tab.active { color: #818cf8 !important; border-bottom-color: #818cf8 !important; }
html.dark .ccp-summary-table th { background: #1e293b !important; color: #94a3b8 !important; }

/* ── Summary highlight cells ────────────────────────────────────────── */
.th-highlight { background: #fef3c7 !important; color: #92400e !important; font-weight: 800 !important; }
.td-highlight { background: #fef9c3 !important; color: #78350f !important; font-weight: 700 !important; }
html.dark .th-highlight { background: rgba(245,158,11,.2) !important; color: #fcd34d !important; }
html.dark .td-highlight { background: rgba(245,158,11,.1) !important; color: #fcd34d !important; }

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  PHASE 5 — Admin / Management pages  (settings, users, companies)  ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

/* ── Card compact ───────────────────────────────────────────────────── */
.card.card-compact { padding: .75rem 1rem !important; margin-bottom: .6rem !important; }
.card h3 { font-size: .92rem !important; font-weight: 900 !important; margin: 0 0 .55rem !important; }
.card > p.text-muted { font-size: .78rem !important; margin-bottom: .55rem !important; }

/* ── Modal compact ──────────────────────────────────────────────────── */
.modal-content { padding: 1.25rem 1.5rem !important; border-radius: 12px !important; }
.modal-header { margin-bottom: 1rem !important; padding-bottom: .65rem !important; border-bottom: 1px solid #e2e8f0 !important; }
.modal-header h3 { font-size: .95rem !important; font-weight: 900 !important; margin: 0 !important; }
html.dark .modal-content { background: #1e293b !important; border: 1px solid #334155 !important; }
html.dark .modal-header { border-bottom-color: #334155 !important; }
html.dark .modal-header h3 { color: #f1f5f9 !important; }

/* ── Form groups ────────────────────────────────────────────────────── */
.form-group { margin-bottom: .7rem !important; }
.form-group label { display: block !important; font-size: .72rem !important; font-weight: 700 !important; color: #64748b !important; margin-bottom: .25rem !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .03em !important; }
.form-group input, .form-group select, .form-group textarea { width: 100% !important; box-sizing: border-box !important; }

/* ── Badge role variants ─────────────────────────────────────────────── */
.badge { display: inline-block !important; padding: .2rem .55rem !important; border-radius: 6px !important; font-size: .65rem !important; font-weight: 800 !important; line-height: 1.4 !important; }
.badge-admin    { background: #ede9fe !important; color: #5b21b6 !important; }
.badge-user     { background: #dbeafe !important; color: #1e40af !important; }
.badge-view     { background: #f1f5f9 !important; color: #475569 !important; }
.badge-active   { background: #d1fae5 !important; color: #065f46 !important; }
.badge-inactive { background: #fee2e2 !important; color: #991b1b !important; }
.badge-account  { background: #e0f2fe !important; color: #0369a1 !important; }
html.dark .badge-admin    { background: rgba(139,92,246,.18) !important; color: #c4b5fd !important; }
html.dark .badge-user     { background: rgba(59,130,246,.18) !important; color: #93c5fd !important; }
html.dark .badge-view     { background: rgba(100,116,139,.18) !important; color: #94a3b8 !important; }
html.dark .badge-active   { background: rgba(16,185,129,.18) !important; color: #6ee7b7 !important; }
html.dark .badge-inactive { background: rgba(239,68,68,.18) !important; color: #fca5a5 !important; }
html.dark .badge-account  { background: rgba(14,165,233,.18) !important; color: #7dd3fc !important; }

/* ── btn-edit / btn-toggle / btn-delete compact ─────────────────────── */
.btn-edit, .btn-toggle, .btn-delete {
  display: inline-flex !important; align-items: center !important; height: 26px !important;
  padding: 0 10px !important; border-radius: 6px !important; font-size: .68rem !important;
  font-weight: 700 !important; cursor: pointer !important; border: none !important;
}
.btn-edit   { background: #dbeafe !important; color: #1e40af !important; }
.btn-toggle { background: #fef9c3 !important; color: #78350f !important; }
.btn-delete { background: #fee2e2 !important; color: #991b1b !important; }
html.dark .btn-edit   { background: rgba(59,130,246,.18) !important; color: #93c5fd !important; }
html.dark .btn-toggle { background: rgba(245,158,11,.15) !important; color: #fcd34d !important; }
html.dark .btn-delete { background: rgba(239,68,68,.15) !important; color: #fca5a5 !important; }

/* ── Table section subtitle header ─────────────────────────────────── */
.dt-subheader { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: .5rem .75rem !important; background: #f8fafc !important; border-bottom: 1px solid #e2e8f0 !important; margin-bottom: 0 !important; }
.dt-section-title { font-size: .82rem !important; font-weight: 900 !important; color: #1e293b !important; margin: 0 !important; display: flex !important; align-items: center !important; gap: .35rem !important; }
html.dark .dt-subheader { background: #0f172a !important; border-bottom-color: #334155 !important; }
html.dark .dt-section-title { color: #e2e8f0 !important; }

/* ── modern-table ───────────────────────────────────────────────────── */
.modern-table { width: 100% !important; border-collapse: collapse !important; }
.modern-table thead th { background: #f1f5f9 !important; font-size: .61rem !important; font-weight: 800 !important; font-variant-caps: all-small-caps !important; text-transform: none !important; letter-spacing: .04em !important; padding: 5px 9px !important; border-bottom: 2px solid #e2e8f0 !important; color: #64748b !important; }
.modern-table tbody td { padding: 5px 9px !important; font-size: .77rem !important; border-bottom: 1px solid #f1f5f9 !important; vertical-align: middle !important; }
.modern-table tbody tr:hover td { background: #f8fafc !important; }
html.dark .modern-table thead th { background: #1e293b !important; color: #94a3b8 !important; border-bottom-color: #334155 !important; }
html.dark .modern-table tbody td { border-bottom-color: #1e293b !important; color: #e2e8f0 !important; }
html.dark .modern-table tbody tr:hover td { background: rgba(99,102,241,.05) !important; }

/* ── Empty state cells ──────────────────────────────────────────────── */
.empty-state-cell { padding: 24px 0 !important; text-align: center !important; color: #9ca3af !important; font-size: .8rem !important; }
.empty-state-cell svg { opacity: .35; display: block; margin: 0 auto 6px; }

/* ── Action buttons bar ─────────────────────────────────────────────── */
.action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ── Card spacing ───────────────────────────────────────────────────── */
.card + .card { margin-top: .5rem !important; }

/* ── Topbar SVG icons inherit color correctly ───────────────────────── */
.de-topbar-clean svg, .de-tb-nav-btn svg, .de-tb-btn svg { vertical-align: middle; flex-shrink: 0; }

/* ── Deal Entry: hide page header in edit/view mode ─────────────────── */
body.de-mode-edit .ccp-page-header,
body.de-mode-view .ccp-page-header { display: none !important; }

/* ── Party combobox ─────────────────────────────────────────────────── */
.party-combo-wrap { position: relative; }
.party-combo-input { width: 100%; padding: 5px 9px; border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: .8rem; background: #fff; color: #1e293b; }
.party-combo-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.party-combo-drop { position: absolute; top: 100%; left: 0; right: 0; z-index: 600; background: #fff; border: 1.5px solid #e2e8f0; border-top: none; border-radius: 0 0 8px 8px; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.party-combo-item { padding: 7px 11px; font-size: .78rem; cursor: pointer; color: #1e293b; border-bottom: 1px solid #f1f5f9; }
.party-combo-item:last-child { border-bottom: none; }
.party-combo-item:hover, .party-combo-item.is-active { background: #f0f9ff; color: #0369a1; }
.party-combo-item .pci-name { font-weight: 700; }
.party-combo-item .pci-meta { font-size: .67rem; color: #94a3b8; margin-top: 1px; }
.party-combo-empty { padding: 10px 11px; font-size: .78rem; color: #9ca3af; font-style: italic; }
html.dark .party-combo-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .party-combo-drop { background: #1e293b; border-color: #334155; }
html.dark .party-combo-item { color: #e2e8f0; border-bottom-color: #334155; }
html.dark .party-combo-item:hover, html.dark .party-combo-item.is-active { background: rgba(14,165,233,.1); color: #7dd3fc; }

/* ── Payment balance indicator ──────────────────────────────────────── */
.de-pay-balance-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; margin-left: .5rem; }
.de-pay-balance-badge.bal-zero { background: #d1fae5; color: #065f46; }
.de-pay-balance-badge.bal-remain { background: #fef3c7; color: #92400e; }
.de-pay-balance-badge.bal-excess { background: #fee2e2; color: #991b1b; }
