/* ============================================
   IT SUPPORT SIMULATOR — Main Stylesheet
   ============================================ */

:root {
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-main: #0f172a;
  --bg-input: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #1d4ed8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #334155;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --sidebar-width: 240px;
  --transition: 0.2s ease;
}

/* ---- RESET ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

a:hover {
  color: var(--accent-hover);
}

/* ---- LAYOUT ---- */
.app-container {
  display: flex;
  min-height: 100vh;
}

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

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

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.sidebar-header .logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-header .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-nav a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  background: var(--accent);
  color: white;
}

.sidebar-nav a .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

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

.lang-selector {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

/* ---- FLAG BUTTONS ---- */
.flag-btn {
  position: relative;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  padding: 3px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  line-height: 0;
}

.flag-btn img {
  display: block;
  width: 28px;
  height: 19px;
  border-radius: 2px;
}

.flag-btn:hover {
  transform: scale(1.15);
  opacity: 1;
}

.flag-btn.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Tooltip — aparece após 0.7s de hover */
.flag-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid #334155;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease 0s;
  z-index: 999;
}

/* Seta do tooltip */
.flag-btn::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #334155;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease 0s;
  z-index: 999;
}

/* Aparecer após 0.7s */
.flag-btn:hover::after,
.flag-btn:hover::before {
  opacity: 1;
  transition-delay: 0.7s;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

.search-box {
  position: relative;
}

.search-box input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius);
  font-size: 14px;
  width: 260px;
  outline: none;
  transition: border-color var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

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

.page-content {
  flex: 1;
  padding: 32px;
}

/* ---- PAGE HEADER ---- */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-info h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

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

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

