/* Convertus CMMS design system
   Brand: navy #141c3a, blues #2a6fd6 / #3bb3e6, greens #8cc63f / #1fa64a
*/
:root {
  --navy: #141c3a;
  --navy-2: #1a2448;
  --blue: #2a6fd6;
  --cyan: #3bb3e6;
  --green: #1fa64a;
  --lime: #8cc63f;
  --sidebar-bg: #141c3a;
  --sidebar-bg-2: #1a2448;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-text: rgba(255, 255, 255, 0.78);
  --sidebar-text-active: #fff;
  --accent: #2a6fd6;
  --accent-2: #3bb3e6;
  --accent-soft: rgba(42, 111, 214, 0.12);
  --page-bg: #f3f5f9;
  --page-bg-2: #e8ecf3;
  --card-bg: #ffffff;
  --text-color: #141c3a;
  --muted: #5c6780;
  --border: rgba(20, 28, 58, 0.10);
  --shadow-1: 0 1px 2px rgba(20, 28, 58, 0.06), 0 1px 1px rgba(20, 28, 58, 0.04);
  --shadow-2: 0 4px 16px rgba(20, 28, 58, 0.08), 0 1px 3px rgba(20, 28, 58, 0.05);
  --shadow-3: 0 12px 32px rgba(20, 28, 58, 0.14), 0 4px 8px rgba(20, 28, 58, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 64px;
  --sidebar-w: 248px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: 180ms cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --sidebar-bg: #0c1220;
  --sidebar-bg-2: #111827;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-text: rgba(232, 237, 247, 0.74);
  --accent: #3bb3e6;
  --accent-2: #5ec8f0;
  --accent-soft: rgba(59, 179, 230, 0.16);
  --page-bg: #0e1324;
  --page-bg-2: #151c2f;
  --card-bg: #181f35;
  --text-color: #e8edf7;
  --muted: #93a0b8;
  --border: rgba(255, 255, 255, 0.08);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text-color);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-color);
}
h1 { font-size: 1.7rem; margin-bottom: 1.15rem; }
h2 { font-size: 1.2rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }

/* ---------- App shell ---------- */
.app-body { margin: 0; }
.app-wrap {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 0% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    var(--page-bg);
}
.app-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 42%, #101628 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
}
.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.65rem 1.1rem;
  text-decoration: none;
  color: #fff;
}
.app-sidebar .brand-mark {
  width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto;
}
.app-sidebar .brand-full {
  height: 28px; max-width: 148px; object-fit: contain;
}
.app-sidebar .brand-text {
  font-weight: 800; letter-spacing: 0.04em; color: #fff; font-size: 1.05rem;
}
.nav-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 0.95rem 0.85rem 0.35rem;
}
.app-sidebar .nav-link,
.app-sidebar .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.52rem 0.8rem;
  border-radius: 10px;
  font-weight: 550;
  font-size: 0.92rem;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--ease), color var(--ease), transform var(--ease);
}
.app-sidebar .nav-link i,
.app-sidebar .dropdown-toggle i {
  width: 1.15rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.92;
}
.app-sidebar .nav-link:hover,
.app-sidebar .dropdown-toggle:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.app-sidebar .nav-link.is-active,
.app-sidebar .dropdown-toggle.is-active {
  background: linear-gradient(90deg, rgba(42,111,214,0.95), rgba(59,179,230,0.75));
  color: #fff;
  box-shadow: 0 6px 16px rgba(42,111,214,0.28);
}
.app-sidebar .dropdown-menu {
  background: #0e1630;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
  padding: 0.35rem;
}
.app-sidebar .dropdown-item {
  color: rgba(255,255,255,0.86);
  border-radius: 8px;
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
}
.app-sidebar .dropdown-item:hover {
  background: rgba(42,111,214,0.35);
  color: #fff;
}

