@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
  --ops-sidebar-bg:     #0d1520;
  --ops-sidebar-width:  240px;
  --ops-amber:          #f59e0b;
  --ops-amber-light:    #fef3c7;
  --ops-amber-dark:     #d97706;
  --ops-blue:           #1a56e8;
  --ops-blue-light:     #eff6ff;
  --ops-green:          #10b981;
  --ops-green-light:    #d1fae5;
  --ops-red:            #ef4444;
  --ops-red-light:      #fee2e2;
  --ops-purple:         #7c3aed;
  --ops-purple-light:   #ede9fe;
  --ops-orange:         #f97316;
  --ops-orange-light:   #ffedd5;
  --ops-bg:             #f0f2f5;
  --ops-surface:        #ffffff;
  --ops-border:         #e5e7eb;
  --ops-text:           #0f172a;
  --ops-text-2:         #4b5563;
  --ops-text-3:         #9ca3af;
  --ops-radius:         10px;
  --ops-radius-sm:      6px;
  --ops-shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --ops-shadow-lg:      0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --ops-font:           'DM Sans', system-ui, sans-serif;
  --ops-font-display:   'Sora', system-ui, sans-serif;
  --ops-font-mono:      'DM Mono', monospace;
  --ops-transition:     180ms cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════════════════
   PORTAL SHELL
═══════════════════════════════════════════════════════════ */
.tw-ops-portal * { box-sizing: border-box; margin: 0; padding: 0; }
.tw-ops-portal {
  font-family: var(--ops-font);
  font-size: 14px;
  color: var(--ops-text);
  line-height: 1.5;
  min-height: 500px;
  height: 100%;
  background: var(--ops-bg);
  border-radius: var(--ops-radius);
  overflow: hidden;
  display: flex;
  box-shadow: var(--ops-shadow-lg);
  position: relative;
}

/* Fullscreen mode */
.tw-ops-portal.tw-ops-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  min-height: 100vh !important;
  height: 100vh !important;
  width: 100vw !important;
}
.tw-ops-portal.tw-ops-fullscreen:fullscreen {
  background: var(--ops-bg);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.tw-ops-sidebar {
  width: var(--ops-sidebar-width);
  min-width: var(--ops-sidebar-width);
  background: var(--ops-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  z-index: 10;
}
.tw-ops-sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,.06);
}

.tw-ops-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tw-ops-logo-mark {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.tw-ops-logo-icon {
  width: 32px; height: 32px;
  background: var(--ops-amber);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tw-ops-logo-text {
  display: flex; flex-direction: column;
}
.tw-ops-logo-name {
  font-family: var(--ops-font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.tw-ops-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 500;
}

.tw-ops-district-selector {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tw-ops-district-selector label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.35);
  display: block;
  margin-bottom: 6px;
}
.tw-ops-district-selector select {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--ops-radius-sm);
  color: rgba(255,255,255,.85);
  font-family: var(--ops-font);
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color var(--ops-transition);
}
.tw-ops-district-selector select:hover { border-color: rgba(255,255,255,.2); }
.tw-ops-district-selector select:focus { outline: none; border-color: var(--ops-amber); }
.tw-ops-district-selector select option {
  background: #1e293b;
  color: #fff;
}

.tw-ops-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.tw-ops-nav-section {
  margin-bottom: 6px;
}
.tw-ops-nav-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.25);
  padding: 8px 10px 4px;
}
.tw-ops-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--ops-radius-sm);
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--ops-transition);
  position: relative;
  user-select: none;
}
.tw-ops-nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.tw-ops-nav-item.active {
  background: rgba(245,158,11,.15);
  color: var(--ops-amber);
}
.tw-ops-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--ops-amber);
  border-radius: 0 3px 3px 0;
}
.tw-ops-nav-icon { font-size: 15px; width: 20px; text-align: center; }
.tw-ops-nav-badge {
  margin-left: auto;
  background: var(--ops-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}

.tw-ops-user-bar {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}
.tw-ops-avatar {
  width: 32px; height: 32px;
  background: rgba(245,158,11,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ops-amber);
  flex-shrink: 0;
  overflow: hidden;
}
.tw-ops-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tw-ops-user-info { flex: 1; min-width: 0; }
.tw-ops-user-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tw-ops-user-role {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-transform: capitalize;
}
.tw-ops-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 14px;
  transition: color var(--ops-transition);
}
.tw-ops-logout-btn:hover { color: rgba(255,255,255,.7); }

