/* ============================================================
   ServiceSentry  —  app.css
   Brand: Navy #1B2E4B  ·  Orange #D45B0A
   ============================================================ */

:root {
  --ss-navy:        #1B2E4B;
  --ss-navy-dark:   #132238;
  --ss-navy-hover:  #243d63;
  --ss-orange:      #D45B0A;
  --ss-orange-dark: #b34d08;
  --ss-orange-light:#FDF0E8;
  --ss-sidebar-w:   260px;
  --ss-topbar-h:    56px;
  --bs-primary:     #D45B0A;
  --bs-primary-rgb: 212, 91, 10;
}

/* ── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9rem;
  color: #2d3748;
  background: #f0f2f5;
}

.tiny { font-size: 0.72rem; }

/* ── Bootstrap primary override ─────────────────────────────── */
.btn-primary {
  background-color: var(--ss-orange);
  border-color: var(--ss-orange);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ss-orange-dark);
  border-color: var(--ss-orange-dark);
}
.btn-outline-primary {
  color: var(--ss-orange);
  border-color: var(--ss-orange);
}
.btn-outline-primary:hover {
  background-color: var(--ss-orange);
  border-color: var(--ss-orange);
  color: #fff;
}
.bg-primary { background-color: var(--ss-orange) !important; }
.text-primary { color: var(--ss-orange) !important; }
.border-primary { border-color: var(--ss-orange) !important; }

/* ── Layout shell ────────────────────────────────────────────── */
.ss-topbar {
  background: var(--ss-navy);
  height: var(--ss-topbar-h);
  position: sticky;
  top: 0;
  z-index: 1040;
}

.ss-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.ss-sidebar {
  width: var(--ss-sidebar-w);
  background: var(--ss-navy);
  color: #c8d6e8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  transition: transform 0.25s ease;
}

.ss-sidebar-brand {
  color: #fff;
  background: var(--ss-navy-dark);
  flex-shrink: 0;
}

.ss-sidebar-company {
  color: #c8d6e8;
  flex-shrink: 0;
}

.ss-sidebar-divider {
  border-color: rgba(255,255,255,0.1);
  margin: 0.25rem 0;
}

.text-muted-sidebar { color: #7a9abc !important; }

/* Nav links */
.ss-nav .nav-link {
  color: #c8d6e8;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
}
.ss-nav .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.ss-nav .nav-link.active {
  background: var(--ss-orange);
  color: #fff;
  font-weight: 600;
}
.ss-nav-section { color: #7a9abc; font-size: 0.72rem; }

/* Sidebar footer */
.ss-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* ── Main content ────────────────────────────────────────────── */
.ss-main {
  margin-left: var(--ss-sidebar-w);
  flex: 1;
  min-width: 0;
}

.ss-content {
  padding: 1.75rem 1.75rem 3rem;
  max-width: 1280px;
}

/* ── Page header ─────────────────────────────────────────────── */
.ss-page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ss-navy);
}

/* ── Cards ───────────────────────────────────────────────────── */
.ss-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.ss-card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: var(--ss-navy);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  border-radius: 10px 10px 0 0 !important;
}

.ss-card-header-primary {
  background: var(--ss-orange-light);
  border-bottom: 1px solid #f5c6a0;
  font-weight: 600;
  color: var(--ss-orange-dark);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  border-radius: 10px 10px 0 0 !important;
}

/* ── Stat cards (dashboard) ──────────────────────────────────── */
.ss-stat-card {
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ss-stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.ss-stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.ss-stat-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.ss-stat-new        { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.ss-stat-scheduled  { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.ss-stat-inprogress { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ss-stat-complete   { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }

/* ── Tables ──────────────────────────────────────────────────── */
.ss-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  white-space: nowrap;
}
.ss-table td { vertical-align: middle; font-size: 0.88rem; }

/* ── Job list items ──────────────────────────────────────────── */
.ss-job-item { transition: background 0.1s; }
.ss-job-item:hover { background: #f8fafc; }
.ss-urgent-item  { border-left: 3px solid #dc3545 !important; }
.ss-urgent-row   { background: #fff8f7 !important; }
.ss-urgent-card  { border-left: 3px solid #dc3545 !important; }

/* ── Time block (dashboard schedule) ────────────────────────── */
.ss-time-block {
  min-width: 56px;
  color: var(--ss-navy);
  font-size: 0.8rem;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.ss-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ss-orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ss-avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }

/* ── Notes ───────────────────────────────────────────────────── */
.ss-note-item { padding: 0.875rem 1rem; }

/* ── Schedule block (job detail) ─────────────────────────────── */
.ss-schedule-date { display: flex; align-items: center; gap: 0.75rem; }
.ss-schedule-day {
  background: var(--ss-orange);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* ── Customer notes block ────────────────────────────────────── */
.ss-customer-notes {
  background: var(--ss-orange-light);
  border-left: 3px solid var(--ss-orange);
  padding: 0.6rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
}

/* ── Internal notes block ────────────────────────────────────── */
.ss-internal-notes {
  background: #fefce8;
  border-left: 3px solid #facc15;
  padding: 0.6rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.ss-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}
.ss-empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.25;
}

/* ── Login page ──────────────────────────────────────────────── */
.ss-login-bg {
  background: linear-gradient(135deg, var(--ss-navy) 0%, #2a4a6b 100%);
  min-height: 100vh;
}
.ss-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ss-login-logo {
  width: 64px;
  height: 64px;
  background: var(--ss-navy);
  color: var(--ss-orange);
  border-radius: 16px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(27,46,75,.3);
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb { font-size: 0.82rem; }
.breadcrumb-item a { color: var(--ss-orange); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Responsive: mobile sidebar ─────────────────────────────── */
@media (max-width: 991.98px) {
  .ss-sidebar {
    transform: translateX(-100%);
    top: var(--ss-topbar-h);
    height: calc(100vh - var(--ss-topbar-h));
  }
  .ss-sidebar.open { transform: translateX(0); }
  .ss-main { margin-left: 0; padding-top: var(--ss-topbar-h); }
  .ss-content { padding: 1.25rem 1rem 3rem; }
  .ss-page-title { font-size: 1.3rem; }
  .ss-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1025;
    top: var(--ss-topbar-h);
  }
  .ss-overlay.open { display: block; }
}

@media (max-width: 575.98px) {
  .ss-stat-number { font-size: 1.9rem; }
  .ss-content { padding: 1rem 0.75rem 3rem; }
}
