/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Colors - Industrial Navy & Brushed Copper B2B */
  --bg-app: #0c0e12;
  --bg-sidebar: #11131a;
  --bg-card: rgba(22, 26, 36, 0.65);
  --bg-card-hover: rgba(30, 36, 48, 0.75);
  --bg-input: #12151e;
  --bg-dialog: #11131a;
  --bg-login-modal: rgba(22, 26, 36, 0.9);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  
  /* Primary Button / Call-to-Action: Brushed Copper Accent */
  --primary: #d97736;
  --primary-hover: #c2652b;
  --primary-light: rgba(217, 119, 54, 0.15);
  
  /* Brand Accents: Navy Steel-Blue */
  --brand-navy: #2e445a;
  --brand-navy-light: rgba(46, 68, 90, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --success-border: rgba(16, 185, 129, 0.2);
  --success-text: #34d399;
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-border: rgba(245, 158, 11, 0.2);
  --warning-text: #fbbf24;
  
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.06);
  --danger-border: rgba(239, 68, 68, 0.18);
  --danger-text: #f87171;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE STYLES & LAYOUT
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   SIDEBAR NAV
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.brand-section {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background-color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.brand-details h1 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--brand-navy-light);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--brand-navy);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

/* ==========================================================================
   MAIN CONTENT HEADER
   ========================================================================== */
.app-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-header {
  height: var(--header-height);
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background-color: rgba(8, 11, 17, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.header-title-area h2 {
  font-size: 20px;
  font-weight: 600;
}

.header-title-area p {
  font-size: 13px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.content-body {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ==========================================================================
   TAB ROUTING CONTROLS
   ========================================================================== */
.tab-content {
  display: none;
}

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

/* ==========================================================================
   DASHBOARD SECTION
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
  
  .upload-card {
    grid-column: 1 / -1;
  }
  
  .result-card {
    grid-column: 1 / 2;
  }
  
  .history-card {
    grid-column: 2 / 3;
  }
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

.card-body {
  padding: 24px;
}

/* ==========================================================================
   UPLOAD ZONE
   ========================================================================== */
.upload-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background-color: rgba(255, 255, 255, 0.01);
}

.upload-drop-zone:hover, .upload-drop-zone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.hidden-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-hover);
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.upload-drop-zone:hover .upload-icon {
  transform: translateY(-4px);
}

.prompt-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.prompt-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.browse-link {
  color: var(--primary-hover);
  text-decoration: underline;
  font-weight: 500;
}

.prompt-info {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.progress-bar-container {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--primary);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   STATS AND METRICS
   ========================================================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
}

.match-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
}

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

.data-table th {
  background-color: rgba(15, 19, 26, 0.95);
  color: var(--text-primary);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

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

/* Color Coding for Results */
.row-matched {
  background-color: var(--success-bg);
}
.row-matched td {
  border-bottom-color: var(--success-border) !important;
}

.row-unmatched {
  background-color: var(--warning-bg);
}
.row-unmatched td {
  border-bottom-color: var(--warning-border) !important;
}

.sub-item-note {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 3px;
  font-style: italic;
}

/* ==========================================================================
   PILLS & ACCENTS
   ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-success {
  background-color: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.pill-warning {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.score-badge {
  font-size: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

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

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color-hover);
}

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

.btn-danger-outline:hover {
  background-color: var(--danger-bg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
}

.icon {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   RATES ACTIONS BAR
   ========================================================================== */
.rates-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
}

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

.search-input-wrapper input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 42px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* ==========================================================================
   PAGINATION FOOTER
   ========================================================================== */
.pagination-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* ==========================================================================
   NATIVE DIALOG MODAL STYLE
   ========================================================================== */
dialog {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-dialog);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 550px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 100;
  overflow: hidden;
}

/* Modern backdrop with blur */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.dialog-content {
  display: flex;
  flex-direction: column;
}

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

.dialog-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-close-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-close-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Forms */
#form-rate {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .span-2 {
    grid-column: span 2;
  }
}

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

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

