/* BLOQUEAR SCROLL ANTES DEL LOGIN */
:root {
  --primary: #0047ab;
  --primary-light: #1e90ff;
  --primary-dark: #001f3f;
  --bg-dark: #0a1929;
  --bg-darker: #0f172a;
  --bg-card: #1a2f4a;
  --text-light: #b0e0e6;
  --text-white: white;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --success: #10b981;
  --success-dark: #059669;
  --warning: #ff9500;
  --warning-dark: #cc7700;
  --info: #3b82f6;
  --gray: #555;
  --gray-light: #777;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(30, 144, 255, 0.5);
}

html.locked, body.locked {
  overflow: hidden;
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* LOGIN */
#loginScreen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: rgba(10, 25, 41, 0.85);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  border-radius: 1.5rem;
  width: 380px;
  border: 1px solid rgba(30, 144, 255, 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  color: var(--text-white);
  animation: fadeInUp 0.6s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(30, 144, 255, 0.6);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-light);
  font-size: 1.8rem;
}

input, select {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
  background: rgba(26, 47, 74, 0.6);
  color: var(--text-white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(26, 47, 74, 0.9);
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.4);
  transform: scale(1.01);
}

button {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::after {
  width: 300px;
  height: 300px;
}

button:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 71, 171, 0.6);
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-login span {
  font-size: 1.2rem;
}

/* SISTEMA DE TICKETS */
#ticketSystem {
  display: none;
  min-height: 100vh;
  color: var(--text-white);
  animation: fadeIn 0.5s ease;
  position: relative;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.glass-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 25, 41, 0.3);
  backdrop-filter: blur(3px);
  z-index: -1;
}

.header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(30, 144, 255, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.header h1 {
  color: var(--primary-light);
  font-size: 1.8rem;
}

#userInfo {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-right: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-container {
  position: relative;
}

.btn-notif {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.4);
  color: white;
  padding: 0.4rem 0.7rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  width: auto;
  transition: all 0.3s;
  position: relative;
}

.btn-notif:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.notif-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: inline-block;
  line-height: 1.2;
}

.notif-panel {
  position: absolute;
  top: 110%;
  right: 0;
  width: 380px;
  max-height: 400px;
  background: rgba(15, 25, 45, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-radius: 0.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 200;
  overflow: hidden;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(30, 144, 255, 0.3);
  color: var(--primary-light);
  font-size: 0.85rem;
}

.btn-notif-marcar {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-light);
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.7rem;
  width: auto;
}

.btn-notif-marcar:hover {
  background: var(--primary);
  color: white;
}

.notif-lista {
  max-height: 340px;
  overflow-y: auto;
}

.notif-item {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(30, 144, 255, 0.1);
  transition: background 0.3s;
  cursor: default;
}

.notif-item:hover {
  background: rgba(30, 144, 255, 0.1);
}

.notif-item.no-leido {
  background: rgba(30, 144, 255, 0.05);
  border-left: 3px solid var(--warning);
}

.notif-item-fail {
  border-left: 3px solid var(--danger);
}

.notif-item-fail .notif-nombre {
  color: var(--danger);
}

.notif-nombre {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-white);
}

.notif-fecha {
  font-size: 0.7rem;
  color: #888;
  margin-left: 0.5rem;
}

.notif-ip {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.2rem;
  font-family: monospace;
}

.notif-detalle {
  font-size: 0.7rem;
  color: #666;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-error {
  text-align: center;
  color: #888;
  padding: 2rem;
  font-size: 0.8rem;
}

.logout {
  background: var(--danger);
  padding: 0.7rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: bold;
  width: auto;
}

.logout:hover {
  background: var(--danger-dark);
}

.content {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 6rem;
}

.content h2 {
  color: var(--primary-light);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 0.9rem 1.8rem;
  border-radius: 0.6rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 71, 171, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--gray), #444);
  padding: 0.8rem 1.2rem;
  border-radius: 0.6rem;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
  width: auto;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--gray-light), var(--gray));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* FORMULARIO DE TICKET */
.formulario-ticket {
  background: rgba(26, 47, 74, 0.7);
  backdrop-filter: blur(8px);
  padding: 2.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.formulario-ticket h3 {
  margin-top: 0;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.formulario-ticket form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-light);
}

.formulario-ticket input,
.formulario-ticket select,
.formulario-ticket textarea {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--primary);
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
}

