/* Design Tokens & Theme Variables */
:root {
  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Colors: Default Dark Theme */
  --bg-primary: #080c14;
  --bg-secondary: #0f1524;
  --bg-tertiary: #172036;
  --bg-active: #202b47;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-color: #1f2937;
  --divider-color: #1e293b;
  
  --accent-blue: #3b82f6;
  --accent-blue-rgb: 59, 130, 246;
  --accent-red: #ef4444;
  --accent-red-rgb: 239, 68, 68;
  --accent-green: #10b981;
  --accent-green-rgb: 16, 185, 129;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  
  --glass-bg: rgba(15, 21, 36, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --sidebar-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
html[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-active: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: #e2e8f0;
  --divider-color: #f1f5f9;
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(0, 0, 0, 0.05);
  --card-shadow: 0 8px 24px rgba(148, 163, 184, 0.15);
  --sidebar-shadow: 4px 0 16px rgba(148, 163, 184, 0.08);
}

/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-y: auto;
  overflow-x: auto;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Lock scrolling when the main app panel is active */
body.app-active {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Main Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
.app-header {
  height: 70px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.logo-icon i {
  width: 20px;
  height: 20px;
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

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

/* Buttons Styling */
.icon-btn {
  width: 40px;
  height: 40px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.icon-btn i {
  width: 18px;
  height: 18px;
}

.action-btn {
  height: 40px;
  padding: 0 16px;
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.action-btn:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn i {
  width: 16px;
  height: 16px;
}

.secondary-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: none;
}

.secondary-btn:hover {
  background-color: var(--bg-active);
  color: var(--text-primary);
  box-shadow: none;
}

.header-dash-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: none;
}
.header-dash-btn.active {
  background-color: rgba(var(--accent-blue-rgb), 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Connection Badges */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-badge.online .status-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-badge.offline .status-dot {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.status-badge.mock .status-dot {
  background-color: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}

.status-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Theme Toggle Button Logic */
html[data-theme="light"] .moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }

/* Workspace Layout */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 70px);
}

/* Sidebar Layout */
.sidebar {
  width: 320px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 5;
  box-shadow: var(--sidebar-shadow);
}

.sidebar-search {
  padding: 16px;
  display: flex;
  gap: 8px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px 0 38px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--accent-blue);
}

/* Directory Filters */
.directory-filters {
  display: flex;
  padding: 0 16px 12px 16px;
  gap: 6px;
  border-bottom: 1px solid var(--divider-color);
}

.filter-chip {
  padding: 6px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background-color: var(--bg-active);
  color: var(--text-primary);
}

.filter-chip.active {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* Customer Master List */
.customer-list-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.customer-list {
  list-style: none;
}

.customer-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider-color);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.customer-item:hover {
  background-color: var(--bg-tertiary);
}

.customer-item.active {
  background-color: var(--bg-active);
  border-left-color: var(--accent-blue);
}

.customer-item.receivable {
  border-left-color: var(--accent-red);
}

.customer-item.advance {
  border-left-color: var(--accent-green);
}

.customer-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.customer-name-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.customer-balance-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
}

.customer-balance-label.dr { color: var(--accent-red); }
.customer-balance-label.cr { color: var(--accent-green); }

.customer-item-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.customer-parent-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.customer-overdue-tag {
  color: var(--accent-red);
  font-weight: 600;
}

/* Sidebar Footer Summary */
.sidebar-summary-card {
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.summary-row.highlight {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.summary-row.highlight span:last-child {
  font-family: var(--font-display);
  color: var(--accent-red);
}

/* Main Content Views */
.content-area {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-primary);
  position: relative;
  display: flex;
  flex-direction: column;
}

.view-section {
  padding: 24px 24px 120px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
}

.view-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.view-header p.company-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* Dashboard Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  transition: transform var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-3px);
}

.metric-card.gradient-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(27, 38, 64, 0.4) 100%);
  border-left: 4px solid var(--accent-blue);
}

.metric-card.gradient-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(64, 27, 27, 0.4) 100%);
  border-left: 4px solid var(--accent-red);
}

.metric-card.gradient-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(46, 27, 64, 0.4) 100%);
  border-left: 4px solid var(--accent-purple);
}

.metric-card.gradient-orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(64, 46, 27, 0.4) 100%);
  border-left: 4px solid var(--accent-orange);
}

.metric-card .card-icon {
  width: 48px;
  height: 48px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.metric-card.gradient-blue .card-icon { color: var(--accent-blue); }
.metric-card.gradient-red .card-icon { color: var(--accent-red); }
.metric-card.gradient-purple .card-icon { color: var(--accent-purple); }
.metric-card.gradient-orange .card-icon { color: var(--accent-orange); }

.metric-card .card-icon i {
  width: 22px;
  height: 22px;
}

.metric-card .card-info h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.metric-card .card-info .value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 4px 0;
}

.metric-card .card-info .sub-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sync-agent-health-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(59, 130, 246, 0.08));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sync-agent-health-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

