/* Design System & Variables (Light Theme) */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Colors */
  --bg-app: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-color: rgba(99, 102, 241, 0.08);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --primary: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #4f46e5, #06b6d4);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --warning: #d97706;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(99, 102, 241, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.05);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.02) 0%, transparent 40%);
  background-attachment: fixed;
}

/* App Container */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  background: var(--primary-gradient);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Control Groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Custom Inputs & Selects */
.custom-select, .custom-input {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
  min-width: 180px;
  box-shadow: var(--shadow-sm);
}

.custom-select:hover, .custom-input:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.2);
}

.custom-select:focus, .custom-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.custom-select option {
  background-color: #ffffff;
  color: var(--text-primary);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.icon-button:active {
  transform: translateY(0);
}

.settings-btn:hover {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

/* Demo Badge */
.demo-badge-container {
  display: flex;
  align-items: center;
}

.demo-badge {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--warning);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulse 2.5s infinite;
}

.demo-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--warning);
  border-radius: 50%;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.15); }
  70% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(241, 245, 249, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

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

.loading-overlay p {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.span-two-columns {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .span-two-columns {
    grid-column: span 1;
  }
}

/* Section Titles */
.grid-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
}

.section-title-container h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.date-display {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: auto;
}

/* KPI Cards Layout */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 600px) {
  .kpi-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* KPI Cards */
.kpi-card {
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

.highlight-card {
  border-left: 3px solid var(--primary);
}

.kpi-card.highlight-card:hover {
  border-left-color: #06b6d4;
}

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

.kpi-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ca-icon {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}

.margin-icon {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.kpi-value-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-value-container .kpi-value {
  margin-bottom: 0;
}

.kpi-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.margin-rate-badge {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* KPI Evolutions */
.kpi-evolutions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.border-top {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 16px;
}

.evol-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.evol-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.evol-value {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--danger);
}

.trend-neutral {
  color: var(--text-muted);
}

/* Charts Card */
.charts-card {
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

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

.charts-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.chart-toggles {
  display: flex;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 4px;
  border-radius: 10px;
}

.chart-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-toggle-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.chart-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1000px) {
  .chart-content {
    grid-template-columns: 1fr;
  }
}

.main-chart-container {
  min-height: 320px;
  position: relative;
}

.secondary-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  padding-left: 24px;
}

@media (max-width: 1000px) {
  .secondary-chart-container {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 24px;
  }
}

.secondary-chart-container h4 {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.donut-chart-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
}

/* Tables Card */
.table-card {
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.table-header {
  margin-bottom: 20px;
}

.table-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

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

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.dashboard-table th {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  font-weight: 500;
}

.dashboard-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.02);
}

.dashboard-table th.number, .dashboard-table td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  background: var(--primary-gradient);
  height: 100%;
  border-radius: 3px;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  max-width: 540px;
  width: 100%;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

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

.modal-body {
  padding: 24px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

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

.form-tip {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.input-with-addon {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.input-with-addon .custom-input {
  border: none;
  flex-grow: 1;
  background: transparent;
  box-shadow: none;
}

.input-addon {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.form-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin: 20px 0;
}

/* Switch styling */
.switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-container input {
  display: none;
}

.switch-slider {
  width: 44px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  position: relative;
  transition: background-color 0.3s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: white;
  top: 3px;
  left: 3px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

.switch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 16px;
}

.alert-info {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--text-secondary);
}

/* Buttons */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.api-fields-container {
  transition: all 0.3s ease;
  max-height: 400px;
  opacity: 1;
  overflow: hidden;
}

.api-fields-container.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  margin-bottom: 0;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* Utilities for Responsive Text/Elements */
.mobile-only {
  display: none !important;
}
.desktop-only {
  display: inline-block;
}

/* VAT Card Sub-info styling */
.vat-sub-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Optimize layout and text size specifically for iPhone and small mobile devices */
@media (max-width: 576px) {
  .mobile-only {
    display: inline-block !important;
  }
  .desktop-only {
    display: none !important;
  }

  .app-container {
    padding: 12px;
  }
  
  /* Header CSS Grid Layout */
  .header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
  }
  
  .header-brand {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
  }
  
  .brand-text h1 {
    font-size: 18px;
  }
  
  .brand-text p {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  
  /* Action buttons next to brand */
  .action-buttons {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 8px;
    width: auto;
    margin-top: 0;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  
  /* Controls full-width in second row, selectors side-by-side */
  .header-controls {
    grid-column: 1 / span 2;
    grid-row: 2;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .demo-badge-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
  }

  .demo-badge {
    padding: 4px 10px;
    font-size: 11px;
  }
  
  .control-group {
    flex: 1;
    min-width: 120px;
  }
  
  .custom-select, .custom-input {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    box-sizing: border-box;
  }
  
  /* Dashboard layout grids */
  .dashboard-grid {
    gap: 16px;
  }
  
  .grid-section {
    gap: 12px;
  }
  
  .section-title-container h2 {
    font-size: 16px;
  }
  
  .date-display {
    font-size: 12px;
  }
  
  .kpi-cards-grid {
    gap: 12px;
  }
  
  .kpi-card {
    padding: 16px;
    border-radius: 16px;
    min-height: auto;
  }
  
  .kpi-value {
    font-size: 24px;
    margin-bottom: 8px;
  }
  
  .kpi-value-container {
    margin-bottom: 8px;
  }
  
  .kpi-value-container .kpi-value {
    font-size: 24px;
  }
  
  .kpi-badge {
    font-size: 10px;
    padding: 2px 6px;
  }



  /* VAT KPI sub-info */
  .vat-sub-info {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  .charts-card, .table-card {
    padding: 16px;
    border-radius: 16px;
  }
  
  .charts-header h3, .table-header h3 {
    font-size: 15px;
  }
  
  .chart-toggle-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .main-chart-container {
    min-height: 240px;
  }
  
  .donut-chart-wrapper {
    min-height: 200px;
  }
  
  /* Horizontal table scrolling & column layout */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-table th, .dashboard-table td {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  
  /* Modal responsive improvements */
  .modal-card {
    width: 95%;
    max-width: 100%;
    border-radius: 16px;
  }

  .modal-header, .modal-body {
    padding: 16px;
  }
  
  .modal-header h2 {
    font-size: 18px;
  }
}

/* Tab Navigation Layout & Styles */
.tab-navigation {
  display: flex;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  max-width: fit-content;
  gap: 6px;
}

.tab-button {
  border: none;
  background: transparent;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.tab-button svg {
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.tab-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
}

.tab-button:hover svg {
  transform: translateY(-1px);
  opacity: 1;
}

.tab-button.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.tab-button.active svg {
  opacity: 1;
}

/* Tab Content toggles */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: grid !important; /* Force grid layout for dashboard structure */
}

@media (max-width: 768px) {
  .tab-navigation {
    width: 100%;
    max-width: 100%;
  }
  
  .tab-button {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Primes Page Styles */
.contract-select {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.contract-select:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.badge-normal {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
  text-align: center;
}

.badge-none {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-info {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Scrollable Table for Seller Primes */
.scrollable-table th,
.scrollable-table td {
  white-space: nowrap;
}

/* Progress bar fill animations */
#progressBarFill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}



