:root {
  --bg-color: #0b0d0e; 
  --bg-accent: #121416;
  --card-bg: rgba(18, 20, 22, 0.45);
  --primary: #00e676; 
  --primary-rgb: 0, 230, 118;
  --primary-glow: rgba(0, 230, 118, 0.15);
  --primary-gradient: linear-gradient(135deg, #00e676 0%, #10b981 100%);
  --accent: #f8fafc;
  --accent-rgb: 248, 250, 252;
  --accent-gradient: linear-gradient(135deg, #f8fafc 0%, #64748b 100%);
  --glass-border: rgba(0, 230, 118, 0.1);
  --glass-border-hover: rgba(0, 230, 118, 0.28);
  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --error: #ff4d4d;
  --success: #00e676;
  --transition: all 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-premium: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --neon-glow: 0 0 20px rgba(0, 230, 118, 0.2);
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
}

h1, h2, h3, h4, h5, h6, .logo, .nav-item {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.01em;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.glass {
  background: var(--card-bg);
  background-image: linear-gradient(135deg, rgba(248, 250, 252, 0.03) 0%, rgba(248, 250, 252, 0) 100%);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(248, 250, 252, 0.05);
  transition: var(--transition-premium);
}

/* Premium Action Buttons */
.btn-action {
    background: rgba(248, 250, 252, 0.02);
    border: 1px solid rgba(248, 250, 252, 0.08);
    color: rgba(248, 250, 252, 0.45);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-premium);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.03);
}

.btn-action:not(.delete) {
    color: rgba(0, 230, 118, 0.7); /* Primary tint */
}

.btn-action.delete {
    color: rgba(255, 77, 77, 0.7); /* Error tint */
}

.btn-action:hover {
    background: rgba(0, 230, 118, 0.08);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px) scale(1.06);
    box-shadow: 
        0 6px 15px rgba(0, 230, 118, 0.25),
        0 0 10px rgba(0, 230, 118, 0.1),
        inset 0 1px 0 rgba(248, 250, 252, 0.05);
}

.btn-action.delete:hover {
    border-color: var(--error);
    color: #fff;
    background: rgba(255, 77, 77, 0.08);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 
        0 6px 15px rgba(255, 77, 77, 0.25),
        0 0 10px rgba(255, 77, 77, 0.1),
        inset 0 1px 0 rgba(248, 250, 252, 0.05);
}

.btn-action:active {
    transform: translateY(1px) scale(0.95);
    transition: all 0.1s ease;
}

.btn-action svg {
    width: 17px;
    height: 17px;
    transition: var(--transition-premium);
}

.btn-action:hover svg {
    transform: scale(1.1);
}

.settings-item {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.01) 0%, rgba(248, 250, 252, 0) 100%);
    border: 1px solid var(--glass-border);
    padding: 0.85rem 1.25rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    transition: var(--transition-premium);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.02);
}

.settings-item:hover {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.04) 0%, rgba(0, 230, 118, 0.01) 100%);
    border-color: rgba(0, 230, 118, 0.3);
    transform: translateX(4px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(248, 250, 252, 0.03);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.settings-list::-webkit-scrollbar {
    width: 6px;
}

.settings-list::-webkit-scrollbar-track {
    background: transparent;
}

.settings-list::-webkit-scrollbar-thumb {
    background: rgba(248, 250, 252, 0.05);
    border-radius: 9999px;
}

.settings-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 230, 118, 0.2);
}

.container { max-width: 1280px; margin: 0 auto; padding: 2rem; }

header {
  margin: 1.25rem 1.25rem 0 1.25rem;
  border-radius: 28px;
  padding: 1.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(90deg, rgba(20, 24, 28, 0.4) 0%, rgba(10, 12, 14, 0.6) 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
  position: relative;
  z-index: 10;
}

.view-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-title h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.view-title span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.9;
}

.logo {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: flex; align-items: center; gap: 0.6rem;
  transition: var(--transition-premium);
}
.logo::before {
  content: ''; width: 12px; height: 12px; background: var(--primary); border-radius: 4px;
  box-shadow: 0 0 18px var(--primary), 0 0 8px var(--primary);
  transition: var(--transition-premium);
}
.logo:hover {
  transform: scale(1.02);
}
.logo:hover::before {
  transform: scale(1.2) rotate(45deg);
  box-shadow: 0 0 25px var(--primary), 0 0 12px var(--primary);
}




.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

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

