/* ============================================================
   IMP — Interpretation Management Platform
   Design System v2
   ============================================================ */

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

:root {
  --brand-600: #5a67d8;
  --brand-500: #667eea;
  --brand-400: #7f9cf5;
  --brand-50: #eef2ff;
  --surface-0: #ffffff;
  --surface-1: #f8f9fb;
  --surface-2: #f1f3f7;
  --surface-3: #e8ecf1;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --green-500: #10b981; --green-50: #ecfdf5; --green-900: #064e3b;
  --orange-500: #f59e0b; --orange-50: #fffbeb; --orange-900: #78350f;
  --red-500: #ef4444; --red-50: #fef2f2; --red-900: #7f1d1d;
  --blue-500: #3b82f6; --blue-50: #eff6ff; --blue-900: #1e3a5f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 8px 16px rgba(0,0,0,0.06), 0 20px 48px rgba(0,0,0,0.12);
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-1);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.imp-header {
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.imp-header h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.imp-header .user-info {
  font-size: 13px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 6px;
}
.imp-header .user-info span[onclick] {
  color: #6b7280;
  transition: color 0.15s;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.imp-header .user-info span[onclick]:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

/* ---- TABS ---- */
.imp-tabs {
  display: flex;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  gap: 2px;
}
.imp-tab {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  user-select: none;
}
.imp-tab:hover { color: var(--text-secondary); }
.imp-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); font-weight: 600; }

/* ---- CONTENT ---- */
.imp-content { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }
.imp-panel { display: none; }
.imp-panel.active { display: block; }

