/* public/css/main.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --primary:    #0ea5e9;
  --primary-dk: #0369a1;
  --accent:     #f59e0b;
  --accent-lt:  #fde68a;
  --success:    #10b981;
  --danger:     #ef4444;
  --dark:       #0f172a;
  --dark2:      #1e293b;
  --dark3:      #334155;
  --muted:      #64748b;
  --light:      #f1f5f9;
  --white:      #ffffff;
  --border:     #e2e8f0;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
  --font:       'Outfit', sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --duration-fast: .15s;
  --duration: .25s;
  --duration-slow: .5s;
  --easing: cubic-bezier(.2,.8,.2,1);
}

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

body {
  font-family: var(--font);
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
}

*:focus-visible {
  outline: 3px solid rgba(14,165,233,.5);
  outline-offset: 2px;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  background: var(--dark2);
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--duration) var(--easing);
}
.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--dark3);
}
.sidebar-brand h1 {
  font-size: 1.4rem; font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
}
.sidebar-brand span { color: var(--accent); }
.sidebar-brand p { font-size: .75rem; color: var(--muted); margin-top: 2px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-nav .nav-group { margin-bottom: 20px; }
.sidebar-nav .nav-label {
  font-size: .68rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
  padding: 0 10px; margin-bottom: 6px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #94a3b8; text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--dark3); color: var(--white);
}
.sidebar-nav a.active { color: var(--primary); }
.sidebar-nav a i { width: 18px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--dark3);
}
.sidebar-footer .user-info {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.sidebar-footer .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-weight: 700; color: #fff; font-size: .85rem;
}
.sidebar-footer .user-name { font-size: .85rem; font-weight: 600; color: var(--white); }
.sidebar-footer .user-role { font-size: .73rem; color: var(--muted); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  background: var(--white);
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 1.25rem; font-weight: 700; color: var(--dark); }
.topbar .breadcrumb { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h2, .topbar .breadcrumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.page-body { padding: 28px 32px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 24px; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.blue   { background: #e0f2fe; color: var(--primary); }
.stat-icon.amber  { background: #fef3c7; color: var(--accent); }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { background: var(--light); }
th { padding: 11px 16px; text-align: left; font-weight: 600; color: var(--muted);
     font-size: .78rem; text-transform: uppercase; letter-spacing: .6px;
     border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .73rem; font-weight: 600;
}
.badge-blue   { background:#e0f2fe; color:#0369a1; }
.badge-green  { background:#d1fae5; color:#065f46; }
.badge-amber  { background:#fef3c7; color:#92400e; }
.badge-red    { background:#fee2e2; color:#991b1b; }
.badge-gray   { background:#f1f5f9; color:#475569; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: .88rem;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  transition: all .2s; white-space: nowrap; font-family: var(--font);
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.9); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }
.btn-amber     { background: var(--accent); color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--dark); }
.btn-outline:hover { background: var(--light); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon { padding: 7px; border-radius: 8px; background: var(--light); color: var(--muted); border: none; cursor: pointer; transition: all .2s; }
.btn-icon:hover { background: var(--border); color: var(--dark); }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: .9rem; font-family: var(--font);
  color: var(--dark); background: var(--white); transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── ALERTS ── */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .88rem; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info     { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }

/* ── PROGRESS BAR ── */
.progress { background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .6s ease;
}

