* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
  background-color: #f4f6f9;
  color: #333;
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}


.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1f2d3d;
  color: #c2c7d0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  font-size: 26px;
}

.sidebar-brand h2 {
  font-size: 18px;
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}

.sidebar-brand h2 .brand-light {
  font-weight: 300;
  color: #8aa1b4;
  letter-spacing: 0.3px;
}

.sidebar-brand p {
  font-size: 11px;
  color: #8aa1b4;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-brand .brand-dot {
  color: #00d2ff;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
}

.sidebar-section {
  padding: 6px 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6c7a89;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #c2c7d0;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: white;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(0, 123, 255, 0.12);
  color: white;
  border-left-color: #007bff;
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: #dc3545;
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #6c7a89;
}


.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 14px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 24px;
}

.cabecera-left {
  display: flex;
  flex-direction: column;
}

.cabecera h1 {
  font-size: 22px;
  font-weight: 700;
  color: #343a40;
  letter-spacing: 0;
  margin: 0;
}

.brand-dot {
  color: #007bff;
}

.subtitulo {
  font-size: 12px;
  color: #6c757d;
  margin-top: 1px;
}

.cabecera-right {
  display: flex;
  align-items: center;
  gap: 12px;
}


.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-nombre {
  color: #343a40;
  font-size: 13px;
  font-weight: 600;
}

