/* ============================================
   COMPONENT STYLES
   ============================================

   This file contains all reusable component styles:
   - Button components (primary, secondary, ghost, icon)
   - Card components (standard, flat, hero)
   - Form components (inputs, labels, selects)
   - Simulation cards & Table views
   - Auth views
   ============================================ */

/* ============================================
   Button Components
   ============================================ */

.btn {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  padding: 10px 22px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  white-space: nowrap;
  color: var(--color-text-high);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-pressed));
  color: var(--color-text-high);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.7);
  color: var(--color-text-high);
  border-radius: var(--radius-full);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.85);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: var(--color-error);
  border-radius: var(--radius-full);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  color: var(--color-error);
}

.btn-tertiary {
  background: rgba(17, 24, 39, 0.65);
  color: var(--color-text-medium);
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-tertiary:hover {
  color: var(--color-text-high);
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.8);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-medium);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: var(--color-text-high);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.btn-icon:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ============================================
   Card Components
   ============================================ */

.card {
  background: var(--color-surface-2);
  border-radius: var(--radius-medium);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: all var(--transition-slow);
}

.card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.card-flat {
  background: rgba(17, 24, 39, 0.7);
  border-radius: var(--radius-medium);
  padding: var(--space-6);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.card-hero {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.82), rgba(24, 33, 45, 0.88));
  border-radius: var(--radius-large);
  padding: var(--space-12);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

/* ============================================
   Form Components (Standardized)
   ============================================ */

/* Wrapper for label + input */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

/* Label Style */
.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 2px;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

/* Unified Input Field Style */
input.input-field,
select.input-field,
textarea.input-field {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--color-text-high);
  transition: all 0.2s ease;
  width: 100%;
  height: 42px; /* Fixed height for consistency */
}

/* Focus State */
input.input-field:focus,
select.input-field:focus,
textarea.input-field:focus {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--color-accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

/* Placeholder */
input.input-field::placeholder,
textarea.input-field::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

/* Hover State */
input.input-field:hover,
select.input-field:hover,
textarea.input-field:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(96, 165, 250, 0.25);
}

/* Disabled/Read-only State */
input.input-field:disabled,
input.input-field[readonly],
select.input-field:disabled,
textarea.input-field:disabled {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.1);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* Select Specific Styles */
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.input-field:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Legacy/Alias Classes mapping to new styles */
.form-group, .form-group-apple {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-label, .form-label-apple {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 2px;
}

.form-input, .form-input-apple {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text-high);
  transition: all 0.2s ease;
  width: 100%;
  height: 42px;
}

.form-input:focus, .form-input-apple:focus {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--color-accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.form-description {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.6);
  margin-top: 4px;
  margin-left: 2px;
}

/* ============================================
   Simulation Card Components
   ============================================ */

.simulation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(30, 41, 59, 0.72);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(59, 130, 246, 0.18);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  --loyer-color: #60a5fa;
  --fiscal-color: #a78bfa;
  --aen-color: #fb7185;
  --tvs-color: #fbbf24;
}

.simulation-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(96, 165, 250, 0.35);
}

.simulation-card--empty {
  align-items: center;
  justify-content: center;
  padding: 48px;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.simulation-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.simulation-card__title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.simulation-card__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-high);
}

.simulation-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.simulation-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.simulation-pill--best {
  background: rgba(16, 185, 129, 0.18);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.35);
}

.simulation-pill--muted {
  background: rgba(24, 33, 45, 0.65);
  color: rgba(148, 163, 184, 0.75);
}

.simulation-card__favorite {
  border: none;
  background: rgba(250, 204, 21, 0.18);
  color: var(--color-warning);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.simulation-card__favorite.is-active {
  background: rgba(250, 204, 21, 0.35);
  transform: translateY(-1px);
}

.simulation-card__toggle {
  display: inline-flex;
  background: rgba(96, 165, 250, 0.12);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.simulation-card__toggle .toggle-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.simulation-card__toggle .toggle-btn.active {
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text-high);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.45);
}

.simulation-card__image {
  position: relative;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.65);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.simulation-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.simulation-card__image-placeholder {
  font-size: 0.9rem;
  color: rgba(203, 213, 225, 0.7);
}

.upload-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: var(--color-text-high);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
}

.simulation-card__image:hover .upload-overlay {
  opacity: 1;
}

.image-badges {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.image-pill {
  background: rgba(15, 23, 42, 0.7);
  color: rgba(30, 41, 59, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.simulation-card__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.metric-card {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-high);
}

.metric-sub {
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.75);
}

.metric-sub--delta {
  color: var(--color-error);
  font-weight: 600;
}

.simulation-card__bar {
  display: grid;
  gap: 10px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--color-text-high);
  font-size: 0.95rem;
}

.total-figures {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.stacked-bar {
  display: grid;
  grid-template-columns: var(--loyer) var(--fiscal) var(--aen) var(--tvs);
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.stacked-bar .segment {
  height: 100%;
}

.segment.loyer { background: var(--loyer-color); }
.segment.fiscal { background: var(--fiscal-color); }
.segment.aen { background: var(--aen-color); }
.segment.tvs { background: var(--tvs-color); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.75);
}

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

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

.delta-pill {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent-primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.delta-pill--better {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.delta-pill--worse {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.simulation-card__footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.85), rgba(17, 24, 39, 0.75));
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.simulation-card__footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.75);
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(248, 113, 113, 0.9);
  background: rgba(248, 113, 113, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  width: fit-content;
}

.simulation-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-pressed));
  color: var(--color-text-high);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.action-btn.secondary {
  background: rgba(15, 23, 42, 0.75);
  color: var(--color-text-high);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.action-btn.danger {
  background: rgba(239, 68, 68, 0.18);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

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

.simulation-card[data-view="ttc"] .value-ht {
  display: none;
}

.simulation-card[data-view="ht"] .value-ttc {
  display: none;
}

/* ============================================
   Simulation List
   ============================================ */

.simulations-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

/* Empty state styling */
.results-placeholder {
  text-align: center;
  padding: 60px 24px;
}

.results-placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ============================================
   Authentication Views
   ============================================ */

.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.88));
  padding: var(--space-6);
}

.auth-card {
  width: min(360px, 100%);
  background: rgba(17, 24, 39, 0.88);
  border-radius: var(--radius-large);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid rgba(96, 165, 250, 0.18);
  backdrop-filter: blur(18px);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-high);
}

.auth-subtitle {
  font-size: 0.9rem;
  color: rgba(203, 213, 225, 0.85);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-error {
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-error, #EF4444);
}

/* ============================================
   Calculations Playground
   ============================================ */

.calc-section {
  margin-bottom: 32px;
}

.calc-card {
  background: linear-gradient(160deg, rgba(21, 30, 47, 0.92), rgba(30, 41, 59, 0.88));
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(96, 165, 250, 0.18);
  padding: 28px;
  display: grid;
  gap: 18px;
}

.calc-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-high);
}

.calc-card-text {
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
  line-height: 1.6;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.calc-grid--vertical {
  grid-template-columns: 1fr;
}

.calc-info {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.calc-info--bar {
  background: rgba(30, 41, 59, 0.72);
}

.calc-info h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-high);
}

