@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap');

:root{
  --bg-gradient: linear-gradient(135deg, #f4f7fc 0%, #e9eef5 100%);
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: #fafcff;
  --text: #1a2634;
  --muted: #5b6e8c;
  --line: #e2eaf5;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;

  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  
  --success-bg: #ecfdf5;
  --success-text: #059669;
  --success-border: #a7f3d0;

  --error-bg: #fef2f2;
  --error-text: #dc2626;
  --error-border: #fecaca;

  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  --warning-border: #fde68a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-focus: 0 0 0 4px rgba(59,130,246,0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  line-height: 1.5;
}

.wrap{
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}

/* TÍTULO MODERNO */
.title{
  text-align: center;
  margin-bottom: 28px;
}

.title h1{
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

/* PANELES CON EFECTO CRISTAL */
.panel{
  background: var(--panel);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.panel:hover{
  box-shadow: var(--shadow-lg);
}

.panel h2{
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.01em;
  border-left: 4px solid var(--primary);
  padding-left: 14px;
}

/* TARJETAS DE CONTADORES MODERNAS */
.summary-bar{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.summary-card{
  background: var(--panel);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(226, 234, 245, 0.8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 8px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.summary-card span{
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-card strong{
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

/* SELECTOR DE GRUPO */
.selector-grupo-form{
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  justify-content: flex-end;
}

.selector-grupo-select{
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.selector-grupo-select:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

/* BOTONES MEJORADOS */
button,
.btn-primary,
.btn-secondary,
.btn-alerta,
.btn-mini {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59,130,246,0.2);
}

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

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* FILTROS MEJORADOS */
.filtro-estados-box {
  background: var(--panel-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--line);
}

.filtro-estados-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.filtro-estados-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.filtro-estados-checks input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* INPUTS MODERNOS */
input, select, textarea {
  font-family: 'Inter', sans-serif;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: all 0.2s;
  background: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

/* TABLA ESTILO MODERNO */
.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.task-table th {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f8fafd;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

.task-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}

.task-table tr:hover td {
  background-color: #fafcff;
}

/* BADGES DE ESTADO MÁS VIBRANTES */
.estado {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.estado-pendiente {
  background: #eff6ff;
  color: #2563eb;
}

.estado-pendiente-de-firma {
  background: #f3e8ff;
  color: #9333ea;
}

.estado-pendiente-devolucion {
  background: #fff7ed;
  color: #ea580c;
}

.estado-programada {
  background: #e0f2fe;
  color: #0284c7;
}

.estado-urgente {
  background: #fef2f2;
  color: #dc2626;
}

.estado-completada {
  background: #ecfdf5;
  color: #059669;
}

/* ALERTAS MÁS ATRACTIVAS */
.alerta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: white;
  border-left: 5px solid;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.alerta-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.alerta-normal {
  border-left-color: var(--primary);
}

.alerta-critica {
  border-left-color: var(--error-text);
  background: #fef2f2;
}

.alerta-urgente {
  border-left-color: var(--warning-text);
}

/* BOTONES ICONO */
.btn-icono {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
  background: #f1f5f9;
  text-decoration: none;
}

.btn-editar {
  background: #eff6ff;
  color: var(--primary);
}
.btn-editar:hover {
  background: #dbeafe;
  transform: scale(1.05);
}

.btn-borrar {
  background: #fef2f2;
  color: var(--error-text);
}
.btn-borrar:hover {
  background: #fee2e2;
  transform: scale(1.05);
}

/* CATEGORIZACIONES */
.catalog-block {
  background: var(--panel-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

.tag-list li {
  background: white;
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.1s;
}

.tag-list li:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* RESPONSIVE AJUSTADO */
@media (max-width: 1100px) {
  .summary-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 16px;
  }
  
  .summary-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .title h1 {
    font-size: 1.6rem;
  }
  
  .panel {
    padding: 16px;
  }
  
  .alerta-item {
    flex-direction: column;
    align-items: stretch;
  }
}

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

.acciones-modulos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #dbe7f5;
}

.modulo-nueva {
    background: linear-gradient(135deg, #dbeafe, #ffffff);
}

.modulo-recargar {
    background: linear-gradient(135deg, #dcfce7, #ffffff);
}

.modulo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 145px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #dbe7f5;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transition: all 0.18s ease;
}

.modulo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.modulo-dashboard {
    background: linear-gradient(135deg, #e0f2fe, #ffffff);
}

.modulo-productividad {
    background: linear-gradient(135deg, #dcfce7, #ffffff);
}

.modulo-mensajes {
    background: linear-gradient(135deg, #fef9c3, #ffffff);
}

.modulo-perfil {
    background: linear-gradient(135deg, #ede9fe, #ffffff);
}

.modulo-admin {
    background: linear-gradient(135deg, #fee2e2, #ffffff);
}

.ia-panel {
    display: grid;
    gap: 12px;
}

.ia-card {
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
    border: 1px solid #dbe7f5;
    font-weight: 600;
    color: #1e293b;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.20), transparent 34%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.22), transparent 32%),
        linear-gradient(135deg, #eef4ff, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
    width: 100%;
    padding: 32px;
    display: flex;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 36px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(219, 231, 245, 0.95);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(14px);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
}

.login-brand h1 {
    margin: 0;
    color: #1e293b;
    font-size: 2rem;
    line-height: 1.1;
}

.login-brand p {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 0.98rem;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    font-weight: 700;
    color: #334155;
    font-size: 0.95rem;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.login-button {
    margin-top: 8px;
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #ffffff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.30);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(59, 130, 246, 0.38);
}

.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 0.86rem;
}

.login-messages {
    margin-bottom: 18px;
}

.login-message {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
    font-size: 0.92rem;
}

.ia-asistente-panel {
    margin-top: 22px;
}

.ia-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.ia-asistente-panel {
    margin-top: 22px;
}

.ia-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.ia-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 13px 18px;
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid #dbe7f5;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ia-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.ia-subtareas {
    color: #5b21b6;
    background: linear-gradient(135deg, #ede9fe, #ffffff);
}

.ia-prioridad {
    color: #1d4ed8;
    background: linear-gradient(135deg, #dbeafe, #ffffff);
}

.ia-resultados {
    margin-top: 10px;
}

.ia-resultado {
    margin-top: 14px;
    white-space: pre-line;
}

.ia-ayuda {
    margin-top: 10px;
    color: #64748b;
}

.ia-checklist {
    color: #047857;
    background: linear-gradient(135deg, #dcfce7, #ffffff);
}

.preview-avatar-perfil{
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #dbeafe;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: block;
    margin: 0 auto 18px;
}

.perfil-foto-placeholder{
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-size: 4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.perfil-preview{
    text-align: center;
}

/* =======================================================
   RESPONSIVE MOVIL
======================================================= */

@media (max-width: 768px) {

    body {
        padding: 10px;
        font-size: 14px;
    }

    .contenedor,
    .dashboard,
    .paneles,
    .fila,
    .row {
        display: flex;
        flex-direction: column !important;
        gap: 10px;
    }

    .panel,
    .card,
    .bloque,
    .widget {
        width: 100% !important;
        max-width: 100% !important;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
    }

    input,
    select,
    textarea,
    button {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

}

@media (max-width: 768px) {

    .resumen-estados,
    .stats-grid,
    .contadores,
    .tarjetas-resumen {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .resumen-estados .card,
    .stats-grid .card,
    .contadores .card,
    .tarjetas-resumen .card {
        min-height: 95px;
        padding: 16px 10px;
    }

    .resumen-estados .card h3,
    .stats-grid .card h3,
    .contadores .card h3,
    .tarjetas-resumen .card h3 {
        font-size: 12px;
        line-height: 1.2;
    }

    .resumen-estados .card .numero,
    .stats-grid .card .numero,
    .contadores .card .numero,
    .tarjetas-resumen .card .numero {
        font-size: 26px;
    }
}

/* ======================================================
   CONTADORES RESPONSIVE MOVIL
====================================================== */

@media (max-width: 768px) {

    .summary-bar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
    }

    .summary-card {
        width: 100% !important;
        min-width: 0 !important;
        padding: 16px 10px;
        box-sizing: border-box;
    }

    .summary-card span {
        font-size: 12px;
        line-height: 1.2;
    }

    .summary-card strong {
        font-size: 28px;
    }

}