/* =========================================
   CHECAR®MX — Custom Styles
   Version: 1.0 | 2026
   ========================================= */

:root {
  --checar-yellow:      #ffca05;
  --checar-yellow-dark: #e6b400;
  --checar-yellow-light:#fff8d6;
  --checar-black:       #1a1a1a;
  --checar-bg:          #f5f5f5;
  --checar-red:         #dc3545;
  --checar-green:       #28a745;
  --checar-sidebar-w:   260px;
  --checar-topbar-h:    64px;
  --checar-bottomnav-h: 70px;
}

/* ── GLOBAL ─────────────────────────────── */
* { box-sizing: border-box; }

body {
  background-color: var(--checar-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.cursor-pointer { cursor: pointer; }

/* ── UTILITY ─────────────────────────────── */
.text-checar { color: var(--checar-yellow) !important; }
.bg-checar   { background-color: var(--checar-yellow) !important; }
.bg-checar-dark { background-color: var(--checar-black) !important; }
.border-checar  { border-color: var(--checar-yellow) !important; }

/* ── CARDS ──────────────────────────────── */
.card {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.card-no-hover:hover {
  transform: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.07) !important;
}
.card-service {
  border-left: 4px solid var(--checar-yellow) !important;
}
.card-alert-red {
  border-left: 4px solid var(--checar-red) !important;
  background: #fff5f5;
}
.card-alert-yellow {
  border-left: 4px solid var(--checar-yellow) !important;
  background: var(--checar-yellow-light);
}

/* ── BUTTONS ────────────────────────────── */
.btn-checar {
  background-color: var(--checar-yellow);
  color: var(--checar-black);
  border: none;
  font-weight: 600;
  border-radius: 10px;
  transition: background .2s, transform .1s;
}
.btn-checar:hover {
  background-color: var(--checar-yellow-dark);
  color: var(--checar-black);
  transform: scale(1.02);
}
.btn-checar-outline {
  border: 2px solid var(--checar-yellow);
  color: var(--checar-black);
  background: transparent;
  font-weight: 600;
  border-radius: 10px;
  transition: all .2s;
}
.btn-checar-outline:hover {
  background-color: var(--checar-yellow);
  color: var(--checar-black);
}

/* ── STATUS BADGES ───────────────────────── */
.badge-status-ok {
  background-color: #d4edda;
  color: #155724;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .73rem;
  font-weight: 700;
  display: inline-block;
}
.badge-status-proximo {
  background-color: #fff3cd;
  color: #856404;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .73rem;
  font-weight: 700;
  display: inline-block;
}
.badge-status-urgente {
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .73rem;
  font-weight: 700;
  display: inline-block;
}
.badge-default-vehicle {
  background-color: var(--checar-yellow);
  color: var(--checar-black);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .68rem;
  font-weight: 700;
  display: inline-block;
}

/* ── STAT CARDS ─────────────────────────── */
.stat-card {
  border-radius: 16px;
  padding: 20px;
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .2s ease, box-shadow .2s ease;
  background: #fff;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
}
.stat-card .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--checar-black);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .8rem;
  color: #6c757d;
  margin-top: 4px;
}

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--checar-sidebar-w);
  height: 100vh;
  background: var(--checar-black);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .3s ease;
}
.sidebar-brand {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-brand .brand-logo {
  width: 38px; height: 38px;
  background-color: var(--checar-yellow);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--checar-black);
  flex-shrink: 0;
}
.sidebar-brand .brand-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: 10px;
}
.sidebar-brand .brand-name span { color: var(--checar-yellow); }

.sidebar-nav { padding: 12px 0; flex: 1; }

.sidebar-section-title {
  padding: 10px 22px 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  margin-top: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 22px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  position: relative;
}
.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,202,5,.1); color: var(--checar-yellow); }
.sidebar-link.active {
  background: rgba(255,202,5,.15);
  color: var(--checar-yellow);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--checar-yellow);
  border-radius: 0 3px 3px 0;
}
.sidebar-link .badge { margin-left: auto; font-size: .62rem; }

/* ── MAIN LAYOUT ─────────────────────────── */
.main-wrapper {
  margin-left: var(--checar-sidebar-w);
  min-height: 100vh;
  background: var(--checar-bg);
}