.stat-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-premium);
    background: linear-gradient(145deg, rgba(20, 24, 28, 0.6) 0%, rgba(10, 12, 14, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px !important;
    min-height: 140px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: -150%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.1), transparent);
    transform: skewX(-25deg);
    transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.stat-card:hover::before {
    left: 150%;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.8), 
        0 0 40px rgba(0, 230, 118, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stat-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    transition: var(--transition-premium);
}

.stat-card:hover .stat-sparkline {
    opacity: 1;
    transform: scaleY(1.1);
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.stat-card > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    z-index: 3;
    width: 100%;
}

.stat-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 3;
    padding: 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(8deg);
}

.sky-icon { background: radial-gradient(circle at top left, rgba(0, 230, 118, 0.2), rgba(0, 230, 118, 0.05)); color: #00e676; border: 1px solid rgba(0, 230, 118, 0.2); box-shadow: 0 8px 20px rgba(0, 230, 118, 0.15); }
.emerald-icon { background: radial-gradient(circle at top left, rgba(110, 231, 183, 0.2), rgba(110, 231, 183, 0.05)); color: #6ee7b7; border: 1px solid rgba(110, 231, 183, 0.2); box-shadow: 0 8px 20px rgba(110, 231, 183, 0.15); }
.amber-icon { background: radial-gradient(circle at top left, rgba(248, 250, 252, 0.2), rgba(248, 250, 252, 0.05)); color: #f8fafc; border: 1px solid rgba(248, 250, 252, 0.2); box-shadow: 0 8px 20px rgba(248, 250, 252, 0.15); }
.purple-icon { background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05)); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15); }

.stat-meta {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    position: relative;
    z-index: 3;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-premium);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.05), 0 2px 5px rgba(0,0,0,0.2);
}
.stat-badge i { stroke-width: 2.5; }
.stat-badge.sky { background: rgba(0, 230, 118, 0.15); color: #00e676; border: 1px solid rgba(0, 230, 118, 0.25); }
.stat-badge.emerald { background: rgba(110, 231, 183, 0.15); color: #6ee7b7; border: 1px solid rgba(110, 231, 183, 0.25); }
.stat-badge.amber { background: rgba(248, 250, 252, 0.15); color: #f8fafc; border: 1px solid rgba(248, 250, 252, 0.25); }
.stat-badge.purple { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    letter-spacing: -0.02em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    opacity: 0.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke-width: 1px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-full {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-full {
        grid-column: span 1;
    }
}

.main-content { display: grid; grid-template-columns: 380px 1fr; gap: 2rem; }
@media (max-width: 1024px) { .main-content { grid-template-columns: 1fr; } }

.panel { padding: 2rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.panel-header span { font-weight: 700; font-size: 1rem; color: var(--text-main); }

.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(11, 13, 14, 0.4);
  border: 1px solid rgba(0, 230, 118, 0.12);
  border-radius: 14px;
  color: #fff;
  font-size: 0.9rem;
  transition: var(--transition-premium);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5), 
    inset 0 1px 0 rgba(248, 250, 252, 0.02);
}
input:hover, select:hover {
  border-color: rgba(0, 230, 118, 0.35);
  background: rgba(11, 13, 14, 0.55);
}
input:focus, select:focus { 
  outline: none;
  border-color: var(--primary); 
  box-shadow: 
    inset 0 1px 2px rgba(0, 0, 0, 0.6), 
    0 0 18px rgba(0, 230, 118, 0.28);
  background: rgba(11, 13, 14, 0.65);
}
input::placeholder {
  color: rgba(248, 250, 252, 0.3);
}

.btn {
  padding: 0.75rem 1.75rem; 
  border-radius: 9999px; /* Capsule pill structure */
  border: 1px solid transparent; 
  font-weight: 700;
  cursor: pointer; 
  transition: var(--transition-premium); 
  display: inline-flex;
  align-items: center; 
  justify-content: center; 
  gap: 0.6rem; 
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: translateY(1px) scale(0.97);
  transition: all 0.1s ease;
}
.btn i { width: 16px; height: 16px; }

.btn-primary { 
  background: var(--primary-gradient); 
  color: #0b0d0e; 
  font-weight: 800;
  border: 1px solid rgba(0, 230, 118, 0.5);
  box-shadow: 
    0 8px 24px rgba(0, 230, 118, 0.2),
    inset 0 1px 0 rgba(248, 250, 252, 0.3);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #69f0ae 0%, #00c853 100%);
  color: #0b0d0e;
  border-color: #69f0ae;
  box-shadow: 
    0 12px 30px rgba(0, 230, 118, 0.4),
    0 0 20px rgba(0, 230, 118, 0.2),
    inset 0 1px 0 rgba(248, 250, 252, 0.4);
  transform: translateY(-2px) scale(1.03);
}

.btn-accent { 
  background: rgba(0, 230, 118, 0.08); 
  color: var(--primary); 
  border: 1px solid rgba(0, 230, 118, 0.25);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4);
}
.btn-accent:hover {
  background: rgba(0, 230, 118, 0.16);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 
    0 8px 20px rgba(0, 230, 118, 0.25),
    0 0 15px rgba(0, 230, 118, 0.15);
  transform: translateY(-2px) scale(1.03);
}

.btn-outline { 
  background: rgba(248, 250, 252, 0.02); 
  border: 1px solid rgba(248, 250, 252, 0.08); 
  color: rgba(248, 250, 252, 0.7); 
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 1px rgba(248, 250, 252, 0.01);
}
.btn-outline:hover { 
  background: rgba(248, 250, 252, 0.06); 
  border-color: rgba(248, 250, 252, 0.25);
  color: #fff;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(248, 250, 252, 0.05);
  transform: translateY(-2px) scale(1.03);
}

.trip-list { display: flex; flex-direction: column; gap: 0.75rem; }
.trip-item { 
  padding: 1.25rem; border-radius: 18px; 
  background: rgba(18, 20, 22, 0.5); 
  border: 1px solid rgba(148, 163, 184, 0.08); 
  transition: var(--transition);
}
.trip-item.waybill-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.trip-stats-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .trip-item.waybill-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .trip-stats-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid rgba(248, 250, 252, 0.05);
    padding-top: 0.75rem;
  }
}
.trip-item:hover { 
  background: rgba(18, 20, 22, 0.75); 
  border-color: rgba(148, 163, 184, 0.25);
  transform: scale(1.01);
}