.formulario-ticket input:focus,
.formulario-ticket select:focus,
.formulario-ticket textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 8px #1e90ff40;
}

.formulario-ticket textarea {
  resize: vertical;
  min-height: 90px;
}

.formulario-ticket form > button {
  margin-right: 0.5rem;
  margin-top: 1rem;
  max-width: 150px;
}

.form-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.form-buttons button {
  width: auto;
  padding: 0.8rem 1.5rem;
}

/* TICKETS */
#ticketList {
  display: grid;
  gap: 1.5rem;
}

.ticket {
  background: rgba(26, 47, 74, 0.6);
  backdrop-filter: blur(5px);
  padding: 1.8rem;
  border-radius: 1rem;
  border-left: 5px solid #64748b;
  border: 1px solid rgba(30, 144, 255, 0.2);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ticket::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.ticket:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(30, 144, 255, 0.3);
  border-color: rgba(30, 144, 255, 0.5);
}

.ticket:hover::before {
  opacity: 1;
}

.ticket-abierto {
  border-left-color: var(--warning) !important;
}

.ticket-cerrado {
  border-left-color: var(--success) !important;
  opacity: 0.85;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--primary);
}

.ticket-id {
  color: var(--primary-light);
  font-weight: bold;
  font-size: 1.1rem;
}

.ticket-title {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: bold;
}

.ticket-details {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  border-left: 3px solid var(--primary);
}

.ticket-details p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: #e0e0e0;
}

.ticket-details strong {
  color: var(--primary-light);
}

.ticket-details small {
  color: #888;
  display: block;
  margin-top: 0.5rem;
}

/* Status Tracker */
.status-tracker {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: 1rem 0; padding: 0.8rem 0.5rem;
  background: rgba(0,0,0,0.2); border-radius: 0.5rem;
  overflow: hidden;
}
.tracker-step {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.8rem; flex-shrink: 0;
  transition: all 0.3s ease; position: relative; z-index: 1;
}
.tracker-line {
  flex: 1; height: 3px; min-width: 10px;
  background: rgba(255,255,255,0.15); transition: background 0.5s ease;
}
.step-done { background: var(--success); }
.step-done + .tracker-line { background: var(--success); }
.step-current { background: var(--warning); box-shadow: 0 0 10px rgba(255,149,0,0.6); animation: pulse-step 1.5s infinite; }
.step-pending { background: rgba(255,255,255,0.2); }
.step-skipped { background: var(--gray); }
.step-skipped + .tracker-line { background: var(--gray); }

@keyframes pulse-step {
  0%, 100% { box-shadow: 0 0 5px rgba(255,149,0,0.4); }
  50% { box-shadow: 0 0 15px rgba(255,149,0,0.8); }
}

.ticket-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
}

.ticket-actions button {
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  max-width: 150px;
  width: auto;
}

.btn-resolve {
  background: var(--success);
  transition: 0.3s;
}

.btn-resolve:hover {
  background: var(--success-dark);
  box-shadow: 0 4px 10px #10b98150;
}

.btn-delete {
  background: var(--danger);
  transition: 0.3s;
}

.btn-delete:hover {
  background: var(--danger-dark);
  box-shadow: 0 4px 10px #dc262650;
}

/* ============ ADMIN PANEL ============ */

.admin-tabs {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
  background: rgba(26, 47, 74, 0.4);
  padding: 0.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(5px);
}

.tab-btn {
  background: transparent;
  color: var(--text-light);
  padding: 0.9rem 2.2rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tab-btn:hover {
  background: rgba(30, 144, 255, 0.15);
  color: var(--text-white);
  transform: translateY(-2px);
}

.tab-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 71, 171, 0.4);
  border: 1px solid rgba(30, 144, 255, 0.5);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.admin-header h2 {
  color: var(--primary-light);
  margin: 0;
}

.admin-header .btn-primary {
  max-width: 180px;
  padding: 0.7rem 1.2rem;
}

.admin-table-wrapper {
  overflow-x: auto;
  background: rgba(26, 47, 74, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
  box-shadow: var(--shadow-lg);
  transition: box-shadow 0.3s ease;
}

.admin-table-wrapper:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(30, 144, 255, 0.2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-white);
  font-size: 0.85rem;
}

.admin-table thead {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: 3px solid var(--primary-light);
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: bold;
  color: var(--text-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--primary);
}

.ticket-row {
  transition: background 0.3s;
}

