/**
 * LoNet Solutions - Helpdesk & Portal de Clientes Design System
 * Paleta corporativa LoNet: Deep Navy #041024, Cyber Blue #0284C7, Cyan #00F2FE
 */

:root {
  --bg-body: #041024;
  --bg-card: #0A192F;
  --bg-surface: #0F233E;
  --bg-input: #081528;
  --border-subtle: #162B4D;
  --border-focus: #00F2FE;
  
  --accent-cyan: #00F2FE;
  --accent-blue: #0284C7;
  --accent-gradient: linear-gradient(135deg, #0284C7 0%, #00F2FE 100%);
  
  --status-abierto: #38BDF8;
  --status-progreso: #F59E0B;
  --status-esperando: #A855F7;
  --status-resuelto: #10B981;
  --status-cerrado: #64748B;
  --status-urgente: #EF4444;
  
  --text-main: #F8FAFC;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;
  --text-cyan: #38BDF8;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 242, 254, 0.25);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

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

/* =========================================================================
   Layout & Top Bar
   ========================================================================= */
/* =========================================================================
   Layout & Top Bar (Precision Responsive Fixed Header)
   ========================================================================= */
.hd-header {
  background: rgba(7, 19, 39, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
}

.hd-header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hd-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  min-width: 0;
}

.hd-brand-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 9px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.25);
  flex-shrink: 0;
  padding: 3px;
}

.hd-brand-logo picture,
.hd-brand-logo img,
.hd-brand-logo .hd-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hd-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hd-brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  line-height: 1.15;
  white-space: nowrap;
}

.hd-brand-title span {
  color: var(--accent-cyan);
}

.hd-brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 2px;
}

.hd-brand-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Menú Desktop */
.hd-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hd-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-main);
}

.hd-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #041024;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  user-select: none;
}

.hd-avatar-circle.large {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

/* Controles Móviles en el Header */
.hd-mobile-controls {
  display: none;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hd-mobile-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.3);
}

.hd-hamburger-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.hd-hamburger-btn:hover,
.hd-hamburger-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Telón / Backdrop para el Drawer Móvil */
.hd-drawer-backdrop {
  position: fixed;
  top: 64px;
  inset: 64px 0 0 0;
  background: rgba(3, 10, 24, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.hd-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Menú Desplegable Móvil Flotante */
.hd-mobile-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #07152B;
  border-bottom: 2px solid var(--accent-cyan);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85);
  z-index: 999;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.28s;
}

.hd-mobile-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.hd-drawer-inner {
  padding: 18px 16px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.hd-drawer-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(15, 35, 62, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.hd-drawer-user-info {
  flex: 1;
  min-width: 0;
}

.hd-drawer-name {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-drawer-company {
  font-size: 12px;
  color: var(--accent-cyan);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hd-drawer-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-drawer-section-title {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 4px;
}

.hd-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.hd-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
}

.hd-drawer-link:hover,
.hd-drawer-link:active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
}

.hd-drawer-link i:first-child {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.hd-drawer-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.hd-drawer-logout {
  color: #F87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.hd-drawer-logout i {
  color: #F87171 !important;
}

.hd-drawer-logout:hover,
.hd-drawer-logout:active {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
}

/* =========================================================================
   Container & Dashboard Grid
   ========================================================================= */
.hd-container {
  max-width: 1400px;
  margin: 28px auto;
  padding: 0 20px;
}

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

.hd-page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

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

/* =========================================================================
   Stat Cards
   ========================================================================= */
.hd-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.hd-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.hd-stat-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.15);
  transform: translateY(-2px);
}

.hd-stat-card:active {
  transform: translateY(0);
}

.hd-stat-card.active-stat-card {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  background: rgba(0, 242, 254, 0.05);
}

.hd-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.hd-stat-icon.cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
}

.hd-stat-icon.amber {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.hd-stat-icon.purple {
  background: rgba(168, 85, 247, 0.12);
  color: #A855F7;
}

.hd-stat-icon.green {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.hd-stat-icon.blue {
  background: rgba(2, 132, 199, 0.12);
  color: #38BDF8;
}

.hd-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

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

/* =========================================================================
   Panels, Tables & Badges
   ========================================================================= */
.hd-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 30px;
}

.hd-panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(15, 35, 62, 0.3);
}