/* ── Main content ──────────────────────────────────────────── */
.tw-ops-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tw-ops-topbar {
  background: var(--ops-surface);
  border-bottom: 1px solid var(--ops-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.tw-ops-topbar-title {
  font-family: var(--ops-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ops-text);
  flex: 1;
}
.tw-ops-topbar-search {
  display: flex;
  align-items: center;
  background: var(--ops-bg);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  width: 220px;
}
.tw-ops-topbar-search input {
  border: none;
  background: none;
  font-family: var(--ops-font);
  font-size: 13px;
  padding: 7px 0;
  outline: none;
  width: 100%;
  color: var(--ops-text);
}
.tw-ops-topbar-search input::placeholder { color: var(--ops-text-3); }
.tw-ops-topbar-search-icon { color: var(--ops-text-3); font-size: 14px; }

/* Fullscreen toggle button in topbar */
.tw-ops-fullscreen-btn {
  background: none;
  border: 1px solid var(--ops-border);
  border-radius: 7px;
  color: var(--ops-text-2);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.tw-ops-fullscreen-btn:hover {
  background: var(--ops-bg);
  color: var(--ops-text);
}
.tw-ops-portal.tw-ops-fullscreen .tw-ops-topbar {
  background: var(--ops-sidebar-bg);
  border-bottom-color: rgba(255,255,255,.08);
}
.tw-ops-portal.tw-ops-fullscreen .tw-ops-topbar-title {
  color: #f1f5f9;
}
.tw-ops-portal.tw-ops-fullscreen .tw-ops-sidebar-toggle {
  color: #cbd5e1;
}
.tw-ops-portal.tw-ops-fullscreen .tw-ops-fullscreen-btn {
  border-color: rgba(255,255,255,.25);
  color: #f1f5f9;
  background: rgba(255,255,255,.08);
  font-size: 13px;
  width: auto;
  padding: 0 10px;
  gap: 5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.tw-ops-portal.tw-ops-fullscreen .tw-ops-fullscreen-btn:hover {
  background: rgba(255,255,255,.16);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

.tw-ops-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.tw-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--ops-radius-sm);
  font-family: var(--ops-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--ops-transition);
  white-space: nowrap;
  text-decoration: none;
}
.tw-btn:disabled { opacity: .5; cursor: not-allowed; }
.tw-btn-primary { background: var(--ops-amber); color: #fff; }
.tw-btn-primary:hover:not(:disabled) { background: var(--ops-amber-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,.35); }
.tw-btn-secondary { background: var(--ops-bg); color: var(--ops-text-2); border: 1px solid var(--ops-border); }
.tw-btn-secondary:hover:not(:disabled) { background: var(--ops-border); color: var(--ops-text); }
.tw-btn-blue { background: var(--ops-blue); color: #fff; }
.tw-btn-blue:hover:not(:disabled) { background: #1447d4; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,232,.3); }
.tw-btn-danger { background: var(--ops-red-light); color: var(--ops-red); }
.tw-btn-danger:hover:not(:disabled) { background: var(--ops-red); color: #fff; }
.tw-btn-ghost { background: transparent; color: var(--ops-text-2); }
.tw-btn-ghost:hover:not(:disabled) { background: var(--ops-bg); }
.tw-btn-sm { padding: 5px 10px; font-size: 12px; }
.tw-btn-icon { padding: 7px; }

/* ═══════════════════════════════════════════════════════════
   CARDS & STATS
═══════════════════════════════════════════════════════════ */
.tw-ops-card {
  background: var(--ops-surface);
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-border);
  box-shadow: var(--ops-shadow);
}
.tw-ops-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ops-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tw-ops-card-title {
  font-family: var(--ops-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ops-text);
}
.tw-ops-card-body { padding: 20px; }

.tw-ops-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.tw-ops-stat-card {
  background: var(--ops-surface);
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-border);
  padding: 18px 20px;
  box-shadow: var(--ops-shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--ops-transition), box-shadow var(--ops-transition);
}
.tw-ops-stat-card:hover { transform: translateY(-2px); box-shadow: var(--ops-shadow-lg); }
.tw-ops-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--ops-radius) var(--ops-radius) 0 0;
}
.tw-ops-stat-card.amber::before { background: var(--ops-amber); }
.tw-ops-stat-card.blue::before  { background: var(--ops-blue); }
.tw-ops-stat-card.green::before { background: var(--ops-green); }
.tw-ops-stat-card.red::before   { background: var(--ops-red); }
.tw-ops-stat-card.purple::before{ background: var(--ops-purple); }
.tw-ops-stat-icon {
  font-size: 22px;
  margin-bottom: 10px;
  display: block;
}
.tw-ops-stat-value {
  font-family: var(--ops-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ops-text);
  line-height: 1;
  margin-bottom: 4px;
}
.tw-ops-stat-label {
  font-size: 12px;
  color: var(--ops-text-3);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.tw-ops-table-wrap {
  overflow-x: auto;
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-border);
  box-shadow: var(--ops-shadow);
  background: var(--ops-surface);
}
.tw-ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tw-ops-table thead tr {
  background: #f8f9fb;
  border-bottom: 2px solid var(--ops-border);
}
.tw-ops-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ops-text-3);
  white-space: nowrap;
}
.tw-ops-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  color: var(--ops-text-2);
}
.tw-ops-table tr:last-child td { border-bottom: none; }
.tw-ops-table tbody tr { transition: background var(--ops-transition); }
.tw-ops-table tbody tr:hover { background: #fafafa; }
.tw-ops-table td.bold { font-weight: 600; color: var(--ops-text); }

.tw-ops-table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--ops-surface);
  border-radius: var(--ops-radius) var(--ops-radius) 0 0;
  border: 1px solid var(--ops-border);
  border-bottom: none;
  flex-wrap: wrap;
}
.tw-ops-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.tw-ops-toolbar-actions { display: flex; gap: 8px; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.tw-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tw-badge-amber  { background: var(--ops-amber-light); color: #92400e; }
.tw-badge-green  { background: var(--ops-green-light); color: #065f46; }
.tw-badge-red    { background: var(--ops-red-light);   color: #991b1b; }
.tw-badge-blue   { background: var(--ops-blue-light);  color: #1e40af; }
.tw-badge-purple { background: var(--ops-purple-light);color: #5b21b6; }
.tw-badge-gray   { background: #f3f4f6; color: #6b7280; }
.tw-badge-orange { background: var(--ops-orange-light);color: #c2410c; }

.tw-priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.tw-priority-low    { background: #9ca3af; }
.tw-priority-normal { background: var(--ops-blue); }
.tw-priority-high   { background: var(--ops-orange); }
.tw-priority-urgent { background: var(--ops-red); }

/* ═══════════════════════════════════════════════════════════
   FORMS & INPUTS
═══════════════════════════════════════════════════════════ */
.tw-ops-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tw-ops-form-grid.cols-1 { grid-template-columns: 1fr; }
.tw-ops-form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.tw-ops-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tw-ops-field.span-2 { grid-column: 1 / -1; }
.tw-ops-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ops-text-2);
}
.tw-ops-label .req { color: var(--ops-red); margin-left: 2px; }
.tw-ops-input,
.tw-ops-select,
.tw-ops-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--ops-border);
  border-radius: var(--ops-radius-sm);
  font-family: var(--ops-font);
  font-size: 13px;
  color: var(--ops-text);
  background: var(--ops-surface);
  transition: border-color var(--ops-transition), box-shadow var(--ops-transition);
  outline: none;
}
.tw-ops-input:focus,
.tw-ops-select:focus,
.tw-ops-textarea:focus {
  border-color: var(--ops-amber);
  box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}
.tw-ops-input::placeholder { color: var(--ops-text-3); }
.tw-ops-textarea { resize: vertical; min-height: 80px; }
.tw-ops-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.tw-ops-select option,
.tw-ops-input option {
  background: var(--ops-surface);
  color: var(--ops-text);
}

/* ═══════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════ */
.tw-ops-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,21,32,.7);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  cursor: default;
}
.tw-ops-modal {
  background: var(--ops-surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  width: 100%;
  max-width: 600px;
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.tw-ops-modal-lg { max-width: 780px; }
.tw-ops-modal-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--ops-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tw-ops-modal-title {
  font-family: var(--ops-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ops-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tw-ops-modal-header-extra {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.tw-ops-modal-close {
  background: var(--ops-bg);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--ops-text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ops-transition);
}
.tw-ops-modal-close:hover { background: var(--ops-red-light); color: var(--ops-red); }
.tw-ops-modal-body { padding: 20px 24px; }
.tw-ops-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--ops-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tw-ops-modal-footer:empty {
  display: none;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   KANBAN (Tasks)
═══════════════════════════════════════════════════════════ */
.tw-ops-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
.tw-ops-kanban-col {
  background: var(--ops-bg);
  border-radius: var(--ops-radius);
  overflow: hidden;
  border: 1px solid var(--ops-border);
}
.tw-ops-kanban-col-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ops-border);
  background: var(--ops-surface);
}
.tw-ops-kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tw-ops-kanban-col.pending .tw-ops-kanban-col-title   { color: var(--ops-text-3); }
.tw-ops-kanban-col.in_progress .tw-ops-kanban-col-title{ color: var(--ops-blue); }
.tw-ops-kanban-col.blocked .tw-ops-kanban-col-title   { color: var(--ops-red); }
.tw-ops-kanban-col.completed .tw-ops-kanban-col-title { color: var(--ops-green); }
.tw-ops-kanban-count {
  background: var(--ops-bg);
  border-radius: 100px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ops-text-3);
}
.tw-ops-kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.tw-ops-kanban-card {
  background: var(--ops-surface);
  border-radius: var(--ops-radius-sm);
  border: 1px solid var(--ops-border);
  padding: 12px 13px;
  cursor: pointer;
  transition: all var(--ops-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.tw-ops-kanban-card:hover { transform: translateY(-2px); box-shadow: var(--ops-shadow); border-color: var(--ops-amber); }
.tw-ops-kanban-card-title { font-size: 13px; font-weight: 600; color: var(--ops-text); margin-bottom: 8px; }
.tw-ops-kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   MESSAGES / CHAT
═══════════════════════════════════════════════════════════ */
.tw-ops-chat {
  display: flex;
  flex-direction: column;
  height: 560px;
  background: var(--ops-surface);
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-border);
  box-shadow: var(--ops-shadow);
  overflow: hidden;
}
.tw-ops-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #f8f9fb 0%, #fff 100%);
}
.tw-ops-chat-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 72%;
}
.tw-ops-chat-bubble.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.tw-ops-chat-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ops-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ops-text-3);
  flex-shrink: 0;
  border: 1px solid var(--ops-border);
}
.tw-ops-chat-body { display: flex; flex-direction: column; gap: 4px; }
.tw-ops-chat-sender { font-size: 11px; font-weight: 600; color: var(--ops-text-3); }
.tw-ops-chat-bubble.mine .tw-ops-chat-sender { text-align: right; }
.tw-ops-chat-text {
  background: var(--ops-bg);
  border: 1px solid var(--ops-border);
  border-radius: 0 12px 12px 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ops-text);
}
.tw-ops-chat-bubble.mine .tw-ops-chat-text {
  background: var(--ops-sidebar-bg);
  color: rgba(255,255,255,.9);
  border-color: transparent;
  border-radius: 12px 0 12px 12px;
}
.tw-ops-chat-time { font-size: 10px; color: var(--ops-text-3); }
.tw-ops-chat-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--ops-amber-light);
  color: #92400e;
  align-self: flex-start;
}
.tw-ops-chat-compose {
  padding: 14px 16px;
  border-top: 1px solid var(--ops-border);
  background: var(--ops-surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tw-ops-chat-compose textarea {
  flex: 1;
  border: 1.5px solid var(--ops-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--ops-font);
  font-size: 13px;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color var(--ops-transition);
}
.tw-ops-chat-compose textarea:focus { border-color: var(--ops-amber); }
.tw-ops-chat-type-select {
  width: 110px;
  padding: 9px 10px;
  border: 1.5px solid var(--ops-border);
  border-radius: 8px;
  font-family: var(--ops-font);
  font-size: 12px;
  outline: none;
  background: var(--ops-bg);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   INSPECTION CONDUCT
═══════════════════════════════════════════════════════════ */
.tw-ops-checklist-items { display: flex; flex-direction: column; gap: 8px; }
.tw-ops-check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ops-surface);
  border: 1.5px solid var(--ops-border);
  border-radius: var(--ops-radius-sm);
  transition: border-color var(--ops-transition);
}
.tw-ops-check-item:hover { border-color: #d1d5db; }
.tw-ops-check-item-text { flex: 1; font-size: 13px; font-weight: 500; color: var(--ops-text); line-height: 1.4; }
.tw-ops-check-item-text small { display: block; color: var(--ops-text-3); font-weight: 400; font-size: 11px; margin-top: 2px; }
.tw-ops-check-response {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.tw-ops-response-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--ops-border);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ops-transition);
  background: none;
  font-family: var(--ops-font);
}
.tw-ops-response-btn[data-val="pass"] { color: var(--ops-green); }
.tw-ops-response-btn[data-val="pass"].active { background: var(--ops-green); border-color: var(--ops-green); color: #fff; }
.tw-ops-response-btn[data-val="fail"] { color: var(--ops-red); }
.tw-ops-response-btn[data-val="fail"].active { background: var(--ops-red); border-color: var(--ops-red); color: #fff; }
.tw-ops-response-btn[data-val="na"]   { color: var(--ops-text-3); }
.tw-ops-response-btn[data-val="na"].active { background: #9ca3af; border-color: #9ca3af; color: #fff; }

/* ── NEW: Color-coded answer buttons (v2) ── */
.tw-ops-check-response-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.tw-ops-response-btn-v2 {
  padding: 6px 14px;
  border-radius: 7px;
  border: 1.5px solid #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  font-family: var(--ops-font);
  color: var(--rcol, #374151);
  white-space: nowrap;
}
.tw-ops-response-btn-v2:hover { border-color: var(--rcol, #9ca3af); background: var(--rbg, #f9fafb); }
.tw-ops-response-btn-v2.active {
  background: var(--rbg, #f3f4f6);
  border-color: var(--rcol, #9ca3af);
  color: var(--rcol, #374151);
  box-shadow: inset 0 0 0 1px var(--rcol, #9ca3af);
}

/* ── Photo upload ── */
.tw-ops-photo-upload-wrap { display: block; }
.tw-ops-photo-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px dashed #d1d5db;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ops-text-3);
  transition: all .15s;
  background: #fafafa;
}
.tw-ops-photo-btn:hover { border-color: var(--ops-amber); color: var(--ops-amber); background: rgba(245,158,11,.04); }
.tw-ops-photo-preview {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
}
.tw-ops-photo-remove {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   REPORTS / CHARTS
═══════════════════════════════════════════════════════════ */
.tw-ops-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tw-ops-district-report-card {
  background: var(--ops-surface);
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-border);
  box-shadow: var(--ops-shadow);
  padding: 18px 20px;
  transition: transform var(--ops-transition), box-shadow var(--ops-transition);
}
.tw-ops-district-report-card:hover { transform: translateY(-2px); box-shadow: var(--ops-shadow-lg); }
.tw-ops-report-name {
  font-family: var(--ops-font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ops-text);
}
.tw-ops-report-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
}
.tw-ops-report-stat-row:last-child { border-bottom: none; }
.tw-ops-report-stat-label { color: var(--ops-text-3); }
.tw-ops-report-stat-val { font-weight: 700; color: var(--ops-text); }

/* ═══════════════════════════════════════════════════════════
   AUTH / LOGIN
═══════════════════════════════════════════════════════════ */
.tw-ops-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  background: linear-gradient(135deg, var(--ops-sidebar-bg) 0%, #1a2842 100%);
  padding: 40px 20px;
  border-radius: var(--ops-radius);
}
.tw-ops-auth-card {
  background: var(--ops-surface);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
  text-align: center;
}
.tw-ops-auth-logo {
  width: 56px; height: 56px;
  background: var(--ops-amber);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 20px;
}
.tw-ops-auth-title {
  font-family: var(--ops-font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ops-text);
  margin-bottom: 6px;
}
.tw-ops-auth-sub { font-size: 13px; color: var(--ops-text-3); margin-bottom: 28px; }
.tw-ops-auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.tw-ops-auth-error {
  background: var(--ops-red-light);
  color: var(--ops-red);
  border-radius: var(--ops-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   STATES
═══════════════════════════════════════════════════════════ */
.tw-ops-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
  color: var(--ops-text-3);
}
.tw-ops-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--ops-border);
  border-top-color: var(--ops-amber);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tw-ops-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--ops-text-3);
}
.tw-ops-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.tw-ops-empty-title { font-size: 15px; font-weight: 600; color: var(--ops-text-2); margin-bottom: 6px; }
.tw-ops-empty-sub   { font-size: 13px; margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.tw-ops-toast {
  position: absolute;
  bottom: 20px; right: 20px;
  background: var(--ops-text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 200;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
}
.tw-ops-toast.success { background: var(--ops-green); }
.tw-ops-toast.error   { background: var(--ops-red); }
.tw-ops-toast.warning { background: var(--ops-orange); }
@keyframes toastIn { from { opacity:0; transform:translateY(12px) scale(.95); } to { opacity:1; transform:translateY(0) scale(1); } }

/* ═══════════════════════════════════════════════════════════
   ACTIVITY FEED
═══════════════════════════════════════════════════════════ */
.tw-ops-activity-list { display: flex; flex-direction: column; gap: 1px; }
.tw-ops-activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  transition: background var(--ops-transition);
}
.tw-ops-activity-item:hover { background: #fafafa; }
.tw-ops-activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--ops-amber);
}
.tw-ops-activity-text { flex: 1; font-size: 13px; color: var(--ops-text-2); }
.tw-ops-activity-text strong { color: var(--ops-text); font-weight: 600; }
.tw-ops-activity-time { font-size: 11px; color: var(--ops-text-3); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════════════ */
.tw-ops-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.tw-ops-section-title {
  font-family: var(--ops-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ops-text);
}
.tw-ops-section-sub {
  font-size: 13px;
  color: var(--ops-text-3);
  margin-top: 2px;
}

/* ── Detail rows ── */
.tw-ops-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.tw-ops-detail-item label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ops-text-3); display: block; margin-bottom: 4px; }
.tw-ops-detail-item span { font-size: 13px; font-weight: 500; color: var(--ops-text); }

/* ── Progress bar ── */
.tw-ops-progress { height: 6px; background: var(--ops-bg); border-radius: 100px; overflow: hidden; }
.tw-ops-progress-fill { height: 100%; background: var(--ops-green); border-radius: 100px; transition: width .4s ease; }
.tw-ops-progress-fill.warn { background: var(--ops-amber); }
.tw-ops-progress-fill.danger { background: var(--ops-red); }

/* ── Pill filter ── */
.tw-ops-pill-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.tw-ops-pill {
  padding: 5px 13px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--ops-border);
  background: var(--ops-surface);
  color: var(--ops-text-3);
  transition: all var(--ops-transition);
}
.tw-ops-pill:hover { border-color: var(--ops-amber); color: var(--ops-amber); }
.tw-ops-pill.active { background: var(--ops-amber); border-color: var(--ops-amber); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   MOBILE SIDEBAR TOGGLE
═══════════════════════════════════════════════════════════ */
.tw-ops-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ops-text-2);
  padding: 4px;
}

@media (max-width: 768px) {
  .tw-ops-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
    height: 100%;
  }
  .tw-ops-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .tw-ops-sidebar-toggle { display: block; }
  .tw-ops-kanban { grid-template-columns: 1fr 1fr; }
  .tw-ops-form-grid { grid-template-columns: 1fr; }
  .tw-ops-form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .tw-ops-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tw-ops-content { padding: 16px; }
}
@media (max-width: 480px) {
  .tw-ops-kanban { grid-template-columns: 1fr; }
  .tw-ops-form-grid.cols-3 { grid-template-columns: 1fr; }
  .tw-ops-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   INSPECTION CONDUCT — SCREENSHOT-MATCH DESIGN
   Mobile-first, stacked full-width answer buttons
═══════════════════════════════════════════════════════════════ */

/* Outer wrapper gets a gray background like the app screenshot */
.insp-conduct-wrap {
  background: #f0f2f5;
  border-radius: 0; margin: -20px -20px 0;
  padding: 14px 12px 80px; /* bottom pad for sticky footer */
  min-height: 100%;
}

/* Progress card at top */
.insp-progress-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.insp-progress-label { font-size: 14px; font-weight: 500; color: #374151; }
.insp-progress-pill {
  background: #f3f4f6; border-radius: 100px;
  padding: 5px 14px; font-size: 13px; font-weight: 700; color: #374151;
}
/* hide bar - pill only like screenshot */
.insp-progress-bar-wrap { display: none; }
.insp-progress-bar-fill { display: none; }

/* Grade bar (optional, compact) */
.insp-grade-bar {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px; padding: 10px 16px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.insp-grade-label { font-size: 12px; font-weight: 700; color: var(--ops-text-2); white-space: nowrap; min-width: 60px; }
.insp-grade-track { flex: 1; height: 7px; background: #e5e7eb; border-radius: 100px; overflow: hidden; }
.insp-grade-fill  { height: 100%; border-radius: 100px; transition: width .4s, background .3s; background: #10b981; }
.insp-grade-pct   { font-size: 13px; font-weight: 700; color: var(--ops-text); min-width: 44px; text-align: right; }

/* Sections wrap */
.insp-sections-wrap { display: flex; flex-direction: column; gap: 10px; }

/* Section card */
.insp-section { border-radius: 12px; overflow: hidden; background: #fff; }

/* Section header — solid blue, matches screenshot exactly */
.insp-section-header {
  display: flex; align-items: center; gap: 10px;
  background: #1a56db; padding: 13px 16px;
  cursor: pointer; user-select: none;
  transition: background .12s;
}
.insp-section-header:hover { background: #1648c0; }
.insp-section-title { flex: 1; font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .01em; }
.insp-section-score { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85); }
.insp-section-count {
  color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; margin-right: 4px;
}
.insp-section-chevron { font-size: 13px; color: rgba(255,255,255,.8); transition: transform .2s; }
.insp-section-header.collapsed .insp-section-chevron { transform: rotate(-90deg); }

/* Section body — gray bg between section header and item cards */
.insp-section-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #f0f2f5; }

/* Area gate */
.insp-area-gate { display: flex; flex-direction: column; gap: 8px; }
.insp-area-question {
  font-size: 14px; font-weight: 500; color: #111827; padding: 12px 0 4px;
  line-height: 1.5;
}
.insp-area-btns { display: flex; flex-direction: column; gap: 8px; }
.insp-area-btn {
  width: 100%; padding: 13px 16px; border-radius: 8px;
  border: 2px solid #e5e7eb; background: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: var(--ops-font);
  color: var(--ac, #374151); text-align: center; transition: all .13s;
}
.insp-area-btn:hover  { background: #f9fafb; border-color: var(--ac, #9ca3af); }
.insp-area-btn.active { background: color-mix(in srgb, var(--ac,#9ca3af) 12%, white); border-color: var(--ac,#9ca3af); }
.insp-area-no { color: #ef4444; }
.insp-area-no:hover, .insp-area-no.active { border-color: #ef4444; background: #fff5f5; }

/* ── ITEM CARD ──────────────────────────────────────────────── */
.insp-item {
  background: #fff; border-radius: 12px;
  overflow: hidden; position: relative;
}

/* Question text — large, top of card */
.insp-item-text {
  padding: 16px 16px 12px;
  font-size: 15px; font-weight: 400; color: #111827; line-height: 1.55;
}
.insp-item-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.insp-cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px; border: 1px solid;
  font-size: 10px; font-weight: 600;
}
.insp-cat-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.insp-photo-badge { font-size: 10px; font-weight: 600; color: #f59e0b; background: #fffbeb; border: 1px solid #fde68a; padding: 2px 7px; border-radius: 100px; }

/* Answer button group — full width stacked vertical */
.insp-item-right { padding: 0 14px 2px; }
.insp-ans-group  { display: flex; flex-direction: column; gap: 8px; }

/* Answer button — outlined, color text; filled on active */
.insp-ans-btn {
  width: 100%; padding: 13px 16px;
  border-radius: 8px; border: 2px solid var(--ab, #e5e7eb);
  font-size: 14px; font-weight: 700; font-family: var(--ops-font);
  cursor: pointer; background: #fff; transition: all .13s;
  color: var(--ac, #374151); text-align: center;
  display: block;
}
.insp-ans-btn:hover {
  background: color-mix(in srgb, var(--ac, #9ca3af) 7%, white);
}
/* Active = filled solid color with white text */
.insp-ans-btn.active {
  background: var(--ac, #9ca3af);
  border-color: var(--ac, #9ca3af);
  color: #fff;
}

/* NA-only row for 5-choice expectations items */
.insp-na-only-btn {
  width: 100%; padding: 10px 16px; margin-top: 4px;
  border-radius: 8px; border: 1.5px dashed #d1d5db;
  font-size: 12px; font-weight: 600; font-family: var(--ops-font);
  cursor: pointer; background: #f9fafb; color: #9ca3af;
  text-align: center; transition: all .13s; display: block;
}
.insp-na-only-btn.active { background: #e5e7eb; border-style: solid; border-color: #9ca3af; color: #374151; }

/* Flat items (no sections) */
.insp-flat-items { display: flex; flex-direction: column; gap: 8px; }

/* ── Note/Photo/Task action row ─────────────────────────────── */
.insp-item-actions {
  display: flex; border-top: 1px solid #f3f4f6;
  margin-top: 10px;
}
.insp-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 10px 6px;
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: #9ca3af;
  font-family: var(--ops-font); transition: all .12s;
  border-right: 1px solid #f3f4f6;
}
.insp-action-btn:last-child { border-right: none; }
.insp-action-btn:hover { background: #f9fafb; color: #374151; }
.insp-action-btn.active { color: #f59e0b; background: #fffbeb; }
.insp-act-icon { font-size: 15px; line-height: 1; }

/* Notes textarea */
.insp-notes-row { padding: 0 14px 12px; }
.insp-notes-field {
  width: 100%; min-height: 58px; padding: 8px 10px;
  border: 1.5px solid #f59e0b; border-radius: 7px;
  font-family: var(--ops-font); font-size: 13px; color: var(--ops-text);
  background: #fffbeb; resize: vertical; outline: none;
  transition: border-color .13s; box-sizing: border-box;
}
.insp-notes-field:focus { border-color: #d97706; background: #fff; }
.insp-notes-field::placeholder { color: #b45309; opacity: .55; }

/* Photo upload */
.insp-photo-upload { padding: 0 14px 12px; }
.tw-ops-photo-btn {
  width: 100%; padding: 8px 12px; border-radius: 7px;
  border: 1.5px dashed #d1d5db; background: #f9fafb;
  font-size: 12px; font-weight: 500; color: var(--ops-text-2);
  text-align: center; cursor: pointer; transition: all .12s;
}
.tw-ops-photo-btn:hover { border-color: #1a56db; background: #eff6ff; color: #1a56db; }
.tw-ops-photo-preview { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.tw-ops-photo-remove {
  background: none; border: none; cursor: pointer; color: #ef4444;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.tw-ops-photo-remove:hover { background: #fee2e2; }

/* Legacy notes toggle compat */
.insp-notes-toggle { display: none; }

/* ═══════════════════════════════════════════════════════════════
   SCHEDULED CHECKLISTS VIEW
═══════════════════════════════════════════════════════════════ */
.sched-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.sched-card {
  background: #fff; border-radius: 12px; border: 1px solid var(--ops-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden;
  transition: box-shadow .13s;
}
.sched-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.sched-card-top {
  padding: 14px 16px 10px;
}
.sched-card-title { font-size: 14px; font-weight: 700; color: var(--ops-text); margin-bottom: 4px; }
.sched-card-tpl { font-size: 12px; color: var(--ops-text-3); margin-bottom: 8px; }
.sched-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sched-freq-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700;
  background: #eff6ff; color: #1d4ed8;
}
.sched-due {
  font-size: 11px; font-weight: 600;
  color: var(--ops-text-3);
}
.sched-due.overdue { color: var(--ops-red); }
.sched-card-actions {
  display: flex; border-top: 1px solid #f3f4f6;
}
.sched-card-action {
  flex: 1; padding: 9px 8px; border: none; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--ops-text-2);
  cursor: pointer; font-family: var(--ops-font); text-align: center;
  border-right: 1px solid #f3f4f6; transition: all .12s;
}
.sched-card-action:last-child { border-right: none; }
.sched-card-action:hover { background: #f9fafb; }
.sched-card-action.complete { color: var(--ops-green); }
.sched-card-action.complete:hover { background: var(--ops-green-light); }
.sched-card-action.miss { color: var(--ops-red); }
.sched-card-action.miss:hover { background: var(--ops-red-light); }

/* Filter tabs */
.sched-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-filter-tab {
  padding: 6px 14px; border-radius: 100px; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--ops-border); background: #fff; cursor: pointer;
  color: var(--ops-text-2); transition: all .12s; font-family: var(--ops-font);
}
.sched-filter-tab.active { background: var(--ops-blue); border-color: var(--ops-blue); color: #fff; }

/* Status color strips on left edge of cards */
.sched-card[data-status="pending"]    { border-left: 4px solid #f59e0b; }
.sched-card[data-status="completed"]  { border-left: 4px solid #10b981; }
.sched-card[data-status="missed"]     { border-left: 4px solid #ef4444; }
.sched-card[data-status="in_progress"]{ border-left: 4px solid #1a56e8; }

/* ── Schedule / Inspection tab bar ─────────────────────────────────────── */
.tw-ops-tab-bar {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--ops-border);
  padding-bottom: 0;
}
.tw-ops-tab {
  padding: 8px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ops-text-3);
  font-family: var(--ops-font); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.tw-ops-tab.active {
  color: var(--ops-primary, #6366f1);
  border-bottom-color: var(--ops-primary, #6366f1);
}
.tw-ops-tab:hover:not(.active) { color: var(--ops-text-1); }

/* Badge utility */
.tw-badge-green { background:#d1fae5; color:#065f46; border-color:#a7f3d0; }

/* ── Conduct modal — full-height mobile-style layout ─────────── */
.tw-ops-modal-conduct {
  max-width: 560px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 48px);
}
.tw-ops-modal-conduct .tw-ops-modal-body {
  padding: 0; overflow-y: auto; flex: 1; min-height: 0;
}
.tw-ops-modal-conduct .insp-conduct-wrap {
  background: #f0f2f5; padding: 14px 12px 0; min-height: 100%;
}
/* Sticky Go Back & Save / Submit bar */
.insp-conduct-footer {
  position: sticky; bottom: 0;
  display: flex; gap: 10px;
  background: #fff; border-top: 1px solid #e5e7eb;
  padding: 12px 14px; box-shadow: 0 -4px 12px rgba(0,0,0,.08); z-index: 10;
}
.insp-foot-back {
  flex: 1; padding: 14px 12px; border: 2px solid #e5e7eb; border-radius: 10px;
  background: #fff; font-size: 15px; font-weight: 600; color: #374151;
  cursor: pointer; font-family: var(--ops-font); transition: all .13s;
}
.insp-foot-back:hover { border-color: #9ca3af; background: #f9fafb; }
.insp-foot-submit {
  flex: 1; padding: 14px 12px; border: none; border-radius: 10px;
  background: #5b5cf6; font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer; font-family: var(--ops-font); transition: background .13s;
}
.insp-foot-submit:hover:not(:disabled) { background: #4a4ae0; }
.insp-foot-submit:disabled { background: #a5b4fc; cursor: not-allowed; }

/* ── Autosave pill in progress header ─────────────────────────────────── */
.insp-autosave-pill {
  font-size: 11px; font-weight: 600; color: #16a34a;
  opacity: 0; transition: opacity .3s; margin-left: auto;
}

/* ── Stat card CTA label ──────────────────────────────────────────────── */
.tw-ops-stat-cta {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.25); border-radius: 20px;
  padding: 2px 10px; color: inherit; letter-spacing: .03em;
}
.tw-ops-stat-card.grey {
  background: #f3f4f6; color: #6b7280;
}
.tw-ops-stat-card.grey .tw-ops-stat-value { color: #374151; }

/* ── Submit warning box ───────────────────────────────────────────────── */
.insp-warn-box {
  background: #fff; border: 2px solid #f59e0b; border-radius: 12px;
  padding: 16px 18px; box-shadow: 0 4px 24px rgba(0,0,0,.12);
  margin: 0 2px;
}
.insp-warn-title {
  font-size: 14px; font-weight: 700; color: #92400e; margin-bottom: 10px;
}
.insp-warn-list { margin-bottom: 8px; }
.insp-warn-item {
  font-size: 12px; color: #374151; padding: 3px 0;
  border-bottom: 1px solid #f3f4f6;
}
.insp-warn-more { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.insp-warn-hint {
  font-size: 11px; color: #6b7280; font-style: italic; margin: 8px 0 12px;
}
.insp-warn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.insp-warn-actions .tw-btn { flex: 1; justify-content: center; }

/* ── Unanswered item highlight (scroll-to) ────────────────────────────── */
@keyframes insp-highlight-pulse {
  0%   { box-shadow: 0 0 0 3px #f59e0b44; }
  50%  { box-shadow: 0 0 0 8px #f59e0b22; }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.insp-item-highlight {
  animation: insp-highlight-pulse 1s ease-out;
  border-color: #f59e0b !important;
}

/* ── General Information auto-fill cards ─────────────────────────────── */
.insp-item-autofill {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: start;
  gap: 0 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
}
.insp-autofill-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #1d4ed8;
  padding-top: 8px;
  flex-shrink: 0;
}
.insp-autofill-field {
  width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--ops-font);
  color: #1e293b;
  background: #fff;
  resize: none;
  min-height: 34px;
  line-height: 1.5;
  transition: border-color .13s, box-shadow .13s;
}
.insp-autofill-field:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Section header hint when all items are auto-fill type */
.insp-section-autofill-hint {
  font-size: 10px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 12px;
  padding: 2px 8px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Overall Score auto-fill — computed/read-only appearance */
.insp-item-autofill-score {
  background: linear-gradient(135deg, #fefce8 0%, #f0fdf4 100%);
  border-color: #fde68a;
}
.insp-autofill-field-score {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  color: #1e293b;
  background: #fffbeb;
  border-color: #fde68a;
  cursor: default;
  text-align: center;
}
.insp-autofill-live-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #16a34a;
  color: #fff;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ═══════════════════════════════════════════════════════════
   R365-STYLE DASHBOARD
   Matches the R365 financial dashboard aesthetic:
   welcome banner · quick-launch tiles · KPI cards
═══════════════════════════════════════════════════════════ */

/* ── Welcome banner ────────────────────────────────────────── */
.r365-welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.r365-welcome-left {}
.r365-hello {
  font-family: var(--ops-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ops-text);
  line-height: 1.2;
}
.r365-hello-sub {
  font-weight: 400;
  color: var(--ops-text-2);
  font-size: 18px;
}
.r365-date-line {
  font-size: 12px;
  color: var(--ops-text-3);
  margin-top: 3px;
}
.r365-welcome-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.r365-quarter-pill {
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* ── Quick-launch tiles ────────────────────────────────────── */
.r365-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.r365-tile {
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: box-shadow var(--ops-transition), transform var(--ops-transition), border-color var(--ops-transition);
  box-shadow: var(--ops-shadow);
  text-align: center;
}
.r365-tile:hover {
  box-shadow: var(--ops-shadow-lg);
  transform: translateY(-2px);
  border-color: #93c5fd;
}
.r365-tile-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.r365-tile-icon-wrap svg {
  width: 28px;
  height: 28px;
}
.r365-blue   { background: #dbeafe; color: #1d4ed8; }
.r365-green  { background: #d1fae5; color: #065f46; }
.r365-purple { background: #ede9fe; color: #5b21b6; }
.r365-amber  { background: #fef3c7; color: #92400e; }

.r365-tile-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ops-blue);
  line-height: 1.2;
}
.r365-tile-badge {
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 10px;
  border-radius: 100px;
}
.r365-badge-amber { background: #fef3c7; color: #92400e; }
.r365-badge-green { background: #d1fae5; color: #065f46; }
.r365-badge-gray  { background: #f3f4f6; color: #6b7280; }

/* Small + button on tile corner */
.r365-tile-add {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  padding: 0;
}
.r365-tile-add:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

/* ── Stats section header ──────────────────────────────────── */
.r365-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.r365-stats-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.r365-stats-period {
  font-size: 15px;
  font-weight: 700;
  color: var(--ops-text);
}
.r365-overdue-pill {
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}
.r365-stats-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.r365-stat-select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius-sm);
  font-family: var(--ops-font);
  font-size: 12px;
  color: var(--ops-text);
  background: var(--ops-surface);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.r365-stat-select-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ops-text-3);
  background: var(--ops-bg);
  padding: 5px 12px;
  border-radius: var(--ops-radius-sm);
  border: 1px solid var(--ops-border);
  white-space: nowrap;
}

/* ── KPI cards grid ────────────────────────────────────────── */
.r365-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.r365-kpi-card {
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  padding: 16px 18px 14px;
  box-shadow: var(--ops-shadow);
  transition: box-shadow var(--ops-transition), transform var(--ops-transition);
  overflow: hidden;
  position: relative;
}
.r365-kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--ops-radius) var(--ops-radius);
  background: var(--ops-border);
  opacity: 0;
  transition: opacity .15s;
}
.r365-kpi-card:hover {
  box-shadow: var(--ops-shadow-lg);
  transform: translateY(-2px);
}
.r365-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.r365-kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ops-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.r365-kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.r365-blue-bg   { background: #dbeafe; color: #1d4ed8; }
.r365-green-bg  { background: #d1fae5; color: #065f46; }
.r365-purple-bg { background: #ede9fe; color: #5b21b6; }
.r365-amber-bg  { background: #fef3c7; color: #92400e; }

.r365-kpi-value {
  font-family: var(--ops-font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ops-text);
  line-height: 1;
  margin-bottom: 4px;
}
.r365-kpi-sub {
  font-size: 11px;
  color: var(--ops-text-3);
  margin-bottom: 8px;
}
.r365-kpi-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.r365-kpi-trend.green { background: #d1fae5; color: #065f46; }
.r365-kpi-trend.red   { background: #fee2e2; color: #991b1b; }
.r365-kpi-trend.amber { background: #fef3c7; color: #92400e; }
.r365-kpi-trend.gray  { background: #f3f4f6; color: #6b7280; }

/* ── Bottom grid ───────────────────────────────────────────── */
.r365-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .r365-tiles      { grid-template-columns: repeat(2, 1fr); }
  .r365-kpi-grid   { grid-template-columns: repeat(2, 1fr); }
  .r365-bottom-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .r365-tiles      { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .r365-kpi-grid   { grid-template-columns: 1fr 1fr; gap: 10px; }
  .r365-hello      { font-size: 16px; }
  .r365-hello-sub  { font-size: 14px; }
  .r365-kpi-value  { font-size: 26px; }
}

/* ══════════════════════════════════════════════════════════════
   LOCATIONS VIEW  (loc-*)
   ══════════════════════════════════════════════════════════════ */

/* District card grid */
.loc-dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

/* District card */
.loc-dist-card {
  background: var(--ops-surface, #fff);
  border: 1px solid var(--ops-border, #e5e7eb);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: box-shadow .15s, transform .12s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  user-select: none;
}
.loc-dist-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.11);
  transform: translateY(-2px);
  border-color: #1a56e8;
}

.loc-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.loc-avatar {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}
.loc-card-info { flex: 1; min-width: 0; }
.loc-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ops-text, #111827);
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loc-card-city {
  font-size: 11px;
  color: var(--ops-text-3, #9ca3af);
  margin-top: 3px;
}
.loc-score {
  font-size: 13px; font-weight: 700;
  padding: 4px 9px;
  border-radius: 100px;
  border: 1.5px solid;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Stats strip */
.loc-card-stats {
  display: flex;
  border: 1px solid var(--ops-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}
.loc-stat {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--ops-border, #e5e7eb);
}
.loc-stat:last-child { border-right: none; }
.loc-stat-num { font-size: 18px; font-weight: 700; line-height: 1.2; display: block; }
.loc-stat-lbl { font-size: 10px; color: var(--ops-text-3, #9ca3af); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; display: block; }

.loc-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid var(--ops-border, #e5e7eb);
}
.loc-last-insp { font-size: 11px; color: var(--ops-text-3, #9ca3af); }
.loc-view-btn  { font-size: 11px; font-weight: 600; color: #1a56e8; }

/* ── Slide-over overlay ── */
.loc-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  z-index: 9000;
  backdrop-filter: blur(1px);
}

/* ── Slide-over panel ── */
.loc-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 500px;
  max-width: 96vw;
  background: var(--ops-surface, #fff);
  border-left: 1px solid var(--ops-border, #e5e7eb);
  box-shadow: -4px 0 32px rgba(0,0,0,.16);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.loc-panel-open { transform: translateX(0) !important; }

.loc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #0a2463 0%, #1a56e8 100%);
  color: #fff;
  flex-shrink: 0;
}
.loc-panel-title    { font-size: 18px; font-weight: 700; line-height: 1.25; }
.loc-panel-subtitle { font-size: 12px; opacity: .75; margin-top: 4px; }
.loc-panel-close {
  background: rgba(255,255,255,.18);
  border: none; color: #fff;
  width: 30px; height: 30px;
  border-radius: 7px;
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.loc-panel-close:hover { background: rgba(255,255,255,.32); }

/* Tabs */
.loc-panel-tabs {
  display: flex;
  border-bottom: 2px solid var(--ops-border, #e5e7eb);
  background: var(--ops-bg, #f9fafb);
  flex-shrink: 0;
  overflow-x: auto;
}
.loc-tab {
  padding: 11px 18px;
  font-size: 12px; font-weight: 600;
  color: var(--ops-text-3, #9ca3af);
  background: transparent; border: none;
  cursor: pointer; white-space: nowrap;
  position: relative;
  transition: color .12s;
  text-transform: uppercase; letter-spacing: .5px;
}
.loc-tab:hover { color: var(--ops-text, #111827); }
.loc-tab.active { color: #1a56e8; }
.loc-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0; height: 2px;
  background: #1a56e8;
  border-radius: 2px 2px 0 0;
}

/* Tab bodies */
.loc-tab-body {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  gap: 0;
}
.loc-tab-body.active { display: flex; }

/* Overview stats */
.loc-ov-stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.loc-ov-stat {
  background: var(--ops-bg, #f9fafb);
  border: 1px solid var(--ops-border, #e5e7eb);
  border-radius: 9px;
  padding: 12px 8px;
  text-align: center;
}
.loc-ov-num { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--ops-text, #111827); }
.loc-ov-lbl { font-size: 10px; color: var(--ops-text-3, #9ca3af); text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }

/* Action row */
.loc-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ops-border, #e5e7eb);
  flex-shrink: 0;
}

/* Tab toolbar */
.loc-tab-toolbar {
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Section title */
.loc-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ops-text-3, #9ca3af);
  margin-bottom: 8px;
  flex-shrink: 0;
}

/* List container */
.loc-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

/* Row items */
.loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ops-border, #e5e7eb);
  border-radius: 8px;
  background: var(--ops-bg, #f9fafb);
  transition: background .1s, border-color .1s;
  flex-shrink: 0;
}
.loc-row:hover { background: #eef2ff; border-color: #c7d2fe; }
.loc-row-main { flex: 1; min-width: 0; }
.loc-row-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ops-text, #111827);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.loc-row-meta { font-size: 11px; color: var(--ops-text-3, #9ca3af); margin-top: 2px; }
.loc-row-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Sublocation tag */
.loc-subloc-tag {
  font-size: 10px;
  font-weight: 600;
  color: #1a56e8;
  background: #eef2ff;
  padding: 2px 7px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .loc-dist-grid {
    grid-template-columns: 1fr;
  }
  .loc-panel {
    width: 100%;
    max-width: 100vw;
    border-left: none;
  }
  .loc-panel-header { padding: 16px 18px 14px; }
  .loc-ov-stats { grid-template-columns: repeat(2,1fr); }
  .loc-action-row { flex-direction: column; }
}
@media (min-width: 601px) and (max-width: 960px) {
  .loc-dist-grid { grid-template-columns: repeat(2, 1fr); }
  .loc-panel { width: 420px; }
}

/* ── Work Orders Quarterly Breakdown ──────────────────────────── */
.r365-qwo-list {
  padding: 4px 0 8px;
}
.r365-qwo-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ops-border, #f0f2f5);
  transition: background .12s;
}
.r365-qwo-row:last-child { border-bottom: none; }
.r365-qwo-row[data-action]:hover { background: #f8fafc; }
.r365-qwo-future { opacity: .45; }
.r365-qwo-current { background: #f0f7ff; }
.r365-qwo-current:hover { background: #e8f2ff !important; }

.r365-qwo-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.r365-qwo-q {
  font-size: 13px;
  font-weight: 800;
  color: var(--ops-text-1, #1f2937);
  min-width: 24px;
}
.r365-qwo-range {
  font-size: 11px;
  color: var(--ops-text-3, #9ca3af);
}
.r365-qwo-current-pill {
  font-size: 10px;
  font-weight: 700;
  background: #1a56db;
  color: #fff;
  border-radius: 100px;
  padding: 1px 7px;
  letter-spacing: .03em;
}

.r365-qwo-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.r365-qwo-done, .r365-qwo-miss, .r365-qwo-open,
.r365-qwo-urg, .r365-qwo-upcoming, .r365-qwo-none {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.r365-qwo-done     { color: #065f46; }
.r365-qwo-miss     { color: #991b1b; }
.r365-qwo-open     { color: #1e40af; }
.r365-qwo-urg      { color: #b45309; font-size: 11px; }
.r365-qwo-upcoming { color: #9ca3af; font-weight: 400; }
.r365-qwo-none     { color: #6b7280; font-weight: 400; font-size: 11px; }
.r365-qwo-pct {
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.r365-qwo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.r365-qwo-dot-green { background: #10b981; }
.r365-qwo-dot-red   { background: #ef4444; }
.r365-qwo-dot-blue  { background: #3b82f6; }

.r365-qwo-bar-wrap {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
}
.r365-qwo-bar-seg {
  border-radius: 2px;
  min-width: 4px;
  transition: flex .3s;
}
