/* =========================================================
   PacaBot — Customer Dashboard
   Dark premium theme — #0D1117, cyan (#00D4FF), gold (#F5C842)
   ========================================================= */

:root {
  --bg-primary:    #0D1117;
  --bg-secondary:  #161B22;
  --bg-card:       #1C2230;
  --bg-card-hover: #202838;
  --border:        #30363D;
  --border-active: #00D4FF;
  --cyan:          #00D4FF;
  --cyan-dim:      rgba(0, 212, 255, 0.12);
  --cyan-glow:     rgba(0, 212, 255, 0.35);
  --gold:          #F5C842;
  --gold-dim:      rgba(245, 200, 66, 0.12);
  --gold-glow:     rgba(245, 200, 66, 0.30);
  --text-primary:  #E6EDF3;
  --text-secondary:#8B949E;
  --text-muted:    #484F58;
  --success:       #3FB950;
  --success-dim:   rgba(63, 185, 80, 0.12);
  --warning:       #F0A000;
  --warning-dim:   rgba(240, 160, 0, 0.12);
  --error:         #F85149;
  --error-dim:     rgba(248, 81, 73, 0.12);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.45);
  --shadow-glow:   0 0 30px rgba(0, 212, 255, 0.10);
  --sidebar-w:     240px;
  --topbar-h:      60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

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

/* ── Background grid ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* =========================================================
   AUTH SCREEN (login/loading before dashboard)
   ========================================================= */
#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
#auth-screen.hidden { display: none; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 1;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #0080A0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #0D1117;
  flex-shrink: 0;
}
.auth-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.auth-logo-text span { color: var(--cyan); }
.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-error {
  background: var(--error-dim);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.visible { display: block; }

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

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  overflow: hidden;
  text-decoration: none;
}
.logo-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), #0080A0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #0D1117;
}
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  transition: opacity var(--transition);
}
.logo-text span { color: var(--cyan); }
.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section {
  margin-bottom: 20px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 8px 6px;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: 6px;
}
.nav-item svg {
  min-width: 20px;
  width: 20px;
  height: 20px;
}
.nav-item-label {
  transition: opacity var(--transition);
  overflow: hidden;
}
.sidebar.collapsed .nav-item-label { opacity: 0; pointer-events: none; }

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

/* ── Sidebar toggle ── */
.sidebar-toggle {
  position: fixed;
  top: 16px;
  left: calc(var(--sidebar-w) - 18px);
  z-index: 300;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left var(--transition), background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-card-hover); color: var(--cyan); }
.sidebar-toggle svg { transition: transform var(--transition); }
.sidebar.collapsed + .sidebar-toggle,
.sidebar-toggle.collapsed {
  left: 50px;
}
.sidebar-toggle.collapsed svg { transform: rotate(180deg); }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.main-content.sidebar-collapsed { margin-left: 64px; }

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.agent-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px 5px 8px;
  font-size: 13px;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.green { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse-green 2s infinite; }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.red { background: var(--error); box-shadow: 0 0 8px var(--error); animation: pulse-red 1.5s infinite; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 4px var(--success); }
  50% { box-shadow: 0 0 12px var(--success); }
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 4px var(--error); }
  50% { box-shadow: 0 0 12px var(--error); }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-dim), var(--gold-dim));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--cyan);
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover { border-color: var(--error); color: var(--error); }

/* ── Page content ── */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1200px;
  width: 100%;
}

/* ── Section views ── */
.view { display: none; }
.view.active { display: block; }

/* =========================================================
   SHARED COMPONENTS
   ========================================================= */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Stats */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-value.cyan { color: var(--cyan); }
.stat-value.gold { color: var(--gold); }
.stat-change {
  font-size: 12px;
  color: var(--text-muted);
}
.stat-change.up { color: var(--success); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,212,255,0.25); }
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(245,200,66,0.25); }
.badge-green { background: var(--success-dim); color: var(--success); border: 1px solid rgba(63,185,80,0.25); }
.badge-red { background: var(--error-dim); color: var(--error); border: 1px solid rgba(248,81,73,0.25); }
.badge-yellow { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(240,160,0,0.25); }
.badge-muted { background: rgba(139,148,158,0.10); color: var(--text-secondary); border: 1px solid var(--border); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--cyan);
  color: #0D1117;
}
.btn-primary:hover { background: #00bde0; box-shadow: 0 0 20px var(--cyan-glow); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-gold {
  background: var(--gold);
  color: #0D1117;
}
.btn-gold:hover { background: #e0b430; box-shadow: 0 0 20px var(--gold-glow); }
.btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid var(--error);
}
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 4px;
}

/* Form elements */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-secondary); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 5px; display: none; }
.form-error.visible { display: block; }

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info {}
.toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.toggle-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--cyan-dim); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--cyan);
}