/* ── TOPBAR ──────────────────────────────── */
.topbar {
  position: sticky;
  top: 0; z-index: 1030;
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 0 24px;
  height: var(--checar-topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.topbar .topbar-search .input-group input {
  border-radius: 24px;
  border: 1px solid #e9ecef;
  padding: 8px 20px;
  font-size: .875rem;
  background: var(--checar-bg);
  width: 300px;
}
.topbar .topbar-search .input-group input:focus {
  box-shadow: 0 0 0 3px rgba(255,202,5,.25);
  border-color: var(--checar-yellow);
  outline: none;
}
.topbar .topbar-search .input-group-text {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  border: none; background: none;
  z-index: 10;
  color: #adb5bd;
  font-size: .9rem;
}
.topbar .notif-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--checar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #495057;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .2s;
}
.topbar .notif-btn:hover { background: #e9ecef; }
.topbar .notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  background: var(--checar-red);
  border-radius: 50%;
  border: 2px solid #fff;
}
.topbar .user-avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--checar-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .88rem;
  color: var(--checar-black);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── CONTENT AREA ────────────────────────── */
.content-area { padding: 28px; }

/* ── BOTTOM NAV (USER APP) ───────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--checar-bottomnav-h);
  background: var(--checar-black);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1050;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(255,255,255,.5);
  padding: 8px 16px;
  border-radius: 14px;
  transition: all .2s;
  min-width: 60px;
}
.bottom-nav-item i { font-size: 1.45rem; line-height: 1; }
.bottom-nav-item span { font-size: .65rem; font-weight: 600; letter-spacing: .02em; }
.bottom-nav-item.active { color: var(--checar-yellow); background: rgba(255,202,5,.12); }
.bottom-nav-item:hover { color: var(--checar-yellow); }

/* ── USER APP HEADER ─────────────────────── */
.app-header {
  background: var(--checar-black);
  padding: 16px 18px 18px;
  color: white;
  position: sticky;
  top: 0; z-index: 100;
}
.app-header .greeting { font-size: .78rem; opacity: .7; margin-bottom: 1px; }
.app-header .greeting-name { font-size: 1.15rem; font-weight: 700; }
.app-header .notif-btn-app {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
}
.header-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--checar-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: var(--checar-black);
  flex-shrink: 0;
}

/* ── APP CONTENT ─────────────────────────── */
.app-content {
  padding: 18px 15px;
  padding-bottom: calc(var(--checar-bottomnav-h) + 18px);
}
.app-content .card { border-radius: 14px !important; }

/* ── NOTIFICATION CARDS ──────────────────── */
.notif-card-last {
  background: linear-gradient(135deg, #1a1a1a 0%, #2e2e2e 100%);
  color: white;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 10px;
}
.notif-card-next {
  background: linear-gradient(135deg, var(--checar-yellow) 0%, #e6b400 100%);
  color: var(--checar-black);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 10px;
}

/* ── KM DISPLAY ──────────────────────────── */
.km-badge {
  background: var(--checar-yellow);
  color: var(--checar-black);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 10px 16px;
  border-radius: 12px;
  display: inline-block;
}
.km-progress { height: 8px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.km-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--checar-yellow) 0%, #e6b400 100%);
  transition: width .6s ease;
}

/* ── SECTION TITLES ──────────────────────── */
.section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--checar-black);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e9ecef;
  margin-left: 4px;
}

/* ── ALERT STRIP ─────────────────────────── */
.alert-strip {
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.alert-strip:last-child { margin-bottom: 0; }
.alert-strip-red    { background: #fef2f2; border-left: 3px solid var(--checar-red); }
.alert-strip-yellow { background: #fffbeb; border-left: 3px solid var(--checar-yellow); }
.alert-strip-green  { background: #f0fdf4; border-left: 3px solid var(--checar-green); }
.alert-strip .alert-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── MODERN TABLE ────────────────────────── */
.table-modern { border-collapse: separate; border-spacing: 0 6px; }
.table-modern thead th {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 6px 14px;
}
.table-modern tbody tr {
  background: white;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  transition: transform .2s, box-shadow .2s;
}
.table-modern tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.09);
}
.table-modern tbody td {
  padding: 14px 14px;
  vertical-align: middle;
  border: none;
}
.table-modern tbody td:first-child { border-radius: 12px 0 0 12px; }
.table-modern tbody td:last-child  { border-radius: 0 12px 12px 0; }

/* ── VEHICLE ICON CIRCLE ─────────────────── */
.vehicle-icon-circle {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--checar-yellow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── SIDEBAR OVERLAY (mobile) ────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ── ANIMATIONS ──────────────────────────── */
.fade-up { animation: fadeUp .45s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }
.delay-5 { animation-delay: .40s; }

/* ── DROPDOWN CUSTOM ─────────────────────── */
.dropdown-menu { border: none !important; box-shadow: 0 8px 24px rgba(0,0,0,.12) !important; }
.dropdown-item { transition: background .15s; border-radius: 6px; }

/* ── SCROLLBAR ──────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .content-area { padding: 18px 16px; }
  .topbar .topbar-search { display: none; }
  .topbar { padding: 0 16px; }
}

/* ── DESKTOP USER APP OVERRIDES (992px+) ─── */
@media (min-width: 992px) {
  /* App content: remove bottom-nav spacing, add proper desktop padding */
  .app-content {
    padding: 28px !important;
    padding-bottom: 28px !important;
  }
  /* Notification cards side by side */
  .notif-row-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .notif-row-desktop .notif-card-last,
  .notif-row-desktop .notif-card-next {
    margin-bottom: 0 !important;
  }
  /* Service cards 2-col grid */
  .services-grid-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .services-grid-desktop .card {
    margin-bottom: 0 !important;
  }
}
