/* ============================================================
   MyDealerMind — dealer app theme
   Shared by login.php and the dashboard shell. Matches the
   DealerMind neon-on-dark identity dealers already know.
   ============================================================ */

:root {
  --primary:      #0a0a0a;
  --secondary:    #141414;
  --tertiary:     #1a1a1a;
  --accent:       #9eff00;
  --accent-hover: #32e612;
  --cyan:         #00c8ff;
  --orange:       #ff6b35;
  --text:         #ffffff;
  --text-muted:   #888888;
  --border:       #2a2a2a;
  --radius:       14px;
}

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

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--primary);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Animated grid + glow backdrop (shared) */
.mdm-bg::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(158,255,0,.03) 1px, transparent 1px),
    linear-gradient(rgba(158,255,0,.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: mdmGrid 20s linear infinite;
}
.mdm-bg::after {
  content: '';
  position: fixed; top: -50%; left: -50%; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background: radial-gradient(circle at center, rgba(158,255,0,.06) 0%, transparent 50%);
}
@keyframes mdmGrid { 0% { transform: translate(0,0);} 100% { transform: translate(50px,50px);} }

/* ── Brand wordmark ── */
.dm-logo {
  width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #000; font-weight: bold;
  box-shadow: 0 0 24px rgba(158,255,0,.3);
}
.dm-title {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 3px; color: var(--text);
  text-shadow: 0 0 24px rgba(158,255,0,.25);
}
.dm-title span { color: var(--accent); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-container { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 20px; }
.login-header { display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.login-header .dm-logo { width: 56px; height: 56px; font-size: 24px; }
.login-header .dm-title { font-size: 42px; }
/* Actual DealerMind logo (speech-bubble DM + wordmark + tagline). */
.login-logo {
  display: block; width: 100%; max-width: 400px; height: auto; margin: 0 auto;
  filter: drop-shadow(0 0 24px rgba(158,255,0,.18));
}
.login-sub {
  text-align: center; color: var(--text-muted); font-family: 'Rajdhani', sans-serif;
  font-weight: 600; font-size: 14px; letter-spacing: 4px; margin-bottom: 30px;
  text-transform: uppercase;
}
.login-card {
  background: rgba(20,20,20,.9); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 16px; padding: 40px;
  box-shadow: 0 25px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
}
.login-card h2 {
  font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 600;
  text-align: center; margin-bottom: 28px;
}
.form-group { margin-bottom: 22px; }
.form-group label {
  display: block; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
}
.form-input {
  width: 100%; padding: 14px 16px; background: var(--primary);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 16px; transition: all .3s ease;
}
.form-input::placeholder { color: #555; }
.form-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(158,255,0,.1), 0 0 20px rgba(158,255,0,.1);
}
.btn-login {
  width: 100%; padding: 16px; border: none; border-radius: 10px; color: #000;
  background: linear-gradient(135deg, var(--accent) 0%, #32e612 100%);
  font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; cursor: pointer;
  transition: all .3s ease; box-shadow: 0 4px 20px rgba(158,255,0,.3);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(158,255,0,.4); }
.btn-login:active { transform: translateY(0); }
.alert {
  border-radius: 10px; padding: 14px 16px; margin-bottom: 22px; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.alert-ok  { background: rgba(158,255,0,.08); border: 1px solid rgba(158,255,0,.3); color: #86efac; }
.login-footer { text-align: center; margin-top: 28px; color: #444; font-size: 13px; }
.login-forgot { display: block; text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 14px; text-decoration: none; transition: color .15s ease; }
.login-forgot:hover { color: var(--accent); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(10,10,10,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.burger {
  width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto;
  background: var(--secondary); border: 1px solid var(--border); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.burger span { width: 18px; height: 2px; background: var(--accent); border-radius: 2px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand .dm-title { font-size: 26px; }
.topbar-dealer {
  margin-left: auto; text-align: right; line-height: 1.2; overflow: hidden;
}
.topbar-dealer .name {
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 15px;
  color: var(--text); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 46vw;
}
.topbar-dealer .user { font-size: 12px; color: var(--text-muted); }

/* Slide-out nav */
.nav-overlay {
  position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,.6);
  opacity: 0; visibility: hidden; transition: opacity .25s ease;
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-menu {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: 280px; max-width: 84vw;
  background: var(--secondary); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
}
.nav-menu.open { transform: translateX(0); }
.nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.nav-head h3 { font-family: 'Rajdhani', sans-serif; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; font-size: 14px; }
.nav-close { background: none; border: none; color: var(--text-muted); font-size: 28px; line-height: 1; cursor: pointer; }
.nav-content { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px;
  color: var(--text-muted); text-decoration: none; font-family: 'Rajdhani', sans-serif;
  font-weight: 600; font-size: 16px; transition: all .15s ease; border-left: 3px solid transparent;
}
.nav-item svg { width: 22px; height: 22px; flex: 0 0 auto; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(158,255,0,.05); }
.nav-item.soon { opacity: .45; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--text-muted); }
.nav-badge {
  margin-left: auto; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: rgba(0,200,255,.12);
  color: var(--cyan); border: 1px solid rgba(0,200,255,.3);
}
.nav-badge.live { background: rgba(158,255,0,.12); color: var(--accent); border-color: rgba(158,255,0,.3); }
.nav-divider { height: 1px; background: var(--border); margin: 12px 20px; }
.nav-foot { border-top: 1px solid var(--border); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.nav-logout { color: var(--orange); }

/* Main content */
.app-main { position: relative; z-index: 1; padding: 24px 20px 60px; max-width: 1100px; margin: 0 auto; }
.welcome h1 { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 28px; }
.welcome p { color: var(--text-muted); margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 26px; }
.tile {
  background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden;
}
.tile::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan)); opacity: .8; }
.tile .k { font-family: 'Rajdhani', sans-serif; text-transform: uppercase; letter-spacing: 1px;
  font-size: 12px; color: var(--text-muted); }
.tile .v { font-family: 'Orbitron', monospace; font-size: 34px; color: var(--text); margin-top: 8px; }
.tile .v.muted { color: var(--text-muted); font-size: 26px; }
.panel {
  background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 24px;
}
.panel h2 { font-family: 'Rajdhani', sans-serif; font-size: 20px; margin-bottom: 6px; }
.panel p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.status-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status-row .label { font-family: 'Rajdhani', sans-serif; font-weight: 600; }

@media (max-width: 640px) {
  .topbar-brand .dm-title { font-size: 22px; }
  .tile .v { font-size: 28px; }
}