/* ---- CARDS ---- */
.imp-card {
  background: var(--surface-0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}
.imp-card:hover { box-shadow: var(--shadow-sm); }
.imp-card h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-loading {
  padding: 8px 0;
}
.dash-loading-bar {
  height: 3px;
  background: var(--surface-1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.dash-loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--brand-500), transparent);
  animation: dashLoadSlide 1.2s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes dashLoadSlide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ---- DASHBOARD LAYOUT ---- */
.dash-summary {
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding: 18px 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
}
.dash-summary-main {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}
.dash-summary-number {
  font-size: 38px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1;
  margin-bottom: 10px;
}
.dash-summary-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-summary-progress-bar {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.dash-summary-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.dash-summary-progress-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.dash-summary-divider {
  width: 1px;
  background: #e5e7eb;
  flex-shrink: 0;
}
.dash-summary-side {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: center;
}
.dash-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-mini-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.dash-mini-val {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1;
}
.dash-mini-stat-warn .dash-mini-val { color: #ea580c; }

@media (max-width: 760px) {
  .dash-summary { flex-direction: column; gap: 14px; }
  .dash-summary-main { flex: 0 0 auto; }
  .dash-summary-divider { display: none; }
  .dash-summary-side { grid-template-columns: repeat(2, 1fr); }
}
.dash-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.dash-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dash-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dash-action-count {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  min-width: 40px;
}
.dash-action-title {
  font-size: 13px;
  font-weight: 700;
}
.dash-action-sub {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}
.dash-action-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.dash-action-orange {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #ea580c;
}
.dash-action-blue {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
}
.dash-action[data-count="0"] {
  opacity: 0.4;
  cursor: default;
}
.dash-action[data-count="0"]:hover {
  transform: none;
  box-shadow: none;
}
.dash-live {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #065f46;
}
.dash-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  animation: livePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.dash-all-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
}

/* ---- SNAPSHOT STATS ---- */
.snapshot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.snapshot-stat {
  background: var(--surface-0);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.snapshot-stat:hover { box-shadow: var(--shadow-sm); }
.snapshot-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.snapshot-stat:nth-child(1)::before { background: var(--brand-500); }
.snapshot-stat:nth-child(2)::before { background: var(--blue-500); }
.snapshot-stat:nth-child(3)::before { background: var(--green-500); }
.snapshot-stat:nth-child(4)::before { background: var(--orange-500); }
.snapshot-stat:nth-child(5)::before { background: var(--red-500); }
.snapshot-stat .stat-label {
  font-size: 11.5px; font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.snapshot-stat .stat-value {
  font-size: 30px; font-weight: 700;
  color: var(--text-primary);
  margin-top: 6px;
  letter-spacing: -0.025em;
  line-height: 1;
}
.snapshot-stat .stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ---- TABLES ---- */
.imp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.imp-table thead th {
  text-align: left; padding: 10px 14px;
  background: var(--surface-1);
  color: var(--text-tertiary);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.imp-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.imp-table thead th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.imp-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}
.imp-table tbody tr { transition: background 0.1s; }
.imp-table tbody tr:hover { background: var(--surface-1); }
.imp-table tbody tr:last-child td { border-bottom: none; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em; line-height: 1.6;
}
.badge-green { background: var(--green-50); color: var(--green-900); border: 1px solid #a7f3d0; }
.badge-green-pulse { background: #065f46; color: #fff; border: 1px solid #065f46; animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
.badge-completed { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-orange { background: var(--orange-50); color: var(--orange-900); border: 1px solid #fde68a; }
.badge-red { background: var(--red-50); color: var(--red-900); border: 1px solid #fecaca; }
.badge-blue { background: var(--blue-50); color: var(--blue-900); border: 1px solid #bfdbfe; }
.badge-gray { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-purple { background: var(--brand-50); color: var(--brand-600); border: 1px solid #c7d2fe; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-primary {
  background: var(--brand-600); color: white;
  box-shadow: 0 1px 2px rgba(90,103,216,0.3);
}
.btn-primary:hover { background: #4c56c0; box-shadow: 0 2px 8px rgba(90,103,216,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-success { background: var(--green-500); color: white; box-shadow: 0 1px 2px rgba(16,185,129,0.3); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--red-500); color: white; box-shadow: 0 1px 2px rgba(239,68,68,0.3); }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: var(--surface-0); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px; letter-spacing: 0.01em;
}
.form-group label .required, .form-group label .req { color: var(--red-500); font-weight: 700; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: inherit; font-size: 13.5px;
  color: var(--text-primary); background: var(--surface-0);
  transition: all 0.15s;
}
.form-control:hover { border-color: #d1d5db; }
.form-control:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(102,126,234,0.12); }
.form-control::placeholder { color: var(--text-tertiary); }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  -webkit-appearance: none; appearance: none;
}
textarea.form-control { resize: vertical; min-height: 72px; line-height: 1.5; }

/* ---- TOASTS ---- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-md); color: white;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease; max-width: 380px;
}
.toast-success { background: rgba(16,185,129,0.95); }
.toast-error { background: rgba(239,68,68,0.95); }
.toast-info { background: rgba(90,103,216,0.95); }
@keyframes toastIn {
  from { transform: translateX(100%) scale(0.95); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ---- MODALS ---- */
.modal-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0); z-index: 1000;
  align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-overlay.active { display: flex; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); }
.modal {
  background: var(--surface-0); border-radius: var(--radius-xl); padding: 24px;
  max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---- LARGE MODAL ---- */
.modal-large {
  background: var(--surface-1); border-radius: var(--radius-xl);
  width: 96vw; max-width: 960px; height: 96vh; padding: 0;
  position: relative; overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.05);
}
@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-large-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  background: var(--surface-0); padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-large-header h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0; letter-spacing: -0.01em; }
.modal-close-btn {
  width: 30px; height: 30px; border: 1px solid var(--border);
  background: var(--surface-0); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-tertiary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.modal-close-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.modal-large-body {
  position: absolute; top: 64px; bottom: 58px; left: 0; right: 0;
  overflow-y: auto; padding: 20px 24px;
}
.modal-large-footer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  background: var(--surface-0); padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ---- FORM SECTIONS ---- */
.form-section {
  background: var(--surface-0); border-radius: var(--radius-lg);
  padding: 18px 20px; margin-bottom: 14px; border: 1px solid var(--border);
}
.form-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.form-section-icon {
  font-size: 14px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); border-radius: var(--radius-sm); border: 1px solid #e0e7ff;
}
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 0; }
.form-col-half { flex: 1; min-width: 180px; }
.form-col-third { flex: 1; min-width: 140px; }
.form-col-quarter { flex: 1; min-width: 110px; }
.form-col-full { flex: 1 1 100%; }

.location-fields {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px; margin-top: 8px;
}
.location-fields .form-group { margin-bottom: 10px; }
.location-fields .form-group:last-child { margin-bottom: 0; }
.save-location-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-tertiary); cursor: pointer; margin-top: 6px;
}
.save-location-check input { cursor: pointer; accent-color: var(--brand-500); }

.recurrence-item {
  padding: 12px 14px; margin-bottom: 6px;
  background: var(--surface-0); border: 1px solid var(--border);
  border-radius: var(--radius-md); transition: box-shadow 0.15s;
}
.recurrence-item:hover { box-shadow: var(--shadow-sm); }
.recurrence-item-removed {
  padding: 10px 14px; margin-bottom: 6px;
  background: var(--surface-1); border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center; opacity: 0.5;
}
.recurrence-item-removed span { text-decoration: line-through; font-size: 13px; color: var(--text-tertiary); }

/* ---- SPINNER ---- */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid var(--border); border-top-color: var(--brand-500);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(4px);
  z-index: 999; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
.loading-overlay.active { display: flex; }

/* ---- VIEW TOGGLE ---- */
.view-toggle {
  padding: 6px 14px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  border: none; background: var(--surface-0); color: var(--text-tertiary); cursor: pointer;
  transition: all 0.15s;
}
.view-toggle:first-child { border-right: 1px solid var(--border); }
.view-toggle.active { background: var(--brand-600); color: white; }
.view-toggle:hover:not(.active) { background: var(--surface-1); color: var(--text-secondary); }

/* ---- CALENDAR ---- */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
}
.cal-header-cell {
  padding: 10px 4px; text-align: center;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 96px; padding: 4px; box-sizing: border-box; min-width: 0;
  border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
  background: var(--surface-0); cursor: pointer; transition: background 0.1s;
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--brand-50); }
.cal-cell.other-month { background: var(--surface-1); }
.cal-cell.other-month .cal-day { color: #d1d5db; }
.cal-cell.today { background: var(--brand-50); }
.cal-cell.today .cal-day {
  color: var(--surface-0); background: var(--brand-500);
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.cal-day { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); padding: 2px 4px; margin-bottom: 2px; }
.cal-job {
  display: block; padding: 1px 5px; margin-bottom: 2px;
  border-radius: 3px; font-size: 10.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; line-height: 1.5; border-left: 2px solid transparent;
}
.cal-job.status-UNBROADCASTED { background: var(--surface-2); color: var(--text-secondary); border-left-color: #9ca3af; }
.cal-job.status-BROADCASTED { background: var(--blue-50); color: var(--blue-900); border-left-color: var(--blue-500); }
.cal-job.status-ACCEPTED { background: var(--orange-50); color: var(--orange-900); border-left-color: var(--orange-500); }
.cal-job.status-CONFIRMED { background: var(--green-50); color: var(--green-900); border-left-color: var(--green-500); }
.cal-job.status-IN_PROGRESS { background: #065f46; color: #fff; border-left-color: #059669; animation: badgePulse 2s ease-in-out infinite; }
.cal-job.status-COMPLETED { background: #f0fdf4; color: #6b7280; border-left-color: #9ca3af; text-decoration: line-through; opacity: 0.7; }
.cal-job.status-CANCELLED { background: var(--red-50); color: var(--red-900); border-left-color: var(--red-500); }
.cal-job.status-NO_SHOW { background: var(--red-50); color: var(--red-900); border-left-color: var(--red-500); }
.cal-more { font-size: 10.5px; color: var(--brand-500); padding: 0 4px; cursor: pointer; font-weight: 600; }

/* ---- URGENT ITEMS ---- */
.urgent-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-left: 3px solid var(--red-500);
  background: var(--red-50); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 8px; transition: box-shadow 0.15s;
}
.urgent-item:hover { box-shadow: var(--shadow-sm); }
.urgent-item .urgent-info { flex: 1; }
.urgent-item .urgent-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.urgent-item .urgent-detail { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.urgent-item .urgent-time {
  font-size: 12px; font-weight: 700; color: var(--red-500);
  white-space: nowrap; margin-left: 16px; font-variant-numeric: tabular-nums;
}

/* ---- ACTIVITY FEED ---- */
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ---- AVAILABLE JOBS ---- */
.avail-job {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-0); transition: all 0.15s;
}
.avail-job:hover { box-shadow: var(--shadow-sm); border-color: var(--brand-400); }
.avail-job .job-details { flex: 1; }
.avail-job .job-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.avail-job .job-meta { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; }
.avail-job .job-actions { display: flex; gap: 8px; }

/* ---- MEMBER TYPE BUTTONS ---- */
.member-type-btn.active { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }

/* ---- LOGIN ---- */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--text-primary);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(102,126,234,0.15) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-page::after {
  content: ''; position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(118,75,162,0.1) 0%, transparent 70%);
  bottom: -100px; left: -50px;
}
.login-card {
  background: var(--surface-0); border-radius: var(--radius-xl); padding: 40px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-xl);
  position: relative; z-index: 1;
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-card h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; letter-spacing: -0.02em; }
.login-card .subtitle { color: var(--text-tertiary); font-size: 14px; margin-bottom: 28px; }
.login-card .btn-primary { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }
.login-error {
  background: var(--red-50); color: var(--red-900); border: 1px solid #fecaca;
  padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px;
  margin-bottom: 16px; display: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .imp-header { padding: 0 16px; }
  .imp-tabs { padding: 0 12px; overflow-x: auto; gap: 0; }
  .imp-tab { padding: 12px 14px; white-space: nowrap; font-size: 13px; }
  .imp-content { padding: 16px; }
  .snapshot-row { grid-template-columns: repeat(2, 1fr); }
  .snapshot-stat .stat-value { font-size: 24px; }
  .modal-large { width: 100%; height: 100vh; border-radius: 0; }
  .modal-large-body { padding: 16px; top: 56px; bottom: 50px; }
  .modal-large-header, .modal-large-footer { padding: 14px 16px; }
  .form-col-half, .form-col-third, .form-col-quarter { min-width: 100%; }
  .avail-job { flex-direction: column; gap: 12px; }
  .avail-job .job-actions { width: 100%; }
}

/* ---- JOB DETAIL FIELDS ---- */
.jd-fields { display: flex; flex-direction: column; gap: 0; }
.jd-field {
  display: flex; padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.jd-field:last-child { border-bottom: none; }
.jd-field-label {
  width: 130px; flex-shrink: 0;
  color: var(--text-tertiary); font-weight: 500;
}
.jd-field-value { color: var(--text-primary); font-weight: 500; }

/* Clickable table rows */
.imp-table tbody tr[onclick] { cursor: pointer; }
.imp-table tbody tr[onclick]:hover { background: var(--brand-50); }

/* ---- BROADCAST TABS ---- */
.broadcast-tab {
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.broadcast-tab.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
}
.broadcast-tab:hover:not(.active) {
  background: var(--surface-1);
  color: var(--text-secondary);
}

/* ---- VRI/OPI CALL WIDGET ---- */
.call-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-600);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(90,103,216,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 900;
  transition: all 0.2s;
}
.call-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(90,103,216,0.5);
}
.call-fab.active {
  background: var(--text-primary);
  transform: rotate(45deg);
}

.call-widget {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 280px;
  background: var(--surface-0);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 899;
  overflow: hidden;
  display: none;
  animation: callWidgetIn 0.25s cubic-bezier(0.16,1,0.3,1);
}
.call-widget.active { display: block; }
@keyframes callWidgetIn {
  from { transform: translateY(12px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.call-widget-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.call-widget-header .cw-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green-900);
  background: var(--green-50);
  border: 1px solid #a7f3d0;
  padding: 2px 10px;
  border-radius: 20px;
}
.call-widget-header .cw-status::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--green-500);
  border-radius: 50%;
}