.sync-agent-health-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}

.sync-agent-health-icon.healthy { background: linear-gradient(135deg, #10b981, #059669); }
.sync-agent-health-icon.delayed { background: linear-gradient(135deg, #f59e0b, #d97706); }
.sync-agent-health-icon.pending { background: linear-gradient(135deg, #64748b, #475569); }
.sync-agent-health-icon.stale { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.sync-agent-health-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sync-agent-health-card h3 {
  margin: 3px 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.sync-agent-health-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.sync-agent-health-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  flex: 1;
  max-width: 680px;
}

.sync-agent-health-stats div {
  background: var(--bg-secondary);
  border: 1px solid var(--divider-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.sync-agent-health-stats span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sync-agent-health-stats strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .sync-agent-health-card {
    flex-direction: column;
    align-items: stretch;
  }

  .sync-agent-health-stats {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* Insights Dashboard Grid */
.insights-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

.insight-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 20px 32px 20px; /* Increased bottom padding */
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--card-shadow);
}

.insight-card .card-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.insight-card .card-header .card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  flex: 1;
  min-height: 250px;
}

/* Top Debtors List */
.top-debtors-list-wrapper {
  overflow-y: auto;
  max-height: 280px;
}

.top-debtors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-debtor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--divider-color);
  transition: border-color var(--transition-fast);
}

.top-debtor-row:hover {
  border-color: var(--accent-blue);
}

.top-debtor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
  padding-right: 8px;
}

.top-debtor-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-debtor-group {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.top-debtor-amt {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-red);
}

/* Customer Detailed Banner */
.customer-banner {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--card-shadow);
}

.banner-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.customer-info-main h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.party-group-tag {
  display: inline-block;
  padding: 4px 10px;
  background-color: rgba(var(--accent-blue-rgb), 0.15);
  border: 1px solid rgba(var(--accent-blue-rgb), 0.3);
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

.banner-actions {
  display: flex;
  gap: 8px;
}

.banner-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--divider-color);
  padding-top: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item .label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-item .value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  word-break: break-all;
}

.banner-balances-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--divider-color);
  padding-top: 16px;
}

@media (max-width: 600px) {
  .banner-balances-row {
    grid-template-columns: 1fr;
  }
}

.bal-box {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--divider-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bal-box.highlight {
  background: rgba(var(--accent-blue-rgb), 0.05);
  border-color: rgba(var(--accent-blue-rgb), 0.2);
}

.bal-box .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.bal-box .val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 24px;
}