.trip-km { font-size: 1.1rem; font-weight: 800; color: var(--primary); text-shadow: 0 0 10px rgba(148, 163, 184, 0.3); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }

.app-layout { 
  display: grid; 
  grid-template-columns: 280px 1fr; 
  min-height: 100vh; 
}
@media (max-width: 1024px) { 
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; } /* Simplified for now, can add a mobile drawer later */
}

.sidebar {
  margin: 1.25rem 0 1.25rem 1.25rem;
  height: calc(100vh - 2.5rem);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 24, 28, 0.4) 0%, rgba(10, 12, 14, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  z-index: 100;
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 9999px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-premium);
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item i { width: 20px; height: 20px; }
.nav-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 230, 118, 0.05) 100%);
  color: #fff;
  border: 1px solid rgba(0, 230, 118, 0.6);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 230, 118, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateX(8px);
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}


.main-wrapper {
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.05) 0%, transparent 40%);
}

.page-content {
  padding: 2.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.stat-trend {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--error); }

@keyframes fadeInDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* Login */
.login-overlay { background: radial-gradient(circle at center, var(--bg-accent) 0%, var(--bg-color) 100%) !important; }
.login-card { animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1); }

/* Conflict Highlights */
.conflict-time { color: var(--error) !important; font-weight: 800; }
.conflict-origin { border: 2px dashed var(--error) !important; background: rgba(244, 63, 94, 0.05) !important; }

.modal-sub {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  width: 90%;
  max-width: 450px;
  padding: 2rem;
  border-radius: 28px;
  background: rgba(18, 20, 22, 0.75);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(0, 230, 118, 0.3);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(248, 250, 252, 0.05),
    0 0 30px rgba(0, 230, 118, 0.1);
  animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#settings-modal {
  background: rgba(18, 20, 22, 0.75) !important;
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  border: 1px solid rgba(0, 230, 118, 0.3) !important;
  border-radius: 28px !important;
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(248, 250, 252, 0.05),
    0 0 30px rgba(0, 230, 118, 0.1) !important;
  animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 13, 14, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsiveness */
@media (max-width: 1200px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-wrapper { padding: 1rem; }
  .mobile-only { display: block !important; }
  .main-content { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .panel { padding: 1rem; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.5rem; }
}

/* ===== PRINT FORM №3 STYLES ===== */
#print-section {
  display: none;
  font-family: 'Times New Roman', serif;
  font-size: 9pt;
  line-height: 1.3;
  color: #000;
  background: #fff;
}

.p-page {
  width: 210mm;
  min-height: 290mm;
  padding: 8mm 10mm;
  margin: 0 auto;
  background: #fff;
  page-break-after: always;
  position: relative;
}

.p-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 2px;
  font-size: 8.5pt;
}