/* ── LOYALTY CARD ── */
.loyalty-card {
  background: linear-gradient(135deg, var(--dark2) 0%, var(--dark) 100%);
  border-radius: 16px; padding: 28px; color: #fff;
  position: relative; overflow: hidden;
}
.loyalty-card::before {
  content: '🚗'; position: absolute; right: -10px; top: -10px;
  font-size: 8rem; opacity: .06;
}
.loyalty-bubbles {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px;
}
.loyalty-bubble {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.3);
  transition: all .3s;
}
.loyalty-bubble.done {
  background: var(--primary); border-color: var(--primary);
  color: #fff; box-shadow: 0 4px 12px rgba(14,165,233,.5);
}
.loyalty-bubble.gift {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-size: 1.3rem;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--dark);
}
.login-left {
  flex: 1; background: linear-gradient(135deg, var(--primary-dk), var(--dark));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 40px; color: #fff;
}
.login-left h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); font-weight: 800; margin-bottom: 12px; line-height: 1.05; }
.login-left h1 span { color: var(--accent); }
.login-left p { font-size: clamp(1rem, 1.2vw + .6rem, 1.1rem); opacity: .8; max-width: 360px; text-align: center; line-height: 1.6; }
.hero-icon { font-size: clamp(3rem, 6vw, 5rem); margin-bottom: 20px; }
.login-info { margin-top: 32px; text-align: center; opacity: .5; font-size: .9rem; }
.login-right {
  width: min(520px, 100%); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 50px 40px;
}
.login-box { width: 100%; max-width: 420px; animation: fadeUp var(--duration-slow) var(--easing) both; }
.login-box h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.login-box p { color: var(--muted); margin-bottom: 32px; font-size: .9rem; }
.login-cta-divider { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.demo-box { margin-top: 20px; background: #f8fafc; border-radius: 8px; padding: 12px; font-size: .78rem; color: var(--muted); }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.perk-list { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; }
.perk-item { background: rgba(255,255,255,.08); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }

/* ── VEHICLE ICON ── */
.vehicle-icon { font-size: 1.3rem; }

/* ── MISC ── */
.text-muted  { color: var(--muted); font-size: .85rem; }
.text-green  { color: var(--success); font-weight: 600; }
.text-amber  { color: var(--accent); font-weight: 600; }
.text-red    { color: var(--danger); font-weight: 600; }
.fw-bold     { font-weight: 700; }
.mono        { font-family: var(--mono); }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.flex        { display: flex; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-between{ flex-wrap: wrap; gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3      { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }

.btn { transition: transform var(--duration-fast) var(--easing), box-shadow var(--duration-fast) var(--easing); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(14,165,233,.2); }
.form-control:hover { border-color: #cbd5e1; }

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

@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .form-grid, .form-grid-3, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .topbar-left { gap: 8px; }
  .topbar h2 { font-size: 1.1rem; }
  .topbar .breadcrumb { max-width: 50vw; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .login-page { flex-direction: column; }
  .login-left {
    display: flex;
    align-items: center; justify-content: center; text-align: center;
    padding: 24px 16px; min-height: auto;
  }
  .login-right { width: 100%; padding: 24px 16px; }
  .perk-list { margin-top: 16px; max-width: 520px; }
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    opacity: 0; pointer-events: none; transition: opacity var(--duration) var(--easing);
    z-index: 90;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .flex-between > form { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; }
  .flex-between > form .form-control[name="q"] { width: 100% !important; }
  .flex-between > a.btn { margin-left: auto; }
}

@media (max-width: 480px) {
  .topbar .breadcrumb { display: none; }
  .topbar-actions { justify-content: space-between; }
  .btn.btn-sm { padding: 8px 12px; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .login-box { animation: none; }
  .btn { transition: none; }
}

@media (min-width: 1600px) {
  .login-right { width: 640px; }
  .login-left h1 { font-size: clamp(2.6rem, 2.2vw + 1rem, 4rem); }
  .hero-icon { font-size: clamp(4rem, 4vw + .5rem, 6rem); }
}

.water-container { position: relative; overflow: hidden; border-radius: var(--radius); }
.water-container img { display: block; width: 100%; height: auto; object-fit: contain; }
.water-drops { position: absolute; inset: 0; pointer-events: none; }
.water-drop {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5), rgba(255,255,255,.15) 40%, rgba(255,255,255,0) 70%);
  filter: blur(.2px); opacity: .6;
  animation-name: dropFall; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes dropFall {
  0% { transform: translateY(-20%); opacity: 0; }
  10% { opacity: .6; }
  100% { transform: translateY(120%); opacity: 0; }
}
.water-depth {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 20%, rgba(0,0,0,.12), rgba(0,0,0,.22) 60%, rgba(0,0,0,0) 70%);
  mix-blend-mode: multiply; opacity: .35; transition: opacity .4s ease;
}
.water-reflect {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient( to right, rgba(255,255,255,.07) 0 2px, rgba(255,255,255,0) 2px 8px );
  transform: translateX(0); opacity: .25; filter: blur(1px);
  animation: reflectMove 2500ms linear infinite;
}
@keyframes reflectMove {
  0% { transform: translateX(-20%); opacity: .18; }
  50% { opacity: .28; }
  100% { transform: translateX(20%); opacity: .18; }
}
.water-ripple {
  position: absolute; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset;
  transform: translate(-50%,-50%) scale(0.3);
  opacity: .8; pointer-events: none;
  animation: rippleExpand 2200ms ease-out forwards;
}
@keyframes rippleExpand {
  0% { transform: translate(-50%,-50%) scale(0.3); opacity: .8; }
  70% { opacity: .35; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .water-drop { animation: none; }
  .water-reflect { animation: none; }
  .water-ripple { animation-duration: 800ms; }
}

.water-screen {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.water-screen .water-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center center; background-repeat: no-repeat;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
}

.aqua-bg {
  background: linear-gradient(270deg, #0d47a1, #1976d2, #42a5f5);
  background-size: 600% 600%;
  animation: aquaBgMove 10s ease infinite;
  position: relative;
  overflow: hidden;
}
@keyframes aquaBgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.aqua-drop {
  position: absolute;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  pointer-events: none;
  animation: aquaFall linear forwards;
}
@keyframes aquaFall {
  0% { transform: translateY(-50px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(400px); opacity: 0; }
}
.aqua-ripple {
  position: absolute;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  animation: aquaRipple 1000ms linear;
}
@keyframes aquaRipple {
  from { transform: scale(0); opacity: 0.7; }
  to   { transform: scale(3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aqua-bg { animation: none; }
}

.aqua-btn {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(270deg, rgba(13,71,161,.12), rgba(25,118,210,.12), rgba(66,165,245,.12));
  background-size: 600% 600%;
  animation: aquaBgMove 10s ease infinite;
}
.aqua-btn::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient( to right, rgba(255,255,255,.12) 0 2px, rgba(255,255,255,0) 2px 8px );
  opacity: .15; pointer-events: none;
  animation: reflectMove 2500ms linear infinite;
}

.brand-center {
  width: 100%;
  min-height: clamp(180px, 32vh, 360px);
  display: grid;
  place-items: center;
  text-align: center;
}
@supports not (place-items: center) {
  .brand-center { display: flex; align-items: center; justify-content: center; }
}
