:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.hidden { display: none !important; }

/* LOGIN */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #e0edff 45%, #e8ecff 100%);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
  padding: 34px 32px;
  text-align: center;
}
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-logo {
  width: 74px; height: 74px; border-radius: 20px;
  background: linear-gradient(145deg, #dbeafe, #eef2ff);
  display: grid; place-items: center; font-size: 32px;
}
.auth-title { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.auth-subtitle { margin: 8px 0 22px; color: var(--muted); font-size: 14px; }
.auth-continue {
  margin: 12px 0 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.18em; color: #64748b; font-weight: 700;
}
.google-btn-shell {
  padding: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #4f46e5, #2563eb);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}
.google-signin-area {
  min-height: 52px;
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.google-signin-skeleton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 300px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}
.google-signin-skeleton-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: googleSignInSpin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes googleSignInSpin {
  to { transform: rotate(360deg); }
}
.google-signin-error {
  min-width: 300px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  text-align: center;
}
.google-btn-inner {
  padding: 10px;
  border-radius: 999px;
  background: #fff;
  display: flex;
  justify-content: center;
}
.bootstrap-fields {
  margin: 12px 0;
  text-align: left;
}
.helper-text { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 0 0 10px; }
.invite-hint { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.security-note {
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  padding: 12px 14px;
  text-align: left;
}
.auth-message { margin-top: 12px; color: #b91c1c; font-size: 13px; min-height: 18px; }

/* APP SHELL */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 270px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 16px; border-bottom: 1px solid #eef2f7; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #dbeafe, #e0e7ff);
}
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.mini-calendar {
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mini-cal-head p { margin: 0; font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.mini-cal-month-wrap { display: inline-flex; align-items: center; gap: 6px; }
.mini-cal-nav {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: default;
}
.mini-cal-month {
  background: #eff6ff;
  color: #2563eb !important;
  padding: 2px 8px;
  border-radius: 7px;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal-dow, .mini-cal-day { text-align: center; font-size: 10px; color: #94a3b8; }
.mini-cal-day { color: #334155; font-weight: 700; border-radius: 999px; padding: 2px 0; }
.mini-cal-day.active { background: #2563eb; color: #fff; }

.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  text-decoration: none;
  color: #334155;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.nav-link:hover { background: #f1f5f9; }
.nav-link.active { background: #eff6ff; color: #1d4ed8; }

.users-nav { margin-top: 4px; }
.users-toggle {
  border: 0;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}
.users-toggle:hover { background: #f8fafc; }
.users-subnav { margin-left: 10px; border-left: 1px solid #e2e8f0; padding-left: 8px; display: block; }
.users-subnav .nav-link.sub { font-size: 13px; padding: 8px 10px; }

.sidebar-user { margin-top: auto; border-top: 1px solid #eef2f7; padding-top: 12px; }
.profile-btn {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.profile-avatar-shell {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #2563eb;
  overflow: hidden;
  flex-shrink: 0;
}
#profileInitial { color: #fff; font-weight: 700; }
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-btn p { margin: 0; text-align: left; }
#profileName { font-size: 13px; font-weight: 700; color: #0f172a; }
#profileRole { font-size: 11px; color: #64748b; }

.content { flex: 1; min-width: 0; }
.app-main { padding: 24px; }

.page-header { margin-bottom: 14px; }
.page-header h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.page-header p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card {
  background: var(--card);
  border: 1px solid #eef2f7;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.card h3 { margin: 0 0 10px; }
.table-card { overflow: auto; }

.btn {
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn.danger { background: var(--danger); }

table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  background: white;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.18); border-color: #60a5fa; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }

.badge { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.badge.Pending { background: #fef3c7; color: #92400e; }
.badge.Active { background: #dbeafe; color: #1d4ed8; }
.badge.Processing { background: #ede9fe; color: #6d28d9; }
.badge.Completed { background: #dcfce7; color: #166534; }

#trackingJson { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

.banner {
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.4;
}
.banner-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #854d0e; }
.banner-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-main { padding: 14px; }
}

/* Enhanced parity UI */
.hero-card {
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a, #132d78 45%, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hero-title { margin: 8px 0 0; font-size: 44px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 900; }
.hero-date { margin: 0; color: #bfdbfe; font-weight: 700; font-size: 14px; }
.hero-mini-cards { display: flex; gap: 10px; }
.hero-mini-card { border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; padding: 12px 14px; min-width: 118px; background: rgba(255,255,255,0.08); text-align: center; }
.mini-label { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: #bfdbfe; font-weight: 700; }
.mini-value { margin: 6px 0 0; font-size: 30px; font-weight: 900; }

.section-head h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.section-head p { margin: 2px 0 8px; font-size: 13px; color: #64748b; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid #edf2f7; background: #fff; padding: 16px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.stat-label { text-transform: uppercase; letter-spacing: .14em; color: #94a3b8; font-size: 10px; font-weight: 800; }
.stat-value { margin: 8px 0 2px; font-size: 42px; line-height: 1; letter-spacing: -0.03em; font-weight: 900; }
.stat-sub { font-size: 12px; color: #64748b; margin: 0; }
.stat-bar { margin-top: 10px; height: 3px; border-radius: 999px; }

.dashboard-bottom-grid { display: grid; grid-template-columns: 1fr 180px; gap: 14px; margin-bottom: 14px; }
.summary-stack { display: grid; gap: 10px; }
.summary-item { border-radius: 16px; border: 1px solid #edf2f7; background: #fff; padding: 12px; box-shadow: 0 6px 18px rgba(15,23,42,.05); }
.summary-item h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #94a3b8; }
.summary-item p { margin: 6px 0 0; font-size: 30px; line-height: 1; font-weight: 900; }

.map-card .card-head, .upcoming-card .card-head, .tracking-side .card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px;
}
.card-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.card-head p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.map-canvas { width: 100%; height: 300px; border-radius: 14px; background: #e2e8f0; border: 1px solid #dbe3ef; }
.tracking-map { height: 420px; }

.btn.btn-dark { background: #0f172a; color: #fff; }
.btn.btn-light { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

.tracking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tracking-side { display: flex; flex-direction: column; }
.tracking-side .muted { margin: 0 0 10px; color: #64748b; font-size: 14px; }
.empty-state { min-height: 300px; border: 1px dashed #dbe3ef; background: #f8fafc; border-radius: 14px; display: grid; place-items: center; color: #94a3b8; font-weight: 700; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav h2 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-right select {
  width: 110px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  font-weight: 700;
}
#newWorkOrderBtn {
  border-radius: 9px;
  font-size: 14px;
  padding: 10px 16px;
}
.calendar-card { padding: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid #eef2f7; border-radius: 14px; overflow: hidden; }
.cal-head { background: #f8fafc; border-bottom: 1px solid #eef2f7; padding: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #64748b; text-align: center; font-weight: 800; }
.cal-cell { min-height: 96px; border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; padding: 8px; position: relative; background: #fff; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-date { font-size: 12px; font-weight: 700; color: #334155; }
.cal-date.today { display: inline-flex; width: 24px; height: 24px; border-radius: 999px; background: #2563eb; color: #fff; align-items: center; justify-content: center; }
.cal-empty { background: #f8fafc; }
.cal-events { margin-top: 6px; display: grid; gap: 5px; }
.cal-event { font-size: 11px; border-radius: 7px; padding: 3px 6px; color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #eef2f7;
  border-radius: 14px;
  overflow: hidden;
}
.week-col { border-right: 1px solid #eef2f7; min-height: 210px; background: #fff; }
.week-col:last-child { border-right: none; }
.week-col-head {
  border-bottom: 1px solid #eef2f7;
  padding: 8px;
  text-align: center;
}
.week-col-head p { margin: 0 0 4px; font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .1em; }
.week-col-body { padding: 8px; min-height: 150px; display: grid; gap: 5px; align-content: start; }
.calendar-day-grid {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  min-height: 300px;
  background: #fff;
  display: grid;
  place-items: center;
}
.day-empty-state { text-align: center; color: #94a3b8; font-weight: 700; }
.day-empty-state p { margin: 0; color: #94a3b8; }
.day-empty-state small { color: #cbd5e1; }
.day-empty-icon { font-size: 28px; margin-bottom: 8px !important; }
.day-events-list {
  width: 100%;
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 80;
  backdrop-filter: none;
  opacity: 1;
}
.workorder-drawer {
  position: fixed; top: 0; right: 0; width: min(860px, 100vw); height: 100vh;
  background: #fff; z-index: 90; box-shadow: -8px 0 32px rgba(15,23,42,.12);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(0);
  opacity: 1;
}

/* Work order drawer — React parity */
.wo-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0;
}
.wo-drawer-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f172a;
  line-height: 1.25;
}
.wo-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px;
  color: #9ca3af; cursor: pointer; padding: 0;
}
.wo-close-btn:hover { background: #f3f4f6; color: #374151; }
.wo-close-btn svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}
.wo-drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wo-drawer-body {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  display: flex; flex-direction: column; gap: 26px;
}
.wo-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  padding: 18px;
}
.wo-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wo-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.wo-section-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}
.wo-drawer-footer {
  flex-shrink: 0; padding: 16px 32px; border-top: 1px solid #f3f4f6;
}
.wo-submit-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 16px;
  background: #2563eb; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.wo-submit-btn:hover { background: #1d4ed8; }
.wo-field { display: flex; flex-direction: column; gap: 8px; }
.wo-label {
  display: block; margin: 0; font-size: 13px; font-weight: 700;
  text-transform: none; letter-spacing: 0.015em; color: #1f2937; line-height: 1.4;
}
.wo-label-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0;
}
.wo-label-inline {
  font-size: 13px; font-weight: 700; text-transform: none;
  letter-spacing: 0.015em; color: #1f2937; line-height: 1.35;
}
.wo-sublabel { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #1f2937; line-height: 1.35; }
.wo-icon {
  width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: #374151;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.wo-input, .wo-textarea, .wo-select {
  width: 100%; font-size: 16px; font-weight: 500; line-height: 1.45; color: #0f172a; background: #fff;
  border: 1px solid #d1d5db; border-radius: 12px; padding: 13px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.wo-input:focus, .wo-textarea:focus, .wo-select:focus {
  outline: none; border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.wo-input::placeholder, .wo-textarea::placeholder { color: #94a3b8; }
.wo-textarea { resize: none; line-height: 1.5; min-height: 0; }
.wo-title-input { font-size: 19px; font-weight: 600; line-height: 1.4; min-height: 88px; letter-spacing: -0.01em; }
.wo-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wo-grid-tight { gap: 12px; }
.wo-submitted-time-row { max-width: 460px; }
.wo-select-wrap { position: relative; }
.wo-select { appearance: none; padding-right: 40px; cursor: pointer; }
.wo-chevron {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af;
  stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.wo-hint { margin: 0 0 6px; font-size: 12px; color: #475569; line-height: 1.5; }
.wo-spacer { height: 16px; }

/* Color swatches */
.wo-color-field { align-items: flex-start; }
.wo-color-swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.wo-color-swatch {
  width: 40px; height: 40px; border-radius: 999px; border: 2px solid #fff;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s;
  opacity: .92;
}
.wo-color-swatch:hover { transform: scale(1.05); }
.wo-color-swatch.active {
  border-color: #111827; transform: scale(1.1);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

/* Sub work orders box */
.wo-sub-box {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;
}
.wo-sub-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.wo-sub-title {
  margin: 0; font-size: 13px; font-weight: 700; text-transform: none;
  letter-spacing: 0.015em; color: #334155; line-height: 1.35;
}
.wo-sub-hint { font-size: 12px; color: #64748b; line-height: 1.45; }
.wo-sub-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wo-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #f9fafb; border-radius: 6px; padding: 8px 12px;
}
.wo-sub-item-left { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; }
.wo-sub-item-left svg { width: 14px; height: 14px; stroke: #9ca3af; fill: none; stroke-width: 2; }
.wo-sub-remove {
  border: 0; background: transparent; color: #9ca3af; cursor: pointer; padding: 4px;
}
.wo-sub-remove:hover { color: #ef4444; }
.wo-sub-remove svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.wo-link-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: #2563eb; font-size: 16px; font-weight: 600; cursor: pointer; padding: 0;
}
.wo-link-btn:hover { color: #1d4ed8; }
.wo-link-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}
.wo-link-btn.is-disabled,
.wo-link-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}

/* Searchable selects */
.wo-search-select { position: relative; }
.wo-search-select .wo-ss-trigger {
  width: 100%; text-align: left; font-size: 16px; font-weight: 500; line-height: 1.45; color: #0f172a;
  background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
  padding: 12px 40px 12px 16px; cursor: pointer; position: relative;
}
.wo-search-select .wo-ss-trigger.placeholder { color: #9ca3af; }
.wo-search-select .wo-ss-trigger::after {
  content: ""; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid #9ca3af;
}
.wo-search-select.open .wo-ss-dropdown {
  display: block;
}
.wo-ss-dropdown {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 5; overflow: hidden;
}
.wo-ss-search {
  width: 100%; border: 0; border-bottom: 1px solid #f3f4f6; padding: 10px 14px;
  font-size: 14px; outline: none;
}
.wo-ss-options { max-height: 200px; overflow-y: auto; }
.wo-ss-option {
  display: block; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 10px 14px; font-size: 14px; color: #374151; cursor: pointer;
}
.wo-ss-option:hover, .wo-ss-option.highlight { background: #eff6ff; color: #1d4ed8; }
.wo-ss-option.wo-ss-create {
  font-weight: 700;
  color: #2563eb;
  border-top: 1px solid #f1f5f9;
}
.wo-ss-empty { padding: 12px 14px; font-size: 13px; color: #9ca3af; }
.wo-ss-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wo-ss-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eff6ff; color: #1d4ed8; border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 600;
}
.wo-ss-tag button {
  border: 0; background: none; color: #60a5fa; cursor: pointer; padding: 0; line-height: 1;
  font-size: 16px;
}
.wo-ss-tag button:hover { color: #1d4ed8; }

/* Priority & status pills */
.wo-pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.wo-pill {
  border: 1px solid #cbd5e1; border-radius: 999px; padding: 9px 18px;
  font-size: 14px; font-weight: 700; background: #ffffff; color: #475569;
  cursor: pointer; transition: all .15s;
}
.wo-pill:hover:not(.active) { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.wo-pill.active[data-value="None"] { background: #4b5563; color: #fff; border-color: #4b5563; }
.wo-pill.active[data-value="Low"] { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.wo-pill.active[data-value="Medium"] { background: #eab308; color: #fff; border-color: #eab308; }
.wo-pill.active[data-value="High"] { background: #ef4444; color: #fff; border-color: #ef4444; }
.wo-status.active[data-value="Pending"] { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.wo-status.active[data-value="Active"] { background: #2563eb; color: #fff; border-color: #2563eb; }
.wo-status.active[data-value="Processing"] { background: #9333ea; color: #fff; border-color: #9333ea; }
.wo-status.active[data-value="Completed"] { background: #16a34a; color: #fff; border-color: #16a34a; }

/* Attachments */
.wo-attachments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.wo-attachment-item {
  display: flex; align-items: center; gap: 12px; background: #f9fafb;
  border-radius: 8px; padding: 8px 12px;
}
.wo-attachment-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: #9ca3af; fill: none; stroke-width: 2; }
.wo-attachment-meta { flex: 1; min-width: 0; }
.wo-attachment-name { margin: 0; font-size: 16px; font-weight: 500; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-attachment-size { margin: 0; font-size: 14px; color: #6b7280; }
.wo-attachment-remove {
  border: 0; background: transparent; color: #9ca3af; cursor: pointer; padding: 4px;
}
.wo-attachment-remove:hover { color: #ef4444; }
.wo-upload-link {
  display: inline-flex; align-items: center; gap: 8px; color: #2563eb;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.wo-upload-link:hover { color: #1d4ed8; }
.wo-upload-link svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}
.wo-upload-link .hidden { display: none; }
.wo-image-dropzone {
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.wo-image-dropzone:hover {
  background: #e0edff;
}
.wo-image-dropzone.dragover {
  border-color: #2563eb;
  background: #dbeafe;
  transform: translateY(-1px);
}
.wo-image-drop-icon {
  font-size: 20px;
  line-height: 1;
}
.wo-image-drop-text {
  font-size: 16px;
  font-weight: 700;
}

/* Asset picker dialog */
.wo-asset-dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15,23,42,.2); z-index: 95; overflow: hidden;
  display: flex; flex-direction: column;
}
.wo-asset-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #f3f4f6;
}
.wo-asset-head h3 { margin: 0; font-size: clamp(24px, 2.4vw, 38px); font-weight: 700; letter-spacing: -0.02em; color: #111827; }
.wo-asset-search-wrap { position: relative; padding: 16px 24px 0; }
.wo-search-icon {
  position: absolute; left: 36px; top: calc(50% + 8px); transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af; stroke-width: 2;
}
.wo-asset-search-wrap .wo-input { padding-left: 36px; font-size: clamp(16px, 1.5vw, 24px); border-radius: 8px; padding-top: 8px; padding-bottom: 8px; }
.wo-asset-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px 0; }
.wo-filter-pill {
  border: 1px solid #dbe2ea; border-radius: 8px; background: #fff;
  color: #0f172a; font-weight: 600; font-size: 14px; padding: 8px 12px; cursor: pointer;
}
.wo-filter-pill:hover { background: #f8fafc; border-color: #cbd5e1; }
.wo-filter-add { color: #2563eb; }
.wo-filter-panel {
  position: absolute;
  top: 170px;
  left: 24px;
  width: min(420px, calc(100% - 48px));
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.08); max-height: 260px; overflow: auto;
  z-index: 8;
}
#woAssetFilterPanel { left: 120px; }
.wo-filter-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 700; color: #334155;
}
.wo-filter-clear { border: 0; background: transparent; color: #2563eb; font-size: 13px; font-weight: 700; cursor: pointer; }
.wo-filter-panel-list { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.wo-filter-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: 14px; color: #334155; cursor: pointer;
}
.wo-filter-option:hover { background: #f8fafc; }
.wo-filter-option input { accent-color: #2563eb; }
.wo-filter-option-label { flex: 1; min-width: 0; text-align: left; }
.wo-filter-empty { margin: 0; padding: 10px 12px; color: #94a3b8; font-size: 13px; }
.wo-asset-info {
  margin: 10px 24px 0; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; color: #1d4ed8; font-size: 14px; font-weight: 600; padding: 10px 12px;
}
.wo-asset-list {
  flex: 1; min-height: 220px; overflow-y: auto; padding: 12px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.wo-asset-option {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 14px; color: #374151;
}
.wo-asset-option:hover { background: #f9fafb; border-color: #cbd5e1; }
.wo-asset-option input { accent-color: #2563eb; margin-top: 2px; flex-shrink: 0; }
.wo-asset-option-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, max-content);
  align-items: center;
  column-gap: 14px;
  width: 100%;
  min-width: 0;
}
.wo-asset-option-name {
  color: #1f2937; font-weight: 600; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wo-asset-option-meta { color: #64748b; font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.wo-asset-foot {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid #f3f4f6;
}
.wo-asset-selected { margin: 0; color: #334155; font-size: 14px; font-weight: 600; flex: 1; }
.wo-btn-secondary {
  border: 0; border-radius: 12px; padding: 10px 14px; background: #f3f4f6;
  color: #374151; font-weight: 700; font-size: 14px; cursor: pointer;
}
.wo-btn-secondary:hover { background: #e5e7eb; }
.wo-btn-primary {
  border: 0; border-radius: 12px; padding: 10px 14px; background: #2563eb;
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.wo-btn-primary:hover { background: #1d4ed8; }
.wo-btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }

.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.muted-label { margin: 2px 0 -2px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #64748b; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; background: #f8fafc; }

.toolbar-grid { grid-template-columns: 120px 1fr 180px !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 80; }
.modal-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 20px)); max-height: 90vh; background: #fff; border-radius: 14px; z-index: 90;
  border: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden;
}
.modal-top-line { height: 8px; background: #2563eb; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #edf2f7; }
.modal-header h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; color: #0f172a; }
.modal-form { display: grid; gap: 14px; padding: 16px 18px; overflow-y: auto; }
.qr-preview { border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px; width: fit-content; background: #fff; }
.qr-preview img { width: 180px; height: 180px; display: block; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-card { flex-direction: column; align-items: flex-start; }
  .hero-title { font-size: 32px; }
  .tracking-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .toolbar-grid { grid-template-columns: 1fr !important; }
  .page-hero-card { flex-direction: column; align-items: stretch; }
  .page-hero-actions { flex-wrap: wrap; }
  .access-grid { grid-template-columns: 1fr; }
}

/* React-parity components */
.page-hero-card {
  background: #fff;
  border-radius: 40px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 28px 32px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-hero-card h2 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.page-hero-card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.page-hero-actions { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap input {
  width: 100%;
  border: 0;
  background: #f9fafb;
  border-radius: 16px;
  padding: 14px 14px 14px 42px;
  font-weight: 700;
  font-size: 14px;
}
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .45; }
.sort-select {
  width: auto;
  border: 0;
  background: #f9fafb;
  border-radius: 16px;
  padding: 14px 36px 14px 14px;
  font-weight: 700;
  font-size: 14px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 30px rgba(37, 99, 235, 0.18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-pill { border-radius: 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; padding: 14px 22px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn-icon { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: #6b7280; }

.table-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.table-scroll { flex: 1; min-height: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 250, 251, 0.95);
  backdrop-filter: blur(4px);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}
.data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.data-table tbody tr:hover { background: rgba(248, 250, 252, 0.8); }
.empty-cell { text-align: center; color: #9ca3af; padding: 48px 16px !important; font-weight: 600; }
.employee-cell { display: inline-flex; align-items: center; gap: 10px; justify-content: center; }
.avatar-dot {
  width: 36px; height: 36px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.type-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.row-actions { display: inline-flex; gap: 6px; justify-content: center; }
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e5e7eb; background: #fff; border-radius: 10px;
  width: 36px; height: 36px; padding: 0; cursor: pointer;
}
.action-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action-btn.view { color: #374151; }
.action-btn.edit { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.action-btn.delete { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.action-btn:hover { filter: brightness(0.97); }

.modal-lg { width: min(760px, calc(100vw - 24px)); max-height: 88vh; }
.modal-xl { width: min(980px, calc(100vw - 24px)); max-height: 88vh; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 16px; margin-top: 8px; border-top: 1px solid #f3f4f6;
}
.entity-form {
  gap: 16px;
}
.entity-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}
.entity-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #111827;
}
.entity-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.entity-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.entity-field-span-2 {
  grid-column: 1 / -1;
}
.entity-inline-actions {
  display: flex;
  justify-content: flex-start;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #1f2937;
  margin: 0;
}
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
}
.color-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #64748b; transform: scale(1.05); }
.contact-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.contact-row input { min-width: 0; }

.alert { border-radius: 16px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.table-loader {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,0.85); z-index: 2; font-weight: 700; color: var(--primary);
}
.page-orbit-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(5px);
  border-radius: inherit;
}
.page-orbit-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.page-orbit-loader-inner p {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}
.access-list-panel { position: relative; overflow: hidden; }
.tracking-layout { position: relative; }
.tracking-layout.is-loading > section { opacity: .55; pointer-events: none; transition: opacity .25s ease; }

.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sidebar-close-btn, .sidebar-open-btn {
  border: 0; background: #f3f4f6; border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 20px;
}
.sidebar-open-btn {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  box-shadow: 0 4px 14px rgba(15,23,42,.12);
  display: none;
}
.sidebar-open-btn:not(.hidden) {
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 40;
}
.nav-icon { opacity: .65; margin-right: 4px; }
.users-chevron { margin-left: auto; transition: transform .2s; }
.users-chevron.open { transform: rotate(90deg); }

.profile-modal-overlay {
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 85;
}
.profile-modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none;
}
.profile-modal:not(.hidden) { pointer-events: auto; }
.profile-modal-card {
  width: min(448px, 100%); background: #fff; border-radius: 24px;
  overflow: hidden; border: 1px solid #f3f4f6;
  box-shadow: 0 25px 50px rgba(15,23,42,.2);
  animation: profileModalIn .22s ease-out;
  pointer-events: auto;
}
@keyframes profileModalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.profile-modal-header {
  position: relative; height: 128px;
  background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
}
.profile-modal-close {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.2); color: #fff; cursor: pointer;
  transition: background .2s;
}
.profile-modal-close:hover { background: rgba(255,255,255,.32); }
.profile-modal-close svg { width: 20px; height: 20px; }
.profile-modal-avatar {
  position: absolute; left: 32px; bottom: -48px;
  width: 96px; height: 96px; border-radius: 24px;
  background: #2563eb; border: 4px solid #fff;
  box-shadow: 0 12px 32px rgba(15,23,42,.15);
  display: grid; place-items: center; overflow: hidden;
}
#profileModalInitial {
  font-size: 32px; font-weight: 800; color: #fff; line-height: 1;
}
.profile-modal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-modal-body { padding: 64px 32px 32px; }
.profile-modal-intro { margin-bottom: 24px; }
.profile-modal-body h3 {
  margin: 0; font-size: 24px; font-weight: 800; color: #111827; letter-spacing: -0.02em;
}
.profile-modal-role {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0 0; font-size: 15px; font-weight: 600; color: #2563eb;
}
.profile-role-icon { width: 16px; height: 16px; flex-shrink: 0; }
.profile-details { display: flex; flex-direction: column; gap: 16px; }
.profile-detail {
  display: flex; align-items: center; gap: 16px;
  background: #f9fafb; border: 1px solid #f3f4f6;
  border-radius: 16px; padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.profile-detail:hover {
  border-color: #e5e7eb; box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.profile-detail-icon-wrap {
  flex-shrink: 0; width: 40px; height: 40px;
  display: grid; place-items: center;
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
  color: #9ca3af;
}
.profile-detail-icon-wrap svg { width: 20px; height: 20px; }
.profile-detail-text { min-width: 0; flex: 1; }
.profile-detail-label {
  margin: 0; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #6b7280;
}
.profile-detail-value {
  margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #111827;
  word-break: break-all; line-height: 1.35;
}

.access-page { gap: 16px; }
.access-hero-metrics { flex-wrap: wrap; justify-content: flex-end; }
.access-metric-card {
  min-width: 112px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  padding: 10px 14px;
}
.access-metric-card span {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: #111827;
  line-height: 1.1;
}
.access-metric-card small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}
.access-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
.access-invite-panel,
.access-list-panel {
  padding: 20px;
}
.access-panel-head h3,
.access-list-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}
.access-panel-head p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}
.access-form { display: grid; gap: 10px; margin-top: 14px; }
.access-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px;
}
.access-list-panel {
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.access-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.access-list-head .search-wrap { min-width: 220px; max-width: 300px; }
.access-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.access-table { min-width: 680px; }
.access-table td {
  vertical-align: middle;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.access-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.access-user-name {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.access-avatar-shell {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.access-avatar-initial {
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.access-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.access-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.access-role-badge.admin {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}
.access-role-badge.user {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

.categories-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.5fr);
  gap: 0;
}
.categories-panel,
.table-panel-loading-host {
  min-height: 280px;
}
.table-panel-loading-host .table-scroll {
  min-height: 220px;
}
.data-table tr.empty-row td {
  text-align: center !important;
  vertical-align: middle;
}
.part-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.part-image-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.part-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.part-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.part-view-body .part-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.part-view-body .part-view-thumb {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.part-view-body .part-view-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.part-view-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.part-view-qr-wrap .part-view-qr {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.part-view-download:hover {
  text-decoration: underline;
}
.part-view-field {
  margin-bottom: 14px;
}
.part-view-field dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 4px;
}
.part-view-field dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.category-card:hover {
  border-color: #dbeafe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.category-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.category-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.category-card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.category-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}
.category-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
}
.category-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto;
}
.categories-empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
}
.category-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.category-icon-option {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  background: transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.category-icon-option:hover {
  transform: translateY(-1px);
}
.category-icon-option.is-selected {
  border-color: #111827;
}
.category-icon-option-inner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.category-icon-option-inner svg {
  width: 22px;
  height: 22px;
  display: block;
}
.category-upload-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.category-upload-link:hover {
  text-decoration: underline;
}
.category-custom-icon-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-custom-icon-preview img {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #111827;
  background: #f9fafb;
}
.category-modal-form .modal-footer {
  margin-top: 4px;
}

.part-modal-form .part-name-input {
  border: 0;
  border-bottom: 1px solid #d1d5db;
  border-radius: 0;
  padding: 8px 0;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
}
.part-modal-form .part-name-input:focus {
  border-bottom-color: #2563eb;
  box-shadow: none;
}
.part-image-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.part-image-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.part-generate-link {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.part-generate-link:hover {
  text-decoration: underline;
}
.part-qr-preview {
  margin-top: 12px;
}
.part-qr-preview img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  background: #fff;
}
.part-stock-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
}
.part-files-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #2563eb;
  border-radius: 10px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.part-attachments-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.part-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.ss-option-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ss-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ss-option-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.ss-option-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.wo-ss-trigger .ss-option-with-icon {
  justify-content: flex-start;
}
.wo-ss-tag .ss-option-with-icon {
  gap: 6px;
}
.wo-ss-tag .ss-option-icon {
  width: 22px;
  height: 22px;
}
.wo-images-grid {
  margin-top: 10px;
}

.categories-list-wrap {
  border-right: 1px solid #e5e7eb;
  min-height: 0;
  max-height: calc(100vh - 220px);
  overflow: auto;
}
.categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.categories-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.categories-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}
.categories-item-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}
.categories-form-wrap {
  padding: 16px;
}
.categories-actions .action-btn {
  width: 32px;
  height: 32px;
}

@media (max-width: 900px) {
  .access-hero-metrics { justify-content: flex-start; }
  .access-list-head { flex-wrap: wrap; }
  .access-list-head .search-wrap {
    min-width: 100%;
    max-width: 100%;
  }
  .access-list-panel { max-height: none; }
  .categories-layout {
    grid-template-columns: 1fr;
  }
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .part-stock-row {
    grid-template-columns: 1fr 1fr;
  }
  .categories-list-wrap {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }
}

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: #111827; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(15,23,42,.25);
}
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.toast-card.show { opacity: 1; transform: translateY(0); }
.toast-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
}
.toast-success .toast-card-icon { background: #dcfce7; color: #15803d; }
.toast-error .toast-card-icon { background: #fee2e2; color: #b91c1c; }
.toast-info .toast-card-icon { background: #dbeafe; color: #1d4ed8; }
.toast-loading .toast-card-icon {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  color: transparent;
  animation: googleSignInSpin .7s linear infinite;
}
.toast-card-text { line-height: 1.4; }
.auth-processing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 300px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
}
.auth-processing-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: googleSignInSpin .7s linear infinite;
  flex-shrink: 0;
}

/* APP SHELL — React parity */
.app-shell { min-height: 100vh; display: flex; background: #f9fafb; }
.sidebar {
  width: 256px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 0; border-bottom: 1px solid #e5e7eb;
}
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 0; background: transparent;
  display: grid; place-items: center; font-size: 28px;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 800; color: #111827; }
.brand p { margin: 2px 0 0; color: #6b7280; font-size: 12px; }
.sidebar-close-btn {
  border: 0; background: #f3f4f6; border-radius: 8px; width: 32px; height: 32px;
  cursor: pointer; font-size: 18px; color: #9ca3af; margin-top: 4px;
}
.mini-calendar { padding: 24px; border-bottom: 1px solid #f3f4f6; }
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mini-cal-head > p { margin: 0; font-size: 10px; color: #9ca3af; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.mini-cal-month-wrap { display: inline-flex; align-items: center; gap: 8px; }
.mini-cal-nav {
  border: 0; background: transparent; color: #9ca3af; font-size: 14px; cursor: pointer;
  padding: 4px; border-radius: 6px;
}
.mini-cal-nav:hover { background: #f3f4f6; color: #2563eb; }
.mini-cal-month {
  background: #eff6ff !important; color: #2563eb !important;
  padding: 2px 8px; border-radius: 6px; font-size: 12px !important;
  font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important;
  min-width: 50px; text-align: center;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mini-cal-dow { font-size: 10px; font-weight: 800; color: #9ca3af; }
.mini-cal-day {
  font-size: 11px; font-weight: 600; color: #4b5563; height: 24px; width: 24px;
  margin: 0 auto; display: grid; place-items: center; border-radius: 999px; cursor: pointer; border: 0; background: transparent;
}
.mini-cal-day:hover { background: #f3f4f6; }
.mini-cal-day.active { background: #2563eb; color: #fff; font-weight: 800; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.mini-cal-day.today-ring { box-shadow: 0 0 0 2px #2563eb; color: #2563eb; font-weight: 800; }

.nav-links { flex: 1; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-link {
  text-decoration: none; color: #374151; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.nav-link:hover { background: #f9fafb; }
.nav-link.active { background: #eff6ff; color: #2563eb; }
.nav-link.active .nav-svg { stroke: #2563eb; }
.nav-svg { width: 20px; height: 20px; stroke: #6b7280; fill: none; stroke-width: 2; flex-shrink: 0; }

.users-nav { margin-top: 8px; }
.users-toggle {
  border: 0; width: 100%; text-align: left; padding: 10px 16px; border-radius: 8px;
  background: transparent; color: #374151; font-weight: 600; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.users-toggle:hover, .users-toggle.open { background: #f9fafb; }
.users-toggle.open { background: #eff6ff; color: #2563eb; }
.users-chevron { margin-left: auto; font-size: 14px; color: #9ca3af; transition: transform .2s; }
.users-chevron.open { transform: rotate(90deg); }
.users-subnav { margin: 4px 0 0 16px; padding-left: 12px; border-left: 1px solid #f3f4f6; display: none; }
.users-subnav.open { display: block; }
.users-subnav .nav-link { font-size: 14px; padding: 8px 16px; }

.sidebar-user { padding: 16px; border-top: 1px solid #e5e7eb; margin-top: auto; }
.profile-btn {
  width: 100%; border: 0; border-radius: 8px; background: #f9fafb;
  padding: 8px 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; cursor: pointer;
}
.profile-btn:hover { background: #f3f4f6; }
.profile-avatar-shell {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  background: #2563eb; overflow: hidden; flex-shrink: 0;
}
#profileInitial { color: #fff; font-weight: 700; font-size: 12px; }
.profile-btn p { margin: 0; text-align: left; }
#profileName { font-size: 12px; font-weight: 800; color: #111827; }
#profileRole { font-size: 10px; color: #6b7280; }
#logoutBtn {
  width: 100%; border: 0; background: transparent; color: #dc2626; font-weight: 800;
  font-size: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
#logoutBtn:hover { background: #fef2f2; }

.content { flex: 1; min-width: 0; overflow: hidden; }
.app-main { padding: 24px; padding-left: 64px; overflow-y: auto; height: 100vh; }

body[data-page="locations"] .app-main,
body[data-page="employees"] .app-main,
body[data-page="vendors"] .app-main,
body[data-page="tracking"] .app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crud-page,
.tracking-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 18px;
  overflow: hidden;
}

.crud-page .page-hero-card,
.crud-page .alert { flex-shrink: 0; margin-bottom: 0; }

.tracking-page .tracking-title { flex-shrink: 0; margin-bottom: 0; }
.dashboard-page, .calendar-page, .tracking-page { display: flex; flex-direction: column; gap: 32px; padding-bottom: 16px; }

/* Welcome banner */
.welcome-banner {
  position: relative; overflow: hidden; border-radius: 36px;
  background: linear-gradient(135deg, #0f172a 0%, #172554 45%, #312e81 100%);
  padding: 32px 40px; box-shadow: 0 25px 50px rgba(15,23,42,.18), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.welcome-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top right, rgba(59,130,246,.22) 0%, transparent 55%);
}
.welcome-banner-glow { position: absolute; border-radius: 999px; pointer-events: none; filter: blur(48px); }
.welcome-banner-glow-a { width: 224px; height: 224px; background: rgba(59,130,246,.22); top: -80px; right: -80px; }
.welcome-banner-glow-b { width: 192px; height: 192px; background: rgba(99,102,241,.18); bottom: -64px; left: -64px; }
.welcome-banner-inner {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 32px;
}
.welcome-date { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: rgba(191,219,254,.92); }
.welcome-sparkle { width: 16px; height: 16px; color: #fcd34d; flex-shrink: 0; }
.welcome-greeting { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 900; color: #fff; letter-spacing: -0.02em; line-height: 1.15; }
.welcome-name {
  background: linear-gradient(90deg, #fde68a, #fcd34d); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.welcome-widgets { display: flex; flex-wrap: wrap; gap: 12px; }
.welcome-widget {
  min-width: 140px; border-radius: 24px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.1); backdrop-filter: blur(12px); padding: 20px 24px; text-align: center;
  transition: background .2s, border-color .2s, transform .2s;
}
.welcome-widget-upcoming {
  text-decoration: none; color: inherit;
  background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(249,115,22,.12));
  border-color: rgba(252,211,77,.35);
}
.welcome-widget-upcoming:hover {
  background: linear-gradient(135deg, rgba(251,191,36,.32), rgba(249,115,22,.18));
  border-color: rgba(252,211,77,.5); transform: translateY(-1px);
}
.welcome-widget-value { margin: 0; font-size: clamp(28px, 4vw, 36px); font-weight: 900; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.welcome-widget-icon-svg { display: flex; justify-content: center; margin: 0 auto 6px; color: #fde68a; }
.welcome-widget-icon-svg svg { width: 20px; height: 20px; }
.welcome-widget-label { margin: 4px 0 0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(255,255,255,.5); }
.welcome-widget-upcoming .welcome-widget-label { color: rgba(254,243,199,.85); }

/* Snapshot stats */
.snapshot-section h2 { margin: 0; font-size: 20px; font-weight: 900; color: #111827; letter-spacing: -0.02em; }
.snapshot-section > .snapshot-head p, .snapshot-head p { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.snapshot-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 12px; }
.sync-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #9ca3af; }
.sync-spinner {
  width: 14px; height: 14px; border: 2px solid #dbeafe; border-top-color: #2563eb;
  border-radius: 999px; animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stats-grid-react {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px;
}
@media (min-width: 640px) { .stats-grid-react { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .stats-grid-react { grid-template-columns: repeat(3, 1fr); } }

.stat-card-react {
  position: relative; overflow: hidden; border-radius: 24px; border: 1px solid rgba(243,244,246,.9);
  background: #fff; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.04);
  text-decoration: none; color: inherit; transition: transform .25s, box-shadow .25s;
}
.stat-card-react:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(15,23,42,.1); }
.stat-ring-orange { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(254,215,170,.6); }
.stat-ring-rose { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(254,205,211,.65); }
.stat-ring-violet { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(221,214,254,.65); }
.stat-ring-amber { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(253,230,138,.65); }
.stat-ring-emerald { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(167,243,208,.65); }
.stat-card-react .stat-glow {
  position: absolute; top: -24px; right: -24px; width: 96px; height: 96px;
  border-radius: 999px; opacity: .08;
}
.stat-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-icon-wrap {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; transition: transform .25s;
}
.stat-card-react:hover .stat-icon-wrap { transform: scale(1.06); }
.stat-icon-svg { width: 20px; height: 20px; display: block; }
.stat-arrow { display: inline-flex; color: #d1d5db; transition: color .2s; }
.stat-arrow-svg { width: 16px; height: 16px; display: block; }
.stat-card-react:hover .stat-arrow { color: #2563eb; }
.stat-card-react .stat-name {
  margin: 16px 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: #9ca3af;
}
.stat-card-react .stat-num {
  margin: 0; font-size: 30px; font-weight: 900; color: #111827; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat-card-react .stat-foot { margin: 4px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.stat-card-react .stat-bar {
  margin-top: 16px; height: 4px; border-radius: 999px; opacity: .88;
}

.stat-skeleton {
  border-radius: 24px; border: 1px solid #f3f4f6; background: #fff; padding: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}
.stat-skeleton .sk { background: #f3f4f6; border-radius: 8px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* Map + summary row */
.dashboard-map-row {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 1280px) { .dashboard-map-row { grid-template-columns: 1fr 280px; } }

.map-panel {
  overflow: hidden; border-radius: 36px; border: 1px solid #f3f4f6; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.03);
}
.map-panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px 32px; border-bottom: 1px solid #f9fafb;
}
.map-panel-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: #111827; }
.map-panel-head p { margin: 2px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.map-panel-canvas { min-height: 380px; background: #f1f5f9; }
.map-panel-canvas iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

.btn-pill-dark {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  background: #0f172a; color: #fff; padding: 8px 16px; font-size: 12px; font-weight: 800;
  text-decoration: none; border: 0; transition: background .2s;
}
.btn-pill-dark:hover { background: #1e293b; }
.btn-pill-primary {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
  background: #2563eb; color: #fff; padding: 8px 16px; font-size: 14px; font-weight: 800;
  text-decoration: none; border: 0; cursor: pointer; box-shadow: 0 8px 24px rgba(37,99,235,.2);
  transition: background .2s, box-shadow .2s;
}
.btn-pill-primary:hover { background: #1d4ed8; box-shadow: 0 10px 28px rgba(37,99,235,.28); }

.summary-stack-react { display: flex; flex-direction: column; gap: 16px; }
.summary-card-react {
  display: flex; align-items: center; gap: 16px; border-radius: 24px; border: 1px solid #f3f4f6;
  background: #fff; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.04);
  text-decoration: none; color: inherit; transition: box-shadow .25s, transform .25s;
}
.summary-card-react:hover { box-shadow: 0 12px 32px rgba(15,23,42,.08); transform: translateY(-2px); }
.summary-card-icon {
  width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; flex-shrink: 0; transition: transform .25s;
}
.summary-card-react:hover .summary-card-icon { transform: scale(1.05); }
.summary-icon-svg { width: 20px; height: 20px; display: block; }
.summary-card-meta { flex: 1; min-width: 0; }
.summary-card-meta p:first-child {
  margin: 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af;
}
.summary-card-meta p:last-child {
  margin: 2px 0 0; font-size: 24px; font-weight: 900; color: #111827;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.summary-card-arrow { display: inline-flex; color: #d1d5db; transition: color .2s; }
.summary-arrow-svg { width: 16px; height: 16px; display: block; }
.summary-card-react:hover .summary-card-arrow { color: #2563eb; }

.btn-icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn-icon-sm { width: 14px; height: 14px; flex-shrink: 0; }

/* Upcoming panel */
.upcoming-panel {
  overflow: hidden; border-radius: 36px; border: 1px solid #f3f4f6; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.03);
}
.upcoming-panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px 32px; border-bottom: 1px solid #f9fafb;
}
.upcoming-panel-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: #111827; }
.upcoming-panel-head p { margin: 2px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.upcoming-panel-body { position: relative; padding: 24px 32px; min-height: 120px; }
.upcoming-item {
  display: flex; align-items: center; gap: 16px; width: 100%; border: 1px solid #f3f4f6;
  border-radius: 16px; background: linear-gradient(90deg, rgba(249,250,251,.8), #fff);
  padding: 16px; margin-bottom: 12px; text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .2s; text-decoration: none; color: inherit;
}
.upcoming-item:hover { border-color: #dbeafe; box-shadow: 0 4px 16px rgba(15,23,42,.06); }
.upcoming-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; box-shadow: 0 0 0 2px #fff; }
.upcoming-meta { flex: 1; min-width: 0; }
.upcoming-meta h4 { margin: 0; font-size: 14px; font-weight: 800; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-item:hover .upcoming-meta h4 { color: #1d4ed8; }
.upcoming-meta p { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-chip {
  flex-shrink: 0; border-radius: 999px; border: 1px solid; padding: 4px 12px;
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
}
.status-chip.Active { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.status-chip.Completed { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.status-chip.Pending { background: #fefce8; color: #ca8a04; border-color: #fef08a; }
.status-chip.Processing { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.panel-loader {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.85); z-index: 2;
}

/* Calendar page */
.calendar-toolbar-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.calendar-toolbar-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.calendar-nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-width: 0; }
.calendar-nav-controls { display: flex; align-items: center; gap: 8px; }
.calendar-nav-group h1 {
  margin: 0; font-size: clamp(22px, 3vw, 28px); font-weight: 800;
  letter-spacing: -0.02em; color: #111827; white-space: nowrap;
}
.cal-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px;
  color: #374151; cursor: pointer; transition: background .15s;
}
.cal-nav-btn:hover { background: #f3f4f6; }
.cal-nav-btn svg { width: 20px; height: 20px; }
.cal-today-btn {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 14px; font-weight: 600; color: #374151;
  cursor: pointer; transition: background .15s;
}
.cal-today-btn:hover { background: #f9fafb; }
.calendar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-cal-primary {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 8px 16px;
  background: #2563eb; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-cal-primary:hover { background: #1d4ed8; }
.btn-cal-primary svg { width: 16px; height: 16px; flex-shrink: 0; }
.cal-loading { display: inline-flex; align-items: center; }
.cal-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(102,126,234,.1), rgba(118,75,162,.08));
  border: 1px solid rgba(102,126,234,.18);
  font-size: 12px;
  font-weight: 700;
  color: #667eea;
}
.cal-loading-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #667eea;
  box-shadow: 0 0 0 0 rgba(102,126,234,.45);
  animation: cal-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes cal-badge-pulse {
  0%, 100% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(102,126,234,.35); }
  50% { transform: scale(1); box-shadow: 0 0 0 6px rgba(102,126,234,0); }
}

/* Custom view dropdown */
.cal-view-dropdown { position: relative; }
.cal-view-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 120px; padding: 10px 12px 10px 14px;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 700; color: #1f2937; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cal-view-trigger:hover { border-color: #d1d5db; }
.cal-view-trigger[aria-expanded="true"] {
  border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.cal-view-chevron { width: 16px; height: 16px; color: #9ca3af; transition: transform .2s; flex-shrink: 0; }
.cal-view-dropdown.open .cal-view-chevron { transform: rotate(180deg); }
.cal-view-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: auto; z-index: 50;
  min-width: 100%; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.12);
  animation: calMenuIn .15s ease-out;
}
@keyframes calMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cal-view-menu li { margin: 0; }
.cal-view-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-weight: 600; color: #374151;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.cal-view-menu button:hover { background: #eff6ff; color: #1d4ed8; }
.cal-view-menu button.active {
  background: #eff6ff; color: #2563eb; font-weight: 700;
}
.cal-view-menu button.active::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}
.cal-view-menu button:not(.active)::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
}
.calendar-actions .cal-view-menu { left: auto; right: 0; }
.calendar-grid-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: visible;
  position: relative;
}
.calendar-grid-card.is-loading .calendar-grid {
  opacity: .5;
  pointer-events: none;
  filter: saturate(.85);
  transition: opacity .28s ease, filter .28s ease;
}
.cal-grid-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}
.cal-grid-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cal-grid-loader-inner p {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: .01em;
}
.cal-loader-orbit {
  position: relative;
  width: 48px;
  height: 48px;
}
.cal-loader-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid transparent;
}
.cal-loader-orbit span:first-child {
  border-top-color: #667eea;
  border-right-color: #764ba2;
  animation: spin .9s linear infinite;
}
.cal-loader-orbit span:last-child {
  inset: 8px;
  border-bottom-color: #2193b0;
  border-left-color: #6dd5ed;
  animation: spin 1.2s linear infinite reverse;
}
.calendar-grid-card.is-padded { padding: 24px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-head {
  background: #f9fafb; border-bottom: 1px solid #f3f4f6; padding: 12px 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7280;
  text-align: center; font-weight: 800;
}
.cal-cell {
  min-height: 120px; border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6;
  padding: 8px; background: #fff; vertical-align: top; cursor: pointer;
  transition: background .15s;
}
.cal-cell.cal-day-cell:hover { background: #f9fafb; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.cal-today-cell { box-shadow: inset 0 0 0 2px #2563eb; z-index: 1; }
.cal-date {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; font-size: 12px; font-weight: 700; color: #374151; border-radius: 999px;
  transition: transform .15s;
}
.cal-day-cell:hover .cal-date:not(.today) { transform: scale(1.08); }
.cal-date.today { background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.cal-empty { background: #fafafa; color: #d1d5db; cursor: default; }
.cal-empty:hover { background: #fafafa; }
.cal-events { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-event {
  font-size: 11px; border-radius: 999px; padding: 4px 10px; color: #fff; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border: 0;
  text-align: left; width: 100%; transition: filter .15s, transform .15s;
}
.cal-event:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cal-more {
  font-size: 11px; font-weight: 800; color: #2563eb; background: none; border: 0;
  cursor: pointer; padding: 4px 2px; text-align: left; transition: color .15s;
}
.cal-more:hover { color: #1d4ed8; text-decoration: underline; }

/* Week view */
.calendar-week-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #f3f4f6;
}
.week-col {
  border-right: 1px solid #f3f4f6; min-height: 360px; background: #fff;
  display: flex; flex-direction: column;
}
.week-col:last-child { border-right: none; }
.week-col-head {
  border-bottom: 1px solid #f3f4f6; padding: 12px 8px; text-align: center; background: #f9fafb;
}
.week-col-head p { margin: 0 0 6px; font-size: 11px; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: 0.08em; }
.week-col.cal-today-col { box-shadow: inset 0 0 0 2px #2563eb; }
.week-col-body {
  flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: background .15s; overflow-y: auto; max-height: 420px;
}
.week-col-body:hover { background: #fafafa; }
.week-col-body .cal-event { border-radius: 8px; }
.week-empty-hint { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: #d1d5db; text-align: center; }
.day-empty-icon-svg { width: 48px; height: 48px; stroke: #d1d5db; margin-bottom: 12px; }

/* Day view */
.calendar-day-grid { min-height: 480px; background: transparent; border: 0; border-radius: 0; }
.day-view-wrap {
  min-height: 440px; cursor: pointer; transition: background .15s;
}
.day-view-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; color: #9ca3af; text-align: center;
}
.day-view-empty svg { width: 48px; height: 48px; stroke: #d1d5db; margin-bottom: 12px; }
.day-view-empty p { margin: 0; font-size: 15px; font-weight: 600; color: #6b7280; }
.day-view-empty small { margin-top: 6px; font-size: 13px; color: #9ca3af; }
.day-view-wrap { width: 100%; }
.day-view-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.day-view-hint { text-align: center; font-size: 12px; color: #9ca3af; margin: 20px 0 0; }

.cal-wo-card {
  display: flex; align-items: stretch; gap: 16px; padding: 16px 20px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .2s, border-color .2s, transform .15s;
  cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
}
.cal-wo-card:hover { box-shadow: 0 4px 16px rgba(15,23,42,.08); border-color: #e5e7eb; transform: translateY(-1px); }
.cal-wo-card:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.cal-wo-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cal-wo-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: #f3f4f6; color: #4b5563;
}
.cal-wo-tag.priority-High { background: #fef2f2; color: #b91c1c; }
.cal-wo-tag.priority-Medium { background: #fff7ed; color: #c2410c; }
.cal-wo-tag.priority-Low { background: #eff6ff; color: #1d4ed8; }
.cal-wo-accent { width: 6px; border-radius: 999px; flex-shrink: 0; align-self: stretch; }
.cal-wo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cal-wo-body h4 {
  margin: 0; font-size: 15px; font-weight: 700; color: #111827;
  line-height: 1.4; word-break: break-word;
}
.cal-wo-body p { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.cal-wo-status {
  flex-shrink: 0; align-self: center; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 0;
}
.cal-wo-status.Active { color: #2563eb; }
.cal-wo-status.Completed { color: #16a34a; }
.cal-wo-status.Pending { color: #ca8a04; }
.cal-wo-status.Processing { color: #9333ea; }

/* Day events popup */
.cal-day-events-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); max-height: min(85vh, 680px);
  background: #fff; border-radius: 16px; z-index: 95;
  box-shadow: 0 24px 48px rgba(15,23,42,.2); border: 1px solid #e5e7eb;
  display: flex; flex-direction: column; overflow: hidden;
  animation: profileModalIn .2s ease-out;
}
.cal-day-events-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 24px 24px 16px; flex-shrink: 0;
}
.cal-day-events-head h3 { margin: 0; font-size: 20px; font-weight: 800; color: #111827; }
.cal-day-events-head p { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.cal-day-events-body {
  flex: 1; overflow-y: auto; padding: 8px 24px 16px;
  display: flex; flex-direction: column; gap: 10px; min-height: 100px; max-height: 420px;
}
.cal-day-events-foot {
  flex-shrink: 0; padding: 16px 24px 24px; border-top: 1px solid #f3f4f6;
}
.cal-day-events-foot .wo-btn-primary {
  width: 100%; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Work order view panel */
.wo-view-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(960px, calc(100vw - 32px)); max-height: min(92vh, 820px);
  background: #fff; border-radius: 24px; z-index: 96;
  box-shadow: 0 24px 48px rgba(15,23,42,.22); border: 1px solid #e5e7eb;
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 1;
}
#woViewOverlay { backdrop-filter: none; }
#woViewOverlay.view-overlay-enter { animation: woViewOverlayIn .14s ease-out forwards; }
#woViewOverlay.view-overlay-leave { animation: woViewOverlayOut .12s ease-in forwards; }
#woViewModal.view-modal-enter { animation: woViewModalIn .18s cubic-bezier(.2,.85,.25,1) forwards; }
#woViewModal.view-modal-leave { animation: woViewModalOut .12s ease-in forwards; }
@keyframes woViewOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes woViewOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes woViewModalIn {
  from { transform: translate(-50%, calc(-50% + 10px)) scale(.985); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes woViewModalOut {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  to { transform: translate(-50%, calc(-50% + 8px)) scale(.99); opacity: 0; }
}
.wo-view-color-bar { height: 8px; flex-shrink: 0; background: #3b82f6; }
.wo-view-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0;
}
.wo-view-kicker {
  margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: #2563eb;
}
.wo-view-head h2 {
  margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 800; color: #111827;
  line-height: 1.25; word-break: break-word;
}
.wo-view-date { margin: 6px 0 0; font-size: 15px; font-weight: 500; color: #6b7280; }
.wo-view-recurrence {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-size: 13px; font-weight: 700; color: #2563eb;
}
.wo-view-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.wo-view-status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; border: 1px solid transparent;
}
.wo-view-status-badge.Active { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.wo-view-status-badge.Pending { background: #fefce8; color: #ca8a04; border-color: #fde68a; }
.wo-view-status-badge.Processing { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.wo-view-status-badge.Completed { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.wo-view-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid #bfdbfe;
  background: #fff; color: #2563eb; cursor: pointer; transition: background .15s;
}
.wo-view-icon-btn svg { width: 18px; height: 18px; }
.wo-view-icon-btn:hover { background: #eff6ff; }
.wo-view-icon-btn.danger { border-color: #fecaca; color: #dc2626; }
.wo-view-icon-btn.danger:hover { background: #fef2f2; }
.wo-view-icon-btn.muted { border-color: #e5e7eb; color: #6b7280; }
.wo-view-icon-btn.muted:hover { background: #f3f4f6; }
.wo-view-body {
  flex: 1; overflow-y: auto; padding: 24px; min-height: 120px;
}
.wo-view-grid {
  display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 12px;
}
@media (min-width: 640px) { .wo-view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .wo-view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wo-view-card.span-2 { grid-column: span 1; }
@media (min-width: 640px) { .wo-view-card.span-2 { grid-column: span 2; } }
.wo-view-card {
  border: 1px solid #f3f4f6; border-radius: 14px; background: #fafafa;
  padding: 14px 16px; min-height: 72px;
}
.wo-view-card-label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af;
}
.wo-view-card-label svg { width: 14px; height: 14px; stroke: #9ca3af; fill: none; stroke-width: 2; }
.wo-view-card-value { margin: 0; font-size: 15px; font-weight: 600; color: #111827; line-height: 1.45; word-break: break-word; }
.wo-view-priority {
  display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
}
.wo-view-priority.None { background: #f3f4f6; color: #4b5563; }
.wo-view-priority.Low { background: #eff6ff; color: #1d4ed8; }
.wo-view-priority.Medium { background: #fff7ed; color: #c2410c; }
.wo-view-priority.High { background: #fef2f2; color: #b91c1c; }
.wo-view-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-view-cat {
  padding: 4px 10px; border-radius: 999px; background: #eff6ff; color: #1e40af;
  font-size: 12px; font-weight: 700; border: 1px solid #dbeafe;
}
.wo-view-section { margin-top: 16px; }
.wo-view-section-title {
  margin: 0 0 10px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af;
}
.wo-view-list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fff; margin-bottom: 8px;
}
.wo-view-list-item svg { width: 18px; height: 18px; stroke: #3b82f6; fill: none; stroke-width: 2; flex-shrink: 0; }
.wo-view-list-item p { margin: 0; font-size: 14px; font-weight: 600; color: #111827; flex: 1; min-width: 0; }
.wo-view-list-item small { display: block; font-size: 12px; color: #6b7280; font-weight: 500; }
.wo-view-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.wo-view-image-thumb {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    aspect-ratio: 1;
}
.wo-view-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wo-view-image-thumb img.is-broken {
    object-fit: contain;
    padding: 12px;
    opacity: 0.45;
}
.wo-view-image-thumb .wo-view-download {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.wo-view-download {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: #eff6ff;
  color: #2563eb; cursor: pointer; flex-shrink: 0;
}
.wo-view-download svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.wo-view-color-preview {
  display: flex; align-items: center; gap: 12px;
}
.wo-view-color-swatch {
  width: 40px; height: 40px; border-radius: 999px; border: 2px solid #e5e7eb; box-shadow: 0 1px 3px rgba(15,23,42,.1);
}
.wo-view-foot {
  flex-shrink: 0; padding: 16px 24px 24px; border-top: 1px solid #f3f4f6;
}
.wo-view-close-full {
  width: 100%; padding: 14px; border: 0; border-radius: 12px; background: #f3f4f6;
  color: #111827; font-size: 15px; font-weight: 800; cursor: pointer; transition: background .15s;
}
.wo-view-close-full:hover { background: #e5e7eb; }
.wo-cancel-btn {
  flex: 1; padding: 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; color: #374151; font-size: 15px; font-weight: 700; cursor: pointer;
}
.wo-drawer-footer.has-cancel { display: flex; gap: 12px; }
.wo-drawer-footer.has-cancel .wo-submit-btn { flex: 1; }

.cal-grid-loading {
  grid-column: 1 / -1; padding: 48px 24px; text-align: center; color: #9ca3af; font-weight: 700;
}

/* Tracking */
.tracking-title { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 800; color: #111827; letter-spacing: -0.02em; }
.tracking-layout {
  display: flex; flex-direction: column; gap: 16px;
  flex: 1; min-height: 0; align-items: stretch;
}
@media (min-width: 768px) { .tracking-layout { flex-direction: row; } }
.tracking-map-panel {
  position: relative; flex: 1.35; min-height: 0;
  border-radius: 16px; border: 1px solid #e5e7eb; background: #fff;
  overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  display: flex; flex-direction: column;
}
.tracking-map-canvas { position: absolute; inset: 0; }
.tracking-map-canvas iframe { width: 100%; height: 100%; border: 0; }
.live-badge {
  position: absolute; top: 16px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #f3f4f6; border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 800; color: #374151; box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; }
.tracking-employees-panel {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  border-radius: 16px; border: 1px solid #e5e7eb; background: #fff;
  padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden;
}
.tracking-employees-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-shrink: 0; }
.tracking-employees-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: #111827; }
.tracking-employees-head .btn { display: inline-flex; align-items: center; gap: 8px; }
.btn-icon-svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.tracking-muted { margin: 0 0 12px; font-size: 14px; font-weight: 500; color: #9ca3af; flex-shrink: 0; }
.tracking-employees-body {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
}
.tracking-employees-list { display: flex; flex-direction: column; gap: 10px; }
.tracking-employee-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fafafa;
}
.tracking-employee-name { margin: 0; font-size: 14px; font-weight: 700; color: #111827; }
.tracking-employee-meta { margin: 2px 0 0; font-size: 12px; color: #6b7280; font-weight: 500; }
.tracking-online-dot {
  width: 10px; height: 10px; border-radius: 999px; background: #22c55e; margin-left: auto; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}
.tracking-empty {
  flex: 1; display: grid; place-items: center; border-radius: 12px; border: 1px solid #f3f4f6;
  background: rgba(249,250,251,.5); color: #9ca3af; font-weight: 800; font-size: 16px; min-height: 120px;
}
.tracking-empty.hidden { display: none; }

@media (max-width: 640px) {
  .wo-drawer-body { padding: 16px 20px; }
  .wo-drawer-footer { padding: 12px 20px; }
  .wo-grid-2 { grid-template-columns: 1fr; }
  .wo-section { padding: 14px; }
  .wo-submitted-time-row { max-width: none; }
  .entity-grid-2 { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; }
  .wo-sub-hint { width: 100%; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%);
    transition: transform .25s ease; width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .app-main { padding-top: 64px; padding-left: 64px; }
}

@media (min-width: 1024px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; height: 100vh;
    transition: transform .3s ease;
  }
  .app-main {
    margin-left: 256px; width: calc(100% - 256px);
    padding-left: 24px;
    transition: margin-left .3s ease, width .3s ease, padding-left .3s ease;
  }
  .app-shell.sidebar-collapsed .app-main {
    margin-left: 0; width: 100%;
    padding-left: 64px;
  }
  .sidebar.collapsed { transform: translateX(-100%); }
  .sidebar-open-btn.desktop-show {
    display: inline-flex !important; align-items: center; justify-content: center;
  }
}

/* Login — reserve space for Google button before GSI renders */
.google-signin-slot {
  min-height: 44px;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Calendar page — fill viewport below toolbar */
body[data-page="calendar"] .app-main {
  display: flex; flex-direction: column; overflow-y: auto;
}
body[data-page="calendar"] .calendar-page {
  flex: 1; min-height: 0; gap: 16px; padding-bottom: 16px;
}
body[data-page="calendar"] .calendar-toolbar-card { flex-shrink: 0; margin-bottom: 0; }
body[data-page="calendar"] .calendar-grid-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  overflow: visible;
}
body[data-page="calendar"] #calendarGrid {
  flex: 1;
  min-height: 0;
}
body[data-page="calendar"] .gcal-month-grid {
  min-height: 100%;
}

/* Google Calendar–style grid */
.gcal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #dadce0;
  border-left: 1px solid #dadce0;
}
.gcal-month-head {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #70757a;
  text-align: center;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
}
.gcal-month-cell {
  min-height: 100px;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  padding: 4px 6px 6px;
  background: #fff;
  vertical-align: top;
  cursor: pointer;
  transition: background .12s;
}
.gcal-month-cell:hover { background: #f8f9fa; }
.gcal-month-cell.gcal-other { background: #fafafa; }
.gcal-month-cell.gcal-other .gcal-date-num { color: #70757a; opacity: 0.65; }
.gcal-date-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 500;
  color: #3c4043;
  border-radius: 999px;
  margin-bottom: 2px;
}
.gcal-date-num.today {
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
}
.gcal-month-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.gcal-month-event {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1px 2px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.gcal-month-event:hover { background: #f1f3f4; }
.gcal-month-timed { font-weight: 400; }
.gcal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.gcal-month-time {
  flex-shrink: 0;
  font-size: 10px;
  color: #70757a;
  font-weight: 500;
}
.gcal-month-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.gcal-month-allday {
  color: #fff;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 1px;
}
.gcal-more {
  font-size: 11px;
  font-weight: 500;
  color: #70757a;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 2px 4px;
  text-align: left;
}
.gcal-more:hover { color: #1a73e8; }

/* Week / Day time grid */
.gcal-time-grid-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gcal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.gcal-time-layout {
  display: grid;
  grid-template-columns: 56px repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  grid-template-rows: auto auto 1fr;
  min-width: 640px;
}
.gcal-corner {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
  min-height: 56px;
}
.gcal-day-headers {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  border-bottom: 1px solid #dadce0;
}
.gcal-day-head {
  padding: 8px 4px 10px;
  text-align: center;
  border-right: 1px solid #dadce0;
  background: #fff;
}
.gcal-day-head:last-child { border-right: none; }
.gcal-dow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #70757a;
  text-transform: uppercase;
}
.gcal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 400;
  color: #3c4043;
  border-radius: 999px;
}
.gcal-day-num.today,
.gcal-day-head.today .gcal-day-num {
  background: #1a73e8;
  color: #fff;
}
.gcal-allday-label {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  font-size: 10px;
  color: #70757a;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
}
.gcal-allday-row {
  grid-column: 2 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  border-bottom: 1px solid #dadce0;
  min-height: 28px;
}
.gcal-allday-col {
  border-right: 1px solid #dadce0;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  min-height: 28px;
}
.gcal-allday-col:last-child { border-right: none; }
.gcal-allday-pill {
  border: 0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcal-time-axis {
  grid-column: 1;
  grid-row: 3;
  border-right: 1px solid #dadce0;
  background: #fff;
}
.gcal-time-label {
  position: relative;
  font-size: 10px;
  color: #70757a;
  box-sizing: border-box;
}
.gcal-time-label span {
  position: absolute;
  top: -6px;
  right: 8px;
  white-space: nowrap;
}
.gcal-days-grid {
  grid-column: 2 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  position: relative;
}
.gcal-day-col {
  position: relative;
  border-right: 1px solid #dadce0;
  cursor: pointer;
  overflow: hidden;
}
.gcal-day-col:last-child { border-right: none; }
.gcal-hour-grid { position: absolute; inset: 0; pointer-events: none; }
.gcal-hour-row { border-bottom: 1px solid #dadce0; box-sizing: border-box; }
.gcal-events-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gcal-timed-event {
  position: absolute;
  border: 0;
  border-left: 4px solid;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.3;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  pointer-events: auto;
  box-shadow: 0 1px 2px rgba(60,64,67,.15);
  z-index: 1;
}
.gcal-timed-event:hover { filter: brightness(1.05); z-index: 2; }
.gcal-event-title {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcal-event-time {
  display: block;
  font-size: 10px;
  opacity: 0.92;
}
.gcal-day-view .gcal-time-layout { min-width: 480px; }
.gcal-week-view .gcal-scroll { max-height: calc(100vh - 220px); }
.gcal-day-view .gcal-scroll { max-height: calc(100vh - 220px); }
.cal-grid-loading {
  padding: 48px 24px;
  text-align: center;
  color: #70757a;
  font-size: 14px;
}

/* Reminiss-style draggable dashboard */
.dashboard-page {
  gap: 20px;
  background: #f5f7fb;
  border-radius: 16px;
  padding: 4px 0 8px;
}

.dash-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 0;
}
.dash-topbar-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.dash-topbar-title span {
  background: linear-gradient(90deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-topbar-date {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}
.dash-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dash-reset-btn {
  border: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.28);
  transition: filter .15s, transform .15s;
}
.dash-reset-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.dash-drag-hint {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
}

.dashboard-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.dash-widget {
  position: relative;
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.dash-widget.is-dragging {
  opacity: .72;
  transform: scale(.985);
  z-index: 20;
  box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
}

.dash-span-3 { grid-column: span 12; }
.dash-span-4 { grid-column: span 12; }
.dash-span-6 { grid-column: span 12; }
@media (min-width: 640px) {
  .dash-span-3 { grid-column: span 6; }
  .dash-span-4 { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .dash-span-3 { grid-column: span 3; }
  .dash-span-4 { grid-column: span 4; }
  .dash-span-6 { grid-column: span 6; }
}

.dash-widget-drag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  color: rgba(255,255,255,.95);
  display: grid;
  place-items: center;
  cursor: grab;
  padding: 0;
  transition: background .15s;
  touch-action: none;
  user-select: none;
}
.dash-panel .dash-widget-drag {
  position: static;
  background: #ede9fe;
  color: #7c3aed;
  flex-shrink: 0;
}
.dash-widget-drag:hover { background: rgba(255,255,255,.32); }
.dash-panel .dash-widget-drag:hover {
  background: #ddd6fe;
}
.dash-widget-drag:active { cursor: grabbing; }
.dash-widget-drag svg { width: 16px; height: 16px; }

.dash-kpi-card {
  position: relative;
  border-radius: 16px;
  padding: 22px 20px 18px;
  min-height: 148px;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  overflow: hidden;
}
.dash-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 58%);
  pointer-events: none;
}
.dash-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.dash-kpi-icon-svg { width: 20px; height: 20px; display: block; }
.dash-kpi-value {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.dash-kpi-label {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  opacity: .95;
}
.dash-kpi-trend {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 600;
  opacity: .82;
}
.dash-kpi-card.is-loading .dash-kpi-load-bar {
  display: block;
  width: 72px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  animation: dash-kpi-pulse 1.3s ease-in-out infinite;
}
.dash-kpi-card.is-loading .dash-kpi-load-line {
  display: block;
  width: 128px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  animation: dash-kpi-pulse 1.3s ease-in-out infinite .15s;
}
.dash-kpi-value-ready,
.dash-kpi-trend-ready {
  animation: dash-kpi-fade-in .35s ease;
}
@keyframes dash-kpi-pulse {
  0%, 100% { opacity: .42; transform: scale(.98); }
  50% { opacity: .88; transform: scale(1); }
}
@keyframes dash-kpi-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-panel {
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}
.dash-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}
.dash-panel-head p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.dash-panel-body {
  flex: 1;
  padding: 16px 20px 20px;
  min-height: 180px;
}
.dash-panel-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: #9ca3af;
}

.dash-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  min-height: 200px;
  padding-top: 8px;
}
.dash-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dash-bar-track {
  width: 100%;
  max-width: 48px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dash-bar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
  transition: height .3s ease;
}
.dash-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
}
.dash-bar-value {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.dash-donut-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 200px;
}
.dash-donut {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
}
.dash-donut::before {
  content: "";
  position: absolute;
  inset: 22px;
  background: #fff;
  border-radius: 999px;
}
.dash-donut span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}
.dash-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.dash-donut-legend strong { margin-left: auto; color: #111827; }
.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dash-table-wrap { overflow-x: auto; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}
.dash-table td {
  padding: 12px;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
  font-weight: 500;
}
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table-row { position: relative; }
.dash-table-accent-cell {
  position: relative;
  padding-left: 16px !important;
}
.dash-row-accent {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
}
.dash-table-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-table-link {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}
.dash-table-link:hover {
  color: #7c3aed;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.dash-empty {
  margin: 0;
  padding: 48px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
}

@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #eceff3 20%, #f3f4f6 40%, #f3f4f6 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  z-index: 110;
}
.app-confirm-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 111;
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  padding: 28px 24px 22px;
  text-align: center;
}
.app-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(102,126,234,.14), rgba(118,75,162,.1));
  color: #667eea;
}
.app-confirm-icon.is-danger {
  background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(220,38,38,.08));
  color: #dc2626;
}
.app-confirm-icon svg { width: 26px; height: 26px; }
.app-confirm-dialog h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.app-confirm-dialog p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #6b7280;
  font-weight: 500;
}
.app-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.app-confirm-btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
.app-confirm-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.app-confirm-cancel {
  background: #f3f4f6;
  color: #374151;
}
.app-confirm-ok {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.28);
}
.app-confirm-ok.is-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.dash-skeleton-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  min-height: 200px;
  padding-top: 8px;
}
.dash-skeleton-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.skeleton-bar {
  width: 100%;
  max-width: 48px;
  height: 120px;
}
.skeleton-bar-label {
  width: 36px;
  height: 10px;
}

.dash-skeleton-donut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 200px;
}
.skeleton-donut {
  width: 140px;
  height: 140px;
  border-radius: 999px;
}
.dash-skeleton-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
}
.skeleton-legend-row {
  width: 100%;
  height: 14px;
}

.dash-skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.skeleton-table-row {
  width: 100%;
  height: 42px;
}
