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

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #10102a;
  --bg-card: rgba(18, 18, 42, 0.8);
  --bg-card-hover: rgba(25, 25, 55, 0.9);
  --bg-input: rgba(30, 30, 60, 0.6);
  --border: rgba(108, 92, 231, 0.2);
  --border-hover: rgba(108, 92, 231, 0.5);
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --teal: #00cec9;
  --teal-glow: rgba(0, 206, 201, 0.3);
  --green: #00b894;
  --green-glow: rgba(0, 184, 148, 0.3);
  --yellow: #fdcb6e;
  --yellow-glow: rgba(253, 203, 110, 0.3);
  --red: #ff6b6b;
  --red-glow: rgba(255, 107, 107, 0.3);
  --orange: #e17055;
  --blue: #74b9ff;
  --text: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6c6c80;
  --sidebar-width: 260px;
  --header-height: 60px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 184, 148, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== AUTH SCREEN ===== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  width: 440px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px var(--accent-glow);
  animation: slideUp 0.6s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a4bd4);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-full { width: 100%; }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); }

.btn-danger {
  background: linear-gradient(135deg, var(--red), #ee5a5a);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #00a884);
  color: white;
}

.btn-teal {
  background: linear-gradient(135deg, var(--teal), #00b8b3);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 8px;
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-toggle a {
  color: var(--accent-light);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover { text-decoration: underline; }

.error-msg {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--red);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.error-msg.show { display: block; }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(108, 92, 231, 0.1);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 206, 201, 0.1));
  color: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-info:hover { background: rgba(108, 92, 231, 0.1); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 24px 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(30%, -30%);
}

.stat-card.purple::after { background: var(--accent); }
.stat-card.teal::after { background: var(--teal); }
.stat-card.green::after { background: var(--green); }
.stat-card.yellow::after { background: var(--yellow); }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--border-hover);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: var(--accent-light); }
.stat-icon.teal { background: rgba(0, 206, 201, 0.15); color: var(--teal); }
.stat-icon.green { background: rgba(0, 184, 148, 0.15); color: var(--green); }
.stat-icon.yellow { background: rgba(253, 203, 110, 0.15); color: var(--yellow); }

.stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== CARDS & PANELS ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== STATUS GRID ===== */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  transition: background 0.4s ease;
}

.status-card[data-status="available"]::before { background: var(--green); }
.status-card[data-status="on_call"]::before { background: var(--red); }
.status-card[data-status="ringing"]::before { background: var(--yellow); }
.status-card[data-status="hold"]::before { background: var(--orange); }
.status-card[data-status="busy"]::before { background: var(--red); }
.status-card[data-status="away"]::before,
.status-card[data-status="lunch"]::before { background: var(--yellow); }
.status-card[data-status="do_not_disturb"]::before { background: var(--red); }
.status-card[data-status="offline"]::before { background: var(--text-muted); }

.status-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.status-avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  position: relative;
  transition: all 0.4s ease;
}