.form-group input,
.form-group select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

dialog[open] {
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   PDF PARSER OVERLAY & MODAL STYLES
   ========================================================================== */
.pdf-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-overlay-content {
  background-color: rgba(20, 26, 38, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.pdf-overlay-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
}

.pdf-overlay-content p {
  font-size: 13px;
}

/* ==========================================================================
   COMPARISON SUITE STYLES
   ========================================================================== */
.sub-panel {
  display: none;
}
.sub-panel.active {
  display: block;
}

.row-cheaper {
  background-color: var(--success-bg);
}
.row-cheaper td {
  border-bottom-color: var(--success-border) !important;
}

.row-dearer {
  background-color: var(--danger-bg);
}
.row-dearer td {
  border-bottom-color: var(--danger-border) !important;
}

.text-danger {
  color: var(--danger-text);
}

.bold-saving {
  font-weight: 700;
  color: var(--success-text);
}

.sub-tabs-bar .btn.active {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary);
}

/* ==========================================================================
   AUTHENTICATION & LOGIN OVERLAY (Glassmorphism & Rich Premium Look)
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgb(18, 16, 33) 0%, rgb(9, 9, 13) 90%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

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

.login-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 16px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  box-sizing: border-box;
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.login-card .btn-primary {
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-danger-outline {
  background-color: transparent;
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.btn-danger-outline:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}


/* ==========================================================================
   DYNAMIC LANDING PAGE & SHOWCASE STYLES
   ========================================================================== */
.landing-page {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: #0b0b0f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.landing-page.hidden {
  display: none !important;
}

/* Navbar */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 80px;
  background-color: rgba(11, 11, 15, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
}

.landing-brand-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.landing-brand-text p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.landing-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.landing-nav-links a:hover {
  color: white;
}

/* Hero Section */
.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  padding: 80px 80px;
  max-width: 1400px;
  margin: 0 auto;
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.badge-new {
  background-color: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-content h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 20px 0;
  color: white;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 36px 0;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Interactive Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.mockup-card {
  width: 100%;
  max-width: 480px;
  background-color: rgba(17, 17, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.mockup-header {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.circle-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.circle-btn.close { background-color: #ef4444; }
.circle-btn.minimize { background-color: #f59e0b; }
.circle-btn.expand { background-color: #10b981; }

.mockup-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.mockup-body {
  padding: 24px;
  font-family: 'Inter', sans-serif;
}

.mockup-row {
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.8fr 1fr 1fr;
  font-size: 11px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mockup-row.header-row {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mockup-row.matched {
  color: #e2e8f0;
}

.rate-strike {
  text-decoration: line-through;
  color: var(--text-muted);
}

.rate-net {
  font-weight: 600;
  color: #38bdf8;
  text-align: right;
}

.mockup-total-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.total-row.grand {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-hover);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Features Section */
.landing-features {
  padding: 100px 80px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px auto;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0 0 16px 0;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  margin-bottom: 20px;
}

.bg-primary-light { background-color: rgba(79, 70, 229, 0.1); }
.bg-success-light { background-color: rgba(16, 185, 129, 0.1); }
.bg-warning-light { background-color: rgba(245, 158, 11, 0.1); }
.bg-info-light { background-color: rgba(6, 182, 212, 0.1); }

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin: 0 0 12px 0;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Sandbox Demo Section */
.landing-sandbox {
  background-color: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding: 80px 80px;
  width: 100%;
  box-sizing: border-box;
}

.sandbox-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
}

.sandbox-info h2 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0 0 16px 0;
}

.sandbox-info p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.sandbox-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

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

.sandbox-widget {
  background-color: rgba(17, 17, 24, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 30px;
  backdrop-filter: blur(8px);
  width: 100%;
  box-sizing: border-box;
}

.sandbox-result {
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.result-header {
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-body {
  padding: 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  font-size: 13px;
  background-color: rgba(0, 0, 0, 0.15);
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 40px 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
}

/* Native Dialog Login Modal styles */
.login-modal {
  background: var(--bg-login-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 420px;
  box-sizing: border-box;
  color: var(--text-primary);
}

.login-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

/* Responsive */
@media (max-width: 1024px) {
  .landing-nav { padding: 20px 40px; }
  .landing-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 40px;
    gap: 40px;
  }
  .hero-content { align-items: center; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .sandbox-container { grid-template-columns: 1fr; gap: 40px; }
  .landing-features { padding: 60px 40px; }
  .landing-sandbox { padding: 60px 40px; }
}

@media (max-width: 640px) {
  .landing-nav-links a { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 32px; }
}
/* ==========================================================================
   MACOS SMOOTH TRANSITIONS & ANIMATIONS
   ========================================================================== */
.accelerated {
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  transform: translateZ(0);
}

@keyframes macOSFadeIn {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Apply tab slide-in fade animation */
.tab-content:not(.hidden) {
  animation: macOSFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity, filter;
}

/* Customer details sidebar panel slide-in */
#customer-detail-panel:not(.hidden) {
  animation: macOSFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity, filter;
  display: block !important;
}

/* Modals slide-up scale & blur transitions */
@keyframes macOSModalOpen {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.93) translateY(24px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
    filter: blur(0);
  }
}

.login-modal[open],
#settings-modal[open],
#customer-modal[open],
#rate-modal[open],
#compare-modal[open] {
  animation: macOSModalOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity, filter;
}

/* Smooth blur on dialog backdrop overlay */
@keyframes macOSBackdrop {
  from {
    backdrop-filter: blur(0px) brightness(1);
    background: rgba(0, 0, 0, 0);
  }
  to {
    backdrop-filter: blur(10px) brightness(0.65);
    background: rgba(0, 0, 0, 0.6);
  }
}

.login-modal[open]::backdrop,
#settings-modal[open]::backdrop,
#customer-modal[open]::backdrop,
#rate-modal[open]::backdrop,
#compare-modal[open]::backdrop {
  animation: macOSBackdrop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slick row insertions fade */
@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.data-table tbody tr {
  animation: rowFadeIn 0.24s ease-out forwards;
}

/* Button click feedback scale shrink */
.btn {
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   DAYLIGHT MODE (LIGHT THEME) OVERRIDES
   ========================================================================== */
body.light-theme {
  --bg-app: #f4f6f8;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-dialog: #ffffff;
  --bg-login-modal: rgba(255, 255, 255, 0.95);
  
  --border-color: #cbd5e1;
  --border-color-hover: #94a3b8;
  
  /* Primary Button / Call-to-Action: Brushed Copper Accent */
  --primary: #d97736;
  --primary-hover: #c2652b;
  --primary-light: rgba(217, 119, 54, 0.08);
  
  /* Brand Accents: Navy Steel-Blue */
  --brand-navy: #1e2d3d;
  --brand-navy-light: rgba(30, 45, 61, 0.08);
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --success: #0284c7; /* Water Blue */
  --success-bg: rgba(2, 132, 199, 0.08);
  --success-border: rgba(2, 132, 199, 0.2);
  --success-text: #0284c7;
  
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-text: #9a3412;
  --danger-bg: rgba(239, 68, 68, 0.06);
  --danger-text: #991b1b;
}

/* Adjust landing page for light theme */
body.light-theme .landing-page {
  background-color: #f8fafc;
  color: #0f172a;
}

body.light-theme .landing-nav {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

body.light-theme .landing-logo-icon {
  background: var(--primary);
  color: #ffffff;
}

body.light-theme .landing-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

body.light-theme .hero-content h1 {
  color: #0f172a;
}

body.light-theme .features-section {
  background-color: #ffffff;
}

body.light-theme .feature-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

body.light-theme .feature-card h3 {
  color: #0f172a;
}

body.light-theme .sandbox-section {
  background-color: #f1f5f9;
}

body.light-theme .sandbox-title h2 {
  color: #0f172a;
}

body.light-theme .invoice-mockup {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body.light-theme .mockup-header {
  border-bottom: 1px solid #e2e8f0;
}

body.light-theme .mockup-table th {
  background: #f1f5f9;
  color: #475569;
}

body.light-theme .mockup-table td {
  border-bottom: 1px solid #f1f5f9;
}

body.light-theme .dialog-content {
  color: #0f172a;
}

body.light-theme .pill-success {
  background: rgba(16, 185, 129, 0.1);
  color: #15803d;
}

/* Light Theme Card Borders & Shadows */
body.light-theme .card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  border: 1px solid #e2e8f0;
}

/* Light Mode Input styling */
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme select {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.light-theme input[type="text"]:focus,
body.light-theme input[type="password"]:focus,
body.light-theme select:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

/* Sidebar item hover states in Light mode */
body.light-theme .nav-item {
  color: #475569;
}

body.light-theme .nav-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

body.light-theme .nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Light mode table overrides */
body.light-theme .data-table th {
  background-color: #f8fafc;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}

body.light-theme .data-table td {
  border-bottom: 1px solid #e2e8f0;
}

body.light-theme .data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Light Theme Title Fix (Override Webkit text transparent gradient) */
body.light-theme .hero-content h1 {
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & TOUCH ADAPTATION
   ========================================================================== */
@media (max-width: 768px) {
  /* Prevent background body scrollbars, fit everything in mobile flex app */
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  
  /* Convert sidebar into a horizontal bottom navigation bar */
  .app-sidebar {
    width: 100%;
    height: 64px;
    min-height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0 8px;
    border-right: none;
    border-top: 1px solid var(--border-color);
    order: 2; /* Move menu bar to the bottom (native mobile app style) */
  }
  
  .brand-section {
    display: none !important; /* Hide sidebar logo section on mobile to save space */
  }
  
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    margin-bottom: 0;
    gap: 4px;
  }
  
  .nav-item {
    flex: 1;
    padding: 6px 4px;
    font-size: 10px;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    height: 100%;
    border-radius: 8px;
  }
  
  .nav-item svg {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  
  .nav-item span {
    font-size: 9px;
    font-weight: 500;
  }
  
  .sidebar-footer {
    display: none !important; /* Hide settings/logout from bottom bar */
  }
  
  /* Main workspace sizing on phone */
  .app-main-content {
    flex-grow: 1;
    overflow-y: auto;
    height: calc(100vh - 64px);
    order: 1;
  }
  
  .content-header {
    padding: 12px 16px;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
  }
  
  .header-title-area h2 {
    font-size: 20px;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .server-status .text-secondary {
    display: none; /* Hide server status text to fit mobile badge */
  }
  
  .content-body {
    padding: 12px;
  }
  
  /* Multi-column grid wraps into single vertical stack on mobile */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  /* Allow all wide tables to scroll horizontally via touch gestures */
  .table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }
  
  /* Stack list filters vertically */
  .rates-actions-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .rates-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  
  .rates-buttons .btn {
    flex: 1;
    justify-content: center;
  }
  
  /* Dialog Modals Mobile Adjustments */
  dialog {
    max-width: 90% !important;
    width: 90% !important;
    padding: 16px !important;
  }
  
  .dialog-content {
    padding: 12px !important;
  }
  
  .login-modal {
    width: 90% !important;
    padding: 24px !important;
  }
}

/* ==========================================================================
   PORTAL SHOWCASE GALLERY STYLING
   ========================================================================== */
.portal-showcase {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
}

.portal-showcase .section-header {
  margin-bottom: 40px;
}

.portal-showcase .section-header h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.portal-showcase .section-header p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.showcase-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.showcase-tab {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

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

.showcase-tab.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-light);
}

.showcase-content {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  overflow: hidden;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.showcase-panel {
  display: none;
}

.showcase-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

.showcase-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .showcase-img {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

@media (max-width: 768px) {
  .portal-showcase {
    padding: 40px 16px;
  }
  .portal-showcase .section-header h2 {
    font-size: 26px;
  }
  .showcase-tab {
    padding: 8px 14px;
    font-size: 13px;
  }
}