.ticket-row:hover {
  background: #0f2850;
}

.ticket-row-bajo-revision {
  border-left: 4px solid var(--warning);
}

.ticket-row-en-progreso {
  border-left: 4px solid var(--info);
}

.ticket-row-completo {
  border-left: 4px solid var(--success);
  opacity: 0.9;
}

.ticket-row-en-espera {
  border-left: 4px solid var(--gray);
  opacity: 0.8;
}

.ticket-row-cancelado {
  border-left: 4px solid var(--danger);
  opacity: 0.7;
}

.btn-edit {
  background: var(--primary);
  color: var(--text-white);
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.3s;
}

.btn-edit:hover {
  background: var(--primary-light);
  box-shadow: 0 2px 8px #0047ab80;
}

/* ============ MODAL EDITOR ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: rgba(26, 47, 74, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 144, 255, 0.4);
  border-radius: 1.2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(30, 144, 255, 0.3);
  max-width: 650px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-ticket-editor {
  max-width: 850px;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-light);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-header h3 {
  color: var(--primary-light);
  margin: 0;
  font-size: 1.3rem;
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.status-warning { background: var(--warning); color: #1a1a1a; }
.status-info { background: var(--info); color: white; }
.status-success { background: var(--success); color: white; }
.status-danger { background: var(--danger); color: white; }
.status-gray { background: var(--gray); color: white; }

.modal-header h3 {
  color: var(--primary-light);
  margin: 0;
}

.btn-close {
  background: transparent;
  color: var(--text-light);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--primary-light);
}

.modal-body {
  padding: 2rem;
}

/* SECCIÓN DE INFORMACIÓN DEL TICKET */
.ticket-info-section {
  background: rgba(10, 25, 41, 0.5);
  border-radius: 0.8rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(30, 144, 255, 0.2);
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ticket-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ticket-info-item label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ticket-info-item span {
  color: var(--text-white);
  font-size: 0.95rem;
  font-weight: 500;
}

.ticket-description {
  border-top: 1px solid rgba(30, 144, 255, 0.2);
  padding-top: 1rem;
}

.ticket-description label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.ticket-description p {
  color: var(--text-white);
  font-size: 0.95rem;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 0;
}

/* SECCIÓN DE RESPUESTA DEL ADMINISTRADOR */
.admin-response-section {
  background: rgba(30, 144, 255, 0.1);
  border-radius: 0.8rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
}

.admin-response-section h4 {
  color: var(--primary-light);
  margin: 0 0 1.2rem 0;
  font-size: 1.1rem;
}

.estado-select {
  font-weight: bold;
}

/* SECCIÓN DE COMENTARIOS */
.comments-section-modal {
  background: rgba(10, 25, 41, 0.5);
  border-radius: 0.8rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(30, 144, 255, 0.2);
}

.comments-section-modal h4 {
  color: var(--primary-light);
  margin: 0 0 1.2rem 0;
  font-size: 1.1rem;
}

.new-comment-box {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.new-comment-box textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-radius: 0.6rem;
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.3s ease;
}

.new-comment-box textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.3);
}

.btn-comment {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
}

.comments-list-modal {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.comment-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 0.6rem;
  border-left: 3px solid var(--primary);
  transition: all 0.3s ease;
}

.comment-item:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(3px);
}

.comment-item.comment-own {
  border-left-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-header strong {
  color: var(--primary-light);
  font-size: 0.9rem;
}

.comment-item.comment-own .comment-header strong {
  color: var(--success);
}

.comment-date {
  color: #888;
  font-size: 0.75rem;
}

.comment-item p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

.empty-state-small {
  text-align: center;
  color: var(--text-light);
  padding: 1.5rem;
  font-size: 0.9rem;
  font-style: italic;
}

/* BOTONES DEL MODAL */
.modal-footer {
  padding: 1.5rem;
  background: rgba(15, 26, 46, 0.8);
  border-top: 1px solid var(--primary);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 0.8rem 1.8rem;
  border-radius: 0.6rem;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  width: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 71, 171, 0.5);
}

