/* Premium Redesign for SKJ Fleet Management System */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --nav-w: 280px;
  --page-bg: #F4F8FC;
  --surface: #ffffff;
  --surface-soft: #F8FAFC;
  --surface-muted: #f8fbff;
  --primary: #0A2342;
  --primary-soft: #E6EDF5;
  --accent: #165DFF;
  --accent-soft: rgba(22, 93, 255, 0.1);
  --success: #1BC47D;
  --danger: #E5484D;
  --warning: #FFB547;
  --border: #E6EDF5;
  --text: #162033;
  --text-muted: #8792A2;
  --text-strong: #162033;
  --shadow: 0 10px 30px rgba(18,38,63, 0.04), 0 2px 8px rgba(18,38,63, 0.02);
  --radius: 18px;
  --text-2: #5B667A;
  --text-3: #8792A2;
  --ocean-pale: rgba(22, 93, 255, 0.05);
  --sand: #FFFBEB;
  --gradient-primary: linear-gradient(135deg, #165DFF 0%, #00C6FF 100%);
  --gradient-dark: linear-gradient(180deg, #0A2342 0%, #051427 100%);
}

/* Global Reset & Typography */
html, body {
  min-height: 100%;
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg) !important;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.page-fare-checker .main-wrap {
  background: var(--page-bg) !important;
}

/* Sidebar */
.sidebar {
  width: var(--nav-w);
  background: var(--gradient-dark);
  box-shadow: 4px 0 30px rgba(5,20,39, 0.15);
  padding: 0;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
  padding: 30px 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  position: relative;
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
}

.sidebar-brand .logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #ffffff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand .logo::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--accent);
}