.calc-info ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.9rem;
  display: grid;
  gap: 6px;
}

.calc-info__chart {
  display: grid;
  gap: 12px;
}

.calc-bar {
  display: grid;
  grid-template-columns: var(--part-1, 1fr) var(--part-2, 1fr) var(--part-3, 1fr) var(--part-4, 1fr);
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 4px 18px rgba(14, 116, 244, 0.25);
}

.calc-bar span {
  display: block;
}

.calc-bar .p1 { background: rgba(59, 130, 246, 0.8); }
.calc-bar .p2 { background: rgba(139, 92, 246, 0.8); }
.calc-bar .p3 { background: rgba(239, 68, 68, 0.8); }
.calc-bar .p4 { background: rgba(245, 158, 11, 0.8); }

.calc-pie-labels {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.9);
}

.calc-pie-labels span::before {
  content: "•";
  margin-right: 6px;
}

.calc-pie-labels .p1::before { color: rgba(59, 130, 246, 0.9); }
.calc-pie-labels .p2::before { color: rgba(16, 185, 129, 0.9); }
.calc-pie-labels .p3::before { color: rgba(148, 163, 184, 0.9); }

.calc-playground {
  display: grid;
  gap: 20px;
}

.calc-widget {
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 20px;
  padding: 20px;
  background: rgba(15, 23, 42, 0.75);
  display: grid;
  gap: 14px;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.calc-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.calc-widget__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-high);
}

.calc-widget__formula {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
  margin: 0;
}

.calc-widget form {
  display: grid;
  gap: 12px;
  color: var(--color-text-high);
}

.calc-widget .form-group-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Removed .calc-widget input styles in favor of global .input-field */

.calc-widget .result-box {
  background: rgba(30, 41, 59, 0.72);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 12px;
  min-height: 48px;
  color: var(--color-text-high);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.calc-widget button.calc-run {
  width: fit-content;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-hover));
  color: var(--color-text-high);
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.calc-widget button.calc-run:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.calc-widget .result-error {
  color: var(--color-error);
}

/* ============================================
   Table Components
   ============================================ */

.simulations-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  color: var(--color-text-high);
}

.simulations-table th {
  text-align: left;
  padding: 16px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
  white-space: nowrap;
}

.simulations-table td {
  padding: 16px;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  transition: background 0.2s ease;
  vertical-align: middle;
}

.simulations-table tbody tr:hover td {
  background: rgba(30, 41, 59, 0.7);
}

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

/* Sticky columns (left and right) */
.simulations-table th[style*="position: sticky"],
.simulations-table td[style*="position: sticky"] {
  z-index: 20;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.simulations-table th[style*="left: 0"],
.simulations-table td[style*="left: 0"] {
  background-color: #1e293b; /* Base background for left sticky */
  border-right: 1px solid rgba(96, 165, 250, 0.2);
}

.simulations-table th[style*="right: 0"],
.simulations-table td[style*="right: 0"] {
  background-color: #1e293b; /* Base background for right sticky */
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  border-left: 1px solid rgba(96, 165, 250, 0.2);
}

/* Hover state for sticky columns - match row hover */
.simulations-table tbody tr:hover td[style*="position: sticky"] {
  background: rgba(30, 41, 59, 0.7);
}

/* Scrollbar Styling for the container */
#simulations-table-container::-webkit-scrollbar {
  height: 12px;
}

#simulations-table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
}

#simulations-table-container::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.5);
}

#simulations-table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.5);
}

/* ============================================
   Expandable Rows & Inline Editing
   ============================================ */

/* Inline Edit Input */
.inline-edit {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #FFFFFF;
  width: 100%;
  max-width: 120px;
  transition: all 0.2s ease;
  font-weight: 500;
}

/* Inline Edit Name (Vehicle Name) */
.inline-edit-name {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.95rem;
  color: #FFFFFF;
  width: 100%;
  max-width: 180px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.inline-edit-name[readonly] {
  background: transparent;
  border: 1px solid transparent;
  cursor: default;
  color: var(--color-text-high);
  padding: 6px 8px;
  font-weight: 600;
}

.inline-edit-name[readonly]:hover {
  background: rgba(30, 41, 59, 0.3);
  border-color: rgba(96, 165, 250, 0.1);
}

.inline-edit-name:not([readonly]) {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
  cursor: text;
}

.inline-edit-name:not([readonly]):focus {
  outline: none;
  background: rgba(15, 23, 42, 1);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Read-only state - looks like regular text */
.inline-edit[readonly] {
  background: transparent;
  border: 1px solid transparent;
  cursor: default;
  color: var(--color-text-high);
  padding: 6px 8px;
}

.inline-edit[readonly]:hover {
  background: rgba(30, 41, 59, 0.3);
  border-color: rgba(96, 165, 250, 0.1);
}

/* Editable state - clear visual indication */
.inline-edit:not([readonly]) {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
  cursor: text;
}

.inline-edit:not([readonly]):focus {
  outline: none;
  background: rgba(15, 23, 42, 1);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.inline-edit.recalculating {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(250, 204, 21, 0.08);
  animation: pulse-border 1s ease-in-out infinite;
}

.inline-edit.success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
}

.inline-edit.error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

@keyframes pulse-border {
  0%, 100% {
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.3);
  }
  50% {
    border-color: rgba(250, 204, 21, 0.8);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.1);
  }
}

/* Scenario Total Cells */
.scenario-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scenario-total .total-amount {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-high);
}

.scenario-total .best-badge {
  font-size: 0.9rem;
  animation: star-glow 2s ease-in-out infinite;
}

@keyframes star-glow {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.scenario-total.best-scenario {
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  padding: 8px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.scenario-total.best-scenario .total-amount {
  color: var(--color-success);
}

/* Expanded Row */
.expanded-row {
  background: rgba(17, 24, 39, 0.8) !important;
  border-top: 1px solid rgba(96, 165, 250, 0.2) !important;
}

.expanded-row td {
  padding: 0 !important;
  background: transparent !important;
}

.expanded-row:hover td {
  background: transparent !important;
}

.scenario-breakdown {
  padding: 20px 24px;
}

.scenario-breakdown-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-medium);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Breakdown Table - Inset Style */
.breakdown-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  background: transparent; /* Transparent to show inset bg */
  border-radius: 0;
  overflow: visible;
  border: none;
}

.breakdown-table thead {
  background: transparent;
}

.breakdown-table th {
  text-align: right; /* Align headers with numbers */
  padding: 14px 16px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  line-height: 1.4;
}

.breakdown-table th:first-child {
  text-align: left;
}

.breakdown-table th.is-best {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02));
  color: var(--color-success);
  border-bottom-color: rgba(16, 185, 129, 0.3);
  border-radius: 8px 8px 0 0;
}

.breakdown-table tbody tr {
  transition: background 0.2s ease;
}

.breakdown-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.breakdown-table td {
  padding: 10px 16px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--color-text-medium);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.breakdown-table td:first-child {
  text-align: left;
}

.breakdown-table td.is-best {
  background: rgba(16, 185, 129, 0.04);
  color: var(--color-text-high);
  font-weight: 600;
}

