:root {
  /* Linear / Stripe / Vercel modern enterprise palette */
  --bg-app: #090a0f;
  --bg-surface: #12141c;
  --bg-surface-elevated: #181b26;
  --bg-surface-hover: #1e2230;
  
  --border-subtle: #1f2333;
  --border-medium: #2a3045;
  --border-focus: #4f46e5;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-primary-dim: rgba(59, 130, 246, 0.12);

  --accent-success: #10b981;
  --accent-success-dim: rgba(16, 185, 129, 0.12);

  --accent-warning: #f59e0b;
  --accent-warning-dim: rgba(245, 158, 11, 0.12);

  --accent-danger: #ef4444;
  --accent-danger-dim: rgba(239, 68, 68, 0.12);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 20px 40px -10px rgba(0, 0, 0, 0.7);

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Header */
header.app-header {
  background: rgba(18, 20, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

/* 1-Click Role Switcher */
.role-switch-container {
  display: flex;
  background: #0b0d14;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.role-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.role-btn:hover {
  color: var(--text-main);
}

.role-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.role-btn.active.intern-badge {
  color: #34d399;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: #ffffff;
  border: 1px solid var(--border-medium);
}

.badge-count {
  background: var(--accent-danger);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Primary buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
}

.btn-success {
  background-color: var(--accent-success);
  color: #042f2e;
  font-weight: 700;
}

.btn-success:hover {
  background-color: #059669;
  color: #ffffff;
}

.btn-danger {
  background-color: var(--accent-danger);
  color: #ffffff;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.775rem;
}

/* Main Layout */
main.main-container {
  max-width: 1440px;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
}

/* Role Banner Alert */
.role-mode-banner {
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  border: 1px solid var(--border-subtle);
  gap: 1rem;
}

.role-mode-banner.founder {
  background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(99,102,241,0.03));
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.role-mode-banner.intern {
  background: linear-gradient(90deg, rgba(16,185,129,0.08), rgba(5,150,105,0.03));
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* Metric KPI Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.metric-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.metric-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
  letter-spacing: -0.5px;
}

.metric-card.alert-due {
  border-left: 3px solid var(--accent-danger);
  background: linear-gradient(135deg, rgba(239,68,68,0.06), var(--bg-surface));
}

.metric-card.alert-due .value {
  color: #f87171;
}

/* Workflow Step Card (Intern View) */
.intern-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-success);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.intern-step-badge {
  background: var(--accent-success-dim);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Cards & Containers */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}

.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.card-body {
  padding: 1.25rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  background: #0f1118;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

table.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  vertical-align: middle;
  color: var(--text-main);
}

table.data-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pill.pending { background: #1e2230; color: #94a3b8; border: 1px solid var(--border-medium); }
.status-pill.email_sent { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.status-pill.call_due { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); font-weight: 800; }
.status-pill.called { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.status-pill.meeting_booked { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pill.replied { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.status-pill.not_interested { background: #1a1d26; color: #64748b; border: 1px solid #232736; }

/* Timer Badges */
.timer-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.timer-badge.overdue {
  background: var(--accent-danger-dim);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.timer-badge.countdown {
  background: var(--accent-primary-dim);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Call Script box inside Call Action modal */
.script-box {
  background: #0d0f17;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.script-box h4 {
  color: var(--accent-primary);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Audio Recorder Section */
.audio-recorder-box {
  background: #0f121a;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  text-align: center;
  margin-bottom: 1rem;
}

.audio-recorder-box.recording {
  border-color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.05);
}

.rec-btn {
  background: var(--accent-danger);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.rec-btn:hover {
  transform: scale(1.05);
}

.rec-btn.recording {
  background: #b91c1c;
  animation: pulse 1s infinite;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Form inputs */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  background: #0a0c12;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
  resize: vertical;
}

/* Drag & Drop Import zone */
.drop-zone {
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #0d0f17;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

/* ======================================================== */
/* Responsive Breakpoints: Tablet (1024px) & Mobile (768px)  */
/* ======================================================== */
@media (max-width: 1024px) {
  .header-container {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.2rem;
  }
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  main.main-container {
    padding: 0 0.85rem;
    margin: 1rem auto;
  }
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .header-actions {
    justify-content: flex-end;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .role-mode-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .role-mode-banner button {
    align-self: flex-start;
  }
  .intern-step-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .card-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-header input, .card-header select {
    width: 100% !important;
  }
  table.data-table td, table.data-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }
}