.hd-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* Indicador de Desplazamiento Táctil Horizontal en Tablas Móviles */
.hd-table-scroll-hint {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(0, 242, 254, 0.05);
  border-bottom: 1px solid rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hd-table-scroll-hint-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hd-table-scroll-hint i.fa-hand-pointer {
  font-size: 13px;
  color: var(--accent-cyan);
  animation: swipeFinger 1.8s infinite ease-in-out;
}

@keyframes swipeFinger {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

.hd-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hd-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

/* Ocultar elementos de tarjeta móvil en escritorio por defecto */
.hd-card-accordion-toggle,
.hd-card-mobile-meta {
  display: none !important;
}

.hd-table th {
  background: #081528;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  white-space: nowrap;
}

.hd-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
  vertical-align: middle;
}

.hd-table tbody tr {
  transition: var(--transition);
}

.hd-table tbody tr:hover {
  background: rgba(15, 35, 62, 0.5);
}

.hd-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-abierto {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-abierto::before { background: #38BDF8; }

.badge-progreso, .badge-en_progreso {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-progreso::before, .badge-en_progreso::before { background: #F59E0B; }

.badge-esperando, .badge-esperando_cliente {
  background: rgba(168, 85, 247, 0.12);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-esperando::before, .badge-esperando_cliente::before { background: #C084FC; }

.badge-resuelto {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-resuelto::before { background: #34D399; }

.badge-cerrado {
  background: rgba(100, 116, 139, 0.12);
  color: #94A3B8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.badge-cerrado::before { background: #94A3B8; }

/* Prioridades */
.priority-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.priority-baja { background: rgba(100, 116, 139, 0.18); color: #94A3B8; }
.priority-media { background: rgba(56, 189, 248, 0.18); color: #38BDF8; }
.priority-alta { background: rgba(245, 158, 11, 0.18); color: #FBBF24; }
.priority-urgente { background: rgba(239, 68, 68, 0.22); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.4); }

/* =========================================================================
   Buttons & Inputs
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #041024 !important;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}
.btn-danger:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34D399;
}
.btn-success:hover {
  background: #10B981;
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Controls & Forms */
.form-group {
  margin-bottom: 18px;
}

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

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* =========================================================================
   Ticket Conversation View (Thread & Messages)
   ========================================================================= */
.hd-thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.hd-message {
  display: flex;
  gap: 14px;
  max-width: 85%;
}

.hd-message.staff {
  margin-left: auto;
  flex-direction: row-reverse;
}

.hd-message.internal {
  max-width: 100%;
  margin: 0;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.hd-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.hd-message.staff .hd-msg-avatar {
  background: var(--accent-gradient);
  color: #041024;
}

.hd-msg-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.hd-message.staff .hd-msg-bubble {
  background: #0D284B;
  border-color: #1A477B;
}

.hd-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.hd-msg-author {
  font-weight: 700;
  color: var(--text-main);
}

.hd-msg-time {
  color: var(--text-muted);
}

.hd-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Attachments list */
.hd-attachments-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hd-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-cyan);
}
.hd-attachment-item:hover {
  background: rgba(0, 242, 254, 0.1);
}

/* =========================================================================
   Modals & Popups (Responsive Flex Container Architecture)
   ========================================================================= */
.hd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 24, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.hd-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.hd-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hd-modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  width: 100%;
}

.hd-modal-backdrop.active .hd-modal {
  transform: translateY(0) scale(1);
}

.hd-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.hd-modal-title-wrap {
  flex: 1;
  min-width: 0;
}

.hd-modal-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hd-modal-body {
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.hd-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(10, 25, 47, 0.96);
  flex-shrink: 0;
}

.btn-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
  line-height: 1;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #EF4444;
}

/* Modales: Formularios & Controles Adaptativos */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hd-reply-options {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hd-reply-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(15, 35, 62, 0.5);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.hd-reply-radio.public {
  color: var(--accent-cyan);
}
.hd-reply-radio.internal {
  color: #F59E0B;
}

.hd-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Pestañas de Navegación del Panel (Admin Tabs Centradas y Responsivas) */
.hd-tabs-scrollable {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0 auto 22px auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: visible;
  white-space: normal;
}
.hd-tabs-scrollable::-webkit-scrollbar {
  display: none;
}
.hd-tabs-scrollable .nav-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-shrink: 0;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* Barra de Búsqueda y Filtros en Paneles */
.hd-search-box {
  position: relative;
  width: 270px;
  max-width: 100%;
}
.hd-search-box .form-control {
  padding-left: 36px;
}
.hd-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.hd-filter-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hd-admin-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hd-admin-selects {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  flex-wrap: nowrap;
}

.hd-admin-selects select,
.hd-admin-selects .form-control {
  width: auto;
  min-width: 155px;
  max-width: 230px;
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.hd-admin-selects select:hover,
.hd-admin-selects .form-control:hover {
  border-color: rgba(0, 242, 254, 0.4);
}

.hd-admin-selects select:focus,
.hd-admin-selects .form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.2);
  outline: none;
}

.hd-admin-selects #filterCompany {
  min-width: 185px;
}

.hd-admin-selects #filterStatus {
  min-width: 155px;
}

.hd-admin-selects #filterPriority {
  min-width: 155px;
}

/* =========================================================================
   Authentication Pages (Login & Reset)
   ========================================================================= */
.hd-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: radial-gradient(circle at 50% 20%, #0F233E 0%, #041024 70%);
}

.hd-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 10;
}

.hd-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.hd-auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.hd-auth-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* Alerts & Toasts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}
.alert-info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38BDF8;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

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

/* =========================================================================
   Manual de Uso & Guía Operativa (Estilos de Componentes)
   ========================================================================= */
.manual-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  transition: var(--transition);
}
.manual-section:hover {
  border-color: rgba(0, 242, 254, 0.4);
}
.manual-header {
  padding: 14px 18px;
  background: rgba(15, 35, 62, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}
.manual-header i.manual-icon {
  color: var(--accent-cyan);
  font-size: 16px;
  width: 24px;
  text-align: center;
}
.manual-header .manual-chevron {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.manual-section.open .manual-chevron {
  transform: rotate(180deg);
}
.manual-body {
  padding: 16px 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-body);
  border-top: 1px solid var(--border-subtle);
  display: none;
}
.manual-section.open .manual-body {
  display: block;
}
.manual-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.manual-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #041024;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.manual-tip {
  background: rgba(0, 242, 254, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #E2E8F0;
  margin: 10px 0;
}
.manual-sla-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin: 10px 0;
}
.manual-sla-table th, .manual-sla-table td {
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.manual-sla-table th {
  background: #081528;
  color: var(--accent-cyan);
}

/* =========================================================================
   DISEÑO RESPONSIVO AVANZADO (MÓVILES, TABLETS & MODALES)
   ========================================================================= */

/* 1. Tablets Grandes y Escritorios Compactos (max-width: 1024px) */
@media (max-width: 1024px) {
  .hd-container {
    padding: 0 16px;
    margin: 20px auto;
  }
  .hd-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .col-hide-tablet {
    display: none !important;
  }
}

/* 2. Breakpoint Móvil / Tablet para Barra de Navegación (max-width: 991px) */
@media (max-width: 991px) {
  .hd-desktop-menu {
    display: none !important;
  }
  .hd-mobile-controls {
    display: flex !important;
  }
  .hd-brand-badge {
    display: none !important;
  }
  .hide-mobile {
    display: none !important;
  }
}

/* 3. Tablets Medianas y Teléfonos (max-width: 768px) */
@media (max-width: 991px) {
  .hd-header {
    height: 58px;
    padding: 0 16px;
  }
  .hd-drawer-backdrop {
    top: 58px;
    inset: 58px 0 0 0;
  }
  .hd-mobile-drawer {
    top: 58px;
    max-height: calc(100vh - 58px);
    max-height: calc(100dvh - 58px);
  }
  .hd-header-inner {
    gap: 12px;
  }
  .hd-brand-title {
    font-size: 16px;
  }
  .hd-brand-sub {
    font-size: 9.5px;
  }
  .hd-brand-logo {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 16px;
  }

  .hd-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }
  .hd-page-title {
    font-size: 22px;
  }
  .hd-page-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tarjetas de Estadísticas en Cuadrícula 2x2 Compacta */
  .hd-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px;
  }
  .hd-stat-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }
  .hd-stat-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: var(--radius-sm);
  }
  .hd-stat-value {
    font-size: 20px;
  }
  .hd-stat-label {
    font-size: 11px;
  }

  /* Paneles, Encabezados y Filtros */
  .hd-panel {
    border-radius: var(--radius-md);
    margin-bottom: 20px;
  }
  .hd-panel-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .hd-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    scrollbar-width: none;
    padding-bottom: 4px;
    width: 100%;
  }
  .hd-filter-buttons::-webkit-scrollbar {
    display: none;
  }
  .hd-filter-buttons .btn {
    flex-shrink: 0;
  }
  .hd-admin-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .hd-admin-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .hd-admin-selects select,
  .hd-admin-selects .form-control {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
  }
  .hd-admin-selects select:first-child {
    grid-column: 1 / -1;
  }
  .hd-search-box {
    width: 100% !important;
    min-width: 100% !important;
  }

  /* =========================================================================
     SMART ACCORDION CARDS LAYOUT PARA TELÉFONOS MÓVILES (<= 768px)
     Eliminación total del arrastre horizontal de tablas en Soporte & CRM
     ========================================================================= */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .hd-table-scroll-hint {
    display: none !important; /* Adiós banner de arrastre */
  }

  .hd-table-responsive,
  .table-responsive {
    overflow-x: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  table.hd-table,
  table.hd-table-contacts {
    min-width: 0 !important;
    width: 100% !important;
    display: block !important;
    border: none !important;
    background: transparent !important;
  }

  table.hd-table thead,
  table.hd-table-contacts thead {
    display: none !important; /* Ocultar cabeceras tabulares */
  }

  table.hd-table tbody,
  table.hd-table-contacts tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Cada fila (tr) se transforma en una tarjeta móvil elevada */
  table.hd-table tbody tr,
  table.hd-table-contacts tbody tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(13, 24, 41, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  table.hd-table tbody tr:hover,
  table.hd-table-contacts tbody tr:hover {
    background: rgba(18, 33, 56, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
  }

  /* Estado Expandido del Acordeón */
  table.hd-table tbody tr.is-expanded,
  table.hd-table-contacts tbody tr.is-expanded {
    border-color: rgba(0, 242, 254, 0.45) !important;
    box-shadow: 0 6px 24px rgba(0, 242, 254, 0.15) !important;
  }

  /* Celda 1: Cabecera de la Tarjeta Móvil (Siempre Visible) */
  table.hd-table tbody tr td:first-child,
  table.hd-table-contacts tbody tr td:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 0 !important;
    border-bottom: none !important;
  }

  table.hd-table tbody tr.is-expanded td:first-child,
  table.hd-table-contacts tbody tr.is-expanded td:first-child {
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 8px !important;
  }

  /* Metadatos Rápidos en Móvil (debajo del identificador) */
  .hd-card-mobile-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 4px !important;
  }

  /* Botón e indicador de acordeón */
  .hd-card-accordion-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    background: rgba(0, 242, 254, 0.1) !important;
    color: var(--accent-cyan, #00F2FE) !important;
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    touch-action: manipulation !important;
  }

  .hd-card-accordion-toggle .accordion-chevron {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.95rem;
    line-height: 1;
  }

  table.hd-table tbody tr.is-expanded .hd-card-accordion-toggle,
  table.hd-table-contacts tbody tr.is-expanded .hd-card-accordion-toggle {
    background: var(--accent-cyan, #00F2FE) !important;
    color: #041024 !important;
  }

  table.hd-table tbody tr.is-expanded .hd-card-accordion-toggle .accordion-chevron,
  table.hd-table-contacts tbody tr.is-expanded .hd-card-accordion-toggle .accordion-chevron {
    transform: rotate(180deg) !important;
  }

  /* Celdas Intermedias (Detalles Secundarios en Acordeón) */
  table.hd-table tbody tr td:not(:first-child):not(:last-child),
  table.hd-table-contacts tbody tr td:not(:first-child):not(:last-child) {
    display: none !important; /* Oculto en modo colapsado */
  }

  table.hd-table tbody tr.is-expanded td:not(:first-child):not(:last-child),
  table.hd-table-contacts tbody tr.is-expanded td:not(:first-child):not(:last-child) {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 7px 0 !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08) !important;
    font-size: 13px !important;
    color: var(--text-body) !important;
  }

  /* Etiqueta semántica de cada celda con data-label */
  table.hd-table tbody tr.is-expanded td:not(:first-child):not(:last-child)[data-label]::before,
  table.hd-table-contacts tbody tr.is-expanded td:not(:first-child):not(:last-child)[data-label]::before {
    content: attr(data-label);
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted) !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
  }

  /* Celda de Acciones (Última celda) */
  table.hd-table tbody tr td:last-child,
  table.hd-table-contacts tbody tr td:last-child {
    display: none !important; /* Oculto en modo colapsado */
  }

  table.hd-table tbody tr.is-expanded td:last-child,
  table.hd-table-contacts tbody tr.is-expanded td:last-child {
    display: flex !important;
    width: 100% !important;
    padding: 12px 0 2px 0 !important;
    margin-top: 6px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  table.hd-table tbody tr.is-expanded td:last-child .btn,
  table.hd-table-contacts tbody tr.is-expanded td:last-child .btn {
    min-height: 40px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    touch-action: manipulation !important;
  }

  .col-hide-mobile {
    display: none !important;
  }

  /* Modales en Móviles y Tablets: Flex Column con Header y Footer Sticky */
  .hd-modal-backdrop {
    padding: 10px;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hd-modal {
    max-width: 100% !important;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: var(--radius-md);
    margin: auto 0;
  }
  .hd-modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }
  .hd-modal-header {
    padding: 14px 16px;
  }
  .hd-modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
  }
  .hd-modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .hd-modal-footer .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Formularios dentro de Modales a 1 columna */
  .form-row-2col,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Hilo de Mensajes en Móvil */
  .hd-thread {
    padding: 14px;
    gap: 12px;
  }
  .hd-message {
    max-width: 100%;
    gap: 8px;
  }
  .hd-msg-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .hd-msg-bubble {
    padding: 12px 14px;
    font-size: 13px;
  }

  /* Opciones de Respuesta en Modales */
  .hd-reply-options {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hd-reply-radio {
    width: 100%;
    box-sizing: border-box;
  }
  .hd-reply-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hd-reply-actions > div {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .hd-reply-actions input[type="file"],
  .hd-reply-actions select,
  .hd-reply-actions button {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 4. Teléfonos Pequeños (max-width: 480px) */
@media (max-width: 480px) {
  .hd-header {
    height: 54px;
    padding: 0 12px;
  }
  .hd-drawer-backdrop {
    top: 54px;
    inset: 54px 0 0 0;
  }
  .hd-mobile-drawer {
    top: 54px;
    max-height: calc(100vh - 54px);
    max-height: calc(100dvh - 54px);
  }
  .hd-brand-title span {
    display: none;
  }
  .hd-brand-title {
    font-size: 15px;
  }
  .hd-brand-sub {
    display: none;
  }
  .hd-brand-logo {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 14px;
    border-radius: 7px;
  }
  .hd-mobile-quick-btn {
    padding: 5px 9px;
    font-size: 11px;
    gap: 4px;
  }
  .hd-hamburger-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 15px;
  }
  .hd-container {
    padding: 0 10px;
    margin: 12px auto;
  }
  .hd-modal-backdrop {
    padding: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hd-modal {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: var(--radius-sm);
    margin: auto 0;
  }
  .hd-modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }
  .hd-modal-body {
    padding: 14px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
  }
  .hd-table-scroll-hint {
    padding: 7px 12px;
    font-size: 11px;
  }
  .hd-table {
    min-width: 490px;
  }
  .hd-table th, .hd-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  .btn {
    padding: 9px 14px;
    font-size: 13px;
  }
  .btn-sm {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  /* Toast en móvil ultra-compacto */
  #toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .toast {
    min-width: unset;
    width: 100%;
    font-size: 13px;
    padding: 12px 14px;
  }

  .hd-auth-card {
    padding: 22px 16px;
  }
}



/* =========================================================================
   Ventanilla de Formularios de Contacto - Responsive Mobile
   ========================================================================= */
.hd-table-contacts {
  min-width: 820px;
}
.hd-contact-mobile-details {
  display: none;
}

@media (max-width: 768px) {
  .hd-table-contacts {
    min-width: 0 !important;
    width: 100% !important;
  }
  .hd-contact-mobile-details {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .hd-table-contacts {
    min-width: 0 !important;
    width: 100% !important;
  }
}


/* =========================================================================
   Ajustes Responsivos de Pestañas Centradas (Sin Desplazamiento en Teléfono y Tablet)
   ========================================================================= */
@media (max-width: 1024px) {
  .hd-tabs-scrollable {
    justify-content: center;
    gap: 7px;
    overflow-x: visible;
  }
  .hd-tabs-scrollable .nav-tab-btn {
    padding: 8px 13px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .hd-tabs-scrollable {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 18px;
    overflow-x: visible !important;
  }
  .hd-tabs-scrollable .nav-tab-btn {
    padding: 7px 11px;
    font-size: 12px;
    gap: 5px;
    flex: 0 1 auto;
  }
  .tab-label-full {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .hd-tabs-scrollable {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 8px;
    margin-bottom: 14px;
    overflow-x: visible !important;
  }
  .hd-tabs-scrollable .nav-tab-btn {
    padding: 6px 9px;
    font-size: 11.5px;
    gap: 4px;
    border-radius: var(--radius-sm);
  }
  .hd-tabs-scrollable .nav-tab-btn i {
    font-size: 11px;
  }
}


.hd-user-mobile-sub {
  display: none;
}
@media (max-width: 768px) {
  .hd-user-mobile-sub {
    display: block !important;
    font-size: 11px;
    color: var(--accent-cyan);
    margin-top: 3px;
  }
}


/* =========================================================================
   Centro de Notificaciones en Vivo
   ========================================================================= */
.hd-notif-wrapper {
  position: relative;
  display: inline-block;
}
.hd-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hd-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  text-align: center;
  border: 2px solid var(--bg-card);
  animation: pulseNotif 2.5s infinite;
}
@keyframes pulseNotif {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.hd-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 242, 254, 0.15);
  z-index: 1050;
  overflow: hidden;
  animation: notifSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes notifSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hd-notif-header {
  padding: 12px 16px;
  background: rgba(15, 35, 62, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.hd-notif-body {
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.hd-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.hd-notif-item:hover {
  background: rgba(0, 242, 254, 0.05);
}
.hd-notif-item.unread {
  background: rgba(0, 242, 254, 0.03);
}
.hd-notif-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.hd-notif-content {
  flex: 1;
  min-width: 0;
}
.hd-notif-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.hd-notif-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hd-notif-time {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.hd-notif-footer {
  padding: 10px 16px;
  background: rgba(15, 35, 62, 0.3);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

/* =========================================================================
   Analítica de Visitas Web & Gráficos Dinámicos
   ========================================================================= */
.visits-chart-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 220px;
  padding: 16px 8px 10px;
  background: rgba(8, 21, 40, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-col {
  flex: 1;
  min-width: 38px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  position: relative;
}

.chart-bars-wrap {
  width: 100%;
  height: 155px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.chart-bar {
  width: 12px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease, opacity 0.2s;
  cursor: pointer;
  position: relative;
}

.chart-bar.bar-visitors {
  background: var(--accent-cyan);
}

.chart-bar.bar-pageviews {
  background: rgba(56, 189, 248, 0.35);
  border: 1px solid var(--accent-cyan);
}

.chart-bar:hover {
  opacity: 0.85;
  filter: brightness(1.2);
}

.chart-date-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}

.chart-sub-label {
  font-size: 9.5px;
  color: #64748B;
  text-align: center;
}

.channel-progress-row,
.page-progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-fill-cyan {
  background: linear-gradient(90deg, #0284C7, #00F2FE);
}

.progress-fill-green {
  background: linear-gradient(90deg, #059669, #10B981);
}

.progress-fill-purple {
  background: linear-gradient(90deg, #7C3AED, #A855F7);
}

.progress-fill-amber {
  background: linear-gradient(90deg, #D97706, #F59E0B);
}

.device-card-box {
  background: rgba(8, 21, 40, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.device-card-box i {
  font-size: 22px;
  margin-bottom: 4px;
}

.device-card-val {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
}

.device-card-lbl {
  font-size: 11px;
  color: var(--text-muted);
}