/* Row Labels with Icons */
.label-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon {
  font-size: 18px;
  color: var(--color-accent-primary);
  opacity: 0.8;
  width: 24px;
  text-align: center;
}

/* Total Row */
.breakdown-table tr.total-row td {
  border-top: 1px solid rgba(96, 165, 250, 0.2);
  border-bottom: none;
  padding-top: 18px;
  padding-bottom: 18px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-high);
}

.breakdown-table tr.total-row .metric-icon {
  color: var(--color-success);
  font-size: 22px;
  opacity: 1;
}

.breakdown-table tr.total-row td.is-best {
  background: rgba(16, 185, 129, 0.1);
  border-radius: 0 0 8px 8px;
  color: var(--color-success);
}

/* Separator Row */
.separator-row td {
  padding: 0;
  border: none;
}

.separator-row hr {
  border: none;
  height: 1px;
  background: rgba(96, 165, 250, 0.1);
  margin: 0;
}

/* Breakdown Hint */
.breakdown-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.5));
  text-align: center;
  margin: 0.75rem 0 0.5rem;
  font-style: italic;
}

/* Expanded Row Container */
.expanded-row {
  background: rgba(0, 0, 0, 0.25) !important;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  border-top: 1px solid rgba(96, 165, 250, 0.15) !important;
}

.expanded-row td {
  padding: 0 !important;
}

/* Collapse Button (Centered Pill) */
.collapse-footer {
  display: flex;
  justify-content: center;
  padding: 16px 0 24px;
}

.collapse-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-high);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.expand-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--color-accent-primary);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.expand-btn:hover {
  color: var(--color-accent-hover);
  transform: scale(1.1);
}

.expand-btn.expanded {
  transform: rotate(90deg);
}

.expand-btn.expanded:hover {
  transform: rotate(90deg) scale(1.1);
}

/* Flash Animation for Updated Cells */
.updated-flash {
  animation: flash-update 1s ease-out;
}

@keyframes flash-update {
  0% {
    background: rgba(16, 185, 129, 0.3);
  }
  100% {
    background: transparent;
  }
}

/* Row in Edit Mode */
.simulation-row.editing td {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(96, 165, 250, 0.3);
}

.simulation-row.editing {
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3);
}

/* Responsive Adjustments for Expandable Rows */
@media (max-width: 768px) {
  .breakdown-table {
    font-size: 0.75rem;
  }

  .breakdown-table th,
  .breakdown-table td {
    padding: 8px 10px;
  }

  .scenario-breakdown {
    padding: 16px;
  }

  .inline-edit {
    max-width: 100px;
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .scenario-breakdown-title {
    font-size: 0.85rem;
  }

  .breakdown-table {
    display: block;
    overflow-x: auto;
  }

  .scenario-total {
    font-size: 0.85rem;
  }

  .scenario-total .best-badge {
    font-size: 0.8rem;
  }
}

.table-action-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.table-action-btn .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.table-action-btn.edit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent-primary);
}

.table-action-btn.edit:hover {
  background: rgba(59, 130, 246, 0.25);
}

.table-action-btn.edit:focus {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

.table-action-btn.delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.table-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

.table-action-btn.delete:focus {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .simulation-card__metrics {
    grid-template-columns: 1fr;
  }

  .simulation-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .simulation-card__toggle {
    align-self: flex-start;
  }
}

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

  .simulation-card-actions {
    flex-direction: column;
  }

  .simulation-card-actions .btn {
    width: 100%;
    min-width: auto;
  }

  /* Responsive Table (Card View) */
  .simulations-table thead {
    display: none;
  }
  
  .simulations-table, .simulations-table tbody, .simulations-table tr, .simulations-table td {
    display: block;
    width: 100%;
  }
  
  .simulations-table tr {
    margin-bottom: 16px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.4);
  }
  
  .simulations-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  }
  
  .simulations-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: left;
    margin-right: 12px;
    flex: 1;
  }
  
  .simulations-table td:last-child {
    justify-content: flex-end;
    border-bottom: none;
    padding-top: 16px;
    padding-bottom: 16px;
    background: rgba(15, 23, 42, 0.3);
  }

  .table-input {
    max-width: 100%;
    text-align: right;
  }
}

@media (max-width: 640px) {
  .calc-card {
    padding: 22px;
  }

  .calc-widget .form-group-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .simulation-card {
    padding: 20px;
  }

  .simulation-card__actions {
    flex-direction: column;
  }

  .simulation-card__actions .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   COLUMN VISIBILITY MODAL
   ============================================================================ */

.column-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.column-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
}

.column-modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.15);
}

.column-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.15);
}

.column-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-high);
}

.column-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.column-modal-close:hover {
  background: rgba(96, 165, 250, 0.1);
  color: var(--color-text-high);
}

.column-modal-body {
  padding: 28px;
}

.column-modal-info {
  margin-bottom: 20px;
  color: var(--color-text-medium);
  font-size: 14px;
  line-height: 1.6;
}

.column-modal-info small {
  font-size: 12px;
  color: var(--color-text-muted);
}

.column-modal-info strong {
  color: var(--color-accent-primary);
  font-weight: 600;
}

.column-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.column-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.column-checkbox:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(96, 165, 250, 0.3);
}

.column-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent-primary);
}

.column-checkbox span {
  font-size: 14px;
  color: var(--color-text-high);
  flex: 1;
}

.column-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid rgba(96, 165, 250, 0.15);
}

@media (max-width: 640px) {
  .column-modal {
    padding: 12px;
  }

  .column-modal-content {
    max-height: 90vh;
  }

  .column-checkboxes {
    grid-template-columns: 1fr;
  }

  .column-modal-header,
  .column-modal-body,
  .column-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ============================================================================
   NEW TOOLBAR STYLES (APPLE-INSPIRED)
   ============================================================================ */

.simulation-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25);
}

.toolbar-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap; /* Explicitly prevent wrapping */
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0; /* Prevent actions from being squashed */
}

.toolbar-secondary {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  align-items: center;
}

.toolbar-secondary::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Enhanced Search Input */
.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.6);
  font-size: 16px;
  pointer-events: none;
}

input.toolbar-search-input { /* Increased specificity */
  width: 100%;
  background: rgba(30, 41, 59, 0.72); /* Use the desired background */
  border: 1px solid rgba(148, 163, 184, 0.5); /* Use the desired border */
  border-radius: 12px; /* Use the desired border-radius */
  padding: 8px 12px 8px 36px; /* Adjust padding for icon, use desired padding */
  font-size: 0.9rem; /* Use the desired font-size */
  color: var(--color-text-high);
  transition: all 0.2s ease;
}

input.toolbar-search-input:focus { /* Increased specificity */
  outline: none;
  border-color: var(--color-accent-primary);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

input.toolbar-search-input::placeholder { /* Increased specificity */
  color: rgba(148, 163, 184, 0.5); /* Use the desired placeholder color */
}

input.toolbar-search-input:hover { /* Increased specificity */
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(96, 165, 250, 0.25);
}

/* Custom Select Wrapper */
.toolbar-select-wrapper {
  position: relative;
}

.toolbar-select {
  appearance: none;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  color: var(--color-text-high);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.toolbar-select:hover {
  background-color: rgba(30, 41, 59, 0.8);
  border-color: rgba(96, 165, 250, 0.25);
}

.toolbar-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
}

/* Divider */
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(96, 165, 250, 0.15);
  margin: 0 4px;
}