.tab-btn {
  padding: 12px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-btn i {
  width: 16px;
  height: 16px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-pane.active {
  display: flex;
}

/* Table Toolbar Controls */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.date-quick-filters {
  display: flex;
  gap: 6px;
}

.chip {
  padding: 6px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.chip.active {
  background-color: rgba(var(--accent-blue-rgb), 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.custom-date-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-field label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-field input {
  height: 28px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0 6px;
  font-size: 0.75rem;
  outline: none;
}

.toolbar-search-wrapper {
  position: relative;
  min-width: 250px;
}

@media (max-width: 600px) {
  .toolbar-search-wrapper {
    width: 100%;
  }
}

.toolbar-search-wrapper .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.toolbar-search-wrapper input {
  width: 100%;
  height: 36px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 10px 0 32px;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
}

/* Data Tables */
.table-responsive {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--card-shadow);
  width: 100%;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.data-table th {
  background-color: var(--bg-tertiary);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider-color);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.4;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

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

.text-right {
  text-align: right;
}

.text-debit {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent-red);
}

.text-credit {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent-green);
}

.text-bold {
  font-weight: 700;
}

.text-narration {
  color: var(--text-muted);
  font-size: 0.75rem;
  max-width: 250px;
  word-break: break-word;
}

/* Outstanding Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
}

.badge.overdue {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.badge.pending {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.badge.current {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

/* Loader / Spinner / Empty States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--text-secondary);
}

.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--text-secondary);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state, .table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state i, .table-empty i {
  width: 40px;
  height: 40px;
}

.empty-state.hidden, .table-loading.hidden, .table-empty.hidden, .hidden {
  display: none !important;
}

/* Settings Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  justify-content: flex-end;
}

.modal-overlay.open {
  display: flex;
}

.settings-drawer {
  width: 400px;
  height: 100%;
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .settings-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.drawer-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input[type="text"] {
  height: 40px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-primary);
  outline: none;
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}

.form-group input[type="text"]:focus {
  border-color: var(--accent-blue);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-group.row-toggle {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--divider-color);
  padding-top: 20px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 280px;
}

/* Switch styling */
.switch-container {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  border: 1px solid var(--divider-color);
  transition: .3s;
  border-radius: var(--radius-full);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

.switch-container input:checked + .slider {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.switch-container input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.status-report-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.report-header i {
  width: 14px;
  height: 14px;
}

.save-settings-btn {
  width: 100%;
  height: 42px;
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.save-settings-btn:hover {
  background-color: #2563eb;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.power-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.power-tag i {
  width: 12px;
  height: 12px;
}

/* Print Styling Configuration */
.print-only {
  display: none;
}

@media print {
  /* Hide all screen interface elements */
  .app-container, .modal-overlay, #saas-landing {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: Arial, sans-serif !important;
    padding: 20px !important;
    width: 100% !important;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000000;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }

  .print-title {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
  }

  .print-company-info {
    text-align: right;
    font-size: 11px;
    color: #333333;
    line-height: 1.4;
  }

  .print-party-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .print-party-details {
    width: 60%;
    font-size: 12px;
    line-height: 1.5;
  }

  .print-party-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .print-summary-box {
    width: 35%;
    border: 1px solid #000000;
    padding: 10px;
    font-size: 11px;
    background-color: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
  }

  .print-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  
  .print-summary-row:last-child {
    margin-bottom: 0;
    border-top: 1px solid #000000;
    padding-top: 6px;
    font-weight: bold;
    font-size: 12px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 11px;
  }

  .print-table th {
    background-color: #f0f0f0 !important;
    border: 1px solid #000000;
    padding: 6px 8px;
    font-weight: bold;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact;
  }

  .print-table td {
    border: 1px solid #cccccc;
    padding: 6px 8px;
    vertical-align: top;
  }

  .print-table tr:nth-child(even) {
    background-color: #fafafa !important;
    -webkit-print-color-adjust: exact;
  }

  .print-totals-row td {
    font-weight: bold;
    background-color: #f5f5f5 !important;
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    -webkit-print-color-adjust: exact;
  }

  .print-narration {
    font-style: italic;
    color: #555555;
    font-size: 9px;
    margin-top: 2px;
  }

  .print-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
  }

  .print-footer-declaration {
    width: 60%;
    line-height: 1.4;
  }

  .print-footer-signature {
    width: 30%;
    text-align: center;
    border-top: 1px solid #000000;
    padding-top: 40px;
    font-weight: bold;
  }
}
/* ----------------------------------------------------
   Invoice Details Modal UI Styles
   ---------------------------------------------------- */
#invoice-modal {
  justify-content: center;
  align-items: center;
  padding: 28px 16px;
  overflow-y: auto;
}

.invoice-modal-container {
  width: 100%;
  max-width: 980px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  max-height: 92vh;
}

.invoice-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.invoice-modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.invoice-modal-header .header-details h2 {
  margin: 0;
}

.invoice-modal-header .header-details {
  flex: 1 1 auto;
  min-width: 0;
}

.inv-type-badge {
  display: inline-block;
  padding: 4px 10px;
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: auto;
}

#btn-export-invoice-lines-excel,
#btn-print-invoice {
  white-space: nowrap;
  flex: 0 0 auto;
}

#btn-close-invoice {
  flex: 0 0 auto;
}

.invoice-modal-content {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background-color: #ececec;
  display: flex;
  justify-content: center;
}

.tally-invoice-sheet {
  width: 100%;
  max-width: 860px;
  background: #fff;
  color: #111;
  border: 1px solid #bcbcbc;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.28;
}

.invoice-title-row {
  position: relative;
  border-bottom: 1px solid #c9c9c9;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invoice-title-row h2 {
  margin: 0;
  font-size: 38px;
  font-weight: 700;
  color: #111;
  text-transform: none;
}

.invoice-copy-note {
  position: absolute;
  right: 18px;
  top: 20px;
  font-size: 10px;
  font-style: italic;
  color: #222;
}

.invoice-party-grid {
  display: grid;
  grid-template-columns: 58% 42%;
  border-bottom: 1px solid #c9c9c9;
}

.party-left-col {
  border-right: 1px solid #c9c9c9;
}

.party-block {
  padding: 10px 12px;
  border-bottom: 1px solid #d7d7d7;
}

.party-block:last-child {
  border-bottom: none;
}

.party-block h3 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.party-block p {
  margin: 1px 0;
  font-size: 11.5px;
}

.party-caption {
  font-size: 11.5px;
  margin: 0 0 4px 0;
  font-weight: 400;
}

#inv-seller-address,
#inv-ship-address,
#inv-billing-address {
  white-space: pre-line;
}

.invoice-info-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.invoice-info-table td {
  border-bottom: 1px solid #d7d7d7;
  border-right: 1px solid #d7d7d7;
  padding: 6px 6px;
  vertical-align: top;
  font-size: 11.5px;
}

.invoice-info-table tr td:nth-child(2),
.invoice-info-table tr td:nth-child(4) {
  font-weight: 700;
}

.invoice-info-table tr td:last-child {
  border-right: none;
}

.tally-items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tally-items-table th,
.tally-items-table td {
  border-right: 1px solid #d7d7d7;
}

.tally-items-table th:last-child,
.tally-items-table td:last-child {
  border-right: none;
}

.tally-items-table thead th {
  border-top: 1px solid #111;
  border-bottom: 1px solid #c9c9c9;
  padding: 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1px;
  text-align: center;
  background: #fff;
}

