:root {
  --bg: #0c0e16;
  --surface: #13151f;
  --surface2: #1a1d2e;
  --surface3: #20243a;
  --border: #252840;
  --border2: #2e3350;
  --accent: #4f8ef7;
  --accent2: #7c5bf7;
  --accent-glow: rgba(79,142,247,0.15);
  --green: #22c55e;
  --green-glow: rgba(34,197,94,0.12);
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #eaecf4;
  --text2: #b0b7cc;
  --muted: #5a6282;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

/* ─── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  padding: 8px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.logo-img {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text2); }
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sync-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sync-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

/* ─── Mobile nav ─────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(19,21,31,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 52px;
}
.mobile-nav-item svg { width: 22px; height: 22px; stroke: currentColor; }
.mobile-nav-item span { font-size: 10px; font-weight: 500; }
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item.active svg { filter: drop-shadow(0 0 6px rgba(79,142,247,0.5)); }

/* ─── Main ───────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

/* ─── Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ─── Stats grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-card:hover::after { opacity: 1; }

.stat-label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-value { font-size: 34px; font-weight: 800; margin: 8px 0 4px; line-height: 1; letter-spacing: -1px; }
.stat-delta { font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-neutral { color: var(--muted); }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

/* ─── Score ──────────────────────────────────────────────── */
.score {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-weight: 700; font-size: 13px;
}
.score-sm { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.score-high { background: var(--green-glow); color: var(--green); }
.score-mid  { background: rgba(245,158,11,0.12); color: var(--yellow); }
.score-low  { background: rgba(239,68,68,0.1);  color: var(--red); }

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; cursor: pointer; }
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }
td { padding: 12px 14px; vertical-align: middle; }

/* ─── Progress ───────────────────────────────────────────── */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.fill-green { background: var(--green); }
.fill-yellow { background: var(--yellow); }
.fill-red { background: var(--red); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3d7ef0; box-shadow: 0 4px 14px rgba(79,142,247,0.35); }
.btn-secondary { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.08); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.16); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ─── Search / inputs ────────────────────────────────────── */
.search-row { display: flex; gap: 10px; margin-bottom: 20px; }
.search-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }
select.search-input { cursor: pointer; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 28px;
  width: 560px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow);
}
.modal-overlay.open .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: none; padding: 4px; border-radius: 6px; transition: all 0.15s; }
.modal-close:hover { color: var(--text); background: var(--surface2); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border 0.15s;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ─── Tags ───────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.tag-sale     { background: rgba(34,197,94,0.12);  color: var(--green); }
.tag-nosale   { background: rgba(239,68,68,0.1);   color: var(--red); }
.tag-nextstep { background: rgba(79,142,247,0.12); color: var(--accent); }
.tag-unknown  { background: rgba(90,98,130,0.15);  color: var(--muted); }

/* ─── Employee ───────────────────────────────────────────── */
.emp-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.emp-avatar {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 20px; font-weight: 700; }
.emp-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.score-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-name { color: var(--muted); font-size: 12px; }

/* ─── Report ─────────────────────────────────────────────── */
.report-text { white-space: pre-wrap; line-height: 1.75; color: var(--text); font-size: 14px; }

/* ─── Period toggle ──────────────────────────────────────── */
.period-toggle { display: flex; background: var(--surface2); border-radius: 8px; padding: 2px; gap: 2px; }
.period-btn {
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; border: none;
  background: none; color: var(--muted);
  transition: all 0.15s;
}
.period-btn.active { background: var(--surface3); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ─── Play button ────────────────────────────────────────── */
.play-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--accent);
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.play-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 12px rgba(79,142,247,0.4); }
.play-btn.playing { background: rgba(239,68,68,0.15); color: var(--red); border-color: rgba(239,68,68,0.3); }
.inline-player { margin-top: 4px; }

/* ─── Audio player ───────────────────────────────────────── */
.audio-player-inline {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 6px;
  user-select: none;
}
.ap-playpause {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none; color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ap-playpause:hover { background: var(--accent2); transform: scale(1.08); box-shadow: 0 0 14px rgba(79,142,247,0.45); }
.ap-time { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 34px; font-variant-numeric: tabular-nums; }
.ap-track {
  flex: 1; height: 5px;
  background: var(--border2);
  border-radius: 3px;
  cursor: pointer;
  position: relative; min-width: 60px;
  transition: height 0.12s;
}
.ap-track:hover { height: 7px; }
.ap-progress { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; pointer-events: none; }
.ap-thumb {
  position: absolute;
  top: 50%; left: 0%;
  transform: translate(-50%, -50%);
  width: 13px; height: 13px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.15s;
}
.ap-track:hover .ap-thumb { opacity: 1; }
.ap-vol-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ap-vol-icon {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 4px; border-radius: 5px;
  transition: color 0.15s;
}
.ap-vol-icon:hover { color: var(--text); }
.ap-vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 72px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  outline: none; cursor: pointer;
  accent-color: var(--accent);
}
.ap-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  cursor: pointer; box-shadow: 0 0 3px rgba(0,0,0,0.4);
}
.ap-vol-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  border: none; cursor: pointer;
}
@media (max-width: 500px) {
  .ap-vol-slider { width: 50px; }
}

