/**
 * 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 — single brand gradient */
.btn-primary,
.btn-indigo,
.ccp-actions .btn-primary {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled),
.btn-indigo:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35) !important;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 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;
  text-transform: uppercase;
  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: 600 !important;
  font-size: var(--fs-label) !important;
  color: var(--gray-700) !important;
  letter-spacing: 0.01em;
}

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; }

/* ── 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.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;
  text-transform: uppercase !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;
  text-transform: uppercase;
  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;
  text-transform: uppercase;
  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: #166534 !important; font-weight: 700 !important; }
.cash-out-cell { color: #991b1b !important; font-weight: 700 !important; }