.tally-items-table thead th:nth-child(1) { width: 47%; }
.tally-items-table thead th:nth-child(2) { width: 9%; }
.tally-items-table thead th:nth-child(3) { width: 9%; }
.tally-items-table thead th:nth-child(4) { width: 9%; }
.tally-items-table thead th:nth-child(5) { width: 4%; }
.tally-items-table thead th:nth-child(6) { width: 12%; }

.tally-items-table td {
  border-bottom: 1px solid #ececec;
  padding: 7px 6px;
  font-size: 12px;
  vertical-align: top;
}

.tally-items-table td:nth-child(1) { font-weight: 700; }
.tally-items-table td:nth-child(3),
.tally-items-table td:nth-child(4),
.tally-items-table td:nth-child(5),
.tally-items-table td:nth-child(6) {
  text-align: right;
}

.invoice-taxes-cell {
  padding: 0 !important;
  border-bottom: 1px solid #ececec;
}

#invoice-taxes-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#invoice-taxes-table td {
  border-bottom: none;
  padding: 4px 6px;
  font-size: 11px;
}

#invoice-taxes-table td:first-child {
  width: 84%;
  text-align: right;
  font-weight: 700;
  font-style: italic;
}

#invoice-taxes-table td:last-child {
  width: 16%;
  text-align: right;
  font-weight: 700;
}

.tally-items-table .subtotal-row td {
  border-top: 1px solid #cfcfcf;
  border-bottom: 1px solid #dcdcdc;
  font-weight: 700;
  background: #fff;
}

.tally-items-table .grand-total-row td {
  border-top: 1px solid #bdbdbd;
  border-bottom: 1px solid #bdbdbd;
  font-weight: 700;
  font-size: 14px;
  background: #fff;
}

.amount-words-row,
.tax-words-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid #d7d7d7;
  padding: 7px 10px;
  font-size: 11px;
}

.tax-words-row {
  grid-template-columns: auto 1fr;
}

.amount-words-row strong,
.tax-words-row strong {
  font-size: 12px;
}

.eoe-label {
  font-style: italic;
}

.invoice-tax-summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.invoice-tax-summary-table th,
.invoice-tax-summary-table td {
  border-right: 1px solid #d7d7d7;
  border-bottom: 1px solid #d7d7d7;
  padding: 5px 6px;
  font-size: 11px;
}

.invoice-tax-summary-table th:last-child,
.invoice-tax-summary-table td:last-child {
  border-right: none;
}

.invoice-tax-summary-table th {
  font-weight: 400;
  text-align: center;
}

.invoice-tax-summary-table td:nth-child(n+2) {
  text-align: right;
}

.invoice-terms-footer {
  padding: 10px;
}

.narration-box {
  border: 1px solid #d7d7d7;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 11px;
}

.narration-box p {
  margin: 4px 0 0 0;
}

.declaration-bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #d7d7d7;
  border-bottom: none;
}

.declaration-box,
.bank-box {
  min-height: 92px;
  padding: 8px 10px;
  font-size: 11px;
}

.declaration-box {
  border-right: 1px solid #d7d7d7;
}

.signatures-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #d7d7d7;
}

.sig-box {
  min-height: 72px;
  padding: 8px 10px;
  font-size: 11px;
}

.sig-box:first-child {
  border-right: 1px solid #d7d7d7;
}

.sig-box p {
  margin: 0;
}

.sig-line {
  height: 1px;
  background-color: #111;
  margin: 40px 0 6px 0;
}

.sig-label {
  font-size: 11px;
}

@media (max-width: 900px) {
  .invoice-modal-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .modal-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .invoice-modal-content {
    padding: 8px;
  }

  .invoice-title-row h2 {
    font-size: 28px;
  }

  .invoice-party-grid {
    grid-template-columns: 1fr;
  }

  .party-left-col {
    border-right: none;
    border-bottom: 1px solid #c9c9c9;
  }

  .invoice-copy-note {
    position: static;
    margin-left: 10px;
    font-size: 10px;
  }

  .declaration-bank-grid,
  .signatures-row {
    grid-template-columns: 1fr;
  }

  .declaration-box,
  .sig-box:first-child {
    border-right: none;
    border-bottom: 1px solid #d7d7d7;
  }
}