.call-widget-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.call-widget-tab {
  padding: 10px 0;
  margin-right: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.call-widget-tab:hover { color: var(--text-secondary); }
.call-widget-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

.call-widget-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.call-widget-agency {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  width: 100%;
  margin-bottom: 20px;
}
.call-widget-agency-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px; font-weight: 700;
}
.call-widget-agency-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.3;
}
.call-widget-agency-sub {
  font-size: 11px; color: var(--text-tertiary);
}

.call-mode-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.call-mode-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}
.call-mode-btn svg { width: 28px; height: 28px; }
.call-mode-btn.active {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 4px rgba(102,126,234,0.12);
}
.call-mode-btn:hover:not(.active) {
  border-color: #d1d5db;
  background: var(--surface-1);
}
.call-mode-label {
  position: absolute;
  bottom: -20px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.call-mode-btn.active .call-mode-label { color: var(--brand-600); }

.call-widget-fields {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.call-widget-fields select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-0);
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.call-widget-btn {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.call-widget-btn.vri { background: var(--brand-600); }
.call-widget-btn.vri:hover { background: #4c56c0; }
.call-widget-btn.opi { background: var(--green-500); }
.call-widget-btn.opi:hover { background: #059669; }
.call-widget-btn.ai { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.call-widget-btn.ai:hover { background: linear-gradient(135deg, #6d28d9, #4f46e5); }

@media (max-width: 768px) {
  .call-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 22px; }
  .call-widget { bottom: 78px; right: 16px; width: 260px; }
}

/* ---- INTERPRETER TOGGLE SWITCH ---- */
.cw-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.cw-toggle-track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}
.cw-toggle-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

/* Interpreter FAB pulse when online */
.call-fab.interpreter-online {
  animation: fabPulse 2s ease infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(16,185,129,0.4); }
  50% { box-shadow: 0 4px 24px rgba(16,185,129,0.6); }
}

/* ---- CONFIRM INTERPRETER ROWS ---- */
.confirm-interp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.confirm-interp-row:last-child { border-bottom: none; }
.confirm-interp-row:hover { background: var(--surface-1); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-sm); }
.confirm-interp-info { display: flex; align-items: center; gap: 12px; }
.confirm-interp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-900);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}
.confirm-interp-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.confirm-interp-detail { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }

/* ---- LOGIN SUCCESS MESSAGE ---- */
.login-success {
  background: var(--green-50);
  color: var(--green-900);
  border: 1px solid #a7f3d0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ---- INTERPRETER ROWS (Job Detail - Boostlingo style) ---- */
.interp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.interp-row:last-of-type { border-bottom: none; }
.interp-row-indicator {
  width: 3px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}
.interp-row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.interp-row-info { flex: 1; min-width: 0; }
.interp-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.interp-row-email {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.interp-row-status { flex-shrink: 0; }
.interp-row-actions { flex-shrink: 0; }

/* ---- JOB ACTIVITY LOG ---- */
.jd-activity-log { display: flex; flex-direction: column; gap: 0; }
.jd-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.jd-log-item:last-child { border-bottom: none; }
.jd-log-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 20px;
  bottom: -8px;
  width: 1px;
  background: var(--border-light);
}
.jd-log-item:last-child::before { display: none; }
.jd-log-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
}
.jd-log-content { flex: 1; min-width: 0; }
.jd-log-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.jd-log-time { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

/* ---- JOB DETAIL TABS ---- */
.jd-tabs {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--surface-0);
  gap: 0;
  flex-shrink: 0;
}
.jd-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.jd-tab:hover { color: var(--text-secondary); }
.jd-tab.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-500);
  font-weight: 600;
}
.jd-tab-count {
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.jd-tab.active .jd-tab-count {
  background: var(--brand-50);
  color: var(--brand-600);
}
.jd-tab-panel { display: none; }
.jd-tab-panel.active { display: block; }

@media (max-width: 768px) {
  #jd-panel-overview > div { grid-template-columns: 1fr !important; }
}

/* ---- CLICKABLE STAT BOXES ---- */
.snapshot-stat[onclick] { cursor: pointer; transition: all 0.15s; }
.snapshot-stat[onclick]:hover { 
  border-color: var(--brand-400); 
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ---- RESOURCE CARDS ---- */
.resource-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  cursor: pointer;
  transition: all 0.15s;
}
.resource-card:hover {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.resource-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resource-info { flex: 1; min-width: 0; }
.resource-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.resource-desc { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.4; }

/* ---- SEARCHABLE SELECT ---- */
.search-select-option:hover { background: var(--brand-50); color: var(--brand-600); }

/* ---- SETTINGS SUB-TABS ---- */
.settings-sub-tab { background: transparent; border: none; color: var(--text-tertiary); font-weight: 600; padding: 8px 16px; }
.settings-sub-tab.active { color: var(--brand-600); border-bottom: 2px solid var(--brand-500) !important; margin-bottom: -2px; }
.settings-sub-tab:hover { color: var(--brand-500); }
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }


/* =============================================================
   DASHBOARD ACTION-ITEMS TABS
   ============================================================= */
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.dash-tab:hover { color: #1a202c; }
.dash-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}
.dash-tab-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  line-height: 16px;
  text-align: center;
}
.dash-tab.active .dash-tab-count {
  background: #dbeafe;
  color: #1d4ed8;
}
.dash-tab-new-badge {
  display: inline-block;
  padding: 1px 8px;
  background: #fef3c7;
  color: #b45309;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 16px;
}


