: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: AUTHENTIC DE LIJN DIENSTFICHE (RITORDER)
   ========================================================================== */
.dienstfiche-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.diensfiche-control-card {
  padding: 16px 20px;
}

.styled-select {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.styled-select:focus {
  border-color: var(--accent-gold);
}

.day-fiche-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 4px;
  display: inline-block;
}

/* Official Digital De Lijn Dienstfiche & Rit Order */
.dienstfiche-render-container {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 20px;
}

.dienstfiche-sheet {
  background: #0b1329;
  color: #f8fafc;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 14px;
  border: 1px solid rgba(250, 204, 21, 0.25);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 15px rgba(250, 204, 21, 0.05);
  box-sizing: border-box;
}

/* Header Banner */
.fiche-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #1e293b;
  padding-bottom: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

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

.fiche-delijn-badge {
  background: var(--de-lijn-yellow, #facc15);
  color: #000000;
  font-weight: 900;
  font-size: 1.15rem;
  padding: 8px 14px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fiche-title-group h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.fiche-title-group p {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.fiche-status-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.4px;
}

/* Info Grid (Specs & Metadata) */
.fiche-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.fiche-spec-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fiche-spec-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.fiche-spec-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.fiche-spec-val.highlight {
  color: var(--de-lijn-yellow, #facc15);
}

/* Timeline Flow */
.fiche-timeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.fiche-time-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 90px;
  text-align: center;
}

.fiche-time-step .time {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--de-lijn-yellow, #facc15);
  font-variant-numeric: tabular-nums;
}

.fiche-time-step .desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: 600;
}

.fiche-time-arrow {
  color: #64748b;
  font-size: 1.2rem;
}

/* Trips / Deelritten Sections */
.fiche-trips-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fiche-trip-block {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
}

.fiche-trip-header {
  background: #172554;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 10px;
}

.fiche-trip-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiche-film-matrix {
  background: #050505;
  color: #fbbf24;
  font-family: 'Consolas', 'Courier New', monospace;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #475569;
  text-shadow: 0 0 4px rgba(251, 191, 36, 0.4);
}

.fiche-trip-type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.fiche-trip-type-pill.reizigers {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.fiche-trip-type-pill.ledig {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Stop Table */
.fiche-stops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.fiche-stops-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid #334155;
}

.fiche-stops-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}

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

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

.fiche-stops-table .stop-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--de-lijn-yellow, #facc15);
  width: 100px;
}

.fiche-stops-table .stop-checkpoint {
  font-weight: 800;
  color: #ffffff;
}

.fiche-stops-table .stop-note {
  font-size: 0.76rem;
  color: #94a3b8;
  font-style: italic;
}

/* Pause Box */
.fiche-pause-block {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.fiche-pause-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fiche-pause-icon {
  font-size: 1.6rem;
}

.fiche-pause-title {
  font-weight: 800;
  color: #fbbf24;
  font-size: 0.95rem;
}

.fiche-pause-sub {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.fiche-pause-time {
  font-size: 1rem;
  font-weight: 900;
  color: #facc15;
  background: #0f172a;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
}

/* Footer Instructions & Stamp */
.fiche-footer-box {
  margin-top: 22px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.fiche-footer-info {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.fiche-footer-stamp {
  border: 2px dashed #facc15;
  color: #facc15;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
}

/* Modal Window */
.dienstfiche-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dienstfiche-modal.hidden {
  display: none !important;
}

.dienstfiche-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 950px;
  width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.dienstfiche-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.7);
}

.dienstfiche-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

/* Print Rules for A4 Paper Output */
@media print {
  body * {
    visibility: hidden !important;
  }
  .dienstfiche-sheet, .dienstfiche-sheet * {
    visibility: visible !important;
  }
  .dienstfiche-sheet {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: 1px solid #000000 !important;
  }
  .fiche-title-group h2, .fiche-spec-val, .fiche-stops-table td, .fiche-trip-title {
    color: #000000 !important;
  }
  .fiche-stops-table th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }
  .fiche-stops-table td {
    border-bottom: 1px solid #cccccc !important;
  }
  .fiche-film-matrix {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }
  .dienstfiche-modal,
  .dienstfiche-modal-content,
  .dienstfiche-modal-header,
  .app-header,
  .dienstfiche-actions,
  .diensfiche-control-card {
    display: none !important;
    border: none !important;
    background: transparent !important;
  }
}

/* ==========================================================================
   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;
  }
  .dienstfiche-view-wrapper, .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;
  }
}

.calendar-day.custom-sql-shift {
  border: 1px solid rgba(250, 204, 21, 0.5) !important;
  background: rgba(250, 204, 21, 0.04) !important;
}