/* ---- TABLES ---- */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-open { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.badge-progress { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-resolved { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-closed { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

.badge-low { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-medium { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-high { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-critical { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* ---- FORMS (LOGIN) ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-main);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-box .logo-icon {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: white;
  margin: 0 auto 16px;
}

.login-box h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.login-box p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus {
  border-color: var(--accent);
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
}

.login-footer {
  margin-top: 20px;
  /* Tooltip needs to escape the box */
  overflow: visible;
}

/* Na login/index box, tooltip aponta para BAIXO (não cortado pela caixa) */
.login-footer .flag-btn::after {
  bottom: auto;
  top: calc(100% + 9px);
}
.login-footer .flag-btn::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: #334155;
}

/* ---- KNOWLEDGE GRID ---- */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
}

.knowledge-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.knowledge-card .card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.knowledge-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.knowledge-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---- SIMULATION ---- */
.simulation-phone {
  max-width: 500px;
  margin: 0 auto;
}

.phone-ring {
  text-align: center;
  padding: 40px;
  animation: pulse 2s infinite;
}

.phone-ring .phone-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.phone-ring h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.phone-ring p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.call-details {
  padding: 24px;
}

.call-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.call-details .detail-row .label {
  color: var(--text-muted);
}

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

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

.empty-state p {
  font-size: 15px;
}

/* ---- FOOTER ---- */
.app-footer {
  padding: 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ---- OVERLAY (mobile) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

  .topbar {
    padding: 12px 16px;
  }

  .search-box input {
    width: 160px;
  }

  .page-content {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .user-name {
    display: none;
  }
}

/* ============================================
   DASHBOARD V2 — Charts & Activity
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  position: relative;
  padding: 20px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding-top: 10px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
  min-height: 4px;
  position: relative;
}

.bar:hover {
  opacity: 0.85;
}

.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.bar-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Activity feed */
.activity-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.blue { background: var(--accent); }
.activity-dot.green { background: var(--success); }
.activity-dot.yellow { background: var(--warning); }
.activity-dot.red { background: var(--danger); }

.activity-text {
  flex: 1;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* SLA mini bars */
.sla-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sla-label {
  width: 80px;
  font-size: 12px;
  color: var(--text-secondary);
}

.sla-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.sla-bar-fill {
  height: 100%;
  max-width: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.sla-percent {
  width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================
   TICKETS V2 — GLPI Style
   ============================================ */
.ticket-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ticket-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-btn .count {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}

/* Ticket detail panel */
.ticket-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .ticket-split {
    grid-template-columns: 1fr;
  }
}

.ticket-detail-panel {
  position: relative;
}

.ticket-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.meta-value {
  font-size: 14px;
  color: var(--text-primary);
}

.ticket-description {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ticket-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ticket-notes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 14px;
  border-left: 3px solid var(--accent);
}

.note-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.note-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.note-date {
  font-size: 11px;
  color: var(--text-muted);
}

.note-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.note-input-area {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.note-input-area textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.note-input-area textarea:focus {
  border-color: var(--accent);
}

/* SLA indicator in ticket row */
.sla-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.sla-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ============================================
   SIMULATION V2 — Full Experience
   ============================================ */
.sim-container {
  max-width: 800px;
  margin: 0 auto;
}

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

.sim-level-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.sim-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.sim-timer .dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: blink 1s infinite;
}

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

.sim-mood-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-input);
  border-radius: var(--radius);
  font-size: 13px;
}

.mood-face {
  font-size: 20px;
}

/* Chat-style conversation */
.sim-chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-main);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  animation: fadeIn 0.3s ease;
}

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

.chat-bubble.caller {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.tech {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble .bubble-name {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.7;
}

/* Response options */
.sim-response-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.response-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
  text-align: left;
  color: var(--text-primary);
}

.response-option:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.response-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.response-option.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.response-option .option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Score card */
.score-card {
  text-align: center;
  padding: 40px;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  font-weight: 700;
}

.score-circle.good {
  border-color: var(--success);
  color: var(--success);
}

.score-circle.ok {
  border-color: var(--warning);
  color: var(--warning);
}

.score-circle.bad {
  border-color: var(--danger);
  color: var(--danger);
}

.score-details {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.score-detail {
  text-align: center;
}

.score-detail .value {
  font-size: 20px;
  font-weight: 700;
  display: block;
}

.score-detail .label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Hint box */
.hint-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--warning);
  display: none;
}

.hint-box.visible {
  display: block;
}

/* Modal overlay for new ticket */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.modal-box h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.modal-box .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.modal-box .form-group select:focus {
  border-color: var(--accent);
}

.modal-box .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
}

.modal-box .form-group textarea:focus {
  border-color: var(--accent);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Clickable table rows */
table tr.clickable {
  cursor: pointer;
}

table tr.clickable:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* ============================================
   PROGRESS SYSTEM — XP, Level, Badges
   ============================================ */

/* Level + XP bar card */
.xp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.xp-level-icon {
  width: 56px; height: 56px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.xp-ring-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.xp-ring-num {
  position: relative; z-index: 1;
  font-size: 15px; font-weight: 800; color: var(--text);
}

.xp-info {
  flex: 1;
}

.xp-level-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.xp-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.xp-bar-wrapper {
  height: 8px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.xp-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.xp-total span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  text-align: right;
}

/* Badge grid */
.badges-section {
  margin-top: 24px;
}

.badges-section h2 {
  font-size: 16px;
  margin-bottom: 16px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.badge-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

.badge-chip.earned {
  border-color: var(--badge-color, var(--accent));
  box-shadow: 0 0 0 1px var(--badge-color, var(--accent)), 0 4px 12px rgba(0,0,0,0.3);
}

.badge-chip.locked {
  opacity: 0.35;
  filter: grayscale(1);
}

.badge-chip .badge-icon {
  font-size: 28px;
  margin-bottom: 6px;
  line-height: 1;
}

.badge-chip .badge-name {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
}

.badge-chip .badge-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* XP earned notification on score panel */
.xp-earned-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 10px;
  padding: 10px 18px;
  margin: 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.xp-earned-box .xp-icon {
  font-size: 20px;
}

/* New badge notification (inline in score) */
.new-badge-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
}

.new-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.4);
  color: var(--success);
  animation: fadeUp 0.4s ease;
}