/* Icon Buttons in Toolbar */
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-medium);
  font-size: 16px;
}

.btn-icon:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(96, 165, 250, 0.25);
  color: var(--color-text-high);
  transform: translateY(-1px);
}

.btn-icon.active {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: var(--color-text-high);
}

.btn-icon.active:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

/* Filter Chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(96, 165, 250, 0.25);
  color: var(--color-text-high);
}

.filter-chip.active {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-pressed);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Meta Count */
.toolbar-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.count-badge {
  background: rgba(96, 165, 250, 0.1);
  color: var(--color-accent-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .toolbar-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .toolbar-actions {
    justify-content: space-between;
  }
  
  .toolbar-select-wrapper {
    flex: 1;
  }
  
  .toolbar-select {
    width: 100%;
  }
  
  .toolbar-meta {
    display: none; /* Hide count on mobile to save space */
  }
}

/* ============================================
   Organization Selector
   ============================================ */

.org-selector-container {
  margin-top: var(--space-3);
  position: relative;
}

.org-selector {
  position: relative;
}

.org-selector--legacy {
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
}

.org-selector__label {
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
}

.org-selector__button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  color: var(--color-text-high);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.org-selector__button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.org-selector__avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

.org-selector__name {
  flex: 1;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-selector__chevron {
  font-size: 18px;
  color: var(--color-text-medium);
  transition: transform var(--transition-base);
}

.org-selector__button[aria-expanded="true"] .org-selector__chevron {
  transform: rotate(180deg);
}

/* No organization state - info message */
.org-selector--no-org .org-selector__no-org-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  color: #f59e0b;
  font-size: var(--font-size-caption);
}

.org-selector--no-org .org-selector__no-org-message .material-symbols-rounded {
  font-size: 18px;
}

/* No organization banner for users without org */
.no-org-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-xl);
  margin: var(--space-4);
  color: #f59e0b;
}

.no-org-banner > .material-symbols-rounded {
  font-size: 24px;
  flex-shrink: 0;
}

.no-org-banner__content {
  flex: 1;
}

.no-org-banner__content strong {
  display: block;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.no-org-banner__content p {
  margin: 0;
  font-size: var(--font-size-caption);
  color: rgba(245, 158, 11, 0.9);
}

.no-org-banner__close {
  background: none;
  border: none;
  padding: var(--space-1);
  color: #f59e0b;
  cursor: pointer;
  border-radius: var(--radius-full);
  opacity: 0.7;
  transition: opacity var(--transition-base);
}

.no-org-banner__close:hover {
  opacity: 1;
}

.org-selector__dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.org-dropdown--open {
  opacity: 1;
  transform: translateY(0);
}

.org-dropdown__header {
  padding: var(--space-3);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

.org-dropdown__list {
  max-height: 240px;
  overflow-y: auto;
}

.org-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-base);
}

.org-dropdown__item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.org-dropdown__item--active {
  background: rgba(59, 130, 246, 0.15);
}

.org-dropdown__item--loading {
  opacity: 0.5;
  pointer-events: none;
}

.org-dropdown__item-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

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

.org-dropdown__item-name {
  display: block;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-high);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-dropdown__item-role {
  display: block;
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
}

.org-dropdown__item-check {
  font-size: 20px;
  color: var(--color-accent-primary);
}

.org-dropdown__footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--space-2);
}

.org-dropdown__action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-accent-primary);
  font-size: var(--font-size-body);
  cursor: pointer;
  transition: background var(--transition-base);
}

.org-dropdown__action:hover {
  background: rgba(59, 130, 246, 0.1);
}

.org-dropdown__action .material-symbols-rounded {
  font-size: 20px;
}

/* ============================================
   Team Management
   ============================================ */

.team-management-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.team-card {
  padding: var(--space-5);
}

.team-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin-bottom: var(--space-4);
}

.team-section-title .material-symbols-rounded {
  font-size: 24px;
  color: var(--color-accent-primary);
}

.team-badge {
  background: var(--color-accent-primary);
  color: white;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: var(--space-2);
}

.team-invite-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.team-invite-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.team-invite-btn {
  flex-shrink: 0;
  height: 42px;
}

.team-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-body);
}

.team-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-body);
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.team-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.team-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.team-list-item--current {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.team-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

.team-member-avatar--pending {
  background: rgba(100, 116, 139, 0.3);
}

.team-member-avatar--pending .material-symbols-rounded {
  font-size: 20px;
  color: var(--color-text-medium);
}

.team-member-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

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

.team-member-name {
  display: block;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-high);
}

.team-you-badge {
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  font-weight: var(--font-weight-normal);
}

.team-member-meta {
  display: block;
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-role-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  background: rgba(100, 116, 139, 0.2);
  color: var(--color-text-medium);
}

.team-role-badge--owner {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.team-role-badge--admin {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.team-role-badge--member {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.team-role-badge--viewer {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.team-role-select {
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-high);
  font-size: var(--font-size-caption);
  cursor: pointer;
}

.team-role-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.team-actions {
  display: flex;
  gap: var(--space-1);
}

.team-actions .btn {
  padding: var(--space-2);
}

.team-actions .btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.team-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--color-text-medium);
}

.team-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-3);
}

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

.team-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.team-empty-icon {
  font-size: 48px;
  color: var(--color-text-low);
  margin-bottom: var(--space-4);
}

.team-empty-state h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin-bottom: var(--space-2);
}

.team-empty-state p {
  color: var(--color-text-medium);
  max-width: 300px;
}

/* Toast notifications */
.team-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-3) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glass);
  color: var(--color-text-high);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.team-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.team-toast--success {
  border-color: rgba(16, 185, 129, 0.3);
}

.team-toast--error {
  border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .team-invite-row {
    flex-direction: column;
    align-items: stretch;
  }

  .team-invite-row .input-group {
    width: 100%;
  }

  .team-invite-btn {
    width: 100%;
  }

  .team-list-item {
    flex-wrap: wrap;
  }

  .team-member-info {
    flex-basis: calc(100% - 56px);
  }

  .team-role-badge,
  .team-role-select {
    margin-left: 52px;
    margin-top: var(--space-2);
  }

  .team-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: var(--space-2);
  }
}

/* ============================================
   Platform Admin Dashboard
   ============================================ */

.admin-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--color-text-medium);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.admin-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-high);
}

.admin-tab--active {
  background: var(--color-accent-primary);
  color: white;
}

.admin-tab--active:hover {
  background: var(--color-accent-primary);
  color: white;
}

.admin-tab .material-symbols-rounded {
  font-size: 20px;
}

.admin-tab-label {
  display: inline;
}

/* Admin Content Area */
.admin-tab-content {
  min-height: 400px;
}

.admin-card {
  padding: var(--space-5);
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

.admin-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-lg);
}

.admin-stat-icon .material-symbols-rounded {
  font-size: 24px;
  color: var(--color-accent-primary);
}

.admin-stat-content {
  display: flex;
  flex-direction: column;
}