@media print {
  @page {
    size: A4;
    margin: 6mm 8mm;
  }

  .print-only {
    padding: 0 !important;
    margin: 0 !important;
    background-color: #ffffff !important;
  }

  .print-only .tally-invoice-sheet {
    border: 1px solid #bcbcbc !important;
    box-shadow: none !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
    font-size: 10px !important;
    line-height: 1.22 !important;
    -webkit-print-color-adjust: exact;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-only .invoice-modal-content {
    background: #fff !important;
    padding: 0 !important;
  }

  /* Shrink invoice title banner */
  .print-only .invoice-title-row {
    min-height: 34px !important;
    border-bottom: 1px solid #c9c9c9 !important;
  }

  .print-only .invoice-title-row h2 {
    font-size: 20px !important;
  }

  .print-only .invoice-copy-note {
    top: 10px !important;
    font-size: 8px !important;
  }

  /* Compact party grid blocks */
  .print-only .party-block {
    padding: 4px 8px !important;
    border-bottom: 1px solid #d7d7d7 !important;
  }

  .print-only .party-block h3 {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }

  .print-only .party-block p {
    font-size: 9.5px !important;
    margin: 0 !important;
  }

  .print-only .party-caption {
    font-size: 9px !important;
    margin-bottom: 1px !important;
  }

  /* Compact invoice meta information table */
  .print-only .invoice-info-table td {
    padding: 3px 5px !important;
    font-size: 9.5px !important;
    border-bottom: 1px solid #d7d7d7 !important;
    border-right: 1px solid #d7d7d7 !important;
  }

  /* Tighten main item table layout */
  .print-only .tally-items-table thead th {
    padding: 4px !important;
    font-size: 9px !important;
    border-top: 1px solid #111 !important;
    border-bottom: 1px solid #c9c9c9 !important;
  }

  .print-only .tally-items-table td {
    padding: 3px 5px !important;
    font-size: 9.5px !important;
    border-bottom: 1px solid #ececec !important;
  }

  .print-only .tally-items-table .subtotal-row td,
  .print-only .tally-items-table .grand-total-row td {
    padding: 4px 5px !important;
  }

  .print-only .tally-items-table .grand-total-row td {
    font-size: 11px !important;
  }

  /* Compact invoice taxes sub-table */
  .print-only #invoice-taxes-table td {
    padding: 2px 5px !important;
    font-size: 9px !important;
  }

  /* Compact HSN tax summary table */
  .print-only .invoice-tax-summary-table th,
  .print-only .invoice-tax-summary-table td {
    padding: 2px 4px !important;
    font-size: 8.5px !important;
  }

  /* Tighten amount in words display */
  .print-only .amount-words-row,
  .print-only .tax-words-row {
    padding: 4px 8px !important;
    font-size: 9px !important;
    gap: 8px !important;
  }

  .print-only .amount-words-row strong,
  .print-only .tax-words-row strong {
    font-size: 9.5px !important;
  }

  /* Narration box */
  .print-only .narration-box {
    padding: 3px 6px !important;
    margin-bottom: 4px !important;
    font-size: 9px !important;
  }

  .print-only .narration-box p {
    margin-top: 1px !important;
  }

  /* Declaration and Bank Info panels */
  .print-only .declaration-bank-grid {
    min-height: auto !important;
  }

  .print-only .declaration-box,
  .print-only .bank-box {
    min-height: auto !important;
    padding: 4px 6px !important;
    font-size: 9px !important;
  }

  /* Authorised Signatories and Seals */
  .print-only .signatures-row {
    min-height: auto !important;
  }

  .print-only .sig-box {
    min-height: auto !important;
    padding: 4px 8px !important;
    font-size: 9px !important;
  }

  .print-only .sig-line {
    margin: 22px 0 3px 0 !important;
  }
}
/* Clickable table row styling */
.clickable-row {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.clickable-row:hover {
  background-color: rgba(59, 130, 246, 0.08) !important;
}
html[data-theme="light"] .clickable-row:hover {
  background-color: rgba(59, 130, 246, 0.05) !important;
}

/* ----------------------------------------------------
   Role-based & Login Portal Styles
   ---------------------------------------------------- */
body.customer-mode .sidebar {
  display: none !important;
}
body.customer-mode #btn-settings {
  display: none !important;
}

#login-overlay {
  justify-content: center;
  align-items: center;
  display: none;
  background-color: rgba(5, 8, 16, 0.8);
  backdrop-filter: blur(8px);
}
#login-overlay.open {
  display: flex;
}

#report-payment-modal {
  justify-content: center;
  align-items: center;
  display: none;
  background-color: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(8px);
}
#report-payment-modal.open {
  display: flex;
}

#app-dialog-overlay {
  justify-content: center;
  align-items: center;
  display: none;
  background-color: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(8px);
  z-index: 140;
}

#app-dialog-overlay.open {
  display: flex;
}


.login-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(0);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  animation: loginCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardAppear {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand {
  text-align: center;
}

.brand-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.brand-icon i {
  width: 24px;
  height: 24px;
}

.login-brand h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
}

.login-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.login-role-selector {
  display: flex;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
}

.role-tab {
  flex: 1;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.role-tab:hover {
  color: var(--text-primary);
}

.role-tab.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input, .form-group .input-wrapper input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px 0 38px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper input:focus, .form-group .input-wrapper input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

.alert-box.error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
}

.alert-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.login-btn {
  width: 100%;
  height: 44px;
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.login-btn:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.login-btn i {
  width: 16px;
  height: 16px;
}

.login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 15px;
}