.modal-footer .btn-secondary {
  background: linear-gradient(135deg, var(--gray), #444);
  color: var(--text-white);
}

.modal-footer .btn-secondary:hover {
  background: linear-gradient(135deg, var(--gray-light), var(--gray));
  transform: translateY(-2px);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background: var(--bg-dark);
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 8px #1e90ff40;
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.modal-footer {
  padding: 1.5rem;
  background: #0f1a2e;
  border-top: 1px solid var(--primary);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
  width: auto;
}

.modal-footer .btn-primary {
  background: var(--primary);
  color: var(--text-white);
  max-width: none;
  width: auto;
}

.modal-footer .btn-primary:hover {
  background: var(--primary-light);
}

.modal-footer .btn-secondary {
  background: var(--gray);
  color: var(--text-white);
}

.modal-footer .btn-secondary:hover {
  background: var(--gray-light);
}

/* ============ USUARIOS ADMIN ============ */

.role-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: bold;
}

.badge-admin {
  background: var(--primary);
  color: var(--text-white);
}

.badge-user {
  background: var(--gray);
  color: var(--text-white);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-delete-user {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.3s;
}

.btn-delete-user:hover {
  opacity: 1;
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  padding: 2rem;
  font-size: 1.1rem;
}

/* ============ TOAST ============ */

#toastContainer {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  background: rgba(26, 47, 74, 0.9);
  backdrop-filter: blur(10px);
  color: var(--text-white);
  padding: 1.2rem 1.8rem;
  border-radius: 0.8rem;
  border-left: 4px solid var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(30, 144, 255, 0.3);
  font-weight: 600;
  min-width: 300px;
  max-width: 450px;
  animation: slideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
}

.toast:hover {
  transform: translateX(-5px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(30, 144, 255, 0.4);
}

.toast-success { border-left-color: var(--success); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.3); }
.toast-error { border-left-color: var(--danger); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(220, 38, 38, 0.3); }
.toast-warning { border-left-color: var(--warning); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 149, 0, 0.3); }

@keyframes slideInRight {
  from { transform: translateX(100%) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ============ NOTIFICACION TICKET TOAST ============ */

#notifToastContainer {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  max-width: 380px;
}

.ticket-toast {
  background: rgba(10, 25, 41, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 144, 255, 0.4);
  border-radius: 0.8rem;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(30,144,255,0.2);
  animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.4s ease;
  pointer-events: all;
  cursor: pointer;
  overflow: hidden;
}
.ticket-toast.removing {
  animation: none;
  opacity: 0;
  transform: translateX(100px);
}
.ticket-toast:hover {
  border-color: var(--primary-light);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 25px rgba(30,144,255,0.4);
}

.ticket-toast-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.ticket-toast-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.ticket-toast-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary-light);
  flex: 1;
}
.ticket-toast-time {
  font-size: 0.65rem;
  color: #888;
}
.ticket-toast-body {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-left: 2.6rem;
}
.ticket-toast-body strong {
  color: var(--text-white);
}

@keyframes toastSlideIn {
  from { transform: translateX(120%) rotate(-3deg); opacity: 0; }
  to { transform: translateX(0) rotate(0deg); opacity: 1; }
}

/* ============ THEME TOGGLE ============ */

.btn-theme {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.5);
  padding: 0.3rem 0.5rem;
  border-radius: 0.8rem;
  cursor: pointer;
  width: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
}

.btn-theme:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 71, 171, 0.5);
}

.btn-theme.clicked {
  animation: themeClick 0.6s ease;
}

@keyframes themeClick {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.3) rotate(15deg); }
  50% { transform: scale(0.9) rotate(-10deg); }
  75% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ============ LIGHT THEME ============ */

