/* ============================================
   ΕΟΔ ΛΑΚΩΝΙΑΣ – Vehicle Tracking App
   style.css
   ============================================ */

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

:root {
  --bg-primary:     #090d1a;
  --bg-secondary:   #0f1629;
  --bg-card:        #131c35;
  --bg-card-hover:  #1a2545;
  --bg-glass:       rgba(19, 28, 53, 0.7);
  --border:         rgba(255,255,255,0.07);
  --border-hover:   rgba(255,255,255,0.15);

  --accent-red:     #e63946;
  --accent-red-dim: rgba(230, 57, 70, 0.15);
  --accent-blue:    #4895ef;
  --accent-blue-dim:rgba(72, 149, 239, 0.15);
  --accent-green:   #2dc653;
  --accent-green-dim:rgba(45, 198, 83, 0.12);
  --accent-orange:  #fb8500;
  --accent-purple:  #7b2fbe;

  --text-primary:   #f0f4ff;
  --text-secondary: #8b96b8;
  --text-muted:     #4a5580;

  --sidebar-width:  260px;
  --topbar-height:  64px;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow-red:  0 0 24px rgba(230,57,70,0.25);
  --shadow-glow-blue: 0 0 24px rgba(72,149,239,0.2);
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 42px; height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--accent-red));
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================
   MOBILE OVERLAY
   ============================ */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================
   TOPBAR
   ============================ */
.topbar {
  height: var(--topbar-height);
  background: rgba(9,13,26,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sync-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition);
}

.sync-badge.online {
  background: rgba(45, 198, 83, 0.12);
  border-color: rgba(45, 198, 83, 0.3);
  color: #2dc653;
}

.sync-badge.offline {
  background: rgba(230, 57, 70, 0.12);
  border-color: rgba(230, 57, 70, 0.3);
  color: #e63946;
}

.sync-badge.syncing {
  background: rgba(72, 149, 239, 0.12);
  border-color: rgba(72, 149, 239, 0.3);
  color: #4895ef;
}

.date-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================
   PAGES
   ============================ */
.page {
  display: none;
  padding: 2rem 1.5rem;
  flex: 1;
  animation: fadeIn 0.25s ease;
}

.page.active { display: block; }

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

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ============================
   STATS GRID
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-blue));
  opacity: 0;
  transition: opacity var(--transition);
}

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

.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 2rem; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ============================
   CHARTS
   ============================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition);
}

.chart-card.full-width {
  margin-bottom: 1rem;
}

.chart-card:hover { border-color: var(--border-hover); }

.chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-wrapper {
  position: relative;
  height: 220px;
}

/* ============================
   RECENT ENTRIES
   ============================ */
.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.recent-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.recent-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.recent-badge {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.recent-info { flex: 1; }

.recent-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.recent-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.recent-fuel {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-orange);
}

/* ============================
   VEHICLES GRID
   ============================ */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: all var(--transition);
}

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

.vehicle-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.vehicle-plate {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.vehicle-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active   { background: var(--accent-green-dim); color: var(--accent-green); }
.status-inactive { background: rgba(139,150,184,0.15); color: var(--text-secondary); }
.status-maintenance { background: rgba(251,133,0,0.15); color: var(--accent-orange); }

.vehicle-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.vehicle-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.vehicle-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================
   FORM
   ============================ */
.entry-form {
  max-width: 1100px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(72,149,239,0.12);
  background: var(--bg-card);
}

.form-group select option { background: var(--bg-card); }

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.km-diff-display {
  background: var(--accent-blue-dim);
  border: 1px solid rgba(72,149,239,0.2);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--accent-blue);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-red), #c1121f);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(230,57,70,0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, #2dc653, #1a7f37);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(45,198,83,0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45,198,83,0.35);
}

.btn-ghost {
  background: none;
  color: var(--accent-blue);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-icon.danger:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: var(--accent-red-dim);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #c1121f);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

/* ============================
   FILTER BAR
   ============================ */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group input,
.filter-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: all var(--transition);
  min-width: 140px;
  -webkit-appearance: none;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(72,149,239,0.1);
}

