/* ==========================================================================
   Smart Bill - Light & Dark Theme Toggle System & Professional Invoice PDF
   ========================================================================== */

/* Shared Root Layout, Sizing & Radius Variables */
:root {
  --sidebar-width: 240px;
  --header-height: 60px;
  --bottom-bar-height: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* Light Theme Colors (DEFAULT) */
body,
body.light-theme {
  --primary-color: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: rgba(79, 70, 229, 0.1);

  --accent-color: #DC2626;
  --accent-dark: #B91C1C;
  --accent-light: rgba(220, 38, 38, 0.1);

  --bg-color: #F8F9FC;
  --surface-color: #FFFFFF;
  --surface-card: #FFFFFF;
  --border-color: #E2E8F0;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
}

/* Dark Theme Colors */
body.dark-theme {
  --primary-color: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: rgba(59, 130, 246, 0.18);

  --accent-color: #EF4444;
  --accent-dark: #DC2626;
  --accent-light: rgba(239, 68, 68, 0.18);

  --bg-color: #0A0C10;
  --surface-color: #14171F;
  --surface-card: #1C202B;
  --border-color: #262B38;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-light: #64748B;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-bar-height) + 12px);
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   Layout Structure & Headers
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

.brand-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.role-badge {
  background: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* Supabase Cloud Sync Badge */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.sync-badge:hover {
  border-color: var(--primary-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.sync-badge .sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
}

.sync-badge.synced {
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--text-main);
}
.sync-badge.synced .sync-dot {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.sync-badge.syncing {
  border-color: rgba(245, 158, 11, 0.4);
  color: #D97706;
}
.sync-badge.syncing .sync-dot {
  background: #F59E0B;
  animation: pulse-sync 1s infinite alternate;
}

.sync-badge.offline,
.sync-badge.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #DC2626;
}
.sync-badge.offline .sync-dot,
.sync-badge.error .sync-dot {
  background: #EF4444;
}

@keyframes pulse-sync {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.user-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Sidebar Drawer */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 90;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.8px;
}

.mobile-close {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-menu {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  border-radius: 0 !important;
  width: 100%;
  transition: all 0.15s ease;
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.nav-link:hover {
  background: var(--surface-card);
  color: var(--text-main);
}

.nav-link.active {
  background: var(--primary-color) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  border-radius: 0 !important;
  width: 100% !important;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-text {
  font-size: 11px;
  color: var(--text-light);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 85;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  flex: 1;
  padding: 24px;
  max-width: 1360px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Native Mobile Bottom Navigation Bar & FAB (+)
   -------------------------------------------------------------------------- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-height);
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  z-index: 110;
  justify-content: space-around;
  align-items: stretch;
  padding: 0;
}

.mobile-nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  border-radius: 0 !important;
  transition: all 0.15s ease;
}

.mobile-nav-item i {
  font-size: 18px;
}

.mobile-nav-item.active {
  color: #FFFFFF !important;
  background: var(--primary-color) !important;
  border-radius: 0 !important;
  font-weight: 700;
}

.fab-btn {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-bar-height) + 16px);
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #FFFFFF;
  border: none;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  cursor: pointer;
  z-index: 115;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
  }

  .fab-btn {
    display: flex;
  }
}

@media (min-width: 769px) {
  .fab-btn {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Action Bottom Sheet (Invoice & Customer Tap Popup)
   -------------------------------------------------------------------------- */
.mobile-action-sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.mobile-action-sheet.open {
  display: flex;
}

.mobile-action-sheet-body {
  background: var(--surface-color);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 12px 0 24px;
  animation: slideUpSheet 0.25s ease;
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.mobile-action-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 99px;
  margin: 0 auto 14px;
}

.mobile-action-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.mobile-action-sheet-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.mobile-action-sheet-info {
  padding: 8px 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-color);
  margin: 0 16px 12px;
  border-radius: 10px;
  line-height: 1.6;
}

.mobile-action-sheet-btns {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px;
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-main);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
}

.mobile-action-btn i {
  width: 22px;
  text-align: center;
  font-size: 17px;
}

.mobile-action-btn:hover,
.mobile-action-btn:active {
  background: var(--bg-color);
}

.mobile-action-btn-pay {
  color: var(--primary-color);
}

.mobile-action-btn-pay i {
  color: var(--primary-color);
}

.mobile-action-btn-publish {
  color: #0EA5E9;
}

.mobile-action-btn-publish i {
  color: #0EA5E9;
}

.mobile-action-btn-edit {
  color: #F59E0B;
}

.mobile-action-btn-edit i {
  color: #F59E0B;
}

.mobile-action-btn-delete {
  color: var(--accent-color);
}

.mobile-action-btn-delete i {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   Payment Mode Selector (Invoice vs Customer)
   -------------------------------------------------------------------------- */
.payment-type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.type-btn input {
  display: none;
}

.type-btn.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

/* --------------------------------------------------------------------------
   Visual Analytics Charts (Reports View)
   -------------------------------------------------------------------------- */
.reports-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .reports-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-canvas-box {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Buttons & UI Controls (Exact Sizing Uniformity)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-color);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

.btn-link {
  background: none;
  color: var(--primary-color);
  padding: 0;
  font-weight: 600;
  font-size: 13px;
}

.btn-sm {
  height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.full-width {
  width: 100%;
}

.btn-whatsapp {
  background: #25D366;
  color: #FFF;
}

.btn-email {
  background: var(--primary-color);
  color: #FFF;
}

.btn-pdf {
  background: var(--accent-color);
  color: #FFF;
}

.btn-sms {
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* Table Action Buttons Group (Identical Sizing & Height) */
.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.action-buttons-group .btn {
  height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-pay {
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.35);
}

.btn-pay:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10B981;
  color: #059669;
}

.btn-delete {
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-delete:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--accent-light);
}

/* --------------------------------------------------------------------------
   Stats & Cards
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-primary {
  background: var(--primary-light);
  color: var(--primary-color);
}

.icon-accent {
  background: var(--accent-light);
  color: var(--accent-color);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1px;
}

.card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Dashboard Cockpit & Executive KPI Grid
   -------------------------------------------------------------------------- */
.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dash-greeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.dashboard-intro h2 {
  font-size: 22px;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 2px;
  font-weight: 700;
}

.dashboard-intro p {
  color: var(--text-muted);
  font-size: 13px;
}

.dash-refresh-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.dash-refresh-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: rotate(180deg);
}

/* Executive Dashboard KPI Grid */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-card-blue .kpi-icon {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
}

.kpi-card-green .kpi-icon {
  background: rgba(16, 185, 129, 0.13);
  color: #059669;
}

.kpi-card-amber .kpi-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
}

