/* assets/style_v2.css - Sistema de Diseño SysNOVA Minimalista */

:root {
  --primary: #0b2b50;
  --navy: #0b2b50;
  --cyan: #00bcd4;
  --cyan-dark: #0097a7;
  --orange: #f97316;
  --bg: #f8fafc;
  --white: #ffffff;
  --text: #0f172a;
  --gray: #64748b;
  --border: #cbd5e1;
  --error: #ef4444;
  --success: #10b981;
  --radius: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 15px rgba(0,188,212,0.3);
}

* { box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 18px; line-height: 1.6; }

/* --- Barra Superior --- */
.top-bar {
  background: var(--primary);
  color: white;
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}
.top-bar .flex-align { display: flex; align-items: center; gap: 20px; }
.top-bar .logo-top { height: 60px; filter: brightness(0) invert(1); transition: transform 0.3s; }
.top-bar .logo-top:hover { transform: scale(1.05); }

/* --- Notificaciones --- */
.notif-wrapper { position: relative; cursor: pointer; }
.notif-bell { font-size: 1.5rem; transition: transform 0.2s; position: relative; }
.notif-bell:hover { transform: rotate(15deg); }
.notif-badge { position: absolute; top: -5px; right: -5px; background: var(--error); color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; font-weight: 800; display: none; }
.notif-badge.active { display: block; animation: pulse 2s infinite; }