[data-theme="light"] {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --bg-dark: #f8fafc;
  --bg-darker: #f1f5f9;
  --bg-card: #ffffff;
  --text-light: #475569;
  --text-white: #1e293b;
  --gray: #94a3b8;
  --gray-light: #cbd5e1;
  --warning-dark: #d97706;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .login-box,
[data-theme="light"] .formulario-ticket,
[data-theme="light"] .ticket,
[data-theme="light"] .admin-table-wrapper,
[data-theme="light"] .modal-content,
[data-theme="light"] .stat-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .dashboard-section {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .stat-bar {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .recent-ticket {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .recent-ticket:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ticket-details p { color: #334155; }

/* ============ LIGHT THEME BADGES ============ */
[data-theme="light"] .priority-alta {
  background: var(--danger-dark);
  color: white;
}
[data-theme="light"] .priority-media {
  background: var(--warning-dark);
  color: white;
}
[data-theme="light"] .priority-baja {
  background: var(--success-dark);
  color: white;
}
[data-theme="light"] .badge-admin {
  background: var(--primary-dark);
  color: white;
}
[data-theme="light"] .badge-user {
  background: var(--gray);
  color: white;
}

/* ============ LIGHT THEME TABLES ============ */
[data-theme="light"] .admin-table-wrapper {
  box-shadow: 0 4px 12px #00000015;
}
[data-theme="light"] .admin-table {
  color: var(--text-white);
}
[data-theme="light"] .admin-table thead {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}
[data-theme="light"] .admin-table th {
  color: white;
}
[data-theme="light"] .admin-table td {
  border-bottom-color: var(--primary-light);
}
[data-theme="light"] #userInfo {
  color: white;
}
[data-theme="light"] .header {
  background: linear-gradient(90deg, var(--primary-dark) 0%, #0f172a 100%);
}
[data-theme="light"] .header h1 {
  color: white;
}
[data-theme="light"] .header h1 img {
  filter: brightness(1.2) contrast(1.2);
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
}
[data-theme="light"] .login-box h2 {
  color: white;
}
[data-theme="light"] .login-box h2 img {
  filter: brightness(1.2) contrast(1.2);
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
}

/* ============ PRIORITY BADGES ============ */

.priority-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.priority-alta {
  background: var(--danger);
  color: white;
}

.priority-media {
  background: var(--warning);
  color: #1a1a1a;
}

.priority-baja {
  background: var(--success);
  color: white;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: bold;
  background: var(--primary);
  color: white;
  text-transform: uppercase;
}
[data-theme="light"] .status-badge {
  color: white;
}

[data-theme="light"] .admin-tabs {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tab-btn {
  color: var(--text-light);
}

[data-theme="light"] .tab-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--text-white);
}

[data-theme="light"] .tab-active {
  color: white;
}

[data-theme="light"] .admin-header {
  border-bottom-color: var(--primary-light);
}

[data-theme="light"] .admin-header h2 {
  color: var(--primary-dark);
}

[data-theme="light"] .empty-state {
  color: var(--text-light);
}

[data-theme="light"] .history-section {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light);
}

[data-theme="light"] .history-section summary {
  color: var(--primary-dark);
}

[data-theme="light"] .history-item {
  color: var(--text-light);
  border-bottom-color: var(--primary-light);
}

[data-theme="light"] .comments-section {
  border-top-color: var(--primary-light);
}

[data-theme="light"] .comment-item {
  background: rgba(0, 0, 0, 0.05);
  border-left-color: var(--primary-light);
}

[data-theme="light"] .comment-author {
  color: var(--primary-dark);
}

[data-theme="light"] .stat-bar-item span {
  color: var(--text-light);
}

[data-theme="light"] .dashboard-section h3 {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-light);
}

[data-theme="light"] .ticket-info-section {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light);
}

[data-theme="light"] .ticket-info-item label {
  color: var(--text-light);
}

[data-theme="light"] .ticket-info-item span {
  color: var(--text-white);
}

[data-theme="light"] .ticket-description label {
  color: var(--text-light);
}

[data-theme="light"] .ticket-description p {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-white);
}

[data-theme="light"] .admin-response-section {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--primary-light);
}

[data-theme="light"] .admin-response-section h4 {
  color: var(--primary-dark);
}

[data-theme="light"] .comments-section-modal {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light);
}

[data-theme="light"] .comments-section-modal h4 {
  color: var(--primary-dark);
}

[data-theme="light"] .new-comment-box textarea {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light);
  color: var(--text-white);
}