.kpi-card-purple .kpi-icon {
  background: rgba(147, 51, 234, 0.13);
  color: #9333EA;
}

.kpi-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-color);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.kpi-value {
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.dashboard-actions-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.dash-action {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  border-radius: 12px;
  padding: 14px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
}

.dash-action:hover {
  background: var(--surface-card);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.dash-action:active {
  transform: scale(0.97);
}

.dash-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.dash-action-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563EB;
}

.dash-action-green {
  background: rgba(16, 185, 129, 0.13);
  color: #059669;
}

.dash-action-red {
  background: rgba(244, 63, 94, 0.12);
  color: #E11D48;
}

.dash-action-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.dash-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.dash-panel-receivables {
  grid-area: receivables;
}

.dash-panel-activity {
  grid-area: activity;
}

.dash-panel-sales {
  grid-area: sales;
}

.dash-panel-expenses {
  grid-area: expenses;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
}

.dash-panel-header h3 i {
  color: var(--text-muted);
}

.dash-chip,
.dash-muted {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.dash-chip {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 9px;
}

.dash-total-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.dash-hero-amount {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 18px;
}

.dash-aging-chart,
.dash-sales-chart {
  min-height: 190px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 16px 4px 8px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(to top, transparent 0, transparent 24%, rgba(148, 163, 184, 0.12) 25%, transparent 26%, transparent 49%, rgba(148, 163, 184, 0.12) 50%, transparent 51%, transparent 74%, rgba(148, 163, 184, 0.12) 75%, transparent 76%);
}

.dash-bar-item {
  flex: 1;
  min-width: 0;
  height: 156px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.dash-bar {
  width: min(42px, 70%);
  min-height: 5px;
  border-radius: 6px 6px 2px 2px;
  background: var(--primary-color);
}

.dash-bar-label,
.dash-bar-value {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.dash-bar-value {
  color: var(--text-main);
  font-weight: 700;
}

.dash-two-metrics,
.dash-three-metrics {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.dash-two-metrics {
  grid-template-columns: 1fr 1fr;
}

.dash-three-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-two-metrics span,
.dash-three-metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.dash-two-metrics strong,
.dash-three-metrics strong {
  display: block;
  color: var(--text-main);
  font-size: 15px;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.dash-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.dash-tab-btn,
.dash-tabs button,
.dash-text-btn {
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-main);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-tab-btn.active,
.dash-tabs button.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #FFFFFF;
}

.dash-text-btn {
  color: var(--primary-color);
  background: var(--primary-light);
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
}

.dash-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.dash-activity-row:hover {
  background: var(--surface-card);
}

.dash-activity-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dash-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dash-activity-info {
  min-width: 0;
}

.dash-activity-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-activity-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-activity-right {
  text-align: right;
  flex-shrink: 0;
}

.dash-activity-amount {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  text-align: right;
}

.dash-activity-status {
  text-align: right;
  font-size: 10.5px;
  font-weight: 700;
}

.dash-sales-chart {
  min-height: 180px;
  gap: 12px;
}

.dash-sales-month {
  flex: 1;
  min-width: 0;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
  position: relative;
  padding-bottom: 18px;
}

.dash-sales-month::after {
  content: attr(data-month);
  position: absolute;
  bottom: 0;
  font-size: 10px;
  color: var(--text-muted);
}

.dash-mini-bar {
  width: 10px;
  min-height: 4px;
  border-radius: 5px 5px 1px 1px;
}

.dash-mini-bar.sales {
  background: #2563EB;
}

.dash-mini-bar.receipts {
  background: #14B8A6;
}

.dash-mini-bar.costs {
  background: #F97316;
}

.dash-expense-stack {
  display: flex;
  height: 16px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-color);
  margin: 28px 0 16px;
}

.dash-expense-segment {
  min-width: 8px;
}

.dash-expense-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-expense-item,
.dash-net-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.dash-expense-item strong,
.dash-net-row strong {
  color: var(--text-main);
}

.dash-empty-note {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  margin: 20px 0;
}

.dash-net-row {
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
  margin-top: 16px;
  align-items: center;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Clean Tables
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  max-width: 300px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--surface-color);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: var(--primary-light);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1;
}

.badge-draft {
  background: var(--border-color);
  color: var(--text-muted);
}

.badge-published {
  background: #EEF2FF;
  color: #4F46E5;
}

.badge-paid {
  background: #ECFDF5;
  color: #10B981;
}

.badge-partial {
  background: #FFFBEB;
  color: #F59E0B;
}

.badge-overdue {
  background: #FEE2E2;
  color: #DC2626;
}

body.dark-theme .badge-published {
  background: rgba(79, 70, 229, 0.25);
  color: #818CF8;
}

body.dark-theme .badge-paid {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
}

body.dark-theme .badge-partial {
  background: rgba(245, 158, 11, 0.25);
  color: #FBBF24;
}

body.dark-theme .badge-overdue {
  background: rgba(220, 38, 38, 0.25);
  color: #EF4444;
}

/* --------------------------------------------------------------------------
   Native Smartphone App Item Card Styling (Zoho Billing Layout)
   -------------------------------------------------------------------------- */
.status-tab-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

.status-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.status-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 700;
  background: none;
}

.app-card-row {
  background: var(--surface-card);
  transition: background 0.15s ease;
}

.app-card-row td {
  padding: 14px 16px !important;
}

.m-card-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.m-card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.m-card-customer-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.m-card-customer-text {
  min-width: 0;
  flex: 1 1 auto;
}

.m-card-customer {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.m-card-contact {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.m-card-due-block {
  text-align: right;
  flex: 0 0 auto;
}

.m-card-due-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.m-card-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  white-space: nowrap;
}

.m-card-row-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.m-card-inv-info {
  color: var(--text-muted);
}

.m-card-due-info {
  text-align: right;
  font-weight: 600;
}

.m-card-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.m-item-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

.m-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Forms & Controls
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.form-input,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary-color);
}

.inline-input {
  display: inline-block;
  width: 75px;
  padding: 4px 8px;
  text-align: right;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.invoice-summary-box {
  background: var(--bg-color);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  margin-left: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.summary-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Tabs Navigation (Settings)
   -------------------------------------------------------------------------- */
.tabs-container {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --------------------------------------------------------------------------
   Modals (Fixed Sticky Footer with Scrollable Body)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000005;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.15s ease;
}

.modal-dialog {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-dialog.modal-lg {
  max-width: 860px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-color);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-color);
  flex-shrink: 0;
  z-index: 10;
}

.send-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.publish-invoice-card {
  background: var(--primary-light);
  border-left: 3px solid var(--primary-color);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.alert-box {
  background: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   PnL Statement Styling
   -------------------------------------------------------------------------- */
.pnl-summary-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.pnl-row.header {
  font-weight: 700;
  background: var(--surface-color);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
}

.pnl-row.highlight {
  background: var(--primary-light);
  font-weight: 600;
  color: var(--primary-color);
}

.pnl-row.total {
  background: var(--primary-color);
  color: #FFF;
  font-weight: 700;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Redesigned Professional PDF Bill & Printable Invoice Layout
   -------------------------------------------------------------------------- */
.printable-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  .printable-area,
  .printable-area * {
    visibility: visible;
  }

  .printable-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 30px 40px;
    background: #FFFFFF;
    color: #1E293B;
    font-family: 'Poppins', sans-serif;
  }
}

.pdf-invoice-container {
  max-width: 820px;
  margin: 0 auto;
  background: #FFFFFF;
  color: #0F172A;
  padding: 36px 40px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.pdf-top-bar {
  height: 6px;
  background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
  border-radius: 6px 6px 0 0;
  margin: -36px -40px 28px -40px;
}

.pdf-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.pdf-brand-col {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.pdf-company-logo {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 8px;
  background: #FFF;
}

.pdf-company-name {
  font-size: 24px;
  font-weight: 800;
  color: #1E1B4B;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.pdf-company-details {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.pdf-invoice-title-block {
  text-align: right;
}

.pdf-invoice-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4F46E5, #4338CA);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.pdf-meta-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 10px 14px;
  border-radius: 8px;
  min-width: 200px;
}

.pdf-meta-p {
  font-size: 12px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  margin: 3px 0;
}

.pdf-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.pdf-status-paid {
  background: #DCFCE7;
  color: #15803D;
}

.pdf-status-unpaid {
  background: #FEE2E2;
  color: #B91C1C;
}

.pdf-status-partial {
  background: #FEF3C7;
  color: #B45309;
}

.pdf-addresses-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 24px;
}

.pdf-address-box {
  background: #F8FAFC;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}

.pdf-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748B;
  margin-bottom: 8px;
}

.pdf-cust-name {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 4px;
}

.pdf-address-box p {
  font-size: 12px;
  color: #334155;
  margin: 3px 0;
}

.pdf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
}

.pdf-table th {
  background: #4F46E5;
  color: #FFFFFF;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: left;
}

.pdf-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 12.5px;
}

.pdf-table tbody tr:last-child td {
  border-bottom: none;
}

.pdf-table tbody tr:nth-child(even) {
  background: #F8FAFC;
}

.pdf-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: flex-start;
  margin-top: 20px;
}

