:root {
  --bg-dark: #070b14;
  --bg-card: #0d1527;
  --bg-card-hover: #16223b;
  --bg-surface: #101c33;
  --border-color: rgba(255, 255, 255, 0.09);
  --border-active: rgba(250, 204, 21, 0.4);

  --accent-gold: #facc15;
  --accent-gold-glow: rgba(250, 204, 21, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-blue: #0284c7;
  --accent-purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   1. LOGIN OVERLAY
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #101c38 0%, #050810 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-overlay.hidden {
  display: none !important;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid rgba(250, 204, 21, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(250, 204, 21, 0.08);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  position: relative;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  box-shadow: 0 0 20px var(--accent-gold-glow);
}

.login-logo svg {
  width: 32px;
  height: 32px;
}

.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.accent-text {
  color: var(--accent-gold);
}

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

.login-badge-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 44px;
  transition: all 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
  background: rgba(15, 23, 42, 0.95);
}

.input-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  margin-right: 10px;
  flex-shrink: 0;
}

.input-wrap input, select, textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}

select {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
}

select:focus, textarea:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

textarea {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  resize: vertical;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #000;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.45);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

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

.btn-danger {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid #f43f5e;
  color: #f43f5e;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background: #f43f5e;
  color: #fff;
}

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

.btn-gold {
  background: #facc15;
  color: #000;
  border: none;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 14px;
}

/* Auth Tabs (Login vs Register) */
.auth-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

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

.auth-tab-btn.active {
  background: var(--accent-gold);
  color: #000;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.3);
}

/* Verify Section */
.verify-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.verify-card-header .verify-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.verify-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.verify-card-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.code-wrap input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--accent-gold);
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  height: 64px;
  background: rgba(13, 21, 39, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: #1e293b;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-gold);
}

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

.nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #000;
  background: var(--accent-gold);
  font-weight: 800;
}

.nav-link svg {
  width: 16px;
  height: 16px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-ring 2s infinite;
}

.badge-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent-rose);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.badge-count.gold {
  background: #000;
  color: var(--accent-gold);
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
}