/* Section heading */
.section-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.section-subheading {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Alert banners */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert svg { margin-top: 1px; flex-shrink: 0; }
.alert-warning { background: var(--warning-dim); border: 1px solid var(--warning); color: var(--warning); }
.alert-error { background: var(--error-dim); border: 1px solid var(--error); color: var(--error); }
.alert-success { background: var(--success-dim); border: 1px solid var(--success); color: var(--success); }
.alert-info { background: var(--cyan-dim); border: 1px solid var(--cyan); color: var(--cyan); }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-desc { font-size: 14px; }

/* =========================================================
   OVERVIEW VIEW
   ========================================================= */
.agent-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.agent-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--cyan-dim) 0%, transparent 70%);
  pointer-events: none;
}
.agent-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.agent-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}
.agent-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #0060A0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 26px;
  color: #0D1117;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
  flex-shrink: 0;
}
.agent-name-block {}
.agent-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.agent-tier-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.health-indicators {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.health-indicator {
  flex: 1;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.health-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-indicator-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.health-indicator-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: auto;
}

.uptime-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.uptime-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 1s ease;
}

/* =========================================================
   DEPLOYMENT PROGRESS VIEW
   ========================================================= */
.deploy-container {
  max-width: 720px;
}
.deploy-status-header {
  text-align: center;
  padding: 32px 0 28px;
}
.deploy-status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 2px solid var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.deploy-status-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.deploy-status-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.deploy-steps {
  list-style: none;
  margin-bottom: 24px;
}
.deploy-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: background var(--transition);
}
.deploy-step.active { background: var(--bg-card); }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}
.deploy-step.complete .step-number {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.deploy-step.in-progress .step-number {
  border-color: var(--cyan);
  color: var(--cyan);
}
.deploy-step.failed .step-number {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.step-label {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}
.deploy-step.complete .step-label { color: var(--text-primary); }
.deploy-step.in-progress .step-label { color: var(--cyan); font-weight: 500; }
.step-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.step-check {
  color: var(--success);
  flex-shrink: 0;
}
.step-cross {
  color: var(--error);
  flex-shrink: 0;
}

.progress-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #00A0C0);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Log terminal */
.log-terminal {
  background: #0A0E14;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'Fira Code', 'Cascadia Code', 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  color: #A8B2BF;
  height: 220px;
  overflow-y: auto;
  line-height: 1.6;
  margin-top: 16px;
}
.log-terminal::-webkit-scrollbar { width: 6px; }
.log-terminal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.log-line-ok { color: #3FB950; }
.log-line-warn { color: #F5C842; }
.log-line-err { color: #F85149; }
.log-line-info { color: #58A6FF; }

.deploy-complete-actions {
  text-align: center;
  padding: 24px 0 8px;
}
.deploy-complete-actions .btn {
  font-size: 16px;
  padding: 14px 32px;
}

/* =========================================================
   SETTINGS VIEW
   ========================================================= */
.settings-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.settings-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* Connected accounts */
.connected-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.connected-account-row:last-child { border-bottom: none; }
.connected-account-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.connected-account-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.connected-account-name { font-size: 14px; font-weight: 500; }
.connected-account-status { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* API keys */
.api-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.api-key-row:last-child { border-bottom: none; }
.api-key-name { font-size: 14px; font-weight: 500; flex: 1; }
.api-key-value {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 2;
}
.api-key-configured { color: var(--success); font-size: 12px; }
.api-key-missing { color: var(--text-muted); font-size: 12px; }

/* =========================================================
   BILLING VIEW
   ========================================================= */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.plan-card.operator-tier {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-dim), var(--shadow-card);
}
.plan-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
  pointer-events: none;
}
.plan-name {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.plan-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 4px;
}
.plan-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
}
.plan-billing-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.billing-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
}

.payment-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.payment-history-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.payment-history-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.payment-history-table tr:last-child td { border-bottom: none; }
.payment-history-table td:first-child { color: var(--text-primary); }

/* =========================================================
   SUPPORT VIEW
   ========================================================= */
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.support-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.support-action-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-dim);
}
.support-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--cyan);
}
.support-action-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.support-action-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  padding: 16px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: inherit;
}
.faq-question:hover { color: var(--cyan); }
.faq-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
  color: var(--text-muted);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 16px;
  line-height: 1.7;
  display: none;
}
.faq-item.open .faq-answer { display: block; }

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: slide-in 0.25s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.info { border-color: var(--cyan); }
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.toast.hiding { animation: slide-out 0.25s ease forwards; }