/* =============================================================
   DASHBOARD CARD-STYLE TABS (3 primary tabs use the dash-action
   colored card visuals + the active-state underline).
   ============================================================= */
.dash-tab-card {
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s, transform 0.1s;
}
.dash-tab-card.active {
  transform: translateY(-1px);
  box-shadow: inset 0 -3px 0 0 currentColor;
}
.dash-tab-card.dash-action-blue.active { box-shadow: inset 0 -3px 0 0 #2563eb; }
.dash-tab-card.dash-action-red.active { box-shadow: inset 0 -3px 0 0 #dc2626; }
.dash-tab-card.dash-action-orange.active { box-shadow: inset 0 -3px 0 0 #ea580c; }


/* =============================================================
   ADDITIONAL DASH-ACTION COLOR VARIANTS (for card-tabs)
   ============================================================= */
.dash-action-amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.dash-action-amber:hover { background: #fef3c7; }
.dash-action-amber .dash-action-count { color: #b45309; }

.dash-action-purple {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #7e22ce;
}
.dash-action-purple:hover { background: #f3e8ff; }
.dash-action-purple .dash-action-count { color: #7e22ce; }

.dash-action-green {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}
.dash-action-green:hover { background: #dcfce7; }
.dash-action-green .dash-action-count { color: #15803d; }

/* Active-state underlines for the 3 new colors */
.dash-tab-card.dash-action-amber.active { box-shadow: inset 0 -3px 0 0 #b45309; }
.dash-tab-card.dash-action-purple.active { box-shadow: inset 0 -3px 0 0 #7e22ce; }
.dash-tab-card.dash-action-green.active { box-shadow: inset 0 -3px 0 0 #15803d; }


/* =============================================================
   STATS BAR ACTIONS (right side: AI Processor + New Appointment)
   ============================================================= */
.dash-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: center;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid #e5e7eb;
  min-width: 200px;
}
.dash-summary-actions .btn {
  white-space: nowrap;
}

/* AI Processor button - gradient, premium feel */
.btn-ai-processor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-ai-processor:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}
.btn-ai-processor:active {
  transform: translateY(0);
}
.btn-ai-sparkle {
  font-size: 14px;
  display: inline-block;
  transform-origin: center center;
  animation: ai-sparkle-twinkle 2s ease-in-out infinite;
}
@keyframes ai-sparkle-twinkle {
  0%   { opacity: 1;   transform: scale(1)    rotate(0deg); }
  20%  { opacity: 1;   transform: scale(1.4)  rotate(-15deg); }
  40%  { opacity: 0.6; transform: scale(0.9)  rotate(20deg); }
  60%  { opacity: 1;   transform: scale(1.3)  rotate(-10deg); }
  80%  { opacity: 0.85; transform: scale(1.05) rotate(5deg); }
  100% { opacity: 1;   transform: scale(1)    rotate(0deg); }
}

@media (max-width: 760px) {
  .dash-summary-actions {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    padding-left: 0;
    padding-top: 14px;
    min-width: auto;
  }
}


/* =============================================================
   MEMBERS PAGE — sub-tabs, stats card, status dots
   ============================================================= */

/* Sub-tab buttons - dashboard-style underline tabs */
.member-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px; /* sit on top of the parent border */
}
.member-tab-btn:hover {
  color: #1a202c;
}
.member-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

/* Members stats card (above the table) */
.members-stats {
  display: flex;
  gap: 24px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.members-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.members-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.members-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1;
}
.members-stat-active .members-stat-val { color: #15803d; }
.members-stat-invited .members-stat-val { color: #b45309; }
.members-stat-disabled .members-stat-val { color: #64748b; }

/* Search + Invite Account header */
.members-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.members-search {
  flex: 1;
  position: relative;
}
.members-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13.5px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.members-search input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.members-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

/* Status dots in the Status column */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.status-dot::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-active { color: #15803d; }
.status-dot-active::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
.status-dot-invited { color: #b45309; }
.status-dot-invited::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
.status-dot-disabled { color: #64748b; }
.status-dot-disabled::before { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15); }

/* Polished members table rows */
.members-table-wrap .imp-table tbody tr {
  transition: background 0.1s;
}
.members-table-wrap .imp-table tbody tr:hover {
  background: #f8fafc;
}
.members-account-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.members-account-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #1a202c;
}
.members-account-meta {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.members-contact-cell {
  font-size: 12.5px;
  line-height: 1.3;
}
.members-contact-name { font-weight: 500; color: #1a202c; }
.members-contact-extra { font-size: 11px; color: #94a3b8; margin-top: 2px; }


/* =============================================================
   ROW OVERFLOW MENU for Members tabs
   ============================================================= */
.row-menu-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  transition: background 0.1s, border-color 0.1s;
  padding: 0;
}
.row-menu-btn:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1a202c;
}
.row-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 180px;
  padding: 6px;
  z-index: 500;
}
.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: #1a202c;
  cursor: pointer;
  transition: background 0.1s;
}
.row-menu-item:hover { background: #f1f5f9; }
.row-menu-item-danger { color: #dc2626; }
.row-menu-item-danger:hover { background: #fee2e2; }
.row-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}
.row-menu-container {
  position: relative;
  display: inline-block;
}

/* Anonymize confirmation modal */
.anonymize-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9700;
  padding: 20px;
}
.anonymize-modal {
  background: white;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.anonymize-modal-header {
  padding: 20px 24px;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
}
.anonymize-modal-header h3 {
  margin: 0;
  color: #991b1b;
  font-size: 17px;
}
.anonymize-modal-body {
  padding: 20px 24px;
}
.anonymize-modal-body p {
  margin: 0 0 12px 0;
  color: #1a202c;
  font-size: 13.5px;
  line-height: 1.5;
}
.anonymize-modal-body .warn-list {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 12.5px;
  color: #9a3412;
}
.anonymize-modal-body .warn-list ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}
.anonymize-modal-body .warn-list li { margin-bottom: 2px; }
.anonymize-modal-body label {
  display: block;
  margin-top: 12px;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}
.anonymize-modal-body input[type=text] {
  width: 100%;
  padding: 9px 12px;
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
}
.anonymize-modal-body input[type=text]:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.anonymize-modal-footer {
  padding: 14px 24px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-danger {
  background: #dc2626;
  color: white;
  border: 1px solid #dc2626;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger:disabled { background: #fca5a5; border-color: #fca5a5; cursor: not-allowed; }


/* =============================================================
   JOB NUMBER BADGE (clickable, monospace, copy-to-clipboard)
   ============================================================= */
.job-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.job-num-badge:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #1a202c;
}
.job-num-badge:active {
  background: #cbd5e1;
}
.job-num-badge::before {
  content: '#';
  opacity: 0.5;
  margin-right: -2px;
}
.job-num-badge-sm {
  padding: 2px 7px;
  font-size: 10.5px;
}
/* Series variant gets a subtle blue accent so it's distinguishable from job # */
.job-num-badge-series {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.job-num-badge-series:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