.pdf-payment-bank-box {
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #C7D2FE;
  display: flex;
  gap: 16px;
  align-items: center;
}

.pdf-upi-qr-img {
  width: 115px;
  height: 115px;
  object-fit: contain;
  border: 2px solid #818CF8;
  border-radius: 8px;
  background: #FFFFFF;
  padding: 4px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
}

.pdf-bank-info h4 {
  font-size: 13px;
  font-weight: 800;
  color: #3730A3;
  margin-bottom: 6px;
}

.pdf-bank-info p {
  font-size: 11.5px;
  margin: 3px 0;
  color: #334155;
}

.pdf-upi-badge {
  background: #FFFFFF;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed #A5B4FC;
  display: inline-block;
  margin-bottom: 4px;
}

.pdf-totals-box {
  background: #F8FAFC;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}

.pdf-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  color: #475569;
}

.pdf-total-row.discount {
  color: #DC2626;
}

.pdf-total-row.tax {
  color: #D97706;
}

.pdf-total-row.grand-total {
  border-top: 2px solid #CBD5E1;
  padding-top: 10px;
  margin-top: 6px;
  font-size: 17px;
  font-weight: 800;
  color: #4F46E5;
  margin-bottom: 0;
}

.pdf-signature-block {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.pdf-signature-box {
  text-align: center;
  width: 210px;
}

.pdf-signature-img {
  max-height: 60px;
  max-width: 170px;
  object-fit: contain;
  margin-bottom: 6px;
}

.pdf-signature-line {
  border-top: 1.5px solid #94A3B8;
  padding-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
}

.pdf-sign-company {
  font-size: 10.5px;
  color: #64748B;
  margin-top: 2px;
}

.pdf-locked-footer {
  margin-top: 36px;
  border-top: 1px dashed #CBD5E1;
  padding-top: 14px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  letter-spacing: 0.5px;
}

/* Desktop / Mobile Row Visibility Toggle */
.desktop-only-row {
  display: table-row;
}

.mobile-only-row {
  display: none !important;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.desktop-action-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.btn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-action-pill:hover {
  transform: translateY(-1px);
}

.btn-action-pay {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-action-pay:hover {
  background: #059669;
  color: #ffffff;
}

.btn-action-publish {
  background: rgba(37, 99, 235, 0.08);
  color: #2563EB;
  border-color: rgba(37, 99, 235, 0.2);
}

.btn-action-publish:hover {
  background: #2563EB;
  color: #ffffff;
}

.btn-action-edit {
  background: var(--bg-color);
  color: var(--text-main);
}

.btn-action-edit:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-action-delete {
  background: rgba(244, 63, 94, 0.08);
  color: #E11D48;
  border-color: rgba(244, 63, 94, 0.2);
}

.btn-action-delete:hover {
  background: #E11D48;
  color: #ffffff;
}

/* Desktop & Tablet Full-Width Responsive Table Rules */
@media (min-width: 769px) {
  .card-table {
    width: 100% !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden !important;
  }

  .table-responsive {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .data-table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
    font-size: 13px;
    vertical-align: middle;
  }

  .data-table th {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
  }

  .data-table td {
    border-bottom: 1px solid var(--border-color);
  }

  .td-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Mobile Smartphone Native App Experience & Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .desktop-only-row {
    display: none !important;
  }

  .mobile-only-row {
    display: block !important;
  }

  html,
  body,
  .app-layout,
  .main-content,
  .card,
  .table-responsive {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-close {
    display: block;
  }

  /* Fixed Smartphone Top Header */
  .top-header {
    height: 56px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  body.dark-theme .top-header {
    background: rgba(15, 23, 42, 0.94);
  }

  .top-header-right select#userSelector {
    display: none;
  }

  #currentUserName {
    display: none;
  }

  .main-content {
    margin-left: 0;
    margin-top: 56px;
    padding: 12px 10px;
    padding-bottom: calc(var(--bottom-bar-height) + 26px);
  }

  /* Smartphone Side Drawer Menu */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
    z-index: 999;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Mobile Section Headers */
  /* Mobile Section Headers - Hidden on mobile, preserved on desktop */
  .section-header {
    display: none !important;
  }

  /* 2-Column KPI Stats Grid for Phones */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 10px;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 9.5px;
  }

  .stat-value {
    font-size: 15px;
  }

  /* Form Layouts & Smartphone Touch Targets */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .form-group label {
    font-size: 12.5px;
    font-weight: 600;
  }

  .form-input,
  .form-select {
    height: 42px;
    font-size: 16px;
    /* Prevents auto-zoom on iOS safari focus */
    padding: 9px 12px;
    border-radius: var(--radius-md);
  }

  .filter-bar {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
  }

  .filter-bar .form-input,
  .filter-bar .form-select {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Smartphone Native Bottom Sheet Modals */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-dialog::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 8px auto 2px auto;
  }

  .modal-header {
    padding: 10px 14px;
    background: var(--surface-card);
  }

  .modal-header h2 {
    font-size: 15px;
  }

  .modal-body {
    padding: 14px;
    gap: 12px;
  }

  .modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
    background: var(--surface-card);
  }

  .modal-footer .btn {
    width: 100%;
    height: 44px;
    font-size: 14px;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  @keyframes slideUpModal {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  /* Invoice Footer Branding Container */
  .footer-branding-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--radius-md);
  }

  .footer-branding-title {
    color: var(--text-main);
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 15px;
  }

  .footer-branding-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .footer-branding-input {
    flex: 1;
    min-width: 220px;
    max-width: 320px;
  }

  .footer-branding-btn {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    white-space: nowrap;
  }

  @media (max-width: 768px) {
    .footer-branding-actions {
      flex-direction: column !important;
      width: 100% !important;
      gap: 14px !important;
      margin-top: 14px !important;
    }

    .footer-branding-input {
      width: 100% !important;
      max-width: 100% !important;
      margin-bottom: 0 !important;
    }

    .footer-branding-btn {
      width: 100% !important;
      max-width: 100% !important;
      justify-content: center !important;
      padding: 12px !important;
      font-size: 13.5px !important;
      box-sizing: border-box !important;
    }
  }

  /* Mobile Settings Forms & Full-Width Action Buttons */
  #companySettingsForm .form-actions,
  #customFieldForm .form-actions,
  #smsApiForm .form-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 16px !important;
  }

  #companySettingsForm .form-actions .btn,
  #customFieldForm .form-actions .btn,
  #smsApiForm .form-actions .btn {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
  }

  /* Zero Horizontal Scroll & Native Smartphone List Cards */
  .card-table {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .table-responsive {
    width: 100% !important;
    overflow-x: hidden !important;
    background: transparent !important;
    border: none !important;
    margin-top: 6px;
  }

  .data-table {
    display: block !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
  }

  .data-table thead {
    display: none !important;
  }

  .data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .data-table tbody tr.app-card-row {
    display: block !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  .data-table tbody tr.app-card-row:active {
    transform: scale(0.99) !important;
  }

  .data-table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    font-size: 13px !important;
  }

  .dashboard-shell {
    gap: 14px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    padding: 12px 10px;
    border-radius: 14px;
  }

  .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .kpi-tag {
    font-size: 9px;
    padding: 2px 6px;
  }

  .kpi-value {
    font-size: clamp(14px, 4vw, 18px);
  }

  .kpi-label {
    font-size: 10.5px;
  }

  .dashboard-actions-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    gap: 8px;
    border-radius: 14px;
  }

  .dash-action {
    font-size: 11px;
    padding: 12px 6px;
    border-radius: 12px;
  }

  .dash-action-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "receivables"
      "activity"
      "sales"
      "expenses";
    gap: 14px;
  }

  .dash-panel,
  .dash-panel-wide {
    border-radius: 14px;
    padding: 14px;
  }

  .dash-panel-header h3 {
    font-size: 13px;
  }

  .dash-hero-amount {
    font-size: 22px;
  }

  .dash-aging-chart,
  .dash-sales-chart {
    min-height: 160px;
    gap: 8px;
    padding: 10px 2px 4px;
  }

  .dash-bar-item {
    height: 135px;
    gap: 4px;
  }

  .dash-bar-value {
    display: block !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    white-space: nowrap !important;
  }

  .dash-bar-label {
    font-size: 9.5px !important;
  }

  .dash-two-metrics strong,
  .dash-three-metrics strong {
    font-size: 14px;
  }

  .dash-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .dash-tab-btn {
    white-space: nowrap;
    padding: 5px 12px;
    font-size: 11px;
  }

  .dash-activity-row {
    padding: 8px 10px;
    gap: 8px;
  }

  .dash-activity-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
  }

  .dash-activity-title {
    font-size: 12px;
  }

  .dash-activity-meta {
    font-size: 10px;
  }

  .dash-activity-amount {
    font-size: 12px;
  }

  .dash-chart-legend {
    font-size: 9.5px;
    gap: 6px;
  }

  .dash-sales-chart {
    overflow-x: auto;
    justify-content: flex-start;
    padding-left: 0;
    padding-right: 0;
    -webkit-overflow-scrolling: touch;
  }

  .dash-sales-month {
    flex: 0 0 42px;
  }

  .dash-mini-bar {
    width: 8px;
  }

  .m-card-row-top {
    align-items: flex-start;
  }

  .m-card-due-block {
    min-width: 108px;
  }

  .m-card-total {
    font-size: clamp(13px, 3.7vw, 15px);
  }

  .m-card-contact {
    line-height: 1.35;
  }

  #customersTable .m-card-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }

  #customersTable .m-card-customer-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  #customersTable .m-card-customer-text {
    min-width: 0;
    flex: 1 1 auto;
  }

  #customersTable .m-card-due-block {
    text-align: right;
    flex-shrink: 0;
    background: var(--bg-color);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 90px;
  }

  #customersTable .m-card-due-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-align: right;
  }

  #customersTable .m-card-total {
    font-size: 13.5px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
  }

  .badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .action-buttons-group {
    flex-wrap: wrap;
    gap: 5px;
  }

  .action-buttons-group .btn {
    height: 30px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
  }

  .perm-badge {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  .send-options-grid {
    grid-template-columns: 1fr;
  }

  .pnl-row {
    padding: 6px 8px;
    font-size: 11.5px;
  }
}