.app-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.35rem;
  background: color-mix(in srgb, var(--card-bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-1);
}
.app-topbar .topbar-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-color);
  padding: 0.25rem 0.35rem 0.25rem 0.25rem;
  border-radius: 999px;
  transition: background var(--ease);
}
.topbar-user:hover { background: var(--accent-soft); color: var(--text-color); }
.topbar-user .user-name { font-weight: 600; font-size: 0.88rem; }
.topbar-user .user-role { font-size: 0.72rem; color: var(--muted); line-height: 1.1; }
.app-main { padding: 1.35rem 1.5rem 2.5rem; flex: 1; }

/* ---------- Avatars ---------- */
.avatar, .avatar-lg { object-fit: cover; border-radius: 50%; }
.avatar { width: 36px; height: 36px; min-width: 36px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--card-bg) 80%, transparent), 0 0 0 3px var(--accent-2); }
.avatar-lg { width: 96px; height: 96px; }
.avatar-fallback {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.avatar.avatar-fallback { width: 36px; height: 36px; min-width: 36px; font-size: 0.9rem; }
.avatar-lg.avatar-fallback { width: 96px; height: 96px; font-size: 2rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  background: var(--card-bg);
  color: var(--text-color);
  transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease);
}
a .card, .card.card-hover, .kpi-card {
  transition: box-shadow var(--ease), transform var(--ease);
}
a:hover .card, .card.card-hover:hover, .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 650;
  padding: 0.9rem 1.15rem;
  color: var(--text-color);
}
.card-body { color: var(--text-color); }

/* KPI */
.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-glow, var(--accent-soft)) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-icon {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: var(--kpi-bg, linear-gradient(135deg, var(--blue), var(--cyan)));
  box-shadow: 0 6px 14px rgba(42, 111, 214, 0.28);
  font-size: 1.05rem;
}
.kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.kpi-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; color: var(--text-color); }
.kpi-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.kpi-assets { --kpi-bg: linear-gradient(135deg, #2a6fd6, #3bb3e6); --kpi-glow: rgba(59,179,230,.22); }
.kpi-wos { --kpi-bg: linear-gradient(135deg, #d97706, #f5b942); --kpi-glow: rgba(245,185,66,.22); }
.kpi-wos .kpi-icon { box-shadow: 0 6px 14px rgba(217,119,6,.28); }
.kpi-low { --kpi-bg: linear-gradient(135deg, #c4353a, #ef6b5b); --kpi-glow: rgba(196,53,58,.2); }
.kpi-low .kpi-icon { box-shadow: 0 6px 14px rgba(196,53,58,.28); }

/* ---------- Buttons / forms / alerts ---------- */
.btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease), background var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 10px rgba(42,111,214,0.25);
}
.btn-primary:hover, .btn-primary:focus { background: var(--accent); border-color: var(--accent); filter: brightness(1.05); }
.btn-success {
  background: linear-gradient(180deg, #2dbd5a, var(--green));
  border-color: var(--green);
}
.btn-outline-secondary, .btn-outline-primary, .btn-light {
  border-color: var(--border);
  color: var(--text-color);
  background: var(--card-bg);
}
.btn-outline-secondary:hover, .btn-light:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-color);
}
.form-control, .form-select, .form-check-input {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--card-bg);
  color: var(--text-color);
  box-shadow: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--card-bg);
  color: var(--text-color);
}
label, .form-label { font-weight: 600; font-size: 0.84rem; color: var(--text-color); }
.form-text, .text-muted { color: var(--muted) !important; }
.alert { border: 0; border-radius: 12px; box-shadow: var(--shadow-1); }
.modal-content {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-3);
  background: var(--card-bg);
  color: var(--text-color);
  overflow: hidden;
}
.modal-header, .modal-footer { border-color: var(--border); background: transparent; }
.modal-title { font-weight: 700; letter-spacing: -0.02em; }
.list-group-item {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border);
}
.dropdown-menu { border-radius: 12px; border-color: var(--border); }

