/* AI Call Center v2 - Global Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #080b12; --sidebar: #0c1019; --card: #111827; --card-hover: #162032;
  --input: #1a2332; --border: #1e293b; --border-light: #334155;
  --text: #e2e8f0; --text-muted: #94a3b8; --text-dim: #64748b;
  --accent: #818cf8; --accent-bg: rgba(129,140,248,0.1); --accent-border: rgba(129,140,248,0.3);
  --green: #34d399; --green-bg: rgba(52,211,153,0.1);
  --red: #f87171; --red-bg: rgba(248,113,113,0.1);
  --yellow: #fbbf24; --yellow-bg: rgba(251,191,36,0.1);
  --blue: #60a5fa; --blue-bg: rgba(96,165,250,0.1);
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --sidebar-w: 240px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
}
.main { margin-left: var(--sidebar-w); flex: 1; padding: 32px; overflow-y: auto; min-height: 100vh; }

/* Sidebar */
.sidebar-logo {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.sidebar-logo .text { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.sidebar-logo .sub { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.sidebar-section { font-size: 10px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px; padding: 16px 20px 6px; }
.sidebar-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; color: var(--text-muted);
  font-size: 14px; font-weight: 400; transition: all 0.15s; position: relative; text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.03); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--accent-bg); color: var(--accent); font-weight: 600;
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.sidebar-status { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--green); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--red); }
.sidebar-footer .meta { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.sidebar-customer {
  padding: 12px 16px; margin: 8px; border-radius: var(--radius-sm);
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  cursor: pointer; transition: all 0.2s;
}
.sidebar-customer:hover { background: rgba(129,140,248,0.15); }
.sidebar-customer .name { font-size: 13px; font-weight: 600; color: var(--accent); }
.sidebar-customer .type { font-size: 11px; color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); transition: all 0.2s; font-family: var(--font);
}
.btn:hover { background: var(--card-hover); border-color: var(--border-light); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { color: var(--red); border-color: rgba(248,113,113,0.3); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; }

/* Inputs */
input, select, textarea {
  background: var(--input); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font); width: 100%;
  transition: border-color 0.2s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 100px; resize: vertical; font-family: var(--mono); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 16px; font-weight: 600; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-ended { background: var(--input); color: var(--text-dim); }
.badge-error { background: var(--red-bg); color: var(--red); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:hover td { background: rgba(255,255,255,0.015); }
tr.clickable { cursor: pointer; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 6px; font-weight: 600; }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }

/* Page */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.page-sub { font-size: 14px; color: var(--text-dim); margin-top: 4px; }

/* Utility */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Animations */
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--text-dim); }
.spinner { display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: 10px; font-size: 14px; color: #fff;
  animation: fadeIn 0.3s ease; pointer-events: none;
}