.admin-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-high);
}

.admin-stat-label {
  font-size: var(--font-size-body);
  color: var(--color-text-medium);
}

.admin-stat-sublabel {
  font-size: var(--font-size-caption);
  color: var(--color-text-low);
}

/* Admin Toolbar */
.admin-toolbar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  flex: 1;
  min-width: 200px;
}

.admin-search .material-symbols-rounded {
  color: var(--color-text-low);
  font-size: 20px;
}

.admin-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-high);
  font-size: var(--font-size-body);
  outline: none;
}

.admin-search-input::placeholder {
  color: var(--color-text-low);
}

.admin-filter-select {
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  color: var(--color-text-high);
  font-size: var(--font-size-body);
  cursor: pointer;
}

/* Admin Tables */
.admin-table-container {
  overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  font-size: var(--font-size-body);
  color: var(--color-text-high);
}

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

.admin-org-cell,
.admin-user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-org-name,
.admin-user-name {
  font-weight: var(--font-weight-medium);
}

.admin-org-id {
  font-size: var(--font-size-caption);
  color: var(--color-text-low);
  font-family: monospace;
}

.admin-user-cell {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

/* Status Badges */
.admin-status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.admin-status-badge.status--active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.admin-status-badge.status--suspended {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.admin-status-badge.status--disabled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Row Actions */
.admin-row-actions {
  display: flex;
  gap: var(--space-1);
}

.admin-row-actions .btn {
  padding: var(--space-2);
}

.admin-row-actions .btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Checkbox */
.admin-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent-primary);
}

/* Load More */
.admin-load-more {
  display: flex;
  justify-content: center;
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Section Title */
.admin-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin-bottom: var(--space-4);
}

.admin-section-title .material-symbols-rounded {
  font-size: 24px;
  color: var(--color-accent-primary);
}

.admin-section-desc {
  color: var(--color-text-medium);
  margin-bottom: var(--space-4);
}

/* Maintenance */
.admin-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.admin-maintenance-result {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
}

.admin-result-success {
  color: #10b981;
}

.admin-result-error {
  color: #ef4444;
}

/* System Info */
.admin-system-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.admin-info-label {
  color: var(--color-text-medium);
}

.admin-info-value {
  color: var(--color-text-high);
  font-weight: var(--font-weight-medium);
}

/* Activity List */
.admin-activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
}

.admin-activity-icon {
  font-size: 18px;
  color: var(--color-text-low);
}

.admin-activity-text {
  flex: 1;
  font-size: var(--font-size-body);
  color: var(--color-text-high);
}

.admin-activity-time {
  font-size: var(--font-size-caption);
  color: var(--color-text-low);
}

/* Loading State */
.admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--color-text-medium);
}

.admin-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-3);
}

/* Error State */
.admin-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.admin-error .material-symbols-rounded {
  font-size: 48px;
  color: #ef4444;
  margin-bottom: var(--space-4);
}

.admin-error p {
  color: var(--color-text-medium);
  margin-bottom: var(--space-4);
}

/* Access Denied */
.admin-access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.admin-access-denied .material-symbols-rounded {
  font-size: 64px;
  color: var(--color-text-low);
  margin-bottom: var(--space-4);
}

.admin-access-denied h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin-bottom: var(--space-2);
}

.admin-access-denied p {
  color: var(--color-text-medium);
}

.admin-access-hint {
  margin-top: var(--space-4);
  font-size: var(--font-size-caption);
  color: var(--color-text-low);
}

/* No Data */
.admin-no-data {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-medium);
}

/* Admin Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-3) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glass);
  color: var(--color-text-high);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.admin-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.admin-toast--success {
  border-color: rgba(16, 185, 129, 0.3);
}

.admin-toast--error {
  border-color: rgba(239, 68, 68, 0.3);
}

/* Admin Modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-4);
}

.admin-modal {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
}

.admin-modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-light);
}

.admin-modal-close {
  background: none;
  border: none;
  padding: var(--space-1);
  color: var(--color-text-medium);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.admin-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
}

.admin-modal-body {
  padding: var(--space-5);
  overflow-y: auto;
}

.admin-modal-body .form-group {
  margin-bottom: var(--space-4);
}

.admin-modal-body .form-group:last-child {
  margin-bottom: 0;
}

.admin-modal-body label {
  display: block;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  margin-bottom: var(--space-2);
}

.admin-modal-body .form-input,
.admin-modal-body .form-select {
  width: 100%;
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-light);
  font-size: var(--font-size-body);
  transition: all var(--transition-base);
}

.admin-modal-body .form-input:focus,
.admin-modal-body .form-select:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 59, 130, 246), 0.2);
}

.admin-modal-body .form-input::placeholder {
  color: var(--color-text-muted);
}

.admin-modal-body .form-hint {
  display: block;
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.admin-modal-body .form-error {
  padding: var(--space-3);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  color: #ef4444;
  font-size: var(--font-size-caption);
  margin-top: var(--space-3);
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-body);
  color: var(--color-text-high);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent-primary);
  cursor: pointer;
}

.checkbox-label span {
  user-select: none;
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--glass-border);
}

.admin-modal--wide {
  max-width: 640px;
}

/* User Detail Modal */
.user-detail__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-4);
}

.user-detail__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

.user-detail__info h4 {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-light);
}

.user-detail__info p {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-body);
  color: var(--color-text-medium);
}

.user-detail__badges {
  display: flex;
  gap: var(--space-2);
}

.user-detail__section {
  margin-bottom: var(--space-5);
}

.user-detail__section:last-child {
  margin-bottom: 0;
}

.user-detail__section h5 {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-light);
}

.user-detail__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.user-detail__section-header h5 {
  margin: 0;
}

.user-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.user-detail__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.user-detail__label {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
}

.user-detail__value {
  font-size: var(--font-size-body);
  color: var(--color-text-light);
  word-break: break-all;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge--primary {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

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

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

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

/* Compact admin table */
.admin-table--compact {
  font-size: var(--font-size-caption);
}

.admin-table--compact th,
.admin-table--compact td {
  padding: var(--space-2) var(--space-3);
}

/* Small form select */
.form-select--sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-caption);
  min-width: 120px;
}

/* Add to org form */
.add-to-org-form {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.add-to-org-form .form-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.add-to-org-form .form-group {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}

.add-to-org-form .form-group label {
  display: block;
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  margin-bottom: var(--space-1);
}

.add-to-org-form .form-actions {
  display: flex;
  gap: var(--space-2);
}

/* Small buttons */
.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-caption);
}

.btn-sm .material-symbols-rounded {
  font-size: 16px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-tabs {
    gap: var(--space-1);
    padding: var(--space-1);
  }

  .admin-tab {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-caption);
  }

  .admin-tab-label {
    display: none;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-toolbar {
    flex-direction: column;
  }

  .admin-search {
    width: 100%;
  }

  .admin-maintenance-actions {
    flex-direction: column;
  }

  .admin-maintenance-actions .btn {
    width: 100%;
  }
}

/* ============================================
   Migration UI Components
   ============================================ */

.migration-status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}

.migration-status__content {
  flex: 1;
}

