/* ============================================
   FatCat — Design System
   Inspired by NexTransfer / ProDrive
   ============================================ */

/* ---------- Tokens ---------- */
:root {
  --primary: #137fec;
  --primary-soft: rgba(19, 127, 236, 0.1);
  --primary-glow: rgba(19, 127, 236, 0.25);

  --bg: #101922;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-2: rgba(255, 255, 255, 0.06);
  --bg-input: rgba(255, 255, 255, 0.05);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: var(--primary);

  --text: #e8edf3;
  --text-muted: #64748b;
  --text-faint: #475569;

  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 200ms ease;

  --sidebar-width: 80px;
  --header-height: 64px;
}

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

html,
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

/* ---------- Mesh gradient background ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(19, 127, 236, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(19, 127, 236, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(19, 127, 236, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(19, 127, 236, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout: App Shell ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Sidebar — Icon only, tooltip on hover */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 68px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  gap: 0.25rem;
  background: rgba(16, 25, 34, 0.85);
  backdrop-filter: blur(16px);
  z-index: 100;
}

.sidebar-logo {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  width: 100%;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-surface-2);
}

.sidebar-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

/* Hide the text span by default */
.sidebar-link>span:not(.material-icons-round) {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 0.35rem 0.75rem;
  background: #1a2332;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sidebar-link:hover>span:not(.material-icons-round) {
  opacity: 1;
}

/* Sidebar User Info */
.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  position: relative;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.sidebar-username {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 68px;
}

/* Header */
.app-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(16, 25, 34, 0.5);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 10;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Content area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* ---------- Two-column layout ---------- */
.layout-split {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3rem;
  justify-content: center;
  overflow-y: auto;
}