.search-group input { min-width: 200px; }

.filter-group select option { background: var(--bg-card); }

/* ============================
   TABLE
   ============================ */
.table-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table thead tr {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

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

.td-primary { color: var(--text-primary) !important; font-weight: 500; }
.td-accent  { color: var(--accent-orange) !important; font-weight: 600; }
.td-blue    { color: var(--accent-blue) !important; font-weight: 600; }

/* ============================
   FUEL STATS ROW
   ============================ */
.fuel-stats-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.fuel-stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.fuel-stat-chip strong {
  color: var(--accent-orange);
  font-weight: 700;
}

/* ============================
   REPORTS
   ============================ */
.report-period {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.report-period select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.report-period select:focus { border-color: var(--accent-blue); }

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.report-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.report-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.report-table-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.report-table-card .table-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

/* ============================
   EMPTY STATE
   ============================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================
   MODAL
   ============================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-sm { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-lg {
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.modal-actions-edit {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

@media (max-width: 700px) {
  .modal-form-grid {
    grid-template-columns: 1fr;
  }
  .modal-lg {
    max-height: 95vh;
  }
}

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-red); }
.toast.info    { border-left: 3px solid var(--accent-blue); }

/* ============================
   CATEGORY BADGE
   ============================ */
.cat-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.cat-search    { background: rgba(72,149,239,0.15); color: var(--accent-blue); }
.cat-fire      { background: rgba(230,57,70,0.15);  color: var(--accent-red); }
.cat-flood     { background: rgba(72,149,239,0.2);  color: #74b3ff; }
.cat-quake     { background: rgba(251,133,0,0.15);  color: var(--accent-orange); }
.cat-accident  { background: rgba(230,57,70,0.12);  color: #ff8fa3; }
.cat-event     { background: rgba(123,47,190,0.15); color: #c084fc; }
.cat-supply    { background: rgba(45,198,83,0.12);  color: var(--accent-green); }
.cat-maintain  { background: rgba(139,150,184,0.15);color: var(--text-secondary); }
.cat-admin     { background: rgba(251,133,0,0.1);   color: #fbb650; }
.cat-other     { background: rgba(139,150,184,0.1); color: var(--text-muted); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-btn { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 1.4rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-group input, .filter-group select { min-width: auto; }
  .form-actions { flex-direction: column-reverse; }
  .modal { padding: 1.25rem; }
}

/* ============================
   AUTHENTICATION & LOGIN SCREEN
   ============================ */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, #17213d 0%, #080c17 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.login-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(19, 28, 53, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), var(--shadow-glow-red);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: loginSlideUp 0.4s ease-out;
}

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

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

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-red), #b70918);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
  margin-bottom: 0.25rem;
}

.login-brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.login-brand-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-form h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: -0.25rem;
}

.login-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.login-error {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.4);
  color: #ff6b6b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 2.75rem;
}

.btn-toggle-pw {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-toggle-pw:hover {
  opacity: 1;
}

.btn-login-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  justify-content: center;
}

.login-footer {
  text-align: center;
  font-size: 0.725rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ============================
   USER PROFILE MENU & BADGES
   ============================ */
.user-menu-container {
  position: relative;
  margin-left: 0.5rem;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.user-name {
  font-weight: 600;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-badge.admin {
  background: rgba(230, 57, 70, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.user-badge.user {
  background: rgba(72, 149, 239, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(72, 149, 239, 0.3);
}

.dropdown-caret {
  font-size: 0.6rem;
  opacity: 0.6;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.user-dropdown-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-header {
  padding: 0.5rem 0.75rem;
}

.dropdown-user-full {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.dropdown-user-username {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.text-danger {
  color: #ff6b6b;
}

.dropdown-item.text-danger:hover {
  background: rgba(230, 57, 70, 0.15);
}