.migration-status__content strong {
  display: block;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.migration-status__content p {
  margin: 0;
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
}

.migration-status--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.migration-status--success .material-symbols-rounded {
  color: #10b981;
  font-size: 24px;
}

.migration-status--success strong {
  color: #10b981;
}

.migration-status--warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.migration-status--warning .material-symbols-rounded {
  color: #f59e0b;
  font-size: 24px;
}

.migration-status--warning strong {
  color: #f59e0b;
}

.migration-status--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.migration-status--error .material-symbols-rounded {
  color: #ef4444;
  font-size: 24px;
}

.migration-status--error strong {
  color: #ef4444;
}

.migration-status--info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.migration-status--info .material-symbols-rounded {
  color: #3b82f6;
  font-size: 24px;
}

.migration-status--info strong {
  color: #3b82f6;
}

.migration-info {
  margin-bottom: var(--space-4);
}

.migration-progress {
  margin-bottom: var(--space-4);
}

.migration-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.migration-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: var(--radius-full);
}

.migration-progress-text {
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  margin: 0;
}

.migration-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.migration-error-list {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
  font-size: var(--font-size-caption);
}

.migration-error-list li {
  margin-bottom: var(--space-1);
}

.migration-more-errors {
  font-size: var(--font-size-small);
  color: var(--color-text-low);
  margin-top: var(--space-2);
}

.settings-help-text--small {
  font-size: var(--font-size-small);
  margin-top: var(--space-3);
}

/* Rotating sync icon animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotating {
  animation: spin 1s linear infinite;
}

/* Small button variant */
.btn-sm {
  padding: 6px 14px;
  font-size: var(--font-size-caption);
}

@media (max-width: 768px) {
  .migration-actions {
    flex-direction: column;
  }

  .migration-actions .btn {
    width: 100%;
  }
}

/* ============================================
   Organization Profile Styles
   ============================================ */

.org-profile-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.org-profile-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.org-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--color-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.org-avatar .material-symbols-rounded {
  font-size: 32px;
  color: white;
}

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

.org-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.org-meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.org-meta-item .material-symbols-rounded {
  font-size: 16px;
  opacity: 0.7;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.color-picker {
  width: 48px;
  height: 40px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.color-value {
  font-family: var(--font-mono);
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.org-usage-display {
  display: flex;
  gap: var(--space-4);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.usage-item {
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
}

.usage-item strong {
  color: var(--color-text-high);
  font-weight: var(--font-weight-semibold);
}

.org-profile-actions {
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================
   Clients View Styles
   ============================================ */

.clients-toolbar {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-low);
  font-size: 20px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-lg);
  color: var(--color-text-high);
  font-size: var(--font-size-body);
  transition: all var(--transition-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

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

.filter-group {
  display: flex;
  gap: var(--space-2);
}

.filter-select {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-lg);
  color: var(--color-text-high);
  font-size: var(--font-size-caption);
  min-width: 140px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
}

.clients-container {
  min-height: 200px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-medium);
}

.empty-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-title);
  color: var(--color-text-high);
}

.empty-state p {
  margin: 0;
  font-size: var(--font-size-body);
  color: var(--color-text-low);
}

/* Client Cards */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

.client-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.client-card:hover {
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: var(--shadow-soft);
}

.client-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  color: white;
  flex-shrink: 0;
}

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

.client-name {
  margin: 0 0 4px;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
}

.client-company {
  margin: 0;
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
}

.client-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.client-status--prospect {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.client-status--active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.client-status--inactive {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-low);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.client-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.client-detail-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.client-detail-row .material-symbols-rounded {
  font-size: 16px;
  opacity: 0.6;
}

.client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.client-tag {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--color-text-medium);
}

.client-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Toast Notification Animation */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .org-profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .org-meta {
    justify-content: center;
  }

  .clients-toolbar {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
    min-width: auto;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-elevated);
}

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

.modal-title {
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--color-text-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-high);
}

.modal-body {
  padding: var(--space-5);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-caption);
  margin-top: var(--space-3);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--color-text-medium);
  gap: var(--space-3);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Textarea styling */
textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

/* ============================================
   Share Modal Styles
   ============================================ */

.modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.share-modal {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-elevated);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

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

.share-modal .modal-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin: 0;
}

.share-section {
  margin-bottom: var(--space-5);
}

.share-section:last-child {
  margin-bottom: 0;
}

.share-section-label {
  display: block;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-medium);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.share-scenario-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.share-scenario-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.share-scenario-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.share-scenario-item input[type="radio"] {
  accent-color: var(--color-accent-primary);
}

.share-scenario-label {
  font-size: var(--font-size-body);
  color: var(--color-text-high);
}

.share-options-grid {
  display: grid;
  gap: var(--space-2);
}

.share-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-base);
}

.share-option:hover {
  background: rgba(255, 255, 255, 0.03);
}

.share-option input[type="checkbox"] {
  accent-color: var(--color-accent-primary);
  width: 16px;
  height: 16px;
}

.share-option span {
  font-size: var(--font-size-body);
  color: var(--color-text-high);
}

.share-textarea {
  width: 100%;
  padding: var(--space-3);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: var(--radius-md);
  color: var(--color-text-high);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  resize: vertical;
  min-height: 80px;
}

.share-textarea:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.share-select {
  width: 100%;
  padding: var(--space-3);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: var(--radius-md);
  color: var(--color-text-high);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  cursor: pointer;
}

.share-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Share Success State */
.share-step {
  text-align: center;
}

#share-step-config {
  text-align: left;
}

.share-success-icon {
  margin-bottom: var(--space-4);
}

.share-success-icon .material-symbols-rounded {
  font-size: 64px;
  color: var(--color-success);
}

.share-step h3 {
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-high);
  margin: 0 0 var(--space-4) 0;
}

.share-link-container {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.share-link-input {
  flex: 1;
  padding: var(--space-3);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: var(--radius-md);
  color: var(--color-text-high);
  font-family: var(--font-mono);
  font-size: var(--font-size-caption);
}

.share-info-text {
  font-size: var(--font-size-caption);
  color: var(--color-text-medium);
  margin-bottom: var(--space-4);
}

/* Share Loading State */
.share-loading {
  padding: var(--space-8);
}

.share-loading .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4) auto;
}

/* Share Error State */
.share-error-icon .material-symbols-rounded {
  font-size: 64px;
  color: var(--color-error);
}

#share-step-error h3 {
  color: var(--color-error);
}

#share-error-message {
  color: var(--color-text-medium);
  margin-bottom: var(--space-4);
}

/* ============================================================================
   BRAND SELECTOR (Nouvelle Simulation Form)
   ============================================================================ */

.brand-selector {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-icon-preview {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  filter: invert(1);
  opacity: 0.8;
}

.brand-select {
  flex: 1;
}

.brand-custom-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-custom-wrapper .input-field {
  flex: 1;
}

.brand-custom-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.brand-custom-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-high);
}

/* ============================================================================
   CLIENT SELECTOR (Nouvelle Simulation Form)
   ============================================================================ */

.form-section-client {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-large);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.input-group-client {
  max-width: 400px;
}

.input-group-client .input-label {
  color: var(--color-primary);
}

