/* ── Layout ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  min-width: 220px;
  background: #1a1d23;
  color: #c9cdd4;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #2d3139;
  letter-spacing: 0.01em;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #9aa0aa;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.sidebar-link:hover {
  color: #fff;
  background: #23272f;
  text-decoration: none;
}

.sidebar-link.active {
  color: #fff;
  background: #23272f;
  border-left-color: #0d6efd;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid #2d3139;
  padding: 12px 0;
  margin-top: auto;
}

/* Sign out is a form button, not a link, so it needs the button chrome
   stripped back to match the surrounding nav items. */
.sidebar-signout {
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-user {
  padding: 4px 20px 0;
  color: #6c727d;
  font-size: 0.75rem;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-brand i {
  font-size: 2.2rem;
  color: #ffc107;
}

/* Keyboard users need to see where they are. */
.sidebar-link:focus-visible,
.btn:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.main-wrapper {
  background: #f5f7fa;
  min-width: 0;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid #e5e9ef;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1d23;
}

.content-area {
  padding: 28px;
}

/* ── Mobile top bar + drawer (below 992px) ── */
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 991.98px) {
  /* Sidebar becomes an off-screen drawer that slides in. */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 264px;
    min-width: 264px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1050;
  }
  body.nav-open .sidebar { transform: translateX(0); }

  body.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1d23;
    color: #fff;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 1030;
  }
  .nav-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
  }
  .mobile-brand {
    font-weight: 700;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* The page header no longer needs to be sticky under the top bar. */
  .page-header { position: static; padding: 14px 16px; }
  .content-area { padding: 16px; }
}

/* ── Stat cards ── */
.stat-card {
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1d23;
  line-height: 1;
  margin-bottom: 4px;
}

/* ── Tables ── */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  white-space: nowrap;
}

/* ── Cards ── */
.card {
  border-radius: 10px;
}

.card-header {
  padding: 14px 20px;
  font-size: 0.9rem;
}

/* ── Badges ── */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

/* ── Forms ── */
.form-label {
  font-size: 0.875rem;
  color: #374151;
}

/* ── Print invoice ── */
@media print {
  .sidebar, .page-header, .btn, .no-print { display: none !important; }
  .main-wrapper { background: white; }
  .content-area { padding: 0; }
}

/* ── FullCalendar tweaks ── */
.fc .fc-toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.fc .fc-button {
  font-size: 0.82rem;
}

/* ── Status colors for text ── */
.status-scheduled  { color: #0d6efd; }
.status-checked_in { color: #0dcaf0; }
.status-in_progress { color: #fd7e14; }
.status-waiting_parts { color: #dc3545; }
.status-ready      { color: #198754; }
.status-complete   { color: #6c757d; }
