/* ============================================
   TIKET BUS - MODERN DASHBOARD THEME
   ============================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #1e1b4b;
  --sidebar-hover: #312e81;
  --shadow: 0 4px 16px rgba(30, 41, 59, 0.08);
  --shadow-lg: 0 10px 30px rgba(30, 41, 59, 0.12);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Poppins', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
}

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

/* ============== LANDING PAGE ============== */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  padding: 20px;
}

.landing-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 50px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.landing-card .icon-bus {
  font-size: 56px;
  margin-bottom: 10px;
}

.landing-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.landing-card p.subtitle {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.landing-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.landing-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: all 0.25s ease;
  text-align: left;
}

.landing-btn:hover {
  border-color: var(--primary);
  background: #f5f3ff;
  transform: translateY(-2px);
}

.landing-btn .emoji {
  font-size: 28px;
}

.landing-btn .label-title {
  font-weight: 600;
  font-size: 16px;
}

.landing-btn .label-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============== AUTH (LOGIN) ============== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 4px;
  font-weight: 700;
}

.auth-card p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0ea271; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-dark);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 7px 14px; font-size: 12px; }

.back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 13px;
}
.back-link:hover { color: var(--primary); }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* ============== APP LAYOUT (Sidebar + Content) ============== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 28px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

.sidebar .brand .emoji { font-size: 26px; }
.sidebar .brand .text { font-weight: 700; font-size: 17px; }
.sidebar .brand .text small { display: block; font-size: 11px; font-weight: 400; opacity: 0.6; }

.sidebar nav {
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar nav a.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--secondary);
}

.sidebar nav a .icon { font-size: 17px; width: 20px; text-align: center; }

.sidebar .sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 16px;
}

.sidebar .sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 10px 0;
}
.sidebar .sidebar-footer a:hover { color: #fca5a5; }

.main-content {
  flex: 1;
  padding: 30px 36px;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 700;
}

.topbar .topbar-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
}

.user-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ============== STAT CARDS ============== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 4px solid var(--primary);
}

.stat-card:nth-child(2) { border-top-color: var(--secondary); }
.stat-card:nth-child(3) { border-top-color: var(--success); }
.stat-card:nth-child(4) { border-top-color: var(--warning); }

.stat-card .stat-icon {
  font-size: 30px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f5f3ff;
}

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

.stat-card .stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ============== CARD / PANEL ============== */
.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-header h2 {
  font-size: 17px;
  font-weight: 700;
}

/* ============== TABLE ============== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table th {
  text-align: left;
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table tr:hover td { background: #f8fafc; }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

.action-group { display: flex; gap: 8px; }

/* ============== ROUTE / SEAT CARDS (customer) ============== */
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.route-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.route-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.route-card .route-path {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 10px;
}

.route-card .route-path .arrow { color: var(--primary); }

.route-card .route-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin: 10px 0;
}

.route-card .route-id {
  font-size: 12px;
  color: var(--text-muted);
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 16px 0;
}

.seat {
  padding: 12px 0;
  text-align: center;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seat:hover { border-color: var(--primary); }
.seat.taken { background: #fee2e2; color: #b91c1c; cursor: not-allowed; border-color: #fecaca; }
.seat.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 44px; display: block; margin-bottom: 12px; }

/* Ticket Print Card */
.ticket-card {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.ticket-card::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.ticket-card h3 { font-size: 18px; margin-bottom: 14px; }
.ticket-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,0.25); }
.ticket-row:last-child { border-bottom: none; }
.ticket-row span:first-child { opacity: 0.8; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 20px; }
}