.user-rol {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.user-rol.rol-admin { color: #dc3545; }
.user-rol.rol-user  { color: #6c757d; }


.boton-logout {
  background: #ffffff;
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.boton-logout:hover {
  background: #dc3545;
  color: white;
}


.view-wrapper {
  padding: 0 24px;
  flex: 1;
}


.tarjetas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.tarjetas-mini .tarjeta {
  min-height: 80px;
  padding: 12px 16px;
}

.tarjetas-mini .tarjeta-info h2 {
  font-size: 12px;
}

.tarjetas-mini .tarjeta-info p {
  font-size: 28px;
}

@media (max-width: 1100px) {
  .tarjetas { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .tarjetas { grid-template-columns: 1fr; }
}

.tarjeta {
  border-radius: 4px;
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  min-height: 100px;
}

.tarjeta-azul    { background: #17a2b8; }
.tarjeta-naranja { background: #2EF527; color: #1f2d3d; }
.tarjeta-rojo    { background: #dc3545; }
.tarjeta-verde   { background: #28a745; }

.tarjeta-info h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0 0 6px 0;
  opacity: 0.95;
}

.tarjeta-info p {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  display: inline-block;
  transform-origin: left center;
}

@keyframes kpiBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.kpi-bump {
  animation: kpiBump 0.45s ease;
}

.tarjeta-icono {
  font-size: 40px;
  opacity: 0.35;
}


.seccion-card {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-top: 3px solid #007bff;
  border-radius: 4px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.seccion-titulo {
  font-size: 16px;
  font-weight: 600;
  color: #343a40;
  padding: 14px 18px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contador-tickets {
  background: #e9ecef;
  color: #495057;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}


.graficas-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.graficas-row .seccion-card {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .graficas-row { grid-template-columns: 1fr; }
}


.filtros-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 14px 18px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  flex-wrap: wrap;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.filtro-buscador {
  flex: 2;
  min-width: 200px;
}

.filtro-grupo label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6c757d;
}

.filtro-grupo input,
.filtro-grupo select {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  color: #495057;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filtro-grupo input:focus,
.filtro-grupo select:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.boton-secundario {
  background: #6c757d;
  color: white;
  border: 1px solid #6c757d;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  height: 34px;
}

.boton-secundario:hover {
  background: #5a6268;
  border-color: #545b62;
}

.sin-resultados {
  padding: 28px 18px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  font-style: italic;
  background: #f8f9fa;
}


.tabla-wrapper {
  padding: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #ffffff;
  color: #343a40;
  padding: 12px 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 2px solid #dee2e6;
}

td {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 14px;
  color: #495057;
}

tbody tr:hover td {
  background: #f8f9fa;
}

tbody tr:last-child td {
  border-bottom: none;
}


.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.badge-critica  { background: #dc3545; }
.badge-alta     { background: #fd7e14; }
.badge-media    { background: #ffc107; color: #1f2d3d; }
.badge-baja     { background: #28a745; }

.badge-abierta  { background: #007bff; }
.badge-proceso  { background: #ffc107; color: #1f2d3d; }
.badge-cerrada  { background: #6c757d; }

.badge-rol-administrador { background: #dc3545; }
.badge-rol-supervisor    { background: #17a2b8; }
.badge-rol-tecnico       { background: #007bff; }
.badge-rol-usuario       { background: #6c757d; }

.badge-registrado {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  font-size: 10px;
  padding: 2px 6px;
  margin-left: 6px;
}


.form-ticket {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

.form-row input,
.form-row select {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: #495057;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.form-actions .boton-primario {
  align-self: flex-start;
  margin-top: 0;
  padding: 9px 18px;
}

.form-mensaje {
  font-size: 13px;
  color: #28a745;
  font-weight: 600;
  margin: 0;
}

.form-mensaje.form-mensaje-ok {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.boton-mini-peligro {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.boton-mini-peligro:hover {
  background: #dc3545;
  color: white;
}


.grafica-wrapper {
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  max-height: 360px;
}

canvas {
  max-height: 320px;
}


.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-row .seccion-card {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .admin-row { grid-template-columns: 1fr; }
}

.info-sesion {
  padding: 18px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f5;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

.info-valor {
  font-size: 14px;
  font-weight: 600;
  color: #343a40;
}

.acciones-admin {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acciones-desc {
  font-size: 13px;
  color: #6c757d;
}

.acciones-aviso {
  font-size: 12px;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  padding: 10px 12px;
  line-height: 1.5;
}

.boton-peligro {
  background: #dc3545;
  color: white;
  border: 1px solid #dc3545;
  border-radius: 4px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  align-self: flex-start;
}

.boton-peligro:hover {
  background: #c82333;
  border-color: #bd2130;
}


.footer {
  margin-top: 12px;
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid #dee2e6;
  text-align: right;
  color: #6c757d;
  font-size: 13px;
}

.footer strong {
  color: #343a40;
}


.login-body {
  background: #e9ecef;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100vh;
}

.login-wrapper {
  width: 100%;
  max-width: 380px;
}

.login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand-title {
  font-size: 38px;
  font-weight: 300;
  color: #495057;
  letter-spacing: 0;
}

.brand-title strong,
.brand-title b {
  font-weight: 700;
  color: #007bff;
}

.brand-title .brand-light {
  font-weight: 300;
  color: #6c757d;
}

.login-brand .brand-dot {
  color: #007bff;
}

.brand-subtitle {
  font-size: 13px;
  color: #6c757d;
  margin-top: 2px;
}

.brand-tagline {
  display: none;
}

.login-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.login-titulo {
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dee2e6;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-card input {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 10px 14px;
  color: #495057;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input::placeholder {
  color: #adb5bd;
}

.login-card input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.boton-primario {
  background: #007bff;
  color: white;
  border: 1px solid #007bff;
  border-radius: 4px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background-color 0.15s ease;
}

.boton-primario:hover {
  background: #0069d9;
  border-color: #0062cc;
}

.login-error {
  margin-top: 10px;
  text-align: center;
  color: #dc3545;
  font-size: 13px;
  min-height: 18px;
}

.login-toggle {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #6c757d;
}

.login-toggle a {
  color: #007bff;
  font-weight: 600;
}

.login-hint {
  margin-top: 18px;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 12px;
  color: #6c757d;
  line-height: 1.7;
}

.login-hint strong {
  color: #343a40;
}

.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #adb5bd;
}

.login-glow { display: none; }
