 /* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
  --color-bg: #f4f7f6;
  --color-text: #222;
  --color-accent: #2196f3;
  --color-nav-bg: rgb(126, 188, 224);
  --color-nav-border: #e0e0e0;
}

/* ============================================================
   BASE GENERAL
   ============================================================ */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.contenedor {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.login-card {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h2 {
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.login-img img {
  border-radius: 50%;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-top: 1rem;
  text-align: left;
  color: #333;
  font-size: 0.95rem;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 55%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
}

.btn-login {
  width: 100%;
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.8rem;
  margin-top: 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-login:hover {
  background: #1976d2;
}

.error-msg {
  color: crimson;
  margin-top: 0.8rem;
}

.login-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.login-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-nav-bg);
  padding: 0.8rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.navbar .logo a {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.2rem;
  letter-spacing: 0.4px;
}

.menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.menu a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.menu a:hover {
  text-decoration: underline;
}

/* ============================================================
   USUARIO Y BOTÓN SALIR
   ============================================================ */
.menu-usuario {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 1rem;
}

.menu-usuario span {
  color: #fff;
  font-weight: 500;
}

.logout {
  background: crimson;
  color: #fff !important;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s;
}

.logout:hover {
  background: #a3122f;
}

/* ============================================================
   IMAGEN PRINCIPAL (Index)
   ============================================================ */
.imagen-principal {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.imagen-principal img {
  width: 550px;
  max-width: 90%;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ============================================================
   DASHBOARD (Principal)
   ============================================================ */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.card h3 {
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.card p {
  color: #444;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card .btn {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.card .btn:hover {
  background: #1976d2;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  background: #fff;
  border-top: 1px solid #ddd;
  color: #333;
  font-size: 0.9rem;
  width: 100%;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.footer-content a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.footer-content a:hover {
  text-decoration: underline;
}

.version {
  font-size: 0.85rem;
  color: #666;
}

/* ============================================================
   TEXTO DE BIENVENIDA
   ============================================================ */
.texto-bienvenida {
  text-align: center;
  margin-top: 1.5rem;
}

.texto-bienvenida h2 {
  font-size: 1.2rem;
  color: #333;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============================================================
   TABLAS Y CLIENTES
   ============================================================ */
.acciones-clientes {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: #1976d2;
}

.btn-secundario {
  background: #ccc;
  color: #000;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-secundario:hover {
  background: #bbb;
}

/* TABLA GENERAL */
.tabla {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.tabla th {
  background: var(--color-nav-bg);
  color: #fff;
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
}

.tabla td {
  padding: 0.7rem;
  border-bottom: 1px solid #ddd;
}

.tabla tr:nth-child(even) {
  background: #f9f9f9;
}

.tabla a {
  text-decoration: none;
  color: #333;
}

.tabla a:hover {
  color: var(--color-accent);
}

/* ÍCONOS DE ACCIÓN (SÓLIDOS Y AZULES) */
.acciones {
  text-align: center;
}

.acciones a {
  display: inline-block;
  margin: 0 0.4rem;
}

.acciones i {
  font-size: 1.3rem;
  color: var(--color-accent);
  transition: transform 0.2s, color 0.2s;
}

.acciones i:hover {
  transform: scale(1.25);
  color: #1976d2;
}

/* ESTADOS Y MENSAJES */
.verde {
  color: #2e7d32;
  font-weight: 600;
}

.rojo {
  color: #c62828;
  font-weight: 600;
}

.success-msg {
  background: #c8e6c9;
  padding: 0.6rem;
  border-radius: 6px;
  color: #256029;
  margin-bottom: 1rem;
}

.error-msg {
  background: #ffcdd2;
  padding: 0.6rem;
  border-radius: 6px;
  color: #b71c1c;
  margin-bottom: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .menu a, .menu-usuario {
    padding: 0.4rem 0;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .imagen-principal img {
    width: 90%;
  }
}

/* ÍCONOS COLORIDOS */
.acciones {
  text-align: center;
}

.acciones a {
  display: inline-block;
  margin: 0 0.5rem;
  transition: transform 0.2s ease;
}

.acciones i {
  font-size: 1.3rem;
  transition: transform 0.2s ease, filter 0.2s ease;
}

/* efecto suave al pasar el mouse */
.acciones a:hover i {
  transform: scale(1.25);
  filter: brightness(1.2);
}

/* BOTÓN SECUNDARIO (Ver todos / Ver solo activos) */
.btn-secundario {
  background: #e0e0e0;
  color: #333;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #ccc;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1.2rem;
}

.btn-secundario i {
  font-size: 0.95rem;
}

.btn-secundario:hover {
  background: #d5d5d5;
  color: #000;
  border-color: #bbb;
}


/* CONTENEDOR DE ACCIONES */
.acciones-clientes {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

/* BOTONES PRINCIPALES */
.btn {
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #1976d2;
}

/* BOTÓN SECUNDARIO (Ver todos / activos) */
.btn-secundario {
  background: #e0e0e0;
  color: #333;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #ccc;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-secundario:hover {
  background: #d5d5d5;
  color: #000;
  border-color: #bbb;
}

/* ============================================================
   FORMULARIO CLIENTES (ADD)
   ============================================================ */
.formulario-clientes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem 2rem;
  margin-top: 1.5rem;
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.campo {
  display: flex;
  flex-direction: column;
}

.formulario-clientes label {
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #333;
}

.formulario-clientes input {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.formulario-clientes input:focus {
  border-color: var(--color-accent);
  outline: none;
}

.acciones-clientes {
  grid-column: 1 / -1; /* ocupa el ancho completo */
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}


/* ============================================================
   MODO IMPRESIÓN
   ============================================================ */
@media print {
  /* Ocultar elementos innecesarios */
  .navbar,
  .menu,
  .menu-usuario,
  .acciones-clientes,
  .btn,
  .btn-secundario,
  .success-msg,
  .error-msg,
  footer,
  .footer {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ajustar fondo y texto */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    margin: 0;
    padding: 0;
  }

  .contenedor {
    width: 100% !important;
    margin: 0;
    padding: 0;
    box-shadow: none !important;
  }

  /* Tablas optimizadas para imprimir */
  .tabla {
    width: 100%;
    border-collapse: collapse !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .tabla th,
  .tabla td {
    border: 1px solid #000 !important;
    padding: 6px 8px !important;
    color: #000 !important;
    background: #fff !important;
    font-size: 10pt !important;
  }

  .tabla th {
  background: #e0e0e0 !important; /* color gris claro para encabezado */
  /* para navegadores basados en WebKit (Chrome, Safari) */
  -webkit-print-color-adjust: exact; /* ok */
  print-color-adjust: exact; /* estándar nuevo */
}


  /* Ocultar scroll y sombras */
  * {
    box-shadow: none !important;
  }

  /* Centrar encabezados */
  h1, h2, h3, h4, h5 {
    text-align: center !important;
    color: #000 !important;
  }

  /* Mostrar solo lo importante */
  .print-only {
    display: block !important;
  }
}

/* ============================================================
   MENÚ DESPLEGABLE (ESTILO CLÁSICO SIN BOOTSTRAP)
   ============================================================ */
.nav-list {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-list li {
  position: relative;
}

.nav-list a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  display: inline-block;
}

.nav-list a:hover {
  text-decoration: underline;
}

/* Dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 230px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border-radius: 6px;
  top: 100%;
  left: 0;
  z-index: 1000;
  padding: 0.3rem 0;
}

.dropdown-content li {
  list-style: none;
}

.dropdown-content a {
  color: #333;
  padding: 0.5rem 0.9rem;
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
}

.dropdown-content a:hover {
  background-color: var(--color-bg);
  color: var(--color-accent);
}

/* Mostrar menú desplegable */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Separador dentro del menú */
.dropdown-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0.3rem 0;
}

/* Flecha en el botón desplegable */
.dropbtn::after {
  content: " ▾";
  font-size: 0.8rem;
}

/* Ajustes responsive */
@media (max-width: 768px) {
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
  }
  .dropdown-content {
    position: static;
    box-shadow: none;
    background: none;
  }
  .dropdown-content a {
    padding-left: 1.5rem;
  }
}


/* FORMULARIO DE TAREAS */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.formulario label {
  font-weight: 500;
  color: #333;
}

.formulario input, 
.formulario select,
.formulario textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.formulario textarea {
  resize: vertical;
}

.formulario .req {
  color: crimson;
}

.invalido {
  border-color: crimson;
  background: #ffe5e5;
}

.btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #1976d2;
}

/* SELECT con color dinámico */
#porcentaje_realizado {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  font-weight: 600;
  color: #333;
  transition: background 0.3s, color 0.3s;
}

/* Colores dinámicos según valor */
#porcentaje_realizado[data-color="0%"] {
  background-color: #ffcdd2;
  color: #b71c1c;
}
#porcentaje_realizado[data-color="25%"] {
  background-color: #fff9c4;
  color: #f57f17;
}
#porcentaje_realizado[data-color="50%"] {
  background-color: #fff59d;
  color: #f9a825;
}
#porcentaje_realizado[data-color="75%"] {
  background-color: #c8e6c9;
  color: #2e7d32;
}
#porcentaje_realizado[data-color="100%"] {
  background-color: #a5d6a7;
  color: #1b5e20;
}

/* Sombras y detalles */
#porcentaje_realizado:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* === SECCIÓN TAREAS === */
.resumen-tareas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.card-resumen {
  flex: 1;
  min-width: 200px;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
}
.card-resumen .titulo { display: block; font-size: 0.9rem; }
.card-resumen .valor { font-size: 1.4rem; }

.card-resumen.total { background: #607d8b; }
.card-resumen.pendientes { background: #ff9800; }
.card-resumen.completas { background: #4caf50; }
.card-resumen.promedio { background: #2196f3; }

.tabla-tareas th {
  background: #f0f0f0;
  font-weight: 600;
}
.tabla-tareas td, .tabla-tareas th {
  border: 1px solid #ddd;
  padding: 0.6rem;
}

.tarea-interna { color: #6a1b9a; font-weight: 600; }

.barra {
  height: 10px;
  border-radius: 5px;
  background: #eee;
  overflow: hidden;
  margin-bottom: 3px;
}
.barra > div {
  height: 100%;
  transition: width 0.3s ease;
}

.p0  { background: #ffcdd2; width: 0%; }
.p25 { background: #fff9c4; width: 25%; }
.p50 { background: #fff59d; width: 50%; }
.p75 { background: #c8e6c9; width: 75%; }
.p100 { background: #a5d6a7; width: 100%; }

.alerta {
  background: #fff3cd;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ffeeba;
  color: #856404;
}

/* === SELECT DE PORCENTAJE (colores visuales) === */
#porcentaje {
  padding: 0.6rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  color: #333;
  transition: all 0.3s;
}

#porcentaje:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 6px rgba(33,150,243,0.4);
}

/* Aplicar color según el valor seleccionado */
#porcentaje option[value="0%"]   { background-color: #ffcdd2; color: #b71c1c; }
#porcentaje option[value="25%"]  { background-color: #ffe0b2; color: #e65100; }
#porcentaje option[value="50%"]  { background-color: #fff59d; color: #f57f17; }
#porcentaje option[value="75%"]  { background-color: #c8e6c9; color: #1b5e20; }
#porcentaje option[value="100%"] { background-color: #a5d6a7; color: #2e7d32; }

/* Opciones de selección más lindas en navegadores modernos */
#porcentaje option:hover {
  filter: brightness(1.1);
}

/* === SELECT de porcentaje más compacto === */
#porcentaje_realizado {
  width: 25%;
  min-width: 120px;
  max-width: 200px;
  display: inline-block;
}



/* ============================================================
   SELECT / OPTION — ESTILO GENERAL UNIFICADO
   ============================================================ */
select,
.form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: all 0.2s ease-in-out;
  appearance: none; /* oculta flecha nativa en algunos navegadores */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%232196f3' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

select:hover,
.form-select:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 4px rgba(33, 150, 243, 0.3);
}

select:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 6px rgba(33, 150, 243, 0.4);
}

/* Opciones dentro del menú desplegable */
option {
  background: #fff;
  color: #333;
  padding: 0.4rem;
  font-size: 0.95rem;
}

option:hover,
option:checked {
  background: rgba(33, 150, 243, 0.1);
  color: #1976d2;
}

/* Para selects deshabilitados */
select:disabled {
  background: #f2f2f2;
  color: #888;
  cursor: not-allowed;
}


/* =========================================
   SECCIÓN: TAREAS (ver todo)
   ========================================= */
.contenedor-tareas {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.contenedor-tareas h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

/* Filtro superior */
.filtro-tareas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.filtro-tareas label {
  font-weight: 600;
}

.select-sm {
  width: 180px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-sm:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 5px rgba(33,150,243,0.4);
  outline: none;
}

.btn-filtrar {
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 600;
}

.btn-filtrar:hover {
  background: #1976d2;
}

/* Tabla principal */
.tabla-tareas {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.tabla-tareas th,
.tabla-tareas td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}

.tabla-tareas th {
  background: rgb(126, 188, 224);
  color: #fff;
  font-weight: 600;
}

.tabla-tareas tr:hover {
  background: #f8f9fa;
}

/* Acciones */
.acciones a {
  text-decoration: none;
  font-size: 1rem;
  margin-right: 0.4rem;
  transition: transform 0.2s, color 0.2s;
}

.acciones a:hover {
  transform: scale(1.15);
}

.edit {
  color: #1976d2;
}

.edit:hover {
  color: #0d47a1;
}

.noaccion {
  color: #999;
}

.alerta {
  background: #e3f2fd;
  border-left: 4px solid var(--color-accent);
  padding: 0.8rem;
  border-radius: 6px;
  color: #333;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .tabla-tareas th,
  .tabla-tareas td {
    font-size: 0.85rem;
    padding: 0.4rem;
  }
}