.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  color: var(--text);
  margin-top: 15px;
  display: none;
  z-index: 1000;
  border: 1px solid var(--border);
  overflow: hidden;
}
.notif-dropdown.show { display: block; animation: slideInNotif 0.3s ease-out; }
.notif-header { padding: 15px; border-bottom: 1px solid var(--border); font-weight: 800; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { padding: 15px; border-bottom: 1px solid var(--border); font-size: 0.9rem; transition: background 0.2s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f1f5f9; }
.notif-item .time { font-size: 0.75rem; color: var(--gray); margin-top: 5px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes slideInNotif { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.top-bar span.highlight { color: #fb7185; font-weight: 700; text-shadow: 0 0 5px rgba(251,113,133,0.3); }

/* --- Header Dashboard --- */
.dashboard-header {
  display: flex;
  gap: 30px;
  padding: 30px;
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Widget de Perfil (Referencia 1) --- */
.profile-card {
  background: var(--cyan);
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
  color: white;
  padding: 40px 25px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px;
  box-shadow: var(--shadow-md);
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}
.profile-card .avatar-circle {
  width: 120px;
  height: 120px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
  border: 5px solid rgba(255,255,255,0.3);
}
.profile-card .avatar-circle img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.profile-card .name { font-weight: 700; font-size: 1.6rem; margin-bottom: 10px; text-align: center; }
.profile-card .links { font-size: 1rem; opacity: 0.9; }
.profile-card .links span { cursor: pointer; border-bottom: 1px solid transparent; transition: 0.2s; }
.profile-card .links span:hover { border-bottom-color: white; }

/* --- Menú de Funciones (Referencia 2) --- */
.functions-menu {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.nav-btn {
  background: var(--white);
  border: none;
  padding: 45px 25px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  position: relative;
}
.nav-btn::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 3px; background: var(--cyan); transition: all 0.3s; transform: translateX(-50%); }
.nav-btn:hover:not(.active) { background: #f1f5f9; color: var(--cyan); }
.nav-btn:hover:not(.active)::after { width: 50%; }
.nav-btn.active { background: var(--cyan); color: white; box-shadow: inset 0 4px 6px rgba(0,0,0,0.1); }
.nav-btn i { font-size: 2.8rem; transition: transform 0.3s; }
.nav-btn:hover i { transform: translateY(-5px); }
.nav-btn span { font-weight: 700; font-size: 1.2rem; text-transform: uppercase; text-align: center; }

/* --- Contenedores de Contenido --- */
main {
  padding: 0 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.content-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 45px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.content-box:hover { box-shadow: var(--shadow-md); }
h2 { margin-top: 0; color: var(--primary); font-size: 2.2rem; font-weight: 800; }
.desc { color: var(--gray); font-size: 1.1rem; margin-bottom: 30px; }

/* --- Tablas Minimalistas (Referencia 3) --- */
.filter-bar {
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-start;
  gap: 15px;
  flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.85rem;
}

.table-container { overflow-x: auto; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
th { background: #0f172a; color: white; text-align: left; padding: 22px 18px; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }
td { padding: 18px; border-bottom: 1px solid var(--border); transition: background 0.2s; }
tr:nth-child(even) { background: #f8fafc; }
tr:hover td { background: #f1f5f9; }

/* --- Badges y Estados --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  color: white;
  font-weight: 700;
  font-size: 0.7rem;
}
.badge-baja { background: #10b981; }
.badge-media { background: #f59e0b; }
.badge-alta { background: #ef4444; }
.badge-critica { background: #7f1d1d; }

.status-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: #e2e8f0;
}
.status-pendiente { background: #cbd5e1; color: #1e293b; }
.status-proceso { background: #bfdbfe; color: #1e40af; }
.status-concluido { background: #bbf7d0; color: #166534; }

/* --- Formularios --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.85rem; color: var(--gray); }
input, textarea, select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  font-size: 1rem;
  background: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { 
  border-color: var(--primary); 
  box-shadow: 0 0 0 4px rgba(11, 43, 80, 0.1);
  background: #fff;
}
.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-submit:hover { 
  background: var(--primary); 
  filter: brightness(1.1); 
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.btn-submit:active { transform: translateY(0) scale(0.96); }

/* --- Modales --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: white;
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  padding: 30px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* --- Alertas de Alerta (Videollamadas) --- */
#notifArea { position: fixed; top: 20px; right: 20px; z-index: 3000; }
.alert-banner {
  background: var(--orange);
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* --- Modal Minimalista (Ticket) --- */
.ticket-header-cards {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  margin-bottom: 25px;
}
.ticket-stat-card {
  flex: 1;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.ticket-stat-card i {
  font-size: 1.5rem;
  color: var(--orange);
}
.ticket-stat-card .st-content {
  display: flex;
  flex-direction: column;
}
.ticket-stat-card .st-content label {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 2px;
}
.ticket-stat-card .st-content span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.chat-layout {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.chat-bubble {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.chat-bubble-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.chat-bubble-header .cb-user {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}
.chat-bubble-header .cb-role {
  font-size: 0.7rem;
  background: #e2e8f0;
  color: var(--gray);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
  font-weight: 700;
}
.chat-bubble-header .cb-date {
  font-size: 0.75rem;
  color: var(--gray);
  margin-left: auto;
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
}
.chat-bubble-body {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* --- Unificación de Vista de Ticket Centralizada --- */
.ticket-dashboard-grid {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 25px;
  margin-top: 20px;
}
.ticket-view-col {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.ticket-view-col-header {
  background: var(--navy);
  color: white;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius) var(--radius) 0 0;
}
.btn-back {
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  color: var(--gray);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-back:hover {
  background: #f1f5f9;
  color: var(--navy);
  border-color: var(--navy);
}

.mascot-container {
  text-align: center;
  padding: 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.mascot-container img {
  max-width: 100%;
  height: auto;
  max-height: 180px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-avatar-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  margin-bottom: 15px;
  background: #f1f5f9;
}

.user-row-foto {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.edit-user-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .edit-user-grid {
    grid-template-columns: 1fr;
  }
}/* --- Responsividad --- */
@media (max-width: 900px) {
  .dashboard-header { flex-direction: column; }
  .profile-card { width: 100%; }
  .nav-btn { padding: 16px 8px; }
  .nav-btn i { font-size: 1.5rem; }
}

.last-updated { font-size: 0.75rem; color: var(--gray); text-align: right; padding: 0 24px; }

/* --- Estados de Carga (Spinners) --- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  color: transparent !important; /* Oculta el texto original */
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