.status-avatar.available { background: linear-gradient(135deg, var(--green), #00a080); }
.status-avatar.on_call { background: linear-gradient(135deg, var(--red), #e05555); animation: pulse-red 2s infinite; }
.status-avatar.ringing { background: linear-gradient(135deg, var(--yellow), #f0c040); animation: pulse-ring 0.8s infinite; }
.status-avatar.hold { background: linear-gradient(135deg, var(--orange), #d06040); animation: pulse-orange 2s infinite; }
.status-avatar.busy { background: linear-gradient(135deg, var(--red), #cc4444); }
.status-avatar.away, .status-avatar.lunch { background: linear-gradient(135deg, var(--yellow), #e0a030); }
.status-avatar.do_not_disturb { background: linear-gradient(135deg, #cc3333, #aa2222); }
.status-avatar.offline { background: linear-gradient(135deg, #555, #444); }

.status-indicator {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.status-indicator.available { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.status-indicator.on_call { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.status-indicator.ringing { background: var(--yellow); box-shadow: 0 0 8px var(--yellow-glow); animation: blink 0.5s infinite; }
.status-indicator.hold { background: var(--orange); }
.status-indicator.busy { background: var(--red); }
.status-indicator.away, .status-indicator.lunch { background: var(--yellow); }
.status-indicator.do_not_disturb { background: #cc3333; }
.status-indicator.offline { background: #666; }

.status-name { font-weight: 600; font-size: 15px; }
.status-extension { font-size: 12px; color: var(--text-muted); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.available { background: rgba(0, 184, 148, 0.15); color: var(--green); }
.status-badge.on_call { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.status-badge.ringing { background: rgba(253, 203, 110, 0.15); color: var(--yellow); }
.status-badge.hold { background: rgba(225, 112, 85, 0.15); color: var(--orange); }
.status-badge.busy { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.status-badge.away, .status-badge.lunch { background: rgba(253, 203, 110, 0.15); color: var(--yellow); }
.status-badge.do_not_disturb { background: rgba(204, 51, 51, 0.15); color: #ff5555; }
.status-badge.offline { background: rgba(100, 100, 100, 0.15); color: #888; }

.status-call-info {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-call-info .call-direction {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.status-call-info .call-direction.inbound { color: var(--teal); }
.status-call-info .call-direction.outbound { color: var(--accent-light); }

.status-call-info .call-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.status-call-info .call-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-call-info .call-duration {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'Courier New', monospace;
}

/* ===== RECORDINGS TABLE ===== */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236c6c80' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recording-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  transition: all 0.3s;
}

.recording-item:hover {
  background: rgba(108, 92, 231, 0.05);
  border-color: var(--border);
}

.recording-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.recording-info {
  flex: 1;
  min-width: 0;
}

.recording-info .rec-parties {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-info .rec-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.recording-info .rec-file {
  font-size: 11px;
  color: var(--text-muted);
}

.recording-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.ai-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.ai-badge.none { background: rgba(100, 100, 100, 0.2); color: #888; }
.ai-badge.processing { background: rgba(108, 92, 231, 0.2); color: var(--accent-light); animation: pulse-badge 1.5s infinite; }
.ai-badge.completed { background: rgba(0, 184, 148, 0.2); color: var(--green); cursor: pointer; }
.ai-badge.failed { background: rgba(255, 107, 107, 0.2); color: var(--red); }

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-top: 10px;
}

.audio-player audio {
  height: 32px;
  flex: 1;
}

/* ===== MAPPINGS ===== */
.mapping-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.mapping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.mapping-item .mapping-name {
  font-weight: 600;
  font-size: 14px;
}

.mapping-item .mapping-did {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

/* ===== INTEGRATION GUIDE ===== */
.endpoint-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 16px;
}

.endpoint-card h4 {
  font-size: 14px;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.endpoint-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--teal);
  word-break: break-all;
}

.endpoint-url .copy-btn {
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
  flex-shrink: 0;
}

.endpoint-url .copy-btn:hover { color: var(--accent-light); }

.endpoint-card p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== ADMIN ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-table tr:hover td {
  background: rgba(108, 92, 231, 0.03);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: rgba(0, 184, 148, 0.15); color: var(--green); }
.badge-red { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.badge-yellow { background: rgba(253, 203, 110, 0.15); color: var(--yellow); }
.badge-purple { background: rgba(108, 92, 231, 0.15); color: var(--accent-light); }

.token-display {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 2px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 700px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
  animation: slideUp 0.4s ease;
}

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

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.modal-body {
  padding: 28px;
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.summary-section {
  margin-bottom: 24px;
}

.summary-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-section .content {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  animation: slideInRight 0.4s ease, fadeOut 0.4s ease 3s forwards;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
}

.toast.success { background: rgba(0, 184, 148, 0.9); color: white; }
.toast.error { background: rgba(255, 107, 107, 0.9); color: white; }
.toast.info { background: rgba(108, 92, 231, 0.9); color: white; }

/* ===== LOADING ===== */
.loading-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(108, 92, 231, 0.3);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay .loading-spinner {
  width: 40px; height: 40px;
  border-width: 3px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state small {
  font-size: 13px;
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 112, 85, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(225, 112, 85, 0); }
}

@keyframes pulse-ring {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .mobile-toggle {
    display: flex !important;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 101;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
  }
  .status-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

.mobile-toggle { display: none; }

/* Tab system */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* Inline form row */
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group { flex: 1; margin-bottom: 0; }

/* Confirm dialog */
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.hidden { display: none !important; }

/* ===== GUIDE ===== */
.guide-section {
  margin-bottom: 32px;
}

.guide-section > h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-section > h2 .guide-num {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}

.guide-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-card p, .guide-card li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.guide-card ul, .guide-card ol {
  padding-left: 20px;
  margin-top: 8px;
}

.guide-card li {
  margin-bottom: 6px;
}

.guide-card code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--teal);
}

.guide-card .guide-step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

.guide-card .guide-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-card .guide-step-content {
  flex: 1;
}

.guide-card .guide-step-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.guide-card .guide-step-content p {
  font-size: 13px;
}

.guide-tip {
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid rgba(0, 184, 148, 0.2);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--green);
}

.guide-tip i {
  margin-right: 6px;
}

.guide-warning {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--red);
}

.guide-warning i {
  margin-right: 6px;
}

.guide-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.guide-toc-item {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.guide-toc-item:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108, 92, 231, 0.05);
}

.guide-toc-item i {
  color: var(--accent-light);
  width: 18px;
  text-align: center;
}

.status-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.status-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.status-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