/* ─── Auto-analysis toggle ───────────────────────────────── */
.auto-toggle-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.auto-toggle-btn:hover { border-color: var(--accent); color: var(--text); }
.auto-toggle-btn.active { border-color: var(--green); color: var(--green); background: var(--green-glow); }
.auto-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; transition: background 0.2s; }
.auto-toggle-btn.active .auto-dot { background: var(--green); }
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.auto-dot.pulse { animation: pulse-dot 1.4s infinite; }

/* ─── Toast ──────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px; font-weight: 500;
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
  box-shadow: var(--shadow);
}
#toast.show { transform: none; opacity: 1; }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red); color: var(--red); }
#toast.info    { border-color: var(--border2); color: var(--text2); }

/* ─── Call card ──────────────────────────────────────────── */
.call-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.call-card:hover { border-color: var(--border2); background: var(--surface3); }
.call-card-header { display: flex; align-items: center; justify-content: space-between; }
.call-card-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.call-eval { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ─── Calls table ────────────────────────────────────────── */
.calls-table-wrap { overflow-x: auto; }
.calls-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calls-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.calls-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.calls-table tbody tr:hover { background: var(--surface2); }
.calls-table tbody tr:last-child td { border-bottom: none; }

/* ─── Empty / loader ─────────────────────────────────────── */
.empty { text-align: center; padding: 56px; color: var(--muted); }
.empty-icon { font-size: 42px; margin-bottom: 12px; opacity: 0.5; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 60px; }

/* ─── Layout helpers ─────────────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 15px; font-weight: 700; }
.chart-container { position: relative; height: 200px; }

/* ─── Responsive: tablet ─────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .main { padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Responsive: mobile ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main { margin-left: 0; padding: 16px 14px calc(72px + env(safe-area-inset-bottom)); }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 26px; }
  .two-col, .detail-grid { grid-template-columns: 1fr; }
  .score-breakdown { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .modal { border-radius: 18px 18px 0 0; position: fixed; bottom: 0; left: 0; right: 0; width: 100% !important; max-height: 92vh; margin: 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .auto-toggle-btn span:not(.auto-dot) { display: none; }
  .auto-toggle-btn { padding: 8px; border-radius: 50%; width: 38px; height: 38px; justify-content: center; }
  #toast { bottom: 80px; right: 14px; left: 14px; max-width: none; text-align: center; }
  .card { padding: 16px; }
  .calls-table th:nth-child(3), .calls-table td:nth-child(3),
  .calls-table th:nth-child(4), .calls-table td:nth-child(4) { display: none; }
  .page-title { font-size: 18px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .score-breakdown { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

/* ─── Login screen ───────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.login-bg {
  position: absolute; inset: 0;
  overflow: hidden;
}
.login-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.45) saturate(0.8);
}
.login-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(12,14,22,0.7) 0%, rgba(79,142,247,0.08) 100%);
  backdrop-filter: blur(1px);
}
.login-box {
  position: relative; z-index: 1;
  background: rgba(19,21,31,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 36px 32px;
  width: 100%; max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(79,142,247,0.08);
}
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo-img { height: 44px; filter: brightness(0) invert(1); opacity: 0.9; }
.login-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.login-subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 4px; }
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
}
.login-eye {
  position: absolute; right: 12px; bottom: 10px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 4px; border-radius: 4px;
  transition: color 0.15s;
}
.login-eye:hover { color: var(--text); }

/* Custom login dropdown */
.login-select {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px; color: var(--text2);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.login-select:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.2); }
.login-select.open { border-color: var(--accent); background: rgba(79,142,247,0.08); }
.login-select svg { flex-shrink: 0; color: var(--muted); transition: transform 0.2s; }
.login-select.open svg { transform: rotate(180deg); }
.login-select-selected { color: var(--text); font-weight: 500; }

.login-dropdown {
  position: relative;
  background: rgba(20,22,34,0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
  z-index: 10;
}
.login-dropdown.open {
  max-height: 280px;
  opacity: 1;
  pointer-events: all;
}
.login-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.login-dropdown-item:last-child { border-bottom: none; }
.login-dropdown-item:hover { background: rgba(79,142,247,0.12); }
.login-dropdown-item.selected { background: rgba(79,142,247,0.15); }
.login-dropdown-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.login-dropdown-name { font-size: 14px; font-weight: 500; color: var(--text); }
.login-dropdown-role { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Sidebar user chip */
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 6px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sidebar-user-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  background: rgba(79,142,247,0.15); color: var(--accent);
}

/* Hide admin items for non-admins */
.hide-for-nonadmin { display: none !important; }

@media (max-width: 480px) {
  .login-box { padding: 28px 20px; }
  .login-title { font-size: 18px; }
}
