/* ===================================================================
   Swadesh IT — Enterprise Client Portal Design System (v2.0 Overhaul)
   Aesthetics: Ultra-Modern Corporate Executive (Slate/Indigo/Emerald)
   Inspired by Stripe Customer Portal, Linear & Mercury Bank
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Canvas & Surfaces */
  --bg-app: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-sidebar-card: #1e293b;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #4f46e5;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Accents */
  --brand-navy: #0f172a;
  --brand-indigo: #4f46e5;
  --brand-indigo-light: #eef2ff;
  --brand-blue: #2563eb;

  /* Status Colors */
  --emerald: #059669;
  --emerald-vibrant: #10b981;
  --emerald-light: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-text: #065f46;

  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #92400e;

  --rose: #e11d48;
  --rose-light: #fff1f2;
  --rose-border: #fecdd3;
  --rose-text: #9f1239;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.16);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Sidebar Width */
  --sidebar-w: 280px;
  --header-h: 70px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.15s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ── App Shell Structure (Sidebar + Main) ── */
.portal-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ── Fixed Sidebar ── */
.portal-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-sidebar-head {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.portal-sidebar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
}

.portal-brand-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.portal-brand-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--emerald-vibrant);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.portal-brand-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--emerald-vibrant);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-vibrant);
}

/* Client Workspace Chip in Sidebar */
.portal-client-chip {
  margin: 16px 16px 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.portal-client-avatar.has-logo {
  background: #ffffff;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.portal-client-avatar-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 7px;
  display: block;
}

.portal-client-meta {
  overflow: hidden;
  flex: 1;
}

.portal-client-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.portal-client-id {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
  letter-spacing: 0.03em;
}

/* Sidebar Navigation Items */
.portal-sidebar-nav {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.portal-nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-nav-item i {
  font-size: 17px;
  color: #64748b;
  transition: color 0.2s ease;
}

.portal-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.portal-nav-item:hover i {
  color: #ffffff;
}

.portal-nav-item.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.25) 0%, rgba(79, 70, 229, 0.08) 100%);
  color: #ffffff;
  font-weight: 700;
  border-left: 3px solid #6366f1;
}

.portal-nav-item.active i {
  color: #818cf8;
}

.portal-nav-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.portal-nav-badge.danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Sidebar Footer & Support */
.portal-sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.portal-support-box {
  background: var(--bg-sidebar-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.support-box-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.support-box-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 8px;
}

.support-box-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--emerald-vibrant);
}

.support-box-link:hover {
  text-decoration: underline;
}

.portal-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portal-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ffffff;
  border-color: #ef4444;
}

/* ── Main Canvas Layout ── */
.portal-main-canvas {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-app);
  /* Use clip not hidden — preserves scroll context for table-wrap */
  overflow-x: clip;
}

/* Sticky App Bar */
.portal-topbar {
  height: var(--header-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.mobile-menu-trigger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-main);
  cursor: pointer;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-breadcrumb span.current {
  color: var(--text-main);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
}

.live-sync-pill .dot {
  width: 6px;
  height: 6px;
  background: #3b82f6;
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 6px #3b82f6;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* ── Inner Content Container ── */
.portal-content-body {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Executive Hero Card ── */
.exec-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #1e293b 100%);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.25);
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.exec-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(16, 185, 129, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(20px);
}

.exec-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 10px;
}

.exec-hero-title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.exec-hero-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  max-width: 100%;
  line-height: 1.6;
  word-break: break-word;
}

.exec-hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.exec-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Hero left content — must have min-width:0 in flex context */
.exec-hero-content {
  flex: 1;
  min-width: 0;
}

/* Hero CTA Buttons */
.exec-hero-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}

/* Invoices Controls Bar */
.invoices-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.invoices-filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.invoices-status-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Ledger page header */
.ledger-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ledger-summary-pills {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Urgent Action Card (When Dues Exist) ── */
.urgent-due-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 6px solid #d97706;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.08);
}