.p-field {
  display: inline-block;
  border-bottom: 1px solid #000;
  min-width: 40px;
  min-height: 14px;
  padding: 0 3px;
  font-size: 8.5pt;
  vertical-align: bottom;
}

.p-half {
  display: flex;
  gap: 15px;
}
.p-half > div {
  flex: 1;
}

.p-codes {
  position: absolute;
  top: 8mm;
  right: 10mm;
  font-size: 7.5pt;
  border-collapse: collapse;
  width: auto !important;
}
.p-codes td {
  border: 1px solid #000;
  padding: 2px 6px;
  text-align: center;
  min-width: 55px;
}

.p-section-title {
  font-weight: 700;
  font-size: 8.5pt;
  margin-top: 6px;
  margin-bottom: 4px;
  text-decoration: underline;
}

.p-sign-area {
  display: inline-block;
  border-bottom: 1px solid #000;
  min-width: 80px;
  min-height: 14px;
}

.p-label-sm {
  font-size: 6.5pt;
  color: #555;
  text-align: center;
  margin-top: -1px;
  margin-bottom: 3px;
}

/* Print section tables */
#print-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
}
#print-section table th,
#print-section table td {
  border: 1px solid #000;
  padding: 2px 4px;
  text-align: left;
  vertical-align: middle;
}
#print-section table th {
  text-align: center;
  font-weight: 700;
  font-size: 7pt;
  background: #69f0ae;
}

/* Fuel/codes tables in front page — smaller, no full width */
.p-half table {
  width: auto;
}
.p-half table td {
  padding: 1px 5px;
  font-size: 7.5pt;
}

#print-section hr {
  border: none;
  border-top: 1px solid #000;
}

/* Print button editing indicator */
.btn-editing {
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

/* Badge for editing state */
.badge-edit {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  margin-left: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

@media print {
  /* Hide entire app UI */
  body {
    background: white !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body > *:not(#print-section) {
    display: none !important;
  }
  /* Show print section */
  #print-section {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .p-page {
    margin: 0 !important;
    padding: 5mm 8mm !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: always;
    width: auto !important;
    min-height: auto !important;
  }
  @page {
    size: A4;
    margin: 5mm;
  }
}

/* Undo Toast System */
.undo-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(11, 13, 14, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(248, 250, 252, 0.1);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(244, 63, 94, 0.15);
    z-index: 11000;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 320px;
    max-width: 450px;
    overflow: hidden;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.undo-toast.hiding {
    animation: slideOutDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.undo-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.undo-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
}

.undo-desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

.btn-undo {
    background: linear-gradient(135deg, var(--primary) 0%, #00c853 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
    transition: all 0.2s ease;
}

.btn-undo:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 230, 118, 0.4);
}

.undo-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, var(--error) 0%, #fda4af 100%);
    width: 100%;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(2rem) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(2rem) scale(0.95);
    }
}

/* Collapsible Month Grouping */
.month-group {
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: rgba(248, 250, 252, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    backdrop-filter: blur(10px);
}

.month-header:hover {
    background: rgba(248, 250, 252, 0.06);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(148, 163, 184, 0.08);
}

.month-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.month-badge {
    margin-left: auto;
    margin-right: 1.25rem;
    background: rgba(148, 163, 184, 0.12);
    color: var(--primary);
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.month-header .chevron-icon {
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.month-group.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.month-content {
    max-height: 2500px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px dashed rgba(248, 250, 252, 0.05);
}

.month-group.collapsed .month-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    padding-left: 0;
    border-left-color: transparent;
}

.month-info-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.month-info-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.month-info-metrics svg {
    width: 12px;
    height: 12px;
    color: var(--accent);
}

/* Premium Animated Backdrop Glow & Grid Pattern */
.backdrop-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-color);
}

.backdrop-glow::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Emerald-tinted grid pattern combining dot and line grid */
    background-image: 
        linear-gradient(rgba(0, 230, 118, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 230, 118, 0.012) 1px, transparent 1px);
    background-size: 45px 45px;
    opacity: 0.85;
}

.backdrop-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 10%, var(--bg-color) 85%);
    opacity: 0.95;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.28;
    mix-blend-mode: screen;
    will-change: transform;
}

.orb-1 {
    top: -10%;
    left: -5%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.45) 0%, rgba(6, 95, 70, 0.15) 50%, transparent 75%);
    animation: float-orb-1 25s infinite alternate ease-in-out;
}

.orb-2 {
    bottom: -15%;
    right: -5%;
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle, rgba(248, 250, 252, 0.35) 0%, rgba(2, 44, 34, 0.12) 55%, transparent 75%);
    animation: float-orb-2 32s infinite alternate ease-in-out;
}