/* --------------------------------------------------------------------------
   Authentication & Login Screen Styling
   -------------------------------------------------------------------------- */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #312E81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.perm-badge {
  display: inline-block;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 1px;
}

body.logged-out .top-header,
body.logged-out .sidebar,
body.logged-out .mobile-bottom-nav,
body.logged-out .app-layout {
  display: none !important;
}

body.logged-out #view-login {
  display: flex !important;
}

body.logged-in #view-login {
  display: none !important;
}

/* ==========================================
   Profile Avatar & Dropdown Menu Styles
   ========================================== */
.profile-dropdown-container {
  position: relative;
}

.profile-avatar-btn {
  background: transparent;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

.profile-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #10B981;
  border: 2px solid var(--surface-card);
  border-radius: 50%;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 12px 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 12px;
}

.menu-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.menu-user-info strong {
  font-size: 14px;
  color: var(--text-main);
  display: block;
  line-height: 1.2;
}

.profile-dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.profile-dropdown-item:hover {
  background-color: var(--surface-color);
  color: var(--primary-color);
}

.profile-dropdown-item.text-danger:hover {
  color: #EF4444;
  background-color: #FEE2E2;
}

/* Employee & Product Thumbnails */
.table-img-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
}

.table-avatar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.emp-code-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   NEXT-GEN CREATE INVOICE / BILLING STUDIO STYLES
   ========================================================================== */

