/**
 * Fichingo — Componentes compartidos (RRHH / control de presencia)
 * Cargado globalmente en todas las pantallas del panel.
 */

/* ─── Tarjetas y tablas ──────────────────────────────────────────────────── */
.fichingo-users-card {
  border: 1px solid var(--chocola-gray-light, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(26, 45, 74, 0.06);
  overflow: hidden;
}

.fichingo-users-table .fichingo-users-id {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
}

.fichingo-users-table .fichingo-users-name {
  font-weight: 600;
  color: var(--fichingo-navy, #1a2d4a);
}

.fichingo-users-table .fichingo-users-email {
  color: #475569;
}

.fichingo-hours-cell {
  font-weight: 600;
  color: var(--fichingo-navy, #1a2d4a);
}

/* ─── Cabecera de página (módulos) ───────────────────────────────────────── */
.fichingo-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.fichingo-page-header-text {
  min-width: 0;
}

.fichingo-page-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.fichingo-page-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.fichingo-page-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.fichingo-page-breadcrumb a {
  color: var(--fichingo-blue, #1a6fd4);
  text-decoration: none;
}

.fichingo-page-breadcrumb a:hover {
  text-decoration: underline;
}

.fichingo-page-breadcrumb .material-icons {
  font-size: 14px;
  color: #cbd5e1;
}

/* ─── Barra de filtros ───────────────────────────────────────────────────── */
.fichingo-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.fichingo-filter-bar .form-group {
  margin-bottom: 0;
  min-width: 130px;
  flex: 1 1 130px;
  max-width: 200px;
}

.fichingo-filter-bar .form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.3rem;
}

.fichingo-filter-bar .form-control {
  height: 38px;
  font-size: 0.875rem;
  border-radius: 8px;
  border-color: #cbd5e1;
}

.fichingo-filter-bar .form-control:focus {
  border-color: var(--fichingo-blue, #1a6fd4);
  box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.12);
}

.fichingo-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.fichingo-filter-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fichingo-filter-preset {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fichingo-filter-preset:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.fichingo-filter-preset.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.fichingo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}

.fichingo-badge--role {
  color: #1558ab;
  background: rgba(26, 111, 212, 0.1);
  border: 1px solid rgba(26, 111, 212, 0.16);
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fichingo-badge--active {
  background: #dcfce7;
  color: #166534;
}

.fichingo-badge--inactive {
  background: #f1f5f9;
  color: #64748b;
}

.fichingo-badge--entry {
  background: #e0f2fe;
  color: #0369a1;
}

.fichingo-badge--clock-in {
  background: #dcfce7;
  color: #15803d;
}

.fichingo-badge--clock-out {
  background: #fee2e2;
  color: #b91c1c;
}

.fichingo-badge--break {
  background: #fef3c7;
  color: #b45309;
}

.fichingo-badge--source-manual {
  background: #ede9fe;
  color: #6d28d9;
}

.fichingo-badge--source-web {
  background: #dbeafe;
  color: #1d4ed8;
}

.fichingo-badge--source-mobile {
  background: #ccfbf1;
  color: #0f766e;
}

.fichingo-badge--mode-onsite {
  background: #f1f5f9;
  color: #334155;
}

.fichingo-badge--mode-remote {
  background: #e0e7ff;
  color: #4338ca;
}

.fichingo-badge--holiday-national {
  background: #dbeafe;
  color: #1d4ed8;
}

.fichingo-badge--holiday-autonomous {
  background: #ccfbf1;
  color: #0f766e;
}

.fichingo-badge--holiday-local {
  background: #f1f5f9;
  color: #475569;
}

.fichingo-badge--holiday-company {
  background: #ffedd5;
  color: #c2410c;
}

.fichingo-stat-icon--slate {
  background: #f1f5f9;
  color: #475569;
}

/* ─── Informes ───────────────────────────────────────────────────────────── */
.fichingo-report-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fichingo-report-total-item {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.fichingo-report-total-item span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.fichingo-report-total-item strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.fichingo-report-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #e2e8f0;
}

/* ─── Estados vacíos ─────────────────────────────────────────────────────── */
.fichingo-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #64748b;
}

.fichingo-empty-state > .material-icons {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.fichingo-empty-state .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.fichingo-empty-state .btn .material-icons {
  font-size: 18px;
  line-height: 1;
  margin: 0;
  color: inherit;
}

.fichingo-empty-state h5 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.fichingo-empty-state p {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  max-width: 360px;
}

/* ─── Avisos y cumplimiento ──────────────────────────────────────────────── */
.fichingo-compliance-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #64748b;
}

.fichingo-compliance-note .material-icons {
  font-size: 16px;
  color: #94a3b8;
}

.fichingo-limit-notice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #92400e;
}

.fichingo-limit-notice .material-icons {
  font-size: 18px;
}

.fichingo-row-link {
  color: inherit;
  text-decoration: none;
}

.fichingo-row-link:hover {
  color: var(--fichingo-blue, #1a6fd4);
}

.fichingo-stat-card--clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.fichingo-stat-card--clickable:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.fichingo-stat-card--clickable a {
  color: inherit;
  text-decoration: none;
  display: contents;
}

/* ─── Filas de módulos (espacio entre columnas y tarjetas) ───────────────── */
body.chocola-app .main-panel > .content > .container-fluid {
  gap: 1.25rem;
}

body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) {
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
}

body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > [class*="col-"] {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
}

body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > [class*="col-"] > .card,
body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > [class*="col-"] > .fichingo-users-card {
  width: 100%;
  height: 100%;
}

@media (min-width: 992px) {
  body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > .col-lg-8 {
    flex: 1 1 calc((100% - 1.25rem) * 2 / 3);
    max-width: calc((100% - 1.25rem) * 2 / 3);
  }

  body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > .col-lg-6 {
    flex: 1 1 calc((100% - 1.25rem) / 2);
    max-width: calc((100% - 1.25rem) / 2);
  }

  body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > .col-lg-4 {
    flex: 1 1 calc((100% - 1.25rem) / 3);
    max-width: calc((100% - 1.25rem) / 3);
  }

  body.chocola-app .main-panel > .content .row:not(.fichingo-stats-row):not(.fichingo-dashboard-row) > .col-lg-3 {
    flex: 1 1 calc((100% - 3.75rem) / 4);
    max-width: calc((100% - 3.75rem) / 4);
  }
}

/* ─── Sidebar normativa (Empresa > Datos) ─────────────────────────────────── */
.fichingo-normativa-links {
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.fichingo-normativa-links__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.65rem;
}

.fichingo-normativa-links__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fichingo-normativa-links__list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fichingo-normativa-links__list a {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  line-height: 1.35;
}

.fichingo-normativa-links__list a .material-icons {
  font-size: 15px;
  margin-top: 1px;
  flex-shrink: 0;
  opacity: 0.85;
}

.fichingo-normativa-links__list a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.fichingo-normativa-links__desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
  padding-left: 1.35rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .fichingo-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .fichingo-filter-bar .form-group {
    max-width: none;
    flex: 1 1 100%;
  }

  .fichingo-filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .fichingo-filter-actions .btn {
    flex: 1;
  }

  .fichingo-page-header {
    margin-bottom: 1rem;
  }
}