/* =========================================================
   MOBILE / RESPONSIVE
   ========================================================= */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .support-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  :root { --sidebar-w: 240px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }
  .sidebar-toggle { display: none; }
  .mobile-menu-btn { display: flex; }

  .main-content { margin-left: 0 !important; }
  .page-content { padding: 16px 16px 32px; }

  .agent-hero-inner { flex-direction: column; align-items: flex-start; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  .plan-card { padding: 20px; }
  .topbar { padding: 0 16px; }
  .topbar .user-chip .user-name { display: none; }
  .settings-nav { overflow-x: auto; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    display: none;
  }
  .sidebar-overlay.visible { display: block; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .health-indicators { flex-direction: column; }
  .deploy-container { max-width: 100%; }
}

/* ═══════════════════════════════════════════
   LANGUAGE TOGGLE
═══════════════════════════════════════════ */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--cyan); color: var(--text-primary); }
.lang-ar, .lang-en { transition: color var(--transition); }
.lang-ar.active, .lang-en.active { color: var(--gold); font-weight: 600; }
.lang-sep { opacity: 0.3; }

/* ═══════════════════════════════════════════
   RTL SUPPORT
═══════════════════════════════════════════ */
html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}
html[dir="rtl"] .sidebar-toggle {
  left: auto;
  right: calc(var(--sidebar-w) - 18px);
}
html[dir="rtl"] .sidebar-toggle svg { transform: rotate(180deg); }
html[dir="rtl"] .sidebar-toggle.collapsed {
  right: 50px;
}
html[dir="rtl"] .sidebar-toggle.collapsed svg { transform: rotate(0deg); }
html[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-w);
}
html[dir="rtl"] .main-content.sidebar-collapsed {
  margin-left: 0;
  margin-right: 64px;
}
html[dir="rtl"] .nav-item.active {
  border-left: none;
  border-right: 2px solid var(--cyan);
  padding-left: 0;
  padding-right: 6px;
}
html[dir="rtl"] .nav-item { text-align: right; }
html[dir="rtl"] .payment-history-table th { text-align: right; }
html[dir="rtl"] .faq-question { text-align: right; }

/* RTL mobile overrides */
@media (max-width: 768px) {
  html[dir="rtl"] .sidebar {
    right: auto;
    left: auto;
    transform: translateX(100%);
    right: 0;
  }
  html[dir="rtl"] .sidebar.mobile-open {
    transform: translateX(0);
  }
  html[dir="rtl"] .main-content {
    margin-right: 0 !important;
  }
}

/* =========================================================
   ANALYTICS VIEW
   ========================================================= */

/* Nav icon sizing for emoji nav items */
.nav-icon {
  font-size: 18px;
  min-width: 20px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-health-card {}
.analytics-health-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.analytics-health-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 80px;
}
.health-indicator-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.health-indicator-large.green {
  background: var(--success);
  box-shadow: 0 0 16px var(--success), 0 0 32px rgba(63,185,80,0.3);
  animation: pulse-green 2s infinite;
}
.health-indicator-large.yellow {
  background: var(--warning);
  box-shadow: 0 0 16px var(--warning), 0 0 32px rgba(240,160,0,0.3);
}
.health-indicator-large.red {
  background: var(--error);
  box-shadow: 0 0 16px var(--error), 0 0 32px rgba(248,81,73,0.3);
  animation: pulse-red 1.5s infinite;
}
.analytics-health-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.analytics-gauges {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.metric-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.metric-gauge canvas { display: block; }
.gauge-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.analytics-uptime-badges {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
}
.uptime-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: center;
  min-width: 80px;
}
.uptime-badge-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.uptime-badge-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

/* Uptime calendar grid */
.uptime-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 4px;
  padding: 4px 0;
}
.uptime-day {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: default;
  position: relative;
  transition: transform 0.15s ease;
}
.uptime-day:hover { transform: scale(1.2); z-index: 1; }
.uptime-day.day-green { background: var(--success); }
.uptime-day.day-yellow { background: var(--warning); }
.uptime-day.day-red { background: var(--error); }
.uptime-day.day-unknown { background: var(--border); }
.uptime-day .day-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  display: none;
  pointer-events: none;
  z-index: 10;
  box-shadow: var(--shadow-card);
}
.uptime-day:hover .day-tooltip { display: block; }

