/* ── ServiceApp Custom CSS ──────────────────────────────── */
:root {
  --sa-sidebar-width: 260px;
  --sa-navbar-height: 56px;
  --sa-primary: #1e3a5f;
  --sa-sidebar-bg: #0f1f35;
  --sa-sidebar-text: rgba(255,255,255,.75);
  --sa-sidebar-active: #fff;
  --sa-sidebar-active-bg: rgba(255,255,255,.12);
}

/* ── AUTH LAYOUT ──────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 60%, #4a90d9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  border-radius: 1rem !important;
  overflow: hidden;
}

/* ── SIDEBAR LAYOUT ───────────────────────────────────── */
.sidebar-layout {
  background-color: #f4f6f9;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--sa-navbar-height);
  left: 0;
  bottom: 0;
  width: var(--sa-sidebar-width);
  background: var(--sa-sidebar-bg);
  overflow-y: auto;
  z-index: 1000;
  transition: transform .25s ease;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 0;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1.25rem;
  color: var(--sa-sidebar-text);
  text-decoration: none;
  font-size: .88rem;
  border-radius: 0;
  transition: background .15s, color .15s;
}

.sidebar-link:hover {
  background: var(--sa-sidebar-active-bg);
  color: var(--sa-sidebar-active);
}

.sidebar-link.active {
  background: var(--sa-sidebar-active-bg);
  color: var(--sa-sidebar-active);
  font-weight: 600;
  border-left: 3px solid #4a90d9;
}

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 1rem 1.25rem .25rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Main content */
.main-content {
  margin-left: var(--sa-sidebar-width);
  margin-top: var(--sa-navbar-height);
  min-height: calc(100vh - var(--sa-navbar-height));
  transition: margin .25s ease;
}

/* ── COMPONENTS ───────────────────────────────────────── */
/* Stat cards */
.stat-card {
  border-radius: .75rem !important;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  font-size: .78rem;
  color: #6c757d;
}

/* Vehicle cards */
.vehicle-card {
  border-radius: .75rem !important;
  transition: transform .15s, box-shadow .15s;
}
.vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important;
}

/* Attachment cards */
.attachment-card {
  transition: box-shadow .15s;
}
.attachment-card:hover {
  box-shadow: 0 .25rem .75rem rgba(0,0,0,.1);
}

/* ── TABLES ───────────────────────────────────────────── */
.table > :not(caption) > * > * {
  padding: .65rem .75rem;
}
.table th {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── CARDS ────────────────────────────────────────────── */
.card {
  border-radius: .75rem !important;
}
.card-header {
  border-radius: .75rem .75rem 0 0 !important;
  font-size: .9rem;
}

/* ── NAVBAR ───────────────────────────────────────────── */
.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: .02em;
}

/* ── MOBILE ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0,0,0,.4);
  }
  .main-content {
    margin-left: 0;
  }
  /* Overlay */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
  }
}

/* ── UTILITIES ────────────────────────────────────────── */
.z-3 { z-index: 3; }
code.small { font-size: .8em; }

/* ── PWA install button ───────────────────────────────── */
#pwaInstallBtn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}