.urgent-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.urgent-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fde68a;
  color: #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.urgent-title {
  font-size: 16px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 2px;
}

.urgent-text {
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

/* ── KPI Grid & Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: var(--shadow-xs);
}

.kpi-icon-box.indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.kpi-icon-box.emerald {
  background: #ecfdf5;
  color: #059669;
}

.kpi-icon-box.amber {
  background: #fffbeb;
  color: #d97706;
}

.kpi-icon-box.purple {
  background: #faf5ff;
  color: #9333ea;
}

.kpi-num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  overflow: hidden;
}

/* ── Modern Card Container ── */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  overflow: hidden;
}

.dash-card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Filter Segmented Tabs ── */
.segmented-control {
  display: inline-flex;
  padding: 4px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.segmented-btn {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.segmented-btn:hover {
  color: var(--text-main);
}

.segmented-btn.active {
  background: #ffffff;
  color: var(--brand-navy);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Modern Interactive Tables ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.exec-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13.5px;
}

.exec-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.exec-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
  background: #ffffff;
  transition: background 0.15s ease;
  word-wrap: break-word;
}

.exec-table tbody tr:hover td {
  background: #f8fafc;
}

.exec-table tr:last-child td {
  border-bottom: none;
}

/* ── Status Pills (High Polish) ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
}

.pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pill-paid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pill-paid .pill-dot {
  background: #16a34a;
}

.pill-due,
.pill-unpaid {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pill-due .pill-dot,
.pill-unpaid .pill-dot {
  background: #dc2626;
}

.pill-partial {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pill-partial .pill-dot {
  background: #d97706;
}

.pill-pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pill-pending .pill-dot {
  background: #d97706;
}

.pill-review {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pill-review .pill-dot {
  background: #0284c7;
}

.pill-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ── Modern Buttons ── */
.btn-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-ui-primary {
  background: var(--brand-indigo);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-ui-primary:hover {
  background: #4338ca;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-ui-emerald {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-ui-emerald:hover {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

.btn-ui-outline {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn-ui-outline:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
}

.btn-ui-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
  gap: 5px;
  flex-shrink: 0;
}

/* Actions Group inside Tables */
.exec-actions-group {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* ── Ultra-Sleek Bangla QR Checkout Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal-overlay.show .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-dialog.modal-dialog-pay {
  max-width: 440px;
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Sleek Minimal Header */
.qr-modal-top {
  background: #ffffff;
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.qr-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08);
}

.qr-title-group {
  display: flex;
  flex-direction: column;
}

.qr-modal-heading {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.qr-modal-subheading {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin: 2px 0 0;
  letter-spacing: -0.005em;
}

.qr-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.qr-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
  transform: rotate(90deg);
}

/* Modal Body */
.qr-simple-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

/* Supported Payment Networks Card */
.qr-networks-strip-card {
  margin-bottom: 14px;
  text-align: center;
}

.qr-networks-caption {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 5px;
}

.qr-networks-banner {
  width: 100%;
  max-width: 350px;
  height: auto;
  max-height: 35px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* QR Code Image Viewfinder */
.qr-simple-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.qr-viewfinder {
  position: relative;
  display: inline-block;
  background: #ffffff;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.qr-viewfinder-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: #059669;
  border-style: solid;
  pointer-events: none;
}

.qr-viewfinder-corner.tl {
  top: 4px;
  left: 4px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 6px;
}

.qr-viewfinder-corner.tr {
  top: 4px;
  right: 4px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 6px;
}

.qr-viewfinder-corner.bl {
  bottom: 4px;
  left: 4px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 6px;
}

.qr-viewfinder-corner.br {
  bottom: 4px;
  right: 4px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 6px;
}

.qr-code-img {
  width: 200px;
  height: 200px;
  display: block;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.qr-scan-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
}

.qr-scan-guide i {
  color: #15803d;
  font-size: 13px;
}

/* Fixed Amount Display Row */
.qr-simple-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 14px;
  margin-bottom: 8px;
}

.qr-simple-amount-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-simple-amount-value {
  font-size: 18px;
  font-weight: 900;
  color: #059669;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* Clean Unified Form Groups (Amount & TrxID) */
.qr-form-field-group {
  margin-bottom: 8px !important;
}

.qr-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.qr-label-row .ui-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  cursor: pointer;
}

.qr-field-hint {
  font-size: 10.5px;
  font-weight: 500;
  color: #94a3b8;
}

.qr-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.qr-input-prefix-icon {
  position: absolute;
  left: 11px;
  width: 18px;
  font-size: 16px;
  font-weight: 800;
  color: #059669;
  pointer-events: none;
  line-height: 1;
  font-family: var(--font-heading), -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.qr-input-hash-icon,
.trx-hash-icon {
  position: absolute;
  left: 11px;
  width: 18px;
  font-size: 15px;
  color: #94a3b8;
  pointer-events: none;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.qr-clean-input {
  width: 100% !important;
  height: 38px !important;
  padding: 6px 12px 6px 36px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  font-family: var(--font-body) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
}

.qr-clean-input:focus {
  background: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12) !important;
  outline: none !important;
}

.qr-clean-input::placeholder {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  color: #94a3b8 !important;
  text-transform: none !important;
}

.qr-clean-input::-webkit-outer-spin-button,
.qr-clean-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qr-clean-input[type=number] {
  -moz-appearance: textfield;
}

.qr-clean-input.trx-input,
.trx-input {
  width: 100% !important;
  height: 38px !important;
  padding-left: 36px !important;
  padding-right: 76px !important;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0f172a;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.trx-input:focus {
  background: #ffffff;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
  outline: none;
}

.trx-input::placeholder {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  color: #94a3b8;
  text-transform: none !important;
}

.btn-paste-trx {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  padding: 0 9px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-paste-trx:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Submit Button */
.btn-submit-payment {
  width: fit-content;
  margin: 12px auto 0;
  height: 44px;
  padding: 0 32px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}

.btn-submit-payment:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-submit-payment:hover .qr-btn-arrow {
  transform: translateX(4px);
}

.btn-submit-payment:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-submit-payment:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.qr-btn-icon {
  font-size: 16px;
}

.qr-btn-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}



@media (max-width: 520px) {
  .modal-overlay {
    padding: 12px;
    align-items: center;
  }

  .modal-dialog.modal-dialog-pay {
    max-width: 100%;
    width: 100%;
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .qr-simple-body {
    padding: 12px 14px 20px;
    gap: 8px;
  }

  .qr-code-img {
    width: 190px;
    height: 190px;
  }

  /* Network banner strip — smaller */
  .qr-networks-banner {
    max-height: 26px;
  }

  .qr-networks-strip-card {
    margin-bottom: 8px;
  }

  /* Scan guide pill — compact */
  .qr-scan-guide {
    font-size: 12px;
    padding: 4px 11px;
    gap: 5px;
  }

  /* Amount display row — compact */
  .qr-simple-amount-row {
    padding: 6px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
  }

  .qr-simple-amount-label {
    font-size: 10px;
  }

  .qr-simple-amount-value {
    font-size: 16px;
  }

  /* Form field groups — tighter spacing */
  .qr-form-field-group {
    margin-bottom: 6px !important;
  }

  .qr-label-row {
    margin-bottom: 2px;
  }

  .qr-label-row .ui-label {
    font-size: 11px;
  }

  .qr-field-hint {
    font-size: 9.5px;
  }

  /* Inputs — shorter height */
  .qr-clean-input {
    height: 36px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    padding: 5px 10px 5px 34px !important;
  }

  .qr-clean-input.trx-input,
  .trx-input {
    height: 36px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    padding-left: 34px !important;
    padding-right: 72px !important;
  }

  .qr-clean-input::placeholder,
  .trx-input::placeholder {
    font-size: 11.5px !important;
  }

  /* Paste button — shorter to match input */
  .btn-paste-trx {
    height: 24px;
    font-size: 10px;
    padding: 0 7px;
  }

  /* Submit button — slightly shorter */
  .btn-submit-payment {
    height: 40px;
    font-size: 13px;
    border-radius: 8px;
  }
}

/* Modern Form Elements */
.ui-form-group {
  margin-bottom: 16px;
}

.ui-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.ui-input,
.ui-select {
  width: 100%;
  padding: 11px 14px;
  font-size: 13.5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.ui-input:focus,
.ui-select:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ── Minimalist Corporate Document Design (Invoice & Receipt) ── */
.sheet-container {
  max-width: 880px;
  margin: 0 auto;
}

.invoice-paper {
  background: #ffffff;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 40px 48px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin-bottom: 40px;
  position: relative;
}

/* Dedicated Receipt Paper Styling */
.receipt-paper,
.invoice-paper.receipt-paper {
  background-image: linear-gradient(135deg, lightyellow, #ffffff, lavender, lightyellow);
}

/* Header / Letterhead */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  gap: 24px;
}

.doc-brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  margin-bottom: 8px;
  display: block;
}

.doc-company-name {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.doc-company-details {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 3px;
}

/* Document Title & Meta Block */
.doc-meta {
  text-align: right;
  min-width: 260px;
}

.doc-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 4px;
}

.doc-number {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
}

.doc-meta-table {
  display: inline-table;
  font-size: 12px;
  border-collapse: collapse;
}

.doc-meta-table td {
  padding: 2.5px 0;
  line-height: 1.4;
}

.doc-meta-table td.label {
  color: #64748b;
  padding-right: 14px;
  text-align: right;
  font-weight: 500;
}

.doc-meta-table td.val {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
}

/* Clean Status Badges */
.doc-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2.5px 9px;
  border-radius: 4px;
}

.doc-status-paid {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.doc-status-due {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.doc-status-partial {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Two-Column Party Context */
.doc-parties {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr);
  gap: 32px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
  align-items: start;
}

.doc-party-col {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.doc-party-col h4 {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.doc-party-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.doc-party-info {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

/* Key-Value Details Table for Invoice & Receipt Context */
.doc-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.doc-details-table td {
  padding: 3px 0;
  line-height: 1.45;
  vertical-align: top;
}

.doc-details-table td.label {
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  padding-right: 12px;
  width: 105px;
  text-align: left;
}

.doc-details-table td.val {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  word-break: normal;
}

/* Line Items Table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.doc-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}

.doc-table th.num,
.doc-table td.num {
  text-align: right;
}

.doc-table th.center,
.doc-table td.center {
  text-align: center;
}

.doc-table td {
  padding: 12px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px;
  color: #334155;
  vertical-align: top;
}

.doc-item-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 13px;
  margin-bottom: 2px;
}

.doc-item-sub {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

/* Financials & Totals */
.doc-financials {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 22px;
}

.doc-financials-left {
  flex: 1;
}

.doc-words-box {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
  padding: 9px 12px;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 0 4px 4px 0;
}

.doc-words-box strong {
  color: #0f172a;
}

.doc-totals-table {
  width: 320px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.doc-totals-table td {
  padding: 5px 10px;
  line-height: 1.4;
}

.doc-totals-table td.label {
  color: #64748b;
  text-align: left;
}

.doc-totals-table td.val {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

.doc-totals-table tr.total-row td {
  border-top: 1px solid #cbd5e1;
  border-bottom: 2px solid #0f172a;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  padding: 8px 10px;
}

.doc-totals-table tr.due-row td {
  font-size: 13.5px;
  font-weight: 800;
  color: #b91c1c;
  padding: 7px 10px;
}

.doc-totals-table tr.discount-row td {
  color: #b45309;
  font-weight: 700;
}

/* Compact Payment Box */
.doc-payment-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 26px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #475569;
}

.doc-payment-box strong {
  color: #0f172a;
}

.doc-payment-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

/* Formal Corporate Receipt Table */
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.receipt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
  vertical-align: top;
}

.receipt-table td.label {
  width: 200px;
  color: #64748b;
  font-size: 12px;
}

.receipt-table td.val {
  color: #0f172a;
  font-weight: 700;
}

.receipt-table tr.highlight td {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

/* Signatures */
.doc-signatures {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 16px;
  margin-top: 10px;
}

.doc-sig-col {
  width: 210px;
  text-align: center;
}

.doc-sig-space {
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.doc-sig-img {
  height: 46px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: -4px;
  display: block;
}

.doc-sig-line {
  border-top: 1px solid #94a3b8;
  padding-top: 5px;
  font-size: 11px;
  color: #64748b;
}

.doc-sig-line strong {
  color: #0f172a;
  font-size: 11.5px;
}

/* Footer Notice */
.doc-footer-notice {
  text-align: center;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 16px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

/* ── Print Media Optimization (Guaranteed Single A4 Page) ── */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 8mm 10mm;
  }

  html,
  body {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .portal-sidebar,
  .portal-topbar,
  .portal-main-canvas>footer,
  footer,
  .modal-overlay,
  .no-print,
  #portalSidebar,
  .mobile-menu-trigger,
  .portal-nav-item,
  .btn-ui,
  button,
  .qr-gov-badge,
  .pill-dot {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .portal-layout,
  .portal-main-canvas,
  .portal-content-body,
  .sheet-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  .invoice-paper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
  }

  .receipt-paper,
  .invoice-paper.receipt-paper {
    background-image: linear-gradient(135deg, lightyellow, #ffffff, lavender, lightyellow) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .doc-header {
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  .doc-brand-logo {
    height: 36px !important;
    margin-bottom: 4px !important;
  }

  .doc-company-name {
    font-size: 14px !important;
  }

  .doc-company-details {
    font-size: 9.5px !important;
    line-height: 1.35 !important;
  }

  .doc-title {
    font-size: 20px !important;
  }

  .doc-number {
    font-size: 11.5px !important;
    margin-bottom: 6px !important;
  }

  .doc-meta-table {
    font-size: 10px !important;
  }

  .doc-meta-table td {
    padding: 1.5px 0 !important;
  }

  .doc-parties {
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
    gap: 16px !important;
    border-bottom: 1px solid #cbd5e1 !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(210px, 1fr) !important;
  }

  .doc-party-col h4 {
    font-size: 9px !important;
    margin-bottom: 4px !important;
  }

  .doc-party-name {
    font-size: 13px !important;
  }

  .doc-party-info {
    font-size: 10px !important;
    line-height: 1.35 !important;
  }

  .doc-details-table {
    font-size: 10px !important;
  }

  .doc-details-table td {
    padding: 1.5px 0 !important;
  }

  .doc-details-table td.label {
    width: 90px !important;
    padding-right: 8px !important;
  }

  .doc-table {
    margin-bottom: 12px !important;
  }

  .doc-table th {
    padding: 6px 8px !important;
    font-size: 9.5px !important;
    background: #f1f5f9 !important;
  }

  .doc-table td {
    padding: 6px 8px !important;
    font-size: 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .doc-item-title {
    font-size: 11px !important;
  }

  .doc-item-sub {
    font-size: 9.5px !important;
  }

  .doc-financials {
    margin-bottom: 12px !important;
    gap: 16px !important;
  }

  .doc-words-box {
    padding: 6px 8px !important;
    font-size: 9.5px !important;
  }

  .doc-totals-table {
    width: 280px !important;
    font-size: 10.5px !important;
  }

  .doc-totals-table td {
    padding: 3px 6px !important;
  }

  .doc-totals-table tr.total-row td {
    font-size: 12px !important;
    padding: 5px 6px !important;
  }

  .doc-totals-table tr.due-row td {
    font-size: 11.5px !important;
    padding: 4px 6px !important;
  }

  .doc-payment-box {
    padding: 6px 10px !important;
    margin-bottom: 14px !important;
    font-size: 9.5px !important;
    line-height: 1.35 !important;
  }

  .doc-payment-grid {
    gap: 10px !important;
    margin-top: 2px !important;
  }

  .receipt-table td {
    padding: 5px 8px !important;
    font-size: 10.5px !important;
  }

  .receipt-table td.label {
    width: 170px !important;
    font-size: 10px !important;
  }

  .doc-signatures {
    padding-top: 8px !important;
    margin-top: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .doc-sig-col {
    width: 170px !important;
  }

  .doc-sig-space {
    height: 38px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .doc-sig-img {
    height: 36px !important;
    max-width: 120px !important;
    margin-bottom: -3px !important;
    display: block !important;
  }

  .doc-sig-line {
    font-size: 9.5px !important;
    padding-top: 4px !important;
  }

  .doc-sig-line strong {
    font-size: 10px !important;
  }

  .doc-footer-notice {
    font-size: 9px !important;
    margin-top: 10px !important;
    padding-top: 6px !important;
  }

  .doc-status-pill {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
    border: 1px solid #cbd5e1 !important;
  }
}

/* ── Responsive Rules (Tablets & Mobile) ── */

/* ── Sidebar Overlay (Mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
}

@media (max-width: 1024px) {
  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.show {
    pointer-events: all;
  }

  .portal-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
  }

  .portal-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.2);
  }

  .portal-main-canvas {
    margin-left: 0;
    width: 100%;
  }

  .mobile-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-menu-trigger:hover {
    background: #e2e8f0;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Topbar adjustments for tablet */
  .portal-topbar {
    padding: 0 20px;
  }

  .topbar-right {
    gap: 10px;
  }

  /* Workspace switcher narrower */
  .switch-current {
    max-width: 120px;
  }
}

@media (max-width: 768px) {

  /* Hide live sync pill text on small screens */
  .live-sync-pill span:last-child {
    display: none;
  }

  .live-sync-pill {
    padding: 6px 10px;
    min-width: unset;
  }

  /* Hide "Main Website" button on mobile */
  .topbar-right>a.btn-ui-outline:last-child {
    display: none;
  }

  /* Workspace switcher - hide text, show icon only */
  .switch-text {
    display: none;
  }

  .btn-workspace-switch {
    padding: 7px 10px;
    gap: 4px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .exec-hero {
    padding: 24px 20px;
  }

  .exec-hero-title {
    font-size: 22px;
  }

  /* Controls bar responsive */
  .segmented-control {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .segmented-control::-webkit-scrollbar {
    display: none;
  }

  .segmented-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-card {
    padding: 18px 16px;
  }

  .kpi-num {
    font-size: 22px;
  }

  .portal-content-body {
    padding: 16px;
  }

  .portal-topbar {
    padding: 0 16px;
    height: var(--header-h);
  }

  .topbar-breadcrumb {
    font-size: 12px;
  }

  /* Hide breadcrumb separator on mobile */
  .topbar-breadcrumb>a {
    display: none;
  }

  .topbar-breadcrumb>i.bi-chevron-right {
    display: none;
  }

  .exec-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px;
    gap: 16px;
  }

  .exec-hero-title {
    font-size: 20px;
  }

  .exec-hero-desc {
    font-size: 12.5px;
  }

  .exec-hero-meta {
    gap: 12px;
    font-size: 11px;
  }

  .urgent-due-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }

  .invoice-client-card {
    grid-template-columns: 1fr;
  }

  /* Dashboard card header */
  .dash-card-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-card-title {
    font-size: 15px;
  }

  /* Tables: transform to card layout on mobile */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .exec-table {
    min-width: 600px;
  }

  /* Action buttons wrap */
  .exec-actions-group {
    flex-wrap: wrap;
    gap: 4px;
  }

  .btn-ui-sm {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  /* Invoices controls bar — stack on mobile */
  .invoices-controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoices-filter-actions {
    width: 100%;
  }

  .invoices-status-btns {
    flex-wrap: wrap;
  }

  .ledger-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Hero CTA buttons — stack on mobile */
  .exec-hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .exec-hero-actions .btn-ui {
    flex: 1;
    justify-content: center;
  }

  /* Document paper responsive */
  .invoice-paper {
    padding: 20px 16px;
    border-radius: 6px;
  }

  .doc-header {
    flex-direction: column;
    gap: 16px;
  }

  .doc-meta {
    text-align: left;
    min-width: unset;
    width: 100%;
  }

  .doc-parties {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .doc-financials {
    flex-direction: column;
    gap: 16px;
  }

  .doc-totals-table {
    width: 100%;
  }

  .doc-signatures {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  .doc-sig-col {
    width: 100%;
    text-align: left;
  }

  /* Topbar right side - minimal on small screens */
  .topbar-right {
    gap: 8px;
  }

  /* Pay button in topbar — keep compact */
  .topbar-right>button.btn-ui {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Segmented control on invoices */
  .segmented-control {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .segmented-control::-webkit-scrollbar {
    display: none;
  }

  .segmented-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11.5px;
    padding: 6px 11px;
  }

  /* QR Modal mobile — centered with scroll */
  .modal-overlay {
    padding: 16px;
    align-items: center;
  }

  .modal-dialog.modal-dialog-pay {
    max-width: 420px;
    width: 100%;
    border-radius: 18px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .qr-simple-body {
    padding: 10px 14px 20px;
    gap: 8px;
  }

  .qr-simple-amount-row {
    padding: 6px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
  }

  .qr-simple-amount-value {
    font-size: 16px;
  }

  .qr-form-field-group {
    margin-bottom: 6px !important;
  }

  .qr-clean-input {
    height: 36px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    padding: 5px 10px 5px 34px !important;
  }

  .qr-clean-input.trx-input,
  .trx-input {
    height: 36px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    padding-left: 34px !important;
    padding-right: 72px !important;
  }

  .btn-paste-trx {
    height: 24px;
    font-size: 10px;
    padding: 0 7px;
  }

  .btn-submit-payment {
    height: 40px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* Portal sidebar footer support box – compact on small */
  .portal-support-box {
    display: none;
  }

  /* Proposal/receipt page */
  .channel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    padding: 14px 12px;
  }

  .kpi-num {
    font-size: 20px;
  }

  .kpi-label {
    font-size: 10.5px;
  }

  .kpi-icon-box {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 9px;
  }

  .exec-table {
    min-width: 560px;
    font-size: 12.5px;
  }

  .exec-table th {
    padding: 10px 12px;
    font-size: 10.5px;
  }

  .exec-table td {
    padding: 12px 12px;
  }

  /* Pill compact */
  .pill {
    font-size: 10.5px;
    padding: 3px 8px;
    gap: 4px;
  }

  .pill .pill-dot {
    width: 5px;
    height: 5px;
  }
}

/* ── Corporate Multi-Entity Workspace Switcher ── */
.workspace-switcher-dropdown {
  position: relative;
  display: inline-block;
}

.btn-workspace-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: left;
}

.btn-workspace-switch:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-workspace-switch i.bi-buildings {
  color: #2563eb;
  font-size: 15px;
}

.switch-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.switch-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.switch-current {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  max-width: 175px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch-caret {
  font-size: 10px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.workspace-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  z-index: 1050;
  max-height: 400px;
  overflow-y: auto;
}

.workspace-menu.show {
  display: block;
}

.workspace-menu-header {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-menu-header strong {
  font-size: 12px;
  color: #0f172a;
}

.badge-group-count {
  font-size: 10px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.workspace-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.workspace-menu-item:hover {
  background: #f8fafc;
}

.workspace-menu-item.active {
  background: #eff6ff;
}

.workspace-menu-item .item-info {
  flex: 1;
  min-width: 0;
}

.workspace-menu-item .item-info strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-menu-item .item-info small {
  display: block;
  font-size: 10.5px;
  color: #64748b;
}

.workspace-menu-divider {
  height: 1px;
  background: #e2e8f0;
}

.concern-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.concern-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  margin-bottom: 3px;
}