.sidebar-brand .tagline {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-section {
  padding: 16px 12px;
}

.nav-section + .nav-section {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 16px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: none;
  border-radius: 10px;
  margin-bottom: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-link.active {
  background: rgba(22, 93, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(22, 93, 255, 0.3);
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  background: #165DFF;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px #165DFF;
}

.nav-link .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  color: inherit;
}

.nav-link.active .icon {
  color: #00C6FF;
  opacity: 1;
}

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

.logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
}

.logout-link:hover {
  background: rgba(229, 72, 77, 0.1);
  border-color: rgba(229, 72, 77, 0.2);
  color: #ff6e73;
}

/* Topbar Navigation */
.topbar {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #E6EDF5;
  padding: 0 32px;
  height: 64px;
}

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.topbar-logout {
  font-size: 12.5px;
  font-weight: 600;
  color: #165DFF;
  background: transparent;
  border: 1.5px solid rgba(22, 93, 255, 0.2);
  border-radius: 10px;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.topbar-logout:hover {
  background: rgba(22, 93, 255, 0.05);
  border-color: #165DFF;
  color: #165DFF;
}

/* Main Content Wrapper */
.main-wrap {
  margin-left: var(--nav-w);
}

.page-content {
  padding: 32px;
  max-width: 1320px;
  margin: 0 auto;
}

/* Welcome Hero Banner */
.welcome-banner {
  background: linear-gradient(135deg, #0A2342 0%, #165DFF 100%),
              radial-gradient(circle at top right, rgba(0, 198, 255, 0.15) 0%, transparent 60%);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(10,35,66, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Abstract Grid and Node overlay */
.welcome-banner::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  opacity: 0.08;
  background-image: linear-gradient(rgba(255,255,255,0.15) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 198, 255, 0.1) 0%, transparent 70%);
  top: -100px;
  right: -50px;
  pointer-events: none;
}

.welcome-banner h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.welcome-banner p {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.date-badge {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: right;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.date-badge strong {
  display: block;
  font-size: 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: #ffffff;
}

.date-badge span {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Section Title */
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Premium KPI Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-height: 140px;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(18, 38, 63, 0.08);
  border-color: rgba(22, 93, 255, 0.2);
}

/* Colorful left/top border highlight per card */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: #9333ea; }
.stat-card:nth-child(5)::before { background: var(--danger); }
.stat-card:nth-child(6)::before { background: #00C6FF; }

.stat-card .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card .desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  margin-top: auto;
}

/* Accent Stat Card override */
.stat-card.accent-card {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #ffffff;
}

.stat-card.accent-card::before {
  display: none;
}

.stat-card.accent-card .label {
  color: rgba(255, 255, 255, 0.8);
}

.stat-card.accent-card .value {
  color: #ffffff;
}

.stat-card.accent-card .desc {
  color: rgba(255, 255, 255, 0.9);
}

/* Quick Action Links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.3);
  background: var(--surface-soft);
  box-shadow: 0 10px 25px rgba(22, 93, 255, 0.08);
  color: #165DFF;
}

.quick-link .ql-icon {
  font-size: 18px;
}

/* Premium Dashboard & Generic Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 32px;
}

.card-head, .card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
}

.card-head h3, .card-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.card-body {
  padding: 28px;
}

/* Tables Redesign */
.table-wrap {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

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

th {
  background: var(--surface-soft) !important;
  color: var(--text-2);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border) !important;
  vertical-align: middle;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

tr:hover td {
  background: rgba(22, 93, 255, 0.02) !important;
}

/* Status Badges / Pills */
.pill, .status-pill, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill-blue, .badge-admin {
  background: rgba(22, 93, 255, 0.08) !important;
  color: #165DFF !important;
  border: 1px solid rgba(22, 93, 255, 0.15);
}

.pill-green, .badge-officer, .status-pill.green, .badge.bg-success {
  background: rgba(27, 196, 125, 0.08) !important;
  color: #169E63 !important;
  border: 1px solid rgba(27, 196, 125, 0.15);
}

.pill-yellow, .status-pill.yellow, .badge.bg-warning {
  background: rgba(255, 181, 71, 0.08) !important;
  color: #CA8208 !important;
  border: 1px solid rgba(255, 181, 71, 0.15);
}

.pill-red, .status-pill.red, .badge.bg-danger {
  background: rgba(229, 72, 77, 0.08) !important;
  color: #CB3438 !important;
  border: 1px solid rgba(229, 72, 77, 0.15);
}

.pill-gray {
  background: rgba(135, 146, 162, 0.08) !important;
  color: #5B667A !important;
  border: 1px solid rgba(135, 146, 162, 0.15);
}

/* Fare Structure Cards */
.fare-zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.zone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.zone-card.accent {
  border-left-color: var(--accent);
}

.zone-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.2);
}

.zone-card .zone-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.zone-card .zone-dist {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 4px 0 10px;
}

.zone-fares {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fare-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(22, 93, 255, 0.04);
  border: 1px solid rgba(22, 93, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
}

.fare-chip strong {
  color: #165DFF;
  font-weight: 700;
}

/* Button Redesign */
.btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(22, 93, 255, 0.25);
  padding: 11.5px 20px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0052FF 0%, #00B6FF 100%);
  box-shadow: 0 6px 20px rgba(22, 93, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(22, 93, 255, 0.2);
  color: #165DFF;
}

.btn-ghost:hover {
  background: rgba(22, 93, 255, 0.05);
  border-color: #165DFF;
}

.btn-danger {
  background: #E5484D;
  color: #ffffff;
}

.btn-danger:hover {
  background: #D83A40;
}

.btn-success {
  background: #1BC47D;
  color: #ffffff;
}

.btn-success:hover {
  background: #16B270;
}

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

/* Form Styling */
.form-group {
  margin-bottom: 20px;
}

.form-label, .form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  background: #F8FAFC;
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: #165DFF;
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
  background: #ffffff;
}

/* Modals */
.modal-backdrop {
  background: rgba(10, 35, 66, 0.6);
  backdrop-filter: blur(4px);
}

.modal {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(10, 35, 66, 0.15);
  border: 1px solid var(--border);
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.modal-head h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--primary);
}

.modal-body {
  padding: 24px;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

/* Student ID Card Redesign */
.student-guide-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.student-guide-card:hover {
  transform: translateX(4px);
}

.student-guide-card.green {
  background: rgba(27, 196, 125, 0.06);
  border-color: rgba(27, 196, 125, 0.15);
}

.student-guide-card.blue {
  background: rgba(22, 93, 255, 0.06);
  border-color: rgba(22, 93, 255, 0.15);
}

.student-guide-card.yellow {
  background: rgba(255, 181, 71, 0.06);
  border-color: rgba(255, 181, 71, 0.15);
}

.student-indicator-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.student-guide-card.green .student-indicator-dot { background: #1BC47D; box-shadow: 0 0 8px rgba(27, 196, 125, 0.5); }
.student-guide-card.blue .student-indicator-dot { background: #165DFF; box-shadow: 0 0 8px rgba(22, 93, 255, 0.5); }
.student-guide-card.yellow .student-indicator-dot { background: #FFB547; box-shadow: 0 0 8px rgba(255, 181, 71, 0.5); }

/* Custom Map Toolbar & Legends styling */
.map-toolbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 8px 12px;
}

/* Scrollbar override */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(22, 93, 255, 0.15);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 93, 255, 0.3);
}

/* Watermark styling */
.page-watermark {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.page-watermark:hover {
  color: #165DFF;
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
}

.alert-error, .flash-error {
  background: rgba(229, 72, 77, 0.06);
  border-color: rgba(229, 72, 77, 0.15);
  color: #CB3438;
}

.alert-success, .flash-success {
  background: rgba(27, 196, 125, 0.06);
  border-color: rgba(27, 196, 125, 0.15);
  color: #169E63;
}

.alert-info {
  background: rgba(22, 93, 255, 0.06);
  border-color: rgba(22, 93, 255, 0.15);
  color: #165DFF;
}