.user-avatar {
  font-size: 1.2rem;
  width: 30px;
  height: 30px;
  background: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.user-id {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.logout-icon-btn:hover {
  color: var(--accent-rose);
}

.logout-icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Owner Status Strip */
.owner-status-strip {
  background: linear-gradient(90deg, #854d0e 0%, #ca8a04 100%);
  color: #fff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.84rem;
}

.strip-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strip-icon {
  font-size: 1.2rem;
}

/* ==========================================================================
   3. MAIN VIEWPORT & TABS
   ========================================================================== */
.main-viewport {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* Card Component */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ==========================================================================
   TAB 1: DASHBOARD
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.hero-rank-card {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(135deg, #0e172e 0%, #070c17 100%);
  border: 1px solid rgba(250, 204, 21, 0.25);
  position: relative;
  overflow: hidden;
}

.hero-rank-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.rank-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rank-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  background: #1e293b;
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 20px var(--accent-gold-glow);
}

.rank-lvl-badge {
  position: absolute;
  bottom: -8px;
  background: var(--accent-gold);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.rank-info {
  flex: 1;
}

.rank-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.rank-title {
  font-size: 0.86rem;
  color: var(--accent-gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.xp-bar-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.xp-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #facc15, #f59e0b);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
  transition: width 0.5s ease-out;
}

.stats-pills-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
}

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

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.today-order-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.today-order-content {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.today-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.line-badge-square {
  width: 44px;
  height: 44px;
  background: #0284c7;
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.today-order-info {
  flex: 1;
}

.today-order-info strong {
  display: block;
  font-size: 0.9rem;
}

.today-order-info span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.quick-actions-card {
  grid-column: span 6;
}

.quick-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-nav-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.quick-nav-btn .q-icon {
  font-size: 1.4rem;
}

.feed-card {
  grid-column: span 6;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.feed-item-icon {
  font-size: 1.1rem;
}

.feed-item-content strong {
  display: block;
  color: var(--text-main);
}

.feed-item-content span {
  color: var(--text-muted);
}

/* ==========================================================================
   TAB 2: MAANDPLANNING
   ========================================================================== */
.planning-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.planning-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-month-label {
  font-size: 1.15rem;
  font-weight: 800;
  min-width: 170px;
  text-align: center;
}

.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.calendar-weekdays .weekend {
  color: var(--accent-gold);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calendar-day {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-day:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.calendar-day.today {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

.calendar-day.empty {
  opacity: 0.2;
  cursor: default;
}

.calendar-day.empty:hover {
  transform: none;
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-color);
}

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

.day-number {
  font-size: 0.85rem;
  font-weight: 700;
}

.shift-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-badge.vroeg {
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.shift-badge.dag {
  background: rgba(250, 204, 21, 0.18);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.shift-badge.laat {
  background: rgba(168, 85, 247, 0.18);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
}

.shift-badge.nacht {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid #3b82f6;
}

.shift-badge.rust {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px dashed var(--border-color);
}

.shift-badge.verlof {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.day-line-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.day-detail-banner {
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease-out;
}

.day-detail-banner[hidden] {
  display: none !important;
}

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

.detail-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  font-size: 0.88rem;
}

/* ==========================================================================
   TAB 3: RIT ORDER & SIMULATOR
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 20px;
}

.sim-order-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.order-badge-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-badge-title .badge-icon {
  font-size: 1.8rem;
}

.sim-bus-info-panel {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bus-graphic-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bus-icon-big {
  font-size: 2.2rem;
}

.bus-specs strong {
  display: block;
  font-size: 1rem;
}

.bus-specs span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sim-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.metric-card .label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.metric-card .val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}

.sim-controls-panel h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sim-terminal-log {
  background: #03060d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-bar {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  font-size: 0.72rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
}

.terminal-content {
  padding: 12px;
  height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  font-size: 0.76rem;
  line-height: 1.4;
}

.log-line.system { color: var(--accent-gold); }
.log-line.driver { color: var(--accent-cyan); }
.log-line.event { color: var(--accent-rose); }
.log-line.success { color: var(--accent-emerald); }

.sim-stops-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
  gap: 12px;
  margin-top: 10px;
}

.sim-stops-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.sim-stop-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.sim-stop-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
}

.sim-stop-item.passed {
  opacity: 0.5;
}

.sim-stop-item.passed::before {
  background: var(--text-dim);
}

.sim-stop-item.current {
  border-color: var(--accent-gold);
  background: rgba(250, 204, 21, 0.1);
  font-weight: 700;
}

.sim-stop-item.current::before {
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  transform: translateY(-50%) scale(1.4);
}

/* ==========================================================================
   TABS 4, 5, 6: SPLIT LAYOUTS (FORMS & LISTS)
   ========================================================================== */
.content-split-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 20px;
}

.standard-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* List Items (Verlof, Wissels, Reports) */
.verlof-history-list, .wissels-list, .reports-list, .owner-approval-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.item-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.item-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.item-title {
  font-size: 0.94rem;
  font-weight: 700;
}

.item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.item-body {
  font-size: 0.84rem;
  color: var(--text-main);
  line-height: 1.4;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* Status Chips */
.status-chip {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-chip.pending {
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.status-chip.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.rejected {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-chip.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ==========================================================================
   TAB 7: OWNER / DISPATCH PANEL
   ========================================================================== */
.owner-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.owner-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.owner-quick-stats {
  display: flex;
  gap: 12px;
}

.owner-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.owner-stat-pill .count {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
}

.owner-stat-pill span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.owner-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.owner-card.full-width {
  grid-column: span 2;
}

/* Roster Table */
.driver-roster-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

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

.roster-table th {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--border-color);
}

.roster-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

/* Utility Colors */
.text-gold { color: var(--accent-gold) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-yellow { color: #fde047 !important; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  color: var(--text-main);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 10000;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Live dots */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.live-dot.pulse {
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .hero-rank-card, .today-order-card, .quick-actions-card, .feed-card {
    grid-column: span 12;
  }
  .simulator-layout, .content-split-layout, .owner-sections-grid {
    grid-template-columns: 1fr;
  }
  .owner-card.full-width {
    grid-column: span 1;
  }
  .calendar-weekdays span {
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .app-header {
    height: auto;
    padding: 10px 14px;
    flex-direction: column;
    gap: 10px;
  }
  .nav-links {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
  }
  .stats-pills-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-grid {
    gap: 4px;
  }
  .calendar-day {
    min-height: 70px;
    padding: 4px;
  }
  .day-line-label {
    display: none;
  }
}
