/* ============================================================
   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 h1::before {
  content: '';
  display: inline-block;
  width: 24px; height: 24px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  border-radius: 6px;
}
.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;
}

/* ---- 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-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, 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;
  border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
  background: var(--surface-0); cursor: pointer; transition: background 0.1s;
}
.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-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; }

@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 {
  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; }