[data-theme="light"] .comment-item {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .comment-header strong {
  color: var(--primary-dark);
}

[data-theme="light"] .comment-item p {
  color: var(--text-light);
}

[data-theme="light"] .empty-state-small {
  color: var(--text-light);
}

[data-theme="light"] .modal-footer {
  background: rgba(0, 0, 0, 0.05);
  border-top-color: var(--primary-light);
}

[data-theme="light"] .notif-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .notif-header {
  border-bottom-color: var(--primary-light);
  color: var(--primary-dark);
}

[data-theme="light"] .notif-item {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .notif-item:hover {
  background: rgba(37, 99, 235, 0.05);
}

[data-theme="light"] .notif-item.no-leido {
  background: rgba(37, 99, 235, 0.08);
  border-left-color: var(--warning);
}

[data-theme="light"] .notif-nombre {
  color: var(--text-white);
}

[data-theme="light"] .notif-ip {
  color: var(--text-light);
}

[data-theme="light"] .btn-notif {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light);
  color: var(--text-white);
}

[data-theme="light"] .btn-notif:hover {
  background: var(--primary);
  color: white;
}

[data-theme="light"] .btn-notif-marcar {
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

[data-theme="light"] .btn-notif-marcar:hover {
  background: var(--primary);
  color: white;
}

/* ============ ADMIN TOOLBAR (SEARCH/FILTER) ============ */

.admin-toolbar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  color: var(--text-white);
  font-size: 0.9rem;
  width: auto;
  margin-bottom: 0;
}

.filter-select {
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  color: var(--text-white);
  font-size: 0.9rem;
  width: auto;
  margin-bottom: 0;
  min-width: 150px;
}

/* ============ SORTABLE HEADERS ============ */

.sortable {
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}

.sortable:hover {
  color: var(--text-white);
  background: var(--primary);
}

/* ============ COMMENTS ============ */

.comments-section {
  margin-top: 0.8rem;
  border-top: 1px solid var(--primary);
  padding-top: 0.8rem;
}

.comment-item {
  background: var(--bg-dark);
  padding: 0.6rem;
  border-radius: 0.4rem;
  margin: 0.4rem 0;
  border-left: 3px solid var(--primary-light);
}

.comment-author {
  color: var(--primary-light);
  font-weight: bold;
  font-size: 0.85rem;
}

.comment-date {
  color: #888;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.comment-item p {
  margin: 0.3rem 0 0 0 !important;
  font-size: 0.9rem;
}

.comments-list-modal {
  max-height: 200px;
  overflow-y: auto;
  margin: 1rem 0;
}

/* ============ HISTORY ============ */

.history-section {
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--bg-dark);
  border-radius: 0.5rem;
  border: 1px solid var(--primary);
}

.history-section summary {
  cursor: pointer;
  color: var(--primary-light);
  font-weight: bold;
}

.history-list {
  margin-top: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
}

.history-item {
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--primary);
}

/* ============ DASHBOARD ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  background: rgba(26, 47, 74, 0.6);
  backdrop-filter: blur(5px);
  padding: 1.8rem;
  border-radius: 1rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.5s ease-out backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(30, 144, 255, 0.3);
  border-color: rgba(30, 144, 255, 0.6);
}

.stat-number {
  font-size: 2.8rem;
  font-weight: bold;
  color: var(--primary-light);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.stat-warning .stat-number { color: var(--warning); }
.stat-info .stat-number { color: var(--info); }
.stat-success .stat-number { color: var(--success); }
.stat-danger .stat-number { color: var(--danger); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-section {
  background: rgba(26, 47, 74, 0.6);
  backdrop-filter: blur(8px);
  padding: 1.8rem;
  border-radius: 1rem;
  border: 1px solid rgba(30, 144, 255, 0.3);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease;
  animation: fadeInUp 0.6s ease-out backwards;
}

.dashboard-grid .dashboard-section:nth-child(1) { animation-delay: 0.5s; }
.dashboard-grid .dashboard-section:nth-child(2) { animation-delay: 0.6s; }

.dashboard-section:hover {
  box-shadow: var(--shadow-lg), 0 0 15px rgba(30, 144, 255, 0.2);
}

.dashboard-section h3 {
  color: var(--primary-light);
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(30, 144, 255, 0.3);
  padding-bottom: 0.8rem;
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stat-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-bar-item span {
  min-width: 140px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.stat-bar {
  flex: 1;
  background: rgba(10, 25, 41, 0.5);
  border-radius: 0.5rem;
  height: 28px;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: white;
  height: 100%;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0.5rem;
  min-width: 30px;
  font-weight: bold;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fillBar 1s ease-out backwards;
}

@keyframes fillBar {
  from { width: 0 !important; }
}

.stat-fill-danger {
  background: linear-gradient(90deg, var(--danger), #ef4444);
}

.recent-tickets-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.recent-ticket {
  background: rgba(10, 25, 41, 0.4);
  padding: 1rem;
  border-radius: 0.6rem;
  border-left: 3px solid var(--primary);
  transition: all 0.3s ease;
  animation: slideInLeft 0.4s ease-out backwards;
}

.recent-tickets-list .recent-ticket:nth-child(1) { animation-delay: 0.7s; }
.recent-tickets-list .recent-ticket:nth-child(2) { animation-delay: 0.8s; }
.recent-tickets-list .recent-ticket:nth-child(3) { animation-delay: 0.9s; }
.recent-tickets-list .recent-ticket:nth-child(4) { animation-delay: 1.0s; }
.recent-tickets-list .recent-ticket:nth-child(5) { animation-delay: 1.1s; }

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.recent-ticket:hover {
  background: rgba(10, 25, 41, 0.6);
  transform: translateX(5px);
  border-left-color: var(--primary-light);
}

.recent-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.recent-ticket-id {
  color: var(--primary-light);
  font-weight: bold;
  font-size: 0.95rem;
}

.recent-ticket-info {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.recent-ticket-date {
  color: #888;
  font-size: 0.8rem;
}

/* ============ EXPORT BUTTONS ============ */