/* ============================================================================
   DRAFT ATTACHMENTS (Nouvelle Simulation Form)
   ============================================================================ */

.draft-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-large);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.draft-upload-zone:hover,
.draft-upload-zone.drag-over {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--color-primary);
}

.draft-upload-icon {
  font-size: 40px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.draft-upload-zone:hover .draft-upload-icon,
.draft-upload-zone.drag-over .draft-upload-icon {
  color: var(--color-primary);
}

.draft-upload-text {
  font-size: var(--font-size-body-small);
  color: var(--color-text-medium);
  margin: 0;
}

.draft-upload-label {
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
}

.draft-upload-label:hover {
  color: var(--color-primary-hover);
}

.draft-upload-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0 0;
}

.draft-attachments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.draft-attachment-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-medium);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.draft-attachment-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-small);
  flex-shrink: 0;
}

.draft-attachment-icon .material-symbols-rounded {
  font-size: 20px;
  color: #ef4444;
}

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

.draft-attachment-name {
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-attachment-size {
  font-size: 12px;
  color: var(--color-text-muted);
}

.draft-attachment-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.draft-attachment-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.draft-attachments-info {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ============================================
   APP LOADING SCREEN
   Full-screen overlay shown during initialization
   ============================================ */

.app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--slate-950, #020617);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.app-loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.app-loading-logo {
  width: 120px;
  height: auto;
  opacity: 0.9;
}

.app-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--slate-700, #334155);
  border-top-color: var(--blue-500, #3b82f6);
  border-radius: 50%;
  animation: app-loading-spin 1s linear infinite;
}

.app-loading-text {
  color: var(--slate-400, #94a3b8);
  font-size: 14px;
  font-weight: 500;
}

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

/* ============================================================================
   MODAL OVERLAY STYLES (Dark Theme)
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  background: var(--slate-900, #0f172a);
  border: 1px solid var(--slate-700, #334155);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--slate-700, #334155);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--slate-400, #94a3b8);
  margin: 4px 0 0 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--slate-400, #94a3b8);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--slate-800, #1e293b);
  color: white;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 160px);
  color: var(--slate-300, #cbd5e1);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--slate-700, #334155);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================
   UPDATE BANNER
   Notification banner for new version availability
   ============================================ */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

.update-banner.show {
  transform: translateY(0);
}

.update-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.update-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.update-banner-text {
  font-size: 14px;
  font-weight: 500;
}

.update-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.update-banner-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.update-banner-btn .material-symbols-rounded {
  font-size: 16px;
}

.update-banner-dismiss {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.update-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.update-banner-dismiss .material-symbols-rounded {
  font-size: 18px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .update-banner-content {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }

  .update-banner-text {
    font-size: 13px;
    flex: 1 1 100%;
    text-align: center;
    order: 1;
  }

  .update-banner-icon {
    order: 0;
  }

  .update-banner-btn {
    order: 2;
    flex: 1;
    justify-content: center;
  }

  .update-banner-dismiss {
    order: 3;
    margin-left: 0;
  }
}

/* ============================================
   CLIENTS VIEW HEADER
   Matches sim-form-header styling
   ============================================ */

.clients-header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding: 24px 32px;
  margin-bottom: 24px;
  border-radius: 12px;
}

.clients-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.clients-header-titles h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
  color: white;
}

.clients-header-titles p {
  color: var(--color-text-muted, #94a3b8);
  margin: 6px 0 0 0;
  font-size: 14px;
}

.clients-header-actions {
  display: flex;
  gap: 12px;
}

/* Toolbar inside header */
.clients-header .clients-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.clients-header .search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 400px;
}

.clients-header .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #64748b);
  font-size: 18px;
  pointer-events: none;
}

.clients-header .search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 10px;
  padding: 10px 12px 10px 40px;
  font-size: 14px;
  color: var(--color-text-high, #e2e8f0);
  transition: all 0.2s ease;
}

