@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-50: #eef3ff;
  --primary-100: #dce6ff;
  --primary-200: #b3c7f0;
  --primary-300: #8aa8e0;
  --primary-400: #5d82c8;
  --primary-500: #3a5f9e;
  --primary-600: #1e3a6e;
  --primary-700: #172e58;
  --primary-800: #112244;
  --primary-900: #0c1a34;

  --accent-400: #f0c84a;
  --accent-500: #d4a843;
  --accent-600: #b8923a;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --emerald-50: #ecfdf5;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --rose-50: #fff1f2;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;

  --amber-50: #fffbeb;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;

  --sky-50: #f0f9ff;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;

  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e3a6e;
  --sidebar-hover: rgba(30, 58, 110, 0.12);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-primary: 0 4px 14px rgba(30, 58, 110, 0.35);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  line-height: 1.6;
}

::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

.form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--slate-600);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.925rem;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  background: var(--surface);
  color: var(--text);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus, .form-select:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(30, 58, 110, 0.12);
  outline: none;
}

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s var(--ease);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: 0 6px 20px rgba(30, 58, 110, 0.4);
  color: #fff;
}

.btn-success {
  background: var(--emerald-500);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: var(--emerald-600);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  color: #fff;
}

.btn-danger {
  background: var(--rose-500);
  color: #fff;
}

.btn-danger:hover {
  background: var(--rose-600);
  color: #fff;
}

.btn-outline-primary {
  border: 1.5px solid var(--primary-200);
  color: var(--primary-600);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.btn-outline-secondary {
  border: 1.5px solid var(--border);
  color: var(--slate-600);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-700);
}

.btn-outline-danger {
  border: 1.5px solid var(--rose-400);
  color: var(--rose-500);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--rose-500);
  color: #fff;
  border-color: var(--rose-500);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-500);
  padding: 0.5rem;
}

.btn-ghost:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.alert {
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: none;
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.alert-success { background: var(--emerald-50); color: #065f46; border-left: 3px solid var(--emerald-500); }
.alert-danger  { background: var(--rose-50); color: #9f1239; border-left: 3px solid var(--rose-500); }
.alert-warning { background: var(--amber-50); color: #92400e; border-left: 3px solid var(--amber-500); }
.alert-primary { background: var(--primary-50); color: var(--primary-800); border-left: 3px solid var(--primary-500); }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: box-shadow 0.2s var(--ease);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.stat-card.purple::before { background: linear-gradient(90deg, var(--primary-400), var(--primary-600)); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--emerald-400), var(--emerald-600)); }
.stat-card.amber::before  { background: linear-gradient(90deg, var(--accent-400), var(--accent-500)); }
.stat-card.sky::before    { background: linear-gradient(90deg, var(--sky-400), var(--sky-500)); }

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.stat-card .stat-icon.ic-purple { background: var(--primary-100); color: var(--primary-600); }
.stat-card .stat-icon.ic-green  { background: var(--emerald-50); color: var(--emerald-600); }
.stat-card .stat-icon.ic-amber  { background: var(--amber-50); color: var(--accent-500); }
.stat-card .stat-icon.ic-sky    { background: var(--sky-50); color: var(--sky-500); }

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.nav-tabs {
  border: none;
  gap: 0.25rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  display: inline-flex;
  width: auto;
}

.nav-tabs .nav-item { flex-shrink: 0; }

.nav-tabs .nav-link {
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.nav-tabs .nav-link:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.nav-tabs .nav-link.active {
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.table {
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.9rem;
}

.table thead th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  padding: 0.85rem 1rem;
}

.table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--slate-700);
}

.table tbody tr:hover td {
  background: var(--slate-50);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-2xl);
}

.modal-backdrop.show { opacity: 0.3; }

.spinner-border { color: var(--primary-500) !important; }

.badge {
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: var(--emerald-50); color: var(--emerald-600); }
.badge-warning { background: var(--amber-50); color: #92400e; }
.badge-danger  { background: var(--rose-50); color: var(--rose-600); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.45s var(--ease) both;
}

.fade-in-up-d1 { animation-delay: 0.05s; }
.fade-in-up-d2 { animation-delay: 0.1s; }
.fade-in-up-d3 { animation-delay: 0.15s; }
.fade-in-up-d4 { animation-delay: 0.2s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-in {
  animation: slideIn 0.35s var(--ease) both;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.5; }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-500);
  display: inline-block;
  animation: pulse-dot 2s infinite var(--ease);
}

.pulse-dot.recording {
  background: var(--rose-500);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

@media (max-width: 768px) {
  .stat-card { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
}