/* ---------- Tables ---------- */
.table-shell {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: auto;
  max-height: min(70vh, 900px);
}
.table-shell .table { margin: 0; background: var(--card-bg); color: var(--text-color); }
.table { background: var(--card-bg); color: var(--text-color); }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: color-mix(in srgb, var(--card-bg) 88%, var(--page-bg-2));
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td { border-color: var(--border); vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: color-mix(in srgb, var(--page-bg) 55%, var(--card-bg)); color: inherit; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover > * { background: var(--accent-soft) !important; }
.table-row-link { cursor: pointer; }
.table-row-link td:last-child { color: var(--muted); }
.table-row-link:hover td:last-child::after {
  content: " Open";
  font-weight: 600;
  color: var(--accent);
  font-size: 0.78rem;
}

/* ---------- Pills ---------- */
.pill, .type-badge, .status-badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}
.pill-status-open, .status-open { background: rgba(42,111,214,.14); color: #1d4f9c; }
.pill-status-closed { background: rgba(31,166,74,.14); color: #147a36; }
.pill-status-on-hold, .pill-status-onhold { background: rgba(217,119,6,.16); color: #9a5a08; }
.pill-status-passed, .badge.bg-success { background: #1fa64a !important; }
.pill-status-failed, .badge.bg-danger { background: #c4353a !important; }
.pill-priority-low { background: rgba(92,103,128,.14); color: var(--muted); }
.pill-priority-medium { background: rgba(42,111,214,.14); color: #1d4f9c; }
.pill-priority-high { background: rgba(217,119,6,.16); color: #9a5a08; }
.pill-priority-critical { background: rgba(196,53,58,.16); color: #9b1c22; }
.type-pm { background: #d7f0fb; color: #0a5b75; }
.type-damage { background: #fde0e2; color: #9b1c22; }
.type-mechanical { background: #ffe9c2; color: #7a4b00; }
.type-safety { background: #d9f5e4; color: #0f6a32; }
.type-low-fuel, .type-low\ fuel { background: #fff3cd; color: #7a5b00; }
.type-inspection { background: #e6e8ef; color: #3b4560; }

[data-theme="dark"] .pill-status-open, [data-theme="dark"] .pill-priority-medium { background: rgba(59,179,230,.2); color: #9bd9f5; }
[data-theme="dark"] .pill-status-closed { background: rgba(31,166,74,.22); color: #8ee0a8; }
[data-theme="dark"] .pill-status-on-hold, [data-theme="dark"] .pill-priority-high { background: rgba(245,185,66,.2); color: #f5d08a; }
[data-theme="dark"] .pill-priority-critical { background: rgba(239,107,91,.22); color: #ffb3b0; }
[data-theme="dark"] .type-pm { background: #0c3a4a; color: #9be0f7; }
[data-theme="dark"] .type-damage { background: #4a1820; color: #ffb4b8; }
[data-theme="dark"] .type-mechanical { background: #3d2c0e; color: #ffd48a; }
[data-theme="dark"] .type-safety { background: #14351f; color: #9ee0b4; }
[data-theme="dark"] .type-low-fuel, [data-theme="dark"] .type-low\ fuel { background: #4a3b10; color: #ffe8a3; }
[data-theme="dark"] .type-inspection { background: #2a3146; color: #c5cce0; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 56px; height: 56px; margin: 0 auto 0.8rem;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.empty-state h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; right: 16px; bottom: 16px; z-index: 1080;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}
.live-toast {
  background: #141c3a; color: #fff;
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow-3);
  font-size: .92rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  border: 1px solid rgba(255,255,255,0.08);
}
.live-toast.show { opacity: 1; transform: none; }
.live-toast a { color: #9bd9f5; }

/* ---------- Theme swatches ---------- */
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding: 6px 8px; border-radius: 10px; border: 2px solid transparent; }
.theme-swatch.selected, .theme-swatch:has(input:checked) { border-color: var(--accent); }
.theme-swatch input { display: none; }
.theme-swatch .swatch { width: 28px; height: 28px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--border); }

/* ---------- Dark theme bootstrap overrides ---------- */
[data-theme="dark"] .bg-light, [data-theme="dark"] .bg-white { background: var(--card-bg) !important; color: var(--text-color) !important; }
[data-theme="dark"] .text-dark { color: var(--text-color) !important; }
[data-theme="dark"] .table { --bs-table-bg: var(--card-bg); --bs-table-color: var(--text-color); --bs-table-striped-bg: #1d2540; --bs-table-hover-bg: #243056; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background: #12192c; color: var(--text-color); border-color: var(--border); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
[data-theme="dark"] .navbar-dark { background: var(--sidebar-bg) !important; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(59,179,230,0.28), transparent 55%),
    radial-gradient(700px 400px at 90% 90%, rgba(140,198,63,0.16), transparent 50%),
    linear-gradient(160deg, #0f1730 0%, #141c3a 48%, #1a2448 100%);
  font-family: var(--font);
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  padding: 2rem 1.75rem 1.5rem;
}
.login-card .login-logo { max-height: 72px; max-width: 100%; }
.login-card h3 { font-weight: 800; letter-spacing: -0.03em; color: #141c3a; }
.login-card .btn-primary { padding: 0.65rem; font-weight: 700; }

/* ---------- Calendar tweaks ---------- */
#calendar table { width: 100%; table-layout: fixed; }
.cal-day { height: 124px; min-height: 124px; border: 1px solid var(--border); padding: 4px; vertical-align: top; background: var(--card-bg); }
.cal-day-inner { min-height: 116px; }
.cal-day-num { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.wo-card { position: relative; background: color-mix(in srgb, var(--page-bg) 70%, var(--card-bg)); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; margin-top: 3px; font-size: 0.7rem; text-align: left; }
.wo-card a { text-decoration: none; color: inherit; font-weight: 650; }
.status-badge { font-size: 0.6rem; padding: 1px 5px; border-radius: 10px; }

/* ---------- Mobile ---------- */
.mobile-bar { display: none; }
@media (max-width: 767.98px) {
  .app-sidebar { display: none !important; }
  .app-topbar { padding: 0 0.75rem; }
  .app-main { padding: 1rem 0.9rem 2rem; }
  .user-name, .user-role { display: none; }
  .cal-day { height: 88px; min-height: 88px; font-size: 0.75rem; }
  .cal-day-inner { min-height: 80px; }
  .wo-card { font-size: 0.65rem; }
  #calendar { overflow-x: auto; }
  #calendar table { min-width: 700px; }
  .kpi-value { font-size: 1.55rem; }
  h1 { font-size: 1.4rem; }
}

.app-sidebar .brand.brand-lockup {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.45rem 0.5rem 1.15rem;
}
.app-sidebar .brand-full {
  height: auto;
  width: 100%;
  max-width: 176px;
  max-height: 100px;
  object-fit: contain;
}

#mobileNav.offcanvas {
  background: linear-gradient(180deg, #1a2448 0%, #141c3a 45%, #101628 100%);
  color: rgba(255,255,255,0.84);
  width: min(280px, 86vw);
}
#mobileNav .brand-full { height: auto; max-width: 160px; max-height: 80px; object-fit: contain; }
#mobileNav .nav-link {
  display: flex; align-items: center;
  color: rgba(255,255,255,0.84);
  text-decoration: none;
  padding: 0.52rem 0.8rem;
  border-radius: 10px;
  font-weight: 550;
}
#mobileNav .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
#mobileNav .nav-section { color: rgba(255,255,255,0.38); }

.page-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.asset-meta { display: grid; grid-template-columns: 140px 1fr; gap: 0.35rem 0.75rem; }
.asset-meta dt { color: var(--muted); font-weight: 600; font-size: 0.82rem; margin: 0; }
.asset-meta dd { margin: 0; }
.inv-ph {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--page-bg) 80%, var(--card-bg));
  color: var(--muted);
  font-weight: 600;
  border-radius: 14px 14px 0 0;
}
.card .card-img-top { border-radius: 14px 14px 0 0; object-fit: cover; height: 150px; }
.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.35rem; width: min(420px, 100%); }
.login-hero-logo { max-width: min(280px, 80vw); height: auto; max-height: 110px; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35)); }
.login-card { width: 100%; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.stat-grid .stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stat-grid .stat-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }

[data-theme="dark"] .tap-btn { background: var(--card-bg); border-color: var(--border); color: var(--text-color); }
a.text-dark, .text-dark { color: var(--text-color) !important; }

/* Password show/hide toggle */
.pw-wrap { position: relative; }
.pw-wrap > input { padding-right: 3rem; }
.pw-toggle { position: absolute; top: 0; right: 0; height: 100%; min-width: 44px; border: 0; background: transparent;
  color: var(--muted, #5c6780); display: flex; align-items: center; justify-content: center; border-radius: 0 10px 10px 0; cursor: pointer; }
.pw-toggle:hover { color: var(--accent, #2a6fd6); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent, #2a6fd6); outline-offset: -2px; }

/* Time clock */
.tc-big { font-size: 1.35rem; padding: 1rem 1.25rem; border-radius: 14px; font-weight: 700; min-height: 64px; }
.tc-running { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; margin: .25rem 0; }
.tc-status { font-weight: 600; display: flex; gap: .4rem; align-items: center; justify-content: center; }
.tc-dot { width: 10px; height: 10px; border-radius: 50%; background: #1fa64a; box-shadow: 0 0 0 4px rgba(31,166,74,.2); }
.tc-open { border-top: 4px solid #1fa64a; }
.tc-chip { display: block; font-size: .72rem; line-height: 1.25; padding: .25rem .4rem; margin-top: .25rem; border-radius: 8px;
  background: rgba(42,111,214,.1); color: inherit; text-decoration: none; }
.tc-chip span { display: block; }
.tc-chip:hover { background: rgba(42,111,214,.2); }
.tc-chip-open { background: rgba(31,166,74,.15); }
.tc-fab { position: fixed; right: 16px; bottom: 16px; z-index: 1040; border-radius: 999px; padding: .8rem 1.1rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(20,28,58,.25); }
@media (min-width: 992px) { .tc-fab { display: none; } }

/* v12 */
@keyframes wo-pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.15); background-color: rgba(220, 53, 69, 0.10); }
    50% { box-shadow: 0 0 16px 4px rgba(220, 53, 69, 0.65); background-color: rgba(220, 53, 69, 0.28); }
}
.wo-pulse, tr.wo-pulse td, .wo-card.wo-pulse, .pm-pulse {
    animation: wo-pulse-red 1.15s ease-in-out infinite;
    border-color: #dc3545 !important;
}
.part-thumb, .upload-thumb img, .upload-thumb {
    width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #e9edf5;
    display: inline-flex; align-items: center; justify-content: center; color: #5c6780;
}
.upload-thumb { overflow: hidden; }
.upload-thumb img { width: 56px; height: 56px; }
.usedby-table td { vertical-align: middle; }
.tc-dot.due { background: #dc3545; box-shadow: 0 0 0 4px rgba(220,53,69,.2); }


/* v13 brand lockup: Convertus logo with Manassas underneath, width-matched */
.app-sidebar .brand.brand-lockup,
#mobileNav .brand.brand-lockup {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.45rem 0.5rem 1.15rem;
  text-decoration: none;
}
.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 176px;
}
.app-sidebar .brand-full {
  height: auto;
  width: 100%;
  max-width: 176px;
  max-height: 88px;
  object-fit: contain;
}
#mobileNav .brand-stack { max-width: 160px; }
#mobileNav .brand-full { height: auto; max-width: 160px; max-height: 80px; object-fit: contain; width: 100%; }
.brand-site {
  display: block;
  width: 100%;
  margin-top: 0.18rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.15;
}
.brand-site-login {
  /* Login canvas is always navy; navy text here made "Manassas" invisible. */
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  margin-top: 0.28rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.brand-site-login-name {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}
.login-brand-stack { display: inline-block; max-width: 280px; }
.login-brand-stack .login-hero-logo { max-width: 100%; height: auto; }
.location-tree-name { color: inherit; text-decoration: none; display: inline-block; }
.location-tree-name:hover { color: var(--accent); }
.cal-note {
  display: block;
  font-size: 0.65rem;
  line-height: 1.2;
  margin: 0.15rem 0;
  padding: 0.12rem 0.3rem;
  border-radius: 6px;
  background: #fff4d6;
  color: #6a4a00;
}
.cal-note-anniversary { background: #e7f0ff; color: #1a3a6a; }

/* Holiday schedule: stack as labeled rows on small screens */
@media (max-width: 767.98px) {
  .holiday-schedule-wrap { overflow: visible; }
  .holiday-schedule thead { display: none; }
  .holiday-schedule, .holiday-schedule tbody, .holiday-schedule tr, .holiday-schedule td {
    display: block;
    width: 100%;
  }
  .holiday-schedule tr {
    border: 1px solid var(--border, #e3e8ef);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg, #fff);
  }
  .holiday-schedule td {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.5rem;
    align-items: center;
    border: 0;
    padding: 0.28rem 0;
  }
  .holiday-schedule td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted, #667);
  }
  .holiday-schedule td[data-label] .form-control { width: 100%; }
}

/* v14 */
.cal-note-birthday,
.cal-note-anniversary {
  background: linear-gradient(110deg, #f9a8d4 0%, #c4b5fd 45%, #fcd34d 100%);
  background-size: 200% 200%;
  animation: people-glow 4s ease-in-out infinite;
  color: #4a1840;
  font-weight: 650;
  border: 0;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.55), 0 0 14px rgba(252, 211, 77, 0.4);
}
@keyframes people-glow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 6px rgba(216, 110, 204, 0.5), 0 0 12px rgba(252, 211, 77, 0.35);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.7), 0 0 18px rgba(244, 114, 182, 0.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cal-note-birthday, .cal-note-anniversary { animation: none; }
}

/* Calendar cards keep a green glow border only. */
.wo-card.done-glow,
.insp-card.done-glow,
#calendar .done-glow {
  box-shadow: 0 0 0 2px rgba(31, 166, 74, 0.35), 0 0 12px rgba(31, 166, 74, 0.5);
  animation: done-glow 2.2s ease-in-out infinite;
}
@keyframes done-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(31,166,74,0.3), 0 0 8px rgba(31,166,74,0.35); }
  50% { box-shadow: 0 0 0 2px rgba(31,166,74,0.6), 0 0 16px rgba(31,166,74,0.65); }
}
/* List views: completed/closed rows are fully green-tinted, readable text, no glow-only border. */
table.table tbody tr.done-glow > *,
tr.done-glow > td,
.list-card.done-glow {
  background: color-mix(in srgb, var(--green) 22%, var(--card-bg)) !important;
  color: var(--text-color);
  box-shadow: none;
  animation: none;
}
table.table tbody tr.done-glow:hover > *,
tr.done-glow:hover > td {
  background: color-mix(in srgb, var(--green) 32%, var(--card-bg)) !important;
}
[data-theme="dark"] table.table tbody tr.done-glow > *,
[data-theme="dark"] tr.done-glow > td,
[data-theme="dark"] .list-card.done-glow {
  background: color-mix(in srgb, var(--green) 28%, var(--card-bg)) !important;
  color: var(--text-color);
}
@media (prefers-reduced-motion: reduce) {
  .wo-card.done-glow, .insp-card.done-glow, #calendar .done-glow { animation: none; }
}

.status-update-box .status-update-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.status-update-box .status-field { flex: 1 1 10rem; min-width: 0; }
.status-update-box .status-field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.status-update-box .status-actions { flex: 0 0 auto; }
@media (max-width: 767.98px) {
  .status-update-box .status-update-fields { flex-direction: column; align-items: stretch; }
  .status-update-box .form-control,
  .status-update-box .form-select,
  .status-update-box .btn { width: 100%; max-width: none !important; }
}

.topbar-bell { position: relative; border: 0; background: transparent; color: inherit; padding: 0.35rem 0.5rem; }
.topbar-bell .bell-count {
  position: absolute; top: 0; right: 0;
  min-width: 1.1rem; height: 1.1rem; padding: 0 0.25rem;
  border-radius: 999px; background: #c4353a; color: #fff;
  font-size: 0.65rem; font-weight: 700; line-height: 1.1rem; text-align: center;
}
.notif-dropdown { min-width: 18rem; max-width: min(24rem, 92vw); }
.notif-dropdown .dropdown-item { white-space: normal; }
.nav-badge, .dash-badge {
  display: inline-block; min-width: 1.15rem; padding: 0 0.35rem;
  margin-left: 0.35rem; border-radius: 999px;
  background: #c4353a; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1.2rem;
  text-align: center; vertical-align: middle;
}

.shift-checklist .task-row { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 0.7rem 0.85rem; margin-bottom: 0.5rem; }
.barcode-scan { border: 1px dashed var(--border, #cfd6e4); border-radius: 12px; padding: 0.85rem; margin-bottom: 0.75rem; background: var(--card-bg, #fff); }
.barcode-scan .scan-video { width: 100%; max-width: 22rem; border-radius: 8px; background: #111; }
.holiday-pref-grid { display: grid; gap: 0.5rem; }

/* ---------- Credit footer ---------- */
.app-credit {
  margin-top: auto;
  padding: 0.7rem 1.25rem 1.1rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1; /* below holiday animations (z 40+) and the clock FAB (1040) */
  pointer-events: none;
  flex-shrink: 0;
}
.app-credit p { margin: 0; }
.app-credit-by { font-weight: 550; }
.app-credit-meta { margin-top: 0.12rem; opacity: 0.92; }

/* Login sits on a dark canvas; keep the footer at the bottom without shifting the card. */
.login-body { position: relative; padding-bottom: 4.5rem; }
.login-body .app-credit,
.app-credit-on-dark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: rgba(255, 255, 255, 0.58);
  padding: 0.75rem 1rem 1.05rem;
}

/* Leave room for the Clock In / Clock Out button on smaller screens. */
@media (max-width: 991.98px) {
  .app-body .app-credit { padding-bottom: 5.25rem; }
}
/* Branding settings previews */
.branding-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 280px;
  padding: 0.75rem 1rem;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.branding-preview img { max-width: 220px; max-height: 80px; object-fit: contain; }
.branding-preview-on-dark { background: #141c3a; }
.branding-preview-icon { max-width: 88px; padding: 0.5rem; }
.branding-preview-icon img { max-width: 48px; max-height: 48px; }

.pill-owner {
    background: #1e3a5f;
    color: #fff;
    margin-left: 0.35rem;
    vertical-align: middle;
}
.pill-locked {
    background: #b45309;
    color: #fff;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* Stretched hit target so the whole card is clickable without restyling the box or its text. */
a.wo-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  background: transparent !important;
  font-weight: inherit;
  cursor: pointer;
  box-shadow: none;
  outline: none;
}
a.wo-card-link:link,
a.wo-card-link:visited,
a.wo-card-link:hover,
a.wo-card-link:active,
a.wo-card-link:focus {
  text-decoration: none !important;
  color: inherit !important;
  background: transparent !important;
  outline: none;
}
.location-level {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
.needs-sub-list a { font-weight: 600; }

/* Pending purchase qty next to on-hand */
.pending-qty,
.badge.pending-qty {
  background: #f5c518;
  color: #1a1a1a;
  font-weight: 600;
}