.export-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-sm {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ============ LOGIN VIDEO ============ */
#loginScreen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.login-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -1;
  object-fit: cover;
}

.login-box {
  position: relative;
  z-index: 1;
}

/* ============ CATEGORIA PICKER ============ */

.categoria-picker { position: relative; }

.categoria-btn {
  width: 100%; padding: 0.8rem 1rem; text-align: left;
  background: var(--bg-dark); border: 1px solid var(--primary);
  border-radius: 0.5rem; color: var(--text-white); font-size: 0.95rem;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  transition: all 0.3s ease; font-weight: normal;
}
.categoria-btn:hover { border-color: var(--primary-light); box-shadow: 0 0 8px #1e90ff40; }
.cat-arrow { font-size: 0.7rem; color: var(--primary-light); transition: transform 0.3s; }
.categoria-btn.open .cat-arrow { transform: rotate(180deg); }

.categoria-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 500;
  background: var(--bg-card); border: 2px solid var(--primary);
  border-radius: 0.6rem; max-height: 350px; overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideDown 0.2s ease-out;
}

.cat-search {
  position: sticky; top: 0; z-index: 10; padding: 0.6rem;
  background: var(--bg-card); border-bottom: 1px solid rgba(30,144,255,0.2);
}
.cat-search input {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 0.4rem;
  border: 1px solid rgba(30,144,255,0.3); background: var(--bg-dark);
  color: var(--text-white); font-size: 0.85rem; margin: 0;
}
.cat-search input:focus { border-color: var(--primary-light); outline: none; }
.cat-item.hidden { display: none; }
.cat-group.no-match { display: none; }

.cat-group { border-bottom: 1px solid rgba(30,144,255,0.15); }
.cat-group:last-child { border-bottom: none; }

.cat-group-title {
  padding: 0.7rem 1rem; font-weight: bold; color: var(--primary-light);
  cursor: pointer; font-size: 0.9rem; transition: background 0.2s;
  display: flex; align-items: center; gap: 0.4rem;
}
.cat-group-title:hover { background: rgba(30,144,255,0.1); }
.cat-group-title::after { content: '▶'; font-size: 0.6rem; margin-left: auto; transition: transform 0.2s; }
.cat-group-title.open::after { transform: rotate(90deg); }

.cat-group-items { display: none; padding: 0 0 0.3rem 0; }
.cat-group-title.open + .cat-group-items { display: block; }

.cat-item {
  padding: 0.5rem 1rem 0.5rem 2.5rem; color: var(--text-light);
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.cat-item:hover { background: rgba(30,144,255,0.15); color: var(--text-white); }
.cat-item.selected { background: var(--primary); color: white; }
.cat-item.selected::before { content: '✓ '; }

/* ============ RESPONSIVE ============ */

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .admin-toolbar { flex-direction: column; }
  .admin-tabs { flex-wrap: wrap; }
  .tab-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
}

/* ============ CONECTADOS ============ */
.conectado-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.3rem; font-size: 0.8rem;
  border-bottom: 1px solid rgba(30,144,255,0.1);
}
.conectado-item:last-child { border-bottom: none; }
.conectado-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.conectado-item.activo .conectado-dot { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.6); }
.conectado-item.inactivo .conectado-dot { background: #dc2626; box-shadow: 0 0 6px rgba(220,38,38,0.4); }
.conectado-nombre { flex: 1; color: var(--text-white); font-weight: bold; font-size: 0.85rem; }
.conectado-info { color: var(--text-light); font-size: 0.75rem; min-width: 80px; text-align: right; }
.conectado-info:last-child { min-width: 110px; }