/* Events timeline */
.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.events-timeline::-webkit-scrollbar { width: 4px; }
.events-timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.event-dot.info    { background: var(--cyan); }
.event-dot.success { background: var(--success); }
.event-dot.warning { background: var(--warning); }
.event-dot.error   { background: var(--error); }
.event-body { flex: 1; }
.event-message { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.event-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* =========================================================
   FLEET VIEW (Admin)
   ========================================================= */

.fleet-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.fleet-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.fleet-summary-healthy  { border-left-color: var(--success); }
.fleet-summary-degraded { border-left-color: var(--warning); }
.fleet-summary-down     { border-left-color: var(--error); }
.fleet-summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.fleet-summary-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.fleet-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fleet-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.fleet-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.fleet-table tr:last-child td { border-bottom: none; }
.fleet-table tr.row-green td:first-child { border-left: 3px solid var(--success); padding-left: 9px; }
.fleet-table tr.row-yellow td:first-child { border-left: 3px solid var(--warning); padding-left: 9px; }
.fleet-table tr.row-red td:first-child { border-left: 3px solid var(--error); padding-left: 9px; }
.fleet-table td:first-child { color: var(--text-primary); font-weight: 600; }

.fleet-alerts-panel {}
.fleet-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fleet-alert-item:last-child { border-bottom: none; }
.fleet-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.fleet-alert-dot.critical { background: var(--error); box-shadow: 0 0 6px var(--error); }
.fleet-alert-dot.warning  { background: var(--warning); }
.fleet-alert-dot.info     { background: var(--cyan); }
.fleet-alert-message { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.fleet-alert-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Analytics + Fleet responsive */
@media (max-width: 768px) {
  .analytics-health-inner { flex-direction: column; align-items: flex-start; }
  .analytics-uptime-badges { margin-left: 0; }
  .fleet-summary { grid-template-columns: 1fr 1fr; }
  .fleet-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .fleet-summary { grid-template-columns: 1fr 1fr; }
  .analytics-gauges { gap: 12px; }
}

/* LTR mode (when switched to English) */
html[dir="ltr"] .sidebar {
  left: 0;
  right: auto;
  border-right: 1px solid var(--border);
  border-left: none;
}
html[dir="ltr"] .sidebar-toggle {
  left: calc(var(--sidebar-w) - 18px);
  right: auto;
}
html[dir="ltr"] .sidebar-toggle svg { transform: none; }
html[dir="ltr"] .sidebar-toggle.collapsed {
  left: 50px;
  right: auto;
}
html[dir="ltr"] .sidebar-toggle.collapsed svg { transform: rotate(180deg); }
html[dir="ltr"] .main-content {
  margin-left: var(--sidebar-w);
  margin-right: 0;
}
html[dir="ltr"] .main-content.sidebar-collapsed {
  margin-left: 64px;
  margin-right: 0;
}

/* =========================================================
   SUPPORT — TICKET FORM & TABLE
   ========================================================= */

/* Submit ticket form card */
.ticket-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.ticket-form-card .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.ticket-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 600px) {
  .ticket-form-grid { grid-template-columns: 1fr; }
}
.ticket-form-card .form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.ticket-form-card select.form-input,
.ticket-form-card input.form-input,
.ticket-form-card textarea.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}
.ticket-form-card select.form-input:focus,
.ticket-form-card input.form-input:focus,
.ticket-form-card textarea.form-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.ticket-form-card select.form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.ticket-confirm-banner {
  background: var(--success-dim);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--success);
}
.ticket-confirm-banner.visible { display: flex; }
.ticket-confirm-num {
  font-weight: 700;
  color: var(--cyan);
}

/* Priority badges */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.priority-badge.high   { background: var(--error-dim);   color: var(--error);   border: 1px solid rgba(248,81,73,0.25); }
.priority-badge.medium { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(240,160,0,0.25); }
.priority-badge.low    { background: rgba(139,148,158,0.10); color: var(--text-secondary); border: 1px solid var(--border); }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.status-badge.received    { background: var(--cyan-dim);    color: var(--cyan);    border: 1px solid rgba(0,212,255,0.25); }
.status-badge.in_progress { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(240,160,0,0.25); }
.status-badge.resolved    { background: var(--success-dim); color: var(--success); border: 1px solid rgba(63,185,80,0.25); }
.status-badge.closed      { background: rgba(139,148,158,0.10); color: var(--text-muted); border: 1px solid var(--border); }

/* Ticket table */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ticket-table th {
  text-align: left;
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ticket-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.ticket-table tr:last-child td { border-bottom: none; }
.ticket-table tbody tr { cursor: pointer; transition: background var(--transition); }
.ticket-table tbody tr:hover td { background: var(--bg-card-hover); }
.ticket-table td.ticket-num { color: var(--cyan); font-weight: 700; font-size: 12px; }
.ticket-table td.ticket-subject { color: var(--text-primary); font-weight: 500; }

/* Expandable ticket detail */
.ticket-detail-row { display: none; }
.ticket-detail-row.open { display: table-row; }
.ticket-detail-row td {
  background: var(--bg-secondary);
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}
.ticket-detail {
  padding: 18px 20px;
}
.ticket-detail-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  margin-top: 16px;
}
.ticket-detail-label:first-child { margin-top: 0; }
.ticket-detail-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Status history timeline */
.ticket-history {
  margin-top: 4px;
}
.ticket-history-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.ticket-history-item:last-child { border-bottom: none; }
.ticket-history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  margin-top: 5px;
}
.ticket-history-content { flex: 1; }
.ticket-history-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.ticket-history-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