.billing-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.studio-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.studio-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studio-title-row h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.4px;
}

.studio-badge {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.studio-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studio-quick-config {
  display: flex;
  gap: 8px;
}

.studio-select {
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background-color: var(--surface-card);
}

/* Studio Main Grid Layout */
.billing-studio-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1200px) {
  .billing-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards inside Workspace */
.studio-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-card:hover {
  box-shadow: var(--shadow-md);
}

.studio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.studio-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Customer Banner */
.customer-info-banner {
  background: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 12.5px;
}

.cust-banner-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.cust-banner-item i {
  color: var(--primary-color);
}

.cust-banner-item.cust-balance {
  margin-left: auto;
  font-weight: 600;
  color: #DC2626;
}

/* POS Catalog Grid */
.pos-catalog-controls {
  margin-bottom: 14px;
}

.pos-search-box {
  position: relative;
  margin-bottom: 10px;
}

.pos-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.pos-search-box input {
  padding-left: 36px;
  font-size: 13px;
}

.pos-category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pos-pill {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pos-pill:hover,
.pos-pill.active {
  background: var(--primary-color);
  color: #FFFFFF;
  border-color: var(--primary-color);
}

.pos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.pos-item-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.pos-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.pos-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
}

.pos-item-stock {
  font-size: 10px;
  color: var(--text-muted);
}

.pos-item-stock.low {
  color: #DC2626;
  font-weight: 600;
}

/* Studio Line Items Table */
.studio-table-wrapper {
  overflow-x: auto;
}

.studio-line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.studio-line-table th {
  background: var(--bg-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.studio-line-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  overflow: hidden;
}

.qty-btn {
  background: var(--bg-color);
  border: none;
  color: var(--text-main);
  width: 26px;
  height: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.qty-input {
  width: 44px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 12.5px;
  background: transparent;
  color: var(--text-main);
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Summary Grid */
.studio-summary-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 768px) {
  .studio-summary-grid {
    grid-template-columns: 1fr;
  }
}

.studio-summary-right {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.calc-row.total-row {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 6px;
}

.calc-row.total-row strong {
  color: var(--primary-color);
  font-size: 20px;
}

.calc-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calc-input {
  width: 75px;
  padding: 4px 6px;
  font-size: 12.5px;
  text-align: right;
}

.calc-select {
  padding: 4px;
  font-size: 12px;
  width: 50px;
}

.calc-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.roundoff-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.words-container {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.words-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.words-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  font-style: italic;
}

/* Studio Action Bar */
.studio-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-top: 10px;
  position: sticky;
  bottom: 12px;
  z-index: 10;
}

.action-bar-right {
  display: flex;
  gap: 10px;
}

/* Right Sticky Document Preview */
.billing-preview-right {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.preview-sticky-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.preview-header {
  background: var(--bg-color);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-mode-tabs {
  display: flex;
  background: var(--surface-card);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.preview-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preview-tab.active {
  background: var(--primary-color);
  color: #FFFFFF;
}

.preview-viewport {
  padding: 16px;
  background: #525659;
  /* Dark neutral preview backdrop like PDF viewers */
  max-height: calc(100vh - var(--header-height) - 100px);
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

/* Live Paper Document */
.live-doc-paper {
  background: #FFFFFF;
  color: #1E293B;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-family: 'Poppins', sans-serif;
  transition: width 0.2s ease;
}

.live-doc-paper.format-a4 {
  width: 100%;
  max-width: 440px;
  min-height: 580px;
  padding: 20px;
  font-size: 11px;
  border-radius: 4px;
}

.live-doc-paper.format-thermal {
  width: 280px;
  padding: 14px 10px;
  font-size: 10.5px;
  font-family: 'Courier New', Courier, monospace;
  border-radius: 0;
}

/* Internal Document Styling */
.doc-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #4F46E5;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.doc-company-name {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
}

.doc-title-badge {
  font-size: 14px;
  font-weight: 700;
  color: #4F46E5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 11px;
  margin-bottom: 12px;
  background: #F8FAFC;
  padding: 8px 10px;
  border-radius: 4px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 10.5px;
}

.doc-table th {
  background: #EEF2FF;
  color: #3730A3;
  padding: 6px;
  text-align: left;
  font-weight: 600;
}

.doc-table td {
  padding: 6px;
  border-bottom: 1px solid #E2E8F0;
}

.doc-totals-box {
  margin-left: auto;
  width: 200px;
  font-size: 11px;
}

.doc-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.doc-totals-row.grand-total {
  font-weight: 700;
  font-size: 13px;
  color: #4F46E5;
  border-top: 1.5px solid #1E293B;
  padding-top: 4px;
}

/* ==========================================================================
   CREATE INVOICE MODAL STYLES (MATCHING SCREENSHOT)
   ========================================================================== */

#invoiceModal .modal-dialog {
  max-width: 700px;
}

#invoiceModal .modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

#invoiceModal .modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

#invoiceModal .modal-body {
  padding: 20px 24px;
}

.line-items-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 20px;
}

body.dark-theme .line-items-card {
  background: #181C26;
  border-color: #262B38;
}

.line-items-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.line-items-table {
  width: 100%;
  border-collapse: collapse;
}

.line-items-table th {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.5px;
  padding: 6px 4px;
  text-align: left;
  border: none;
  background: transparent;
}

.line-items-table td {
  padding: 6px 4px;
  border: none;
  vertical-align: top;
}

.btn-add-line {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-line:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Invoice Summary Card */
.invoice-summary-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 16px;
}

body.dark-theme .invoice-summary-card {
  background: #181C26;
  border-color: #262B38;
}

.summary-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: #64748B;
  margin-bottom: 8px;
}

body.dark-theme .summary-line-item {
  color: #94A3B8;
}

.summary-value {
  font-weight: 700;
  color: var(--text-main);
}

.summary-divider {
  height: 1px;
  background: #E2E8F0;
  margin: 10px 0;
}

body.dark-theme .summary-divider {
  background: #262B38;
}

.summary-line-item.total-item {
  margin-bottom: 0;
}

.summary-line-item.total-item .total-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.summary-line-item.total-item .total-value {
  font-size: 20px;
  font-weight: 800;
  color: #2563EB;
}

body.dark-theme .summary-line-item.total-item .total-value {
  color: #3B82F6;
}

#invoiceSaveSubmitBtn {
  background-color: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 8px;
}

#invoiceSaveSubmitBtn:hover {
  background-color: #1D4ED8;
}