.orb-3 {
    top: 30%;
    left: 60%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(6, 95, 70, 0.55) 0%, rgba(0, 230, 118, 0.08) 45%, transparent 70%);
    animation: float-orb-3 22s infinite alternate ease-in-out;
}

@keyframes float-orb-1 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { transform: translate(12%, 8%) scale(1.2) rotate(45deg); }
}

@keyframes float-orb-2 {
    0% { transform: translate(0, 0) scale(1.15) rotate(0deg); }
    100% { transform: translate(-10%, -12%) scale(0.9) rotate(-60deg); }
}

@keyframes float-orb-3 {
    0% { transform: translate(0, 0) scale(0.85) rotate(0deg); }
    100% { transform: translate(-15%, 10%) scale(1.2) rotate(30deg); }
}

/* ==========================================
   PREMIUM GLASSMORPHIC DESIGN SYSTEM POLISH
   ========================================== */

/* Custom SELECT indicator Arrow & styling override */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2336E387' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1.25rem center !important;
  background-size: 1.1rem !important;
  padding-right: 2.75rem !important;
}

/* Small premium button classes */
.btn-sm {
  padding: 0.45rem 1.1rem !important;
  font-size: 0.78rem !important;
  border-radius: 9999px !important;
  gap: 0.4rem !important;
}

/* Enhancing settings items list items on hover */
.settings-item {
  transition: var(--transition-premium) !important;
}
.settings-item:hover {
  transform: translateX(6px) !important;
  border-color: rgba(0, 230, 118, 0.45) !important;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.06) 0%, rgba(0, 230, 118, 0.02) 100%) !important;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(248, 250, 252, 0.04) !important;
}

/* Enhancing Trip list items transitions and hover animations */
.trip-item {
  transition: var(--transition-premium) !important;
}
.trip-item:hover {
  background: rgba(18, 20, 22, 0.75) !important;
  border-color: rgba(0, 230, 118, 0.4) !important;
  transform: translateY(-4px) scale(1.015) !important;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.55), 
    0 0 20px rgba(0, 230, 118, 0.12),
    inset 0 1px 0 rgba(248, 250, 252, 0.04) !important;
}

/* Blue glowing highlight for edited waybill cards */
.waybill-card.editing {
  border-color: rgba(59, 130, 246, 0.55) !important;
  background: rgba(59, 130, 246, 0.08) !important;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.55), 
    0 0 25px rgba(59, 130, 246, 0.22),
    inset 0 1px 0 rgba(248, 250, 252, 0.04) !important;
}

/* Enhanced scrollbar track rounded bounds */
::-webkit-scrollbar-thumb {
  transition: background-color 0.3s ease !important;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 230, 118, 0.4) !important;
}

/* --- Item Cards (Vehicles & Drivers) --- */
.item-card {
  padding: 1.25rem 1.5rem !important;
  border-radius: 16px !important;
  background: var(--card-bg) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  margin-bottom: 0.75rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  transition: var(--transition-premium) !important;
}
.item-card:last-child {
  margin-bottom: 0 !important;
}
.item-card:hover {
  background: rgba(18, 20, 22, 0.75) !important;
  border-color: var(--glass-border-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.55), 
    0 0 20px rgba(0, 230, 118, 0.12),
    inset 0 1px 0 rgba(248, 250, 252, 0.04) !important;
}
.item-card-title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
  letter-spacing: -0.01em !important;
}
.item-card-subtitle {
  font-size: 0.875rem !important;
  color: var(--text-dim) !important;
}
.item-card-subtitle span {
  color: var(--text-main) !important;
  font-weight: 500 !important;
}
.item-card-meta {
  font-size: 0.875rem !important;
  color: var(--text-dim) !important;
  margin-bottom: 0.25rem !important;
}
.item-card-actions {
  display: flex !important;
  gap: 0.75rem !important;
  margin-top: 0.5rem !important;
}

/* Animations for login overlay */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.login-landing-side {
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-form-side .login-card {
    animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0; /* Starts hidden before animation kicks in */
}

/* Login responsiveness */
@media (max-width: 900px) {
    .login-landing-side {
        display: none !important;
    }
    
    .login-layout-container {
        justify-content: center !important;
        align-items: center !important;
        padding: 1rem !important;
    }
    
    .login-form-wrapper {
        flex: 1 1 100% !important;
        max-width: 480px !important;
        margin: 1rem 0 !important;
        padding: 2rem 1.5rem !important;
        box-sizing: border-box;
    }
    
    .mobile-logo-container {
        display: flex !important;
    }
}