.clients-header .search-input::placeholder {
  color: var(--color-text-muted, #64748b);
}

.clients-header .search-input:focus {
  outline: none;
  border-color: var(--color-accent-primary, #3b82f6);
  background: rgba(15, 23, 42, 0.8);
}

.clients-header .filter-group {
  display: flex;
  gap: 12px;
}

.clients-header .filter-select {
  appearance: none;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  color: var(--color-text-high, #e2e8f0);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.clients-header .filter-select:focus {
  outline: none;
  border-color: var(--color-accent-primary, #3b82f6);
}

/* Header buttons */
.clients-header .btn-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.clients-header .btn-header-primary {
  background: var(--color-accent-primary, #3b82f6);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.clients-header .btn-header-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.clients-header .btn-header-secondary {
  background: rgba(30, 41, 59, 0.6);
  color: var(--color-text-medium, #94a3b8);
  border-color: rgba(55, 65, 81, 0.5);
}

.clients-header .btn-header-secondary:hover {
  background: rgba(30, 41, 59, 0.8);
  color: white;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .clients-header {
    padding: 16px;
  }

  .clients-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .clients-header-actions {
    width: 100%;
  }

  .clients-header .btn-header {
    flex: 1;
    justify-content: center;
  }

  .clients-header .clients-toolbar {
    flex-direction: column;
  }

  .clients-header .search-box {
    width: 100%;
    max-width: none;
  }

  .clients-header .filter-group {
    width: 100%;
  }

  .clients-header .filter-select {
    flex: 1;
  }
}

/* ============================================
   CLIENTS TABLE VIEW
   Table-based layout for client management
   ============================================ */

/* Table wrapper with scroll */
.clients-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.clients-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.clients-table-wrapper::-webkit-scrollbar-track {
  background: #1e293b;
}

.clients-table-wrapper::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

/* Table base */
.clients-table {
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--color-text-medium, #94a3b8);
  border-collapse: collapse;
}

/* Table header */
.clients-table thead {
  background: rgba(22, 32, 50, 1);
  border-bottom: 1px solid var(--slate-700, #334155);
}

.clients-table th {
  padding: 16px 24px;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9ca3af);
  letter-spacing: 0.05em;
}

/* Table body */
.clients-table tbody {
  background: var(--card-bg, #1e293b);
}

.clients-table tbody tr {
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  transition: background 0.2s ease;
}

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

.clients-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.clients-table td {
  padding: 20px 24px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Name cell with avatar */
.client-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Small avatar for table rows */
.client-avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  box-shadow: 0 0 0 2px var(--slate-700, #334155);
}

.clients-table .client-name {
  font-weight: 600;
  color: var(--color-text-high, #e2e8f0);
}

/* Email and phone cells */
.clients-table .client-email,
.clients-table .client-phone {
  color: var(--color-text-medium, #cbd5e1);
}

.clients-table .client-empty {
  color: var(--color-text-muted, #64748b);
}

/* Status badges in table context */
.clients-table .client-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clients-table .client-status--prospect {
  background: #2563eb;
  color: white;
}

.clients-table .client-status--active {
  background: #16a34a;
  color: white;
}

.clients-table .client-status--inactive {
  background: rgba(148, 163, 184, 0.3);
  color: var(--color-text-medium, #94a3b8);
}

/* Action buttons in table */
.clients-table .client-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-table-action:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.btn-table-action .material-symbols-rounded {
  font-size: 16px;
}

.btn-table-action--danger {
  color: var(--color-error, #ef4444);
}

.btn-table-action--danger:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Empty state inside table wrapper */
.clients-table-wrapper .empty-state {
  padding: 60px 20px;
  text-align: center;
}

/* Mobile responsive table */
@media (max-width: 768px) {
  .clients-table th,
  .clients-table td {
    padding: 12px 16px;
  }

  .clients-table th:nth-child(3),
  .clients-table td:nth-child(3),
  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4) {
    display: none;
  }

  .clients-table .client-actions {
    gap: 8px;
  }

  .btn-table-action span:not(.material-symbols-rounded) {
    display: none;
  }
}

/* ============================================
   Fleet Dashboard Styles
   ============================================ */

.fleet-header {
  margin-bottom: 24px;
}

.fleet-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fleet-header-titles h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-high);
  margin: 0 0 4px 0;
}

.fleet-header-titles p {
  font-size: 14px;
  color: var(--color-text-medium);
  margin: 0;
}

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

.view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.5);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.view-toggle-btn {
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background: var(--color-accent-primary);
  color: white;
}

.view-toggle-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

/* Fleet Stats Cards */
.fleet-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-high);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--color-text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card.stat-success .stat-value {
  color: var(--color-success);
}

.stat-card.stat-warning .stat-value {
  color: var(--color-warning);
}

.stat-card.stat-danger .stat-value {
  color: var(--color-error);
}

/* Fleet Toolbar */
.fleet-toolbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Vehicle Grid */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Vehicle Card */
.vehicle-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vehicle-card:hover {
  border-color: var(--color-accent-primary);
  transform: translateY(-2px);
}

.vehicle-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(96, 165, 250, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-brand-icon .material-symbols-rounded {
  font-size: 20px;
  color: var(--color-accent-primary);
}

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

.vehicle-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-high);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-registration {
  font-size: 13px;
  color: var(--color-text-medium);
  font-family: var(--font-mono);
}

.vehicle-details {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.vehicle-tag {
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(96, 165, 250, 0.1);
  color: var(--color-accent-light);
  border-radius: var(--radius-sm);
}

.vehicle-contract {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-medium);
  margin-bottom: 8px;
}

.vehicle-contract .material-symbols-rounded {
  font-size: 16px;
}

.vehicle-contract.expiring {
  color: var(--color-warning);
}

.expiring-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--color-warning);
  color: black;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.vehicle-driver {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-medium);
  margin-bottom: 12px;
}

.vehicle-driver .material-symbols-rounded {
  font-size: 16px;
}

.vehicle-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

/* Status Badges */
.status-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.status-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.status-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

.status-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.status-gray {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.status-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  min-width: 260px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.kanban-count {
  font-size: 12px;
  color: var(--color-text-medium);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.kanban-card.expiring {
  border-left: 3px solid var(--color-warning);
}

.kanban-card-brand {
  font-size: 12px;
  color: var(--color-text-medium);
}

.kanban-card-model {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-high);
}

.kanban-card-reg {
  font-size: 11px;
  color: var(--color-text-medium);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Status Change Modal */
.status-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.status-option {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.status-option:hover {
  border-color: var(--color-accent-primary);
}

.status-option.current {
  border-color: var(--color-accent-primary);
  background: rgba(96, 165, 250, 0.1);
}

/* ============================================
   Drivers View Styles
   ============================================ */

.drivers-header {
  margin-bottom: 24px;
}

.drivers-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.drivers-header-titles h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-high);
  margin: 0 0 4px 0;
}

.drivers-header-titles p {
  font-size: 14px;
  color: var(--color-text-medium);
  margin: 0;
}

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

.drivers-toolbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Drivers Table */
.drivers-table-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.drivers-table th,
.drivers-table td {
  padding: 14px 16px;
  text-align: left;
}

.drivers-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.drivers-table tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  cursor: pointer;
  transition: background 0.15s ease;
}

.drivers-table tr:hover {
  background: rgba(96, 165, 250, 0.05);
}

.drivers-table tr:last-child {
  border-bottom: none;
}

.driver-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-pressed));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.vehicle-count {
  font-size: 13px;
  color: var(--color-text-medium);
}

.vehicle-count.has-vehicles {
  color: var(--color-success);
}

.actions-cell {
  display: flex;
  gap: 4px;
}

/* Assigned Vehicles List */
.assigned-vehicles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.assigned-vehicle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.assigned-vehicle span {
  font-size: 13px;
  color: var(--color-text-medium);
}

/* Vehicle Select List */
.vehicle-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.vehicle-select-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
}

.vehicle-select-item .vehicle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vehicle-select-item .vehicle-info strong {
  font-size: 14px;
  color: var(--color-text-high);
}

.vehicle-select-item .vehicle-info .reg {
  font-size: 12px;
  color: var(--color-text-medium);
  font-family: var(--font-mono);
}

.empty-message {
  text-align: center;
  color: var(--color-text-medium);
  padding: 20px;
}

/* Shared Header Buttons */
.btn-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-primary {
  background: var(--color-accent-primary);
  color: white;
}

.btn-header-primary:hover {
  filter: brightness(1.1);
}

.btn-header-secondary {
  background: rgba(15, 23, 42, 0.6);
  color: var(--color-text-medium);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-header-secondary:hover {
  color: var(--color-text-high);
  border-color: rgba(148, 163, 184, 0.4);
}

/* ============================================
   Contacts View Styles (Unified Clients + Drivers)
   ============================================ */

.contacts-header {
  margin-bottom: 24px;
}

.contacts-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.contacts-header-titles h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-high);
  margin: 0 0 4px 0;
}

.contacts-header-titles p {
  font-size: 14px;
  color: var(--color-text-medium);
  margin: 0;
}

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

.contacts-toolbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Contacts Table */
.contacts-table-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.contacts-table th,
.contacts-table td {
  padding: 14px 16px;
  text-align: left;
}

.contacts-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.contacts-table tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  cursor: pointer;
  transition: background 0.15s ease;
}

.contacts-table tr:hover {
  background: rgba(96, 165, 250, 0.05);
}

.contacts-table tr:last-child {
  border-bottom: none;
}

.contact-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.driver-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  margin-left: 4px;
}

.driver-badge .material-symbols-rounded {
  font-size: 14px;
}

.driver-badge.status-green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.driver-badge.status-orange {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.sim-count {
  color: var(--color-text-medium);
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fleet-header-top,
  .drivers-header-top,
  .contacts-header-top {
    flex-direction: column;
  }

  .fleet-header-actions,
  .drivers-header-actions,
  .contacts-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .fleet-stats {
    flex-direction: column;
  }

  .stat-card {
    min-width: 100%;
  }

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

  .kanban-board {
    flex-direction: column;
  }

  .kanban-column {
    min-width: 100%;
  }

  .drivers-table th:nth-child(3),
  .drivers-table td:nth-child(3) {
    display: none;
  }

  .contacts-table th:nth-child(3),
  .contacts-table td:nth-child(3),
  .contacts-table th:nth-child(4),
  .contacts-table td:nth-child(4) {
    display: none;
  }
}