/* --------------------------------------------------------------------------
   Invoice Template Selection & Settings Styling
   -------------------------------------------------------------------------- */
.template-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.template-select-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-card);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-select-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.template-select-card.active {
  border-color: var(--primary-color);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.template-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.style-1-icon {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
}

.style-2-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
}

.style-3-icon {
  background: rgba(147, 51, 234, 0.15);
  color: #9333EA;
}

.template-radio-check {
  font-size: 18px;
  color: var(--border-color);
  transition: color 0.15s ease;
}

.template-select-card.active .template-radio-check {
  color: var(--primary-color);
}

.template-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.template-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-color);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.template-select-card.active .template-tag {
  background: #ffffff;
  color: var(--primary-color);
  border-color: rgba(99, 102, 241, 0.3);
}

body.dark-theme .template-select-card.active .template-tag {
  background: var(--surface-card);
}

/* --------------------------------------------------------------------------
   Dynamic UPI QR Code Generator Preview Box
   -------------------------------------------------------------------------- */
.upi-qr-live-preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.qr-preview-info {
  flex: 1;
  min-width: 220px;
}

.qr-preview-image-wrap {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

.qr-preview-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   Publish Modal & Action Sheet Spacing Tightening
   -------------------------------------------------------------------------- */
#publishModal .modal-body {
  padding: 16px 20px;
  gap: 10px;
}