.layout-panel {
  width: 0;
  /* Hidden by default */
  opacity: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  padding: 0;
  /* No padding when closed */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  /* No horizontal scroll */
  flex-shrink: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.layout-panel.open {
  width: 400px;
  opacity: 1;
  padding: 2rem;
}

/* ---------- Glass panel ---------- */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Drop Zone ---------- */
.drop-zone {
  position: relative;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.drop-zone-border {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23137FEC44' stroke-width='2' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
  border-radius: var(--radius);
  transition: all 300ms;
}

.drop-zone:hover .drop-zone-border,
.drop-zone.dragover .drop-zone-border {
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23137FEC' stroke-width='2' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
  box-shadow: 0 0 24px var(--primary-glow);
}

.drop-zone-inner {
  position: relative;
  margin: 8px;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border-radius: calc(var(--radius) - 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  transition: transform var(--transition);
}

.drop-zone:hover .drop-zone-inner {
  transform: scale(0.99);
}

.drop-zone-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.25rem;
  transition: transform var(--transition);
}

.drop-zone:hover .drop-zone-icon {
  transform: scale(1.1);
}

.drop-zone-icon .material-icons-round {
  font-size: 28px;
}

.drop-zone h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.drop-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drop-zone-badge {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
}

.drop-zone-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Browse buttons row */
.browse-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(19, 127, 236, 0.3);
}

.btn-primary:hover {
  background: rgba(19, 127, 236, 0.85);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* ---------- Inputs ---------- */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input::placeholder {
  color: var(--text-faint);
}

.input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

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

/* ---------- Centered Layout (v2) ---------- */
.centered-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem 1rem;
  overflow-y: auto;
}

.intro-header-hidden {
  display: none !important;
}

/* Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ---------- Questionnaire Cards ---------- */
.question-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: left;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.question-card:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.q-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.q-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.q-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Provider styles update ---------- */
.provider-toggle {
  /* Legacy override */
  display: none;
}

.provider-option {
  position: relative;
  display: flex;
}

.provider-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.provider-option label {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  overflow: hidden;
}

.provider-option input:checked+label {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 20px var(--primary-glow);
}

.provider-option label:hover {
  border-color: var(--border-hover);
}

.provider-option.disabled label:hover {
  border-color: var(--border);
}

.provider-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.6rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.provider-badge.coming-soon {
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.provider-badge.best-choice {
  background: var(--success);
  color: #000;
}


.provider-icon {
  font-size: 1.75rem;
}

.provider-name {
  font-weight: 600;
  font-size: 0.8125rem;
}

.provider-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.provider-info {
  font-size: 0.6rem;
  color: var(--primary);
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* ---------- Expiration ---------- */
.expiration-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.expiration-title {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.expiration-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.expiration-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
}

.expiration-option:hover {
  border-color: var(--border-hover);
}

.expiration-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 12px rgba(19, 127, 236, 0.15);
}

.exp-icon {
  font-size: 1rem;
}

.exp-label {
  font-size: 0.6875rem;
  font-weight: 500;
}

/* ---------- Progress ---------- */
.progress-container {
  margin: 1.5rem 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-bar {
  height: 6px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(19, 127, 236, 0.4);
  transition: width 200ms ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ---------- File Queue ---------- */
.file-list {
  margin-top: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.375rem;
  transition: all var(--transition);
}

.file-item:hover {
  border-color: var(--border-hover);
}

.file-icon {
  font-size: 1.25rem;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.file-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.file-status-error .status-text {
  color: var(--error);
}

.file-status-success .status-text {
  color: var(--success);
}

.file-status-uploading .status-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

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

.file-actions {
  display: flex;
  gap: 0.25rem;
}

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--primary-soft);
}

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

.table-file-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.table-file-name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.table-file-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.table-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.table-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition);
}

tbody tr:hover .table-actions {
  opacity: 1;
}

.action-btn {
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.action-btn.danger:hover {
  color: var(--error);
  background: rgba(248, 113, 113, 0.1);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-default {
  background: var(--bg-surface-2);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
}

.badge-error,
.badge-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.badge-success .badge-dot {
  background: var(--success);
}

.badge-primary .badge-dot {
  background: var(--primary);
}

/* ---------- Stats grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text);
  background: var(--bg-surface-2);
}

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

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 250ms ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #1a2332;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  transform: translateY(16px);
  transition: transform 250ms ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.share-link {
  display: flex;
  gap: 0.5rem;
}

.share-link input {
  flex: 1;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--error);
}

.alert-info {
  background: var(--primary-soft);
  border: 1px solid rgba(19, 127, 236, 0.2);
  color: var(--primary);
}

/* ---------- Calculator ---------- */
.calculator-details {
  margin-top: 1rem;
}

.calculator-toggle {
  cursor: pointer;
  padding: 0.6rem 0.875rem;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calculator-toggle::-webkit-details-marker {
  display: none;
}

.calculator-toggle::before {
  content: '▸';
  font-size: 0.7rem;
  transition: transform var(--transition);
}

details[open] .calculator-toggle::before {
  transform: rotate(90deg);
}

.toggle-hint {
  font-size: 0.6875rem;
  color: var(--text-faint);
}

.calculator-compact {
  padding: 1rem;
  margin-top: 0.5rem;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
}

.calculator-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.input-group-inline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.input-group-inline label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.calculator-results-compact {
  display: flex;
  justify-content: space-around;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.result-item-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.result-provider-sm {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.result-cost-sm {
  font-size: 0.9375rem;
  font-weight: 700;
}

.result-cost-sm.success,
.result-cost-sm.recommended {
  color: var(--success);
}

/* ---------- Info Tooltip ---------- */
.info-bubble {
  position: relative;
  display: inline-block;
  margin-left: 0.35rem;
  cursor: help;
}

.info-bubble::after {
  content: 'ℹ️';
  font-size: 0.75rem;
}

.info-bubble .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem;
  background: #1a2332;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 260px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  visibility: hidden;
  transition: all 150ms ease;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.info-bubble:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-6px);
}

/* ---------- Footer stamps ---------- */
.footer-stamps {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.footer-stamp {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-faint);
}

.footer-stamp .material-icons-round {
  font-size: 14px;
  color: var(--primary);
}

/* ---------- Section headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo .sidebar-logo {
  margin-bottom: 0;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Header (legacy compat) ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.75rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Container (legacy compat) ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .layout-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar {
    --sidebar-width: 60px;
  }

  .layout-main {
    padding: 1.5rem;
  }

  .content {
    padding: 1rem;
  }

  .provider-toggle {
    flex-direction: column;
  }

  .calculator-inputs {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

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

  .browse-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- SPA Views ---------- */
.view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.view.active {
  display: flex;
}

/* ---------- Wizard Steps ---------- */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  transition: all var(--transition);
  flex: 1;
}

.wizard-step.active {
  color: var(--primary);
}

.wizard-step.done {
  color: var(--success);
}

.wizard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
}

.wizard-step.active .wizard-step-num {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.wizard-step.done .wizard-step-num {
  background: rgba(74, 222, 128, 0.1);
  border-color: var(--success);
  color: var(--success);
}

/* Wizard content */
.wizard-content {
  display: none;
}

.wizard-content.active {
  display: block;
  animation: fadeIn 250ms ease;
}

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

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

.wizard-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.wizard-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Wizard nav */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---------- Cost Estimate ---------- */
.cost-estimate {
  margin-top: 1.5rem;
  padding: 1rem !important;
}

.cost-estimate-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
}

.cost-label {
  color: var(--text-muted);
}

.cost-value {
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.cost-total {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.cost-total .cost-value {
  color: var(--primary);
  font-size: 0.9375rem;
}

/* ---------- Summary Card ---------- */
.summary-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.summary-value {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---------- Version Tag ---------- */
.version-tag {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.5625rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  z-index: 100;
  opacity: 0.5;
}