.footer-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-security i {
  width: 12px;
  height: 12px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.back-link i {
  width: 14px;
  height: 14px;
}

/* SaaS Landing Page Styling */
.saas-landing {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  width: 100%;
  overflow-y: auto;
  font-family: var(--font-body);
  scroll-behavior: smooth;
  padding-bottom: 80px;
}

.saas-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  margin: 14px auto 0;
  width: min(1320px, calc(100% - 28px));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.35));
  backdrop-filter: blur(12px);
  position: static;
  top: auto;
  z-index: 100;
}

.saas-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.saas-nav .nav-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.saas-nav .nav-logo .logo-icon i {
  width: 20px;
  height: 20px;
}

.saas-nav .nav-logo .logo-text h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.saas-nav .nav-logo .logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saas-nav .nav-main-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px;
}

.saas-nav .nav-main-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: all var(--transition-fast);
}

.saas-nav .nav-main-links a:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.12);
}

.saas-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px;
}

.saas-nav .nav-actions a.cta-nav-btn {
  background: var(--accent-blue);
  color: white;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.saas-nav .nav-actions a.cta-nav-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Hero Section */
.saas-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  padding: 80px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.saas-hero .hero-content .hero-badge {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 24px;
}

.saas-hero .hero-content h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-primary) 50%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.saas-hero .hero-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

.saas-hero .hero-actions {
  display: flex;
  gap: 20px;
}

.saas-hero .hero-btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
  transition: all var(--transition-fast);
}

.saas-hero .hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.4);
}

.saas-hero .hero-btn-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.saas-hero .hero-btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  border-color: var(--text-muted);
}

/* Hero Visual Mockup */
.saas-hero .hero-visual .visual-mockup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 380px;
}

.visual-mockup .mockup-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.visual-mockup .mockup-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.visual-mockup .mockup-header .dot.red { background: #ef4444; }
.visual-mockup .mockup-header .dot.yellow { background: #f59e0b; }
.visual-mockup .mockup-header .dot.green { background: #10b981; }

.visual-mockup .mockup-header .mockup-title {
  margin-left: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.visual-mockup .mockup-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  flex-grow: 1;
}

.visual-mockup .mockup-sidebar {
  border-right: 1px solid var(--border-color);
  background: rgba(15, 21, 36, 0.5);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.visual-mockup .mockup-sidebar .mockup-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.visual-mockup .mockup-sidebar .mockup-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 500;
}

.visual-mockup .mockup-main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.visual-mockup .mockup-metric-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.visual-mockup .mockup-metric-card span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visual-mockup .mockup-metric-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-green);
}

.visual-mockup .mockup-table {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.75rem;
}

.visual-mockup .mockup-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 3fr;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.visual-mockup .mockup-row.header {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

/* Sections */
.saas-features, .saas-how, .saas-register-section, .saas-pricing {
  padding: 80px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}

.features-grid .feat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-normal);
}

.features-grid .feat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--card-shadow);
}

.features-grid .feat-card .feat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.features-grid .feat-card .feat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.features-grid .feat-card .feat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.features-grid .feat-card .feat-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }

.features-grid .feat-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.features-grid .feat-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Steps Timeline */
.steps-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  position: relative;
}

.steps-timeline .step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  position: relative;
}

.steps-timeline .step-card .step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.steps-timeline .step-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-top: 10px;
  margin-bottom: 12px;
}

.steps-timeline .step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Register Section */
.register-card-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 650px;
  margin: 0 auto;
  box-shadow: var(--card-shadow);
}

.register-card-wrapper .register-header {
  text-align: center;
  margin-bottom: 36px;
}

.register-card-wrapper .register-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.register-card-wrapper .register-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.register-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: all var(--transition-fast);
  margin-top: 24px;
}

.register-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

/* Register Success Area */
.saas-success-box {
  margin-top: 20px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
}

.saas-success-box .success-header {
  text-align: center;
  margin-bottom: 20px;
}