#publishModal .publish-invoice-card {
  background: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 0;
}

#publishModal .send-options-grid {
  gap: 10px;
  margin-top: 4px;
}

/* Print CSS adjustments for multi-style templates */
@media print {
  body * {
    visibility: hidden;
  }

  #printableInvoiceArea,
  #printableInvoiceArea * {
    visibility: visible;
  }

  #printableInvoiceArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

/* Invoice & Template Settings Custom Responsive Styles */
.branding-dropzone {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.branding-dropzone:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.branding-preview-area {
  width: 100%;
  height: 95px;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-color);
  margin-bottom: 14px;
  position: relative;
}

.branding-preview-area img {
  max-width: 90%;
  max-height: 80px;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   Custom Slide-Down Select Dropdown Component
   -------------------------------------------------------------------------- */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-select-trigger .trigger-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.custom-select-trigger .trigger-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-wrapper.open .trigger-chevron {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 100;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.custom-select-wrapper.open .custom-select-menu {
  max-height: 380px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.custom-option {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.custom-option:last-child {
  border-bottom: none;
}

.custom-option:hover {
  background: var(--surface-card);
}

.custom-option.active {
  background: var(--primary-light);
  border-left: 3px solid var(--primary-color);
}

.custom-option .option-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.custom-option .option-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   DESKTOP FIXED SIDEBAR & BOX-CONTAINED HORIZONTAL SCROLL ENFORCEMENT
   ========================================================================== */
@media (min-width: 769px) {
  body {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100% !important;
  }

  .app-layout {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  .sidebar {
    position: fixed !important;
    top: var(--header-height) !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--sidebar-width) !important;
    height: calc(100vh - var(--header-height)) !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
    z-index: 90 !important;
    transform: none !important;
    border-right: 1px solid var(--border-color) !important;
  }

  .main-content {
    margin-left: var(--sidebar-width) !important;
    margin-top: var(--header-height) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - var(--sidebar-width)) !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding: 24px 28px !important;
  }

  .view-section {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .card {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }
}

/* SLEEK CUSTOM SCROLLBARS FOR TABLES & SCROLL BOXES */
.table-responsive::-webkit-scrollbar,
.pnl-summary-box::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track,
.pnl-summary-box::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb,
.pnl-summary-box::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.pnl-summary-box::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ==========================================================================
   CUSTOM MODERN DIALOG POPUPS & CONFIRMATION MODALS
   ========================================================================== */
.custom-dialog-backdrop {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(15, 23, 42, 0.7) !important;
  z-index: 10000 !important;
}

.custom-dialog-box {
  border-radius: 22px !important;
  background: var(--surface-color) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  overflow: hidden !important;
  transform: scale(0.9) translateY(10px) !important;
  opacity: 0 !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.modal-backdrop.active .custom-dialog-box {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

.custom-dialog-content {
  padding: 30px 26px !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.custom-dialog-icon-wrapper {
  width: 66px !important;
  height: 66px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  margin-bottom: 18px !important;
  position: relative !important;
}

.custom-dialog-icon-wrapper.danger {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #EF4444 !important;
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.25) !important;
}

.custom-dialog-icon-wrapper.warning {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #F59E0B !important;
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.25) !important;
}

.custom-dialog-icon-wrapper.success {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #10B981 !important;
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.25) !important;
}

.custom-dialog-icon-wrapper.primary {
  background: rgba(99, 102, 241, 0.14) !important;
  color: #6366F1 !important;
  box-shadow: 0 0 26px rgba(99, 102, 241, 0.25) !important;
}

.custom-dialog-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  margin: 0 0 8px 0 !important;
  letter-spacing: -0.3px !important;
}

.custom-dialog-message {
  font-size: 14px !important;
  color: var(--text-muted) !important;
  line-height: 1.55 !important;
  margin: 0 0 22px 0 !important;
  max-width: 360px !important;
}

.custom-dialog-actions {
  display: flex !important;
  gap: 12px !important;
  width: 100% !important;
  justify-content: center !important;
}

.custom-dialog-actions button {
  flex: 1 !important;
  padding: 12px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.custom-dialog-actions .btn-danger {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border: none !important;
}

.custom-dialog-actions .btn-danger:hover {
  background: #DC2626 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35) !important;
}

.custom-dialog-actions.single button {
  width: 100% !important;
}

/* ==========================================================================
   PRINTABLE FINANCIAL REPORT TEMPLATE STYLES
   ========================================================================== */
.pdf-report-container {
  max-width: 860px;
  margin: 0 auto;
  background: #FFFFFF;
  color: #0F172A;
  padding: 36px 40px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pdf-report-top-bar {
  height: 6px;
  background: linear-gradient(90deg, #4F46E5 0%, #06B6D4 100%);
  border-radius: 6px 6px 0 0;
  margin: -36px -40px 28px -40px;
}

.pdf-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.pdf-report-title-block h1 {
  font-size: 24px;
  font-weight: 800;
  color: #1E293B;
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.pdf-report-title-block p {
  margin: 0;
  color: #64748B;
  font-size: 12px;
}

.pdf-report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.pdf-report-kpi-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 14px;
}

.pdf-report-kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pdf-report-kpi-card .kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.pdf-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.pdf-report-table th,
.pdf-report-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 12.5px;
}

.pdf-report-table th {
  background: #F1F5F9;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.pdf-report-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94A3B8;
}