.saas-success-box .success-header .success-icon {
  color: var(--accent-green);
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.saas-success-box .success-header h3 {
  color: var(--accent-green);
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.saas-success-box .success-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.credentials-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.credentials-box .cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.credentials-box .cred-row.highlight {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  margin-top: 4px;
}

.credentials-box .cred-label {
  color: var(--text-muted);
  font-weight: 500;
}

.credentials-box .cred-value {
  color: var(--text-primary);
  font-family: monospace;
  font-weight: bold;
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  user-select: all;
}

.credentials-box a.cred-value {
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
  max-width: 250px;
}

.setup-instruction-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.setup-instruction-box ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.success-btn-primary {
  display: block;
  text-align: center;
  background: var(--accent-green);
  color: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.success-btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

/* Pricing Grid */
.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 40px auto 0;
}

/* Pricing Card */
.saas-pricing .pricing-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 450px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.saas-pricing .pricing-card:hover {
  border-color: var(--accent-purple);
  box-shadow: var(--card-shadow);
}

.saas-pricing .pricing-card .price-badge {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 24px;
}

.saas-pricing .pricing-card .price-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 16px;
}

.saas-pricing .pricing-card .price-header .currency {
  font-size: 1.5rem;
  font-weight: 600;
}

.saas-pricing .pricing-card .price-header .amount {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.saas-pricing .pricing-card .price-header .period {
  color: var(--text-muted);
  font-size: 1rem;
  margin-left: 4px;
}

.saas-pricing .pricing-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 32px;
}

.saas-pricing .price-features {
  text-align: left;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 320px;
  margin: 0 auto;
}

.saas-pricing .price-features li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.saas-pricing .price-features li .check-icon {
  color: var(--accent-green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.buy-plan-btn {
  margin-top: 18px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.buy-plan-btn i {
  width: 16px;
  height: 16px;
}

.buy-plan-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.34);
}

.buy-plan-btn:active {
  transform: translateY(0);
}

.buy-plan-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Custom Sync Badge inside Login Portal */
.login-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 10px;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.login-sync-badge i.icon-sync {
  width: 11px;
  height: 11px;
}

/* Responsive layout adjustments */
@media (max-width: 1024px) {
  .saas-nav { padding: 20px 40px; }
  .saas-hero { grid-template-columns: 1fr; padding: 40px 40px; text-align: center; gap: 40px; }
  .saas-hero .hero-actions { justify-content: center; }
  .saas-features, .saas-how, .saas-register-section, .saas-pricing { padding: 40px 40px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-timeline { grid-template-columns: 1fr; gap: 32px; }
}

/* Simulated Sync Console */
.simulator-wrapper {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.success-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.success-btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.success-btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-console {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-family: 'Consolas', 'Courier New', monospace;
  margin-top: 12px;
  text-align: left;
}

.console-header {
  background: #1e293b;
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #0f172a;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot-anim 1.5s infinite;
}

@keyframes pulse-dot-anim {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.console-logs {
  padding: 16px;
  font-size: 0.78rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  color: #38bdf8;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line.success {
  color: #4ade80;
}

.log-line.error {
  color: #f87171;
}

.log-line.warning {
  color: #fbbf24;
}

.log-line.info {
  color: #94a3b8;
}

.success-btn-primary.disabled {
  pointer-events: none;
  background: var(--border-color) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  opacity: 0.5;
  cursor: not-allowed;
}

.setup-download-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.setup-download-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

/* Demo autofill hints on login pages */
.demo-hints {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hint-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.demo-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.demo-badge:hover {
  background-color: var(--bg-active);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* Secondary CTA Button in Nav Bar */
.saas-nav .nav-actions a.cta-nav-btn-secondary {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 999px;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.saas-nav .nav-actions a.cta-nav-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  color: var(--text-primary);
}

/* SaaS Landing Page Tab selector */
.saas-tabs-header {
  display: flex;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
  width: 100%;
}

.saas-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  text-align: center;
}

.saas-tab:hover {
  color: var(--text-primary);
}

.saas-tab.active {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Status Badges for Reported Payments */
.badge.status-pending {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.badge.status-verified {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.badge.status-rejected {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

/* Actions Buttons for Admin Verification Table */
.btn-verify, .btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
}

.btn-verify {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.btn-verify:hover {
  background-color: var(--accent-green);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.btn-verify:active, .btn-reject:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.btn-reject {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.btn-reject:hover {
  background-color: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* Admin reported payments table â€” allow overflow so buttons are not clipped */
#admin-reported-payments-card .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

#admin-reported-payments-table td {
  vertical-align: middle;
}

/* Toolbar Select Dropdown Wrapper */
.toolbar-select-wrapper {
  position: relative;
  min-width: 180px;
}

@media (max-width: 600px) {
  .toolbar-select-wrapper {
    width: 100%;
  }
}

.toolbar-select-wrapper .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar-select-wrapper select {
  width: 100%;
  height: 36px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 32px 0 32px;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.toolbar-select-wrapper select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.toolbar-select-wrapper::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
  pointer-events: none;
}

/* Pagination Controls style */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  padding-bottom: 24px; /* Added bottom padding */
  margin-bottom: 12px; /* Added bottom margin */
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent-blue);
  background-color: rgba(59, 130, 246, 0.05);
  color: var(--accent-blue);
}

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

.pagination-btn.active {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.pagination-btn.dots {
  border: none;
  background: none;
  cursor: default;
  color: var(--text-secondary);
}

.pagination-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-select-wrapper span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-select-wrapper select {
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0 8px;
  outline: none;
  cursor: pointer;
}

/* Mobile optimization */
@media (max-width: 900px) {
  body,
  body.app-active {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    height: auto;
    min-height: 70px;
    padding: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-logo {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
    padding-bottom: 0;
    gap: 8px;
  }

  .header-actions > * {
    flex: 0 0 auto;
  }

  .header-actions .status-badge {
    order: 2;
  }

  .header-actions .action-btn,
  .header-actions .icon-btn {
    height: 36px;
  }

  #btn-dashboard span,
  #btn-global-download-installer span {
    display: none;
  }

  #sync-last-time {
    display: none;
  }

  .workspace {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 70px);
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    position: static;
  }

  .customer-list-container {
    max-height: 40vh;
  }

  .content-area {
    min-height: 0;
  }

  .view-section {
    padding: 16px 12px 88px 12px;
    gap: 16px;
  }

  .view-header h2 {
    font-size: 1.3rem;
  }

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

  .customer-banner {
    padding: 14px;
  }

  .banner-title-row {
    flex-direction: column;
    gap: 10px;
  }

  .banner-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .banner-actions .action-btn,
  .banner-actions .icon-btn {
    flex: 1;
    min-width: 130px;
  }

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

  .tab-btn {
    white-space: nowrap;
    font-size: 0.82rem;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .date-quick-filters {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .custom-date-inputs {
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .custom-date-inputs .date-field {
    flex: 1;
    min-width: 130px;
  }

  .toolbar-search-wrapper,
  .toolbar-select-wrapper {
    min-width: 0;
    width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .login-card {
    max-width: calc(100vw - 20px);
    padding: 18px;
    gap: 16px;
    border-radius: var(--radius-md);
  }

  .saas-nav {
    width: calc(100% - 16px);
    margin: 8px auto 0;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .saas-nav .nav-logo {
    justify-content: center;
  }

  .saas-nav .nav-main-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    border-radius: 14px;
  }

  .saas-nav .nav-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 14px;
    padding: 8px;
  }

  .saas-nav .nav-actions a.cta-nav-btn,
  .saas-nav .nav-actions a.cta-nav-btn-secondary {
    flex: 1 1 31%;
    text-align: center;
    min-width: 120px;
  }

  .saas-hero {
    padding: 30px 12px;
    gap: 24px;
  }

  .saas-features,
  .saas-how,
  .saas-register-section,
  .saas-pricing {
    padding: 30px 12px;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 28px;
  }

  .register-card-wrapper {
    padding: 18px;
  }

  .saas-tabs-header {
    flex-wrap: wrap;
  }

  .saas-tab {
    min-width: 100%;
  }

  .credentials-box .cred-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .credentials-box a.cred-value {
    max-width: 100%;
  }

  .pricing-grid {
    gap: 16px;
  }

  .saas-pricing .pricing-card {
    padding: 24px 16px;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 10px 8px;
    gap: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .header-logo {
    align-items: center;
    gap: 10px;
  }

  .header-logo .logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .header-logo .logo-text h1 {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .header-logo .logo-text span {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
    padding-bottom: 0;
  }

  .header-actions > * {
    flex: 1 1 62px;
    max-width: 92px;
  }

  .header-actions .icon-btn,
  .header-actions .action-btn,
  .header-actions > div {
    min-width: 62px;
  }

  .header-actions .icon-btn,
  .header-actions .action-btn {
    justify-content: center;
    padding: 0 6px;
  }

  #header-company-switcher-wrapper {
    min-width: 120px !important;
    max-width: 180px;
    margin-right: 0 !important;
  }

  #btn-dashboard {
    min-width: 98px;
    max-width: 140px;
  }

  /* Hide verbose badges on very small screens to avoid overlap */
  #tally-status-badge,
  #header-trial-badge {
    display: none !important;
  }

  #sync-now-wrap {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
  }

  #sync-last-time {
    display: none !important;
  }

  .sidebar-search {
    gap: 8px;
    padding-top: 0;
  }

  .search-input-wrapper {
    min-width: 0;
  }

  .search-input-wrapper input {
    font-size: 0.9rem;
    padding: 0 10px 0 34px;
  }

  .directory-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .directory-filters .filter-chip {
    flex: 0 1 auto;
  }

  .view-section {
    padding: 14px 10px 84px 10px;
  }

  .banner-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .banner-actions .action-btn,
  .banner-actions .icon-btn {
    width: 100%;
    min-width: 0;
  }

  #vendor-gst-sync-card input,
  #vendor-gst-sync-card button {
    width: 100%;
    min-width: 0 !important;
  }

  .tabs-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .tab-btn {
    min-width: max-content;
    white-space: nowrap;
  }

  .table-toolbar {
    gap: 8px;
  }

  .toolbar-search-wrapper,
  .toolbar-select-wrapper,
  .date-quick-filters,
  .custom-date-inputs {
    width: 100%;
    min-width: 0;
  }

  .date-chip {
    height: 34px;
    font-size: 0.76rem;
    padding: 0 10px;
  }

  .invoice-modal-container {
    width: calc(100vw - 10px);
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
    border-radius: 12px;
  }

  .invoice-modal-header {
    padding: 12px;
    gap: 10px;
  }

  .modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .modal-actions .action-btn,
  .modal-actions .icon-btn {
    width: 100%;
    min-width: 0;
  }
}

#superadmin-login-modal {
  justify-content: center;
  align-items: center;
}
