:root {
  --blue: #0d6efd;
  --blue-dark: #0646c8;
  --bg: #f6f8fc;
  --text: #111827;
  --muted: #64748b;
  --border: #e5e7eb;
  --green: #16a34a;
  --red: #ef4444;
  --yellow: #f59e0b;
  --orange: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 100% 100%, rgba(13, 110, 253, .24), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.app-sidebar {
  min-height: 100vh;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  padding: 0 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border: 3px solid var(--blue);
  color: var(--blue);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.brand-title {
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  color: var(--blue);
  font-weight: 800;
  line-height: 1.1;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  color: #334155;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-link i {
  font-size: 18px;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: var(--blue);
  color: #fff;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 18px;
}

.company-switch,
.user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
}

.user-mini {
  border: 0;
  background: transparent;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.avatar.small {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.user-name {
  font-weight: 700;
}

.user-role {
  color: var(--muted);
  font-size: 13px;
}

.app-main {
  padding: 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 800;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.date-pill,
.icon-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-weight: 600;
}

.icon-btn {
  width: 44px;
  justify-content: center;
  position: relative;
  padding: 0;
}

.icon-btn {
  text-decoration: none;
}

.icon-btn:hover {
  color: #0f172a;
}

.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card,
.clock-card,
.chart-card,
.alerts-card,
.table-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.stat-card {
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.stat-icon.blue {
  color: var(--blue);
  background: #eaf2ff;
}

.stat-icon.green {
  color: var(--green);
  background: #dcfce7;
}

.stat-icon.yellow {
  color: var(--yellow);
  background: #fef3c7;
}

.stat-icon.red {
  color: var(--red);
  background: #fee2e2;
}

.stat-card p,
.stat-card h2 {
  margin: 0;
}

.stat-card p {
  color: #334155;
  font-weight: 700;
}

.stat-card h2 {
  font-size: 28px;
  font-weight: 800;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 13px;
}

.stat-trend {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-weight: 800;
  font-size: 13px;
}

.stat-trend.up {
  color: var(--green);
}

.stat-trend.down {
  color: var(--red);
}

.stat-trend small {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  gap: 18px;
  margin-bottom: 18px;
}

.clock-card {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  padding: 22px;
}

.clock-card h3,
.chart-card h3,
.alerts-card h3,
.table-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.live-clock {
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 24px;
}

.clock-date {
  text-align: center;
  opacity: .86;
  margin-bottom: 22px;
}

.clock-info {
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 14px;
}

.clock-info small {
  grid-column: 2;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.btn-clock {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 10px;
  margin-top: 16px;
  background: #ef233c;
  color: #fff;
  font-weight: 800;
}

.clock-link {
  margin-top: 16px;
  color: #fff;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.chart-card,
.alerts-card,
.table-card {
  padding: 22px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header-row a {
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
}

.legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 22px 0 18px;
  color: #475569;
  font-size: 13px;
}

.legend-solid {
  display: inline-block;
  width: 18px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
  margin-right: 8px;
}

.legend-line {
  display: inline-block;
  width: 18px;
  border-top: 2px dashed #93c5fd;
  margin-right: 8px;
  transform: translateY(-3px);
}

.bar-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 20px 16px 0;
  position: relative;
}

.bar-chart::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 46%;
  border-top: 2px dashed #93c5fd;
}

.bar-item {
  height: 100%;
  display: grid;
  grid-template-rows: 24px 1fr 26px;
  align-items: end;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.bar-item span {
  font-size: 12px;
  font-weight: 700;
}

.bar-track {
  width: 34px;
  height: 150px;
  display: flex;
  align-items: end;
}

.bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: #cfe0ff;
}

.bar.active {
  background: var(--blue);
}

.bar-item small {
  color: var(--muted);
  font-weight: 600;
}

.alert-list {
  display: grid;
}

.alert-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.alert-item:last-child {
  border-bottom: 0;
}

.alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.alert-icon.red {
  color: var(--red);
  background: #fee2e2;
}

.alert-icon.yellow {
  color: var(--yellow);
  background: #fef3c7;
}

.alert-icon.orange {
  color: var(--orange);
  background: #ffedd5;
}

.alert-icon.blue {
  color: var(--blue);
  background: #dbeafe;
}

.alert-item strong,
.alert-item span,
.alert-item a {
  display: block;
}

.alert-item span {
  color: var(--muted);
  font-size: 13px;
}

.alert-item a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.app-table {
  margin-bottom: 0;
}

.app-table thead th {
  color: #334155;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.app-table td {
  border-bottom: 1px solid #eef2f7;
  padding-top: 14px;
  padding-bottom: 14px;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.en_jornada {
  color: #166534;
  background: #dcfce7;
}

.status-badge.completada {
  color: #166534;
  background: #dcfce7;
}

.status-badge.incidencia {
  color: #991b1b;
  background: #fee2e2;
}

.row-menu {
  border: 0;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    min-height: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 18px;
  }

  .date-pill {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

.clock-message {
  margin-top: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.clock-message.ok {
  color: #dcfce7;
}

.clock-message.error {
  color: #fee2e2;
}

.employees-stats {
  margin-bottom: 18px;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  height: 42px;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
}

.search-box i {
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 600;
  color: var(--text);
}

.search-box input::placeholder {
  color: #94a3b8;
}

.employee-cell>div:last-child {
  display: grid;
  gap: 2px;
}

.employee-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.center-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 768px) {

  .table-tools,
  .search-box {
    width: 100%;
  }

  .card-header-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

.form-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  padding: 24px;
}

.employee-form {
  display: grid;
  gap: 28px;
}

.form-section {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.form-section h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.form-section p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

.form-field input,
.form-field select {
  height: 46px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  padding: 0 14px;
  outline: 0;
  font-weight: 600;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, .10);
}

.form-field small {
  color: var(--muted);
  font-size: 12px;
}

.check-field {
  align-content: end;
}

.check-field label {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-primary-app,
.btn-secondary-app {
  height: 46px;
  border-radius: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  border: 1px solid transparent;
}

.btn-primary-app {
  background: var(--blue);
  color: #fff;
}

.btn-primary-app:hover {
  background: var(--blue-dark);
  color: #fff;
}

.btn-secondary-app {
  background: #fff;
  border-color: var(--border);
  color: #334155;
}

.btn-secondary-app:hover {
  background: #f8fafc;
  color: #111827;
}

@media (max-width: 900px) {
  .form-section {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn-primary-app,
  .btn-secondary-app {
    width: 100%;
  }
}

.jornadas-stats {
  margin-bottom: 18px;
}

.filter-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  padding: 20px;
  margin-bottom: 18px;
}

.filters-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 16px;
  align-items: end;
}

.filters-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-weight: 800;
  color: #334155;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .filters-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-actions {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .filters-form {
    grid-template-columns: 1fr;
  }

  .filters-actions {
    grid-column: auto;
    flex-direction: column;
  }

  .filters-actions .btn-primary-app,
  .filters-actions .btn-secondary-app {
    width: 100%;
  }
}

.turnos-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.turno-form {
  display: grid;
  gap: 18px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.search-box select {
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 700;
  color: var(--text);
  width: 100%;
  min-width: 220px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.row-menu.danger {
  color: var(--red);
}

@media (max-width: 1200px) {
  .turnos-layout {
    grid-template-columns: 1fr;
  }
}

.reports-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

.informes-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.report-status-list {
  display: grid;
  gap: 14px;
}

.report-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.report-status-item strong {
  font-size: 28px;
}

.report-header {
  margin-bottom: 18px;
}

.print-only {
  display: none;
}

.mt-3 {
  margin-top: 18px;
}

@media (max-width: 1200px) {
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .informes-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .informes-filters {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .no-print,
  .app-sidebar {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .app-shell {
    display: block;
  }

  .app-main {
    padding: 0;
  }

  .stat-card,
  .table-card,
  .report-mini-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }

  .stats-grid,
  .reports-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-table {
    font-size: 12px;
  }

  .center-pill,
  .time-pill,
  .status-badge {
    border: 1px solid #ddd;
    background: #fff !important;
    color: #000 !important;
  }
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.compact-form {
  gap: 20px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.settings-user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.settings-user-box strong,
.settings-user-box span {
  display: block;
}

.settings-user-box span {
  color: var(--muted);
  font-size: 14px;
}

.settings-info-list {
  display: grid;
  gap: 12px;
}

.settings-info-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.settings-info-list span {
  color: var(--muted);
  font-weight: 700;
}

.settings-info-list strong {
  color: var(--text);
  text-align: right;
}

.settings-password-card,
.settings-info-card {
  min-height: 100%;
}

@media (max-width: 1100px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.admin-dashboard-grid {
  grid-template-columns: 320px 1fr 320px;
}

.dashboard-summary-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  padding: 22px;
}

.dashboard-kpi-list {
  display: grid;
  gap: 12px;
}

.dashboard-kpi-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.dashboard-kpi-item:hover {
  background: #fff;
  color: var(--text);
  border-color: #cbd5e1;
}

.dashboard-kpi-item strong,
.dashboard-kpi-item small {
  display: block;
}

.dashboard-kpi-item strong {
  font-size: 24px;
  line-height: 1;
}

.dashboard-kpi-item small {
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.dashboard-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.dashboard-kpi-icon.blue {
  color: var(--blue);
  background: #dbeafe;
}

.dashboard-kpi-icon.green {
  color: var(--green);
  background: #dcfce7;
}

.dashboard-kpi-icon.yellow {
  color: var(--yellow);
  background: #fef3c7;
}

.dashboard-kpi-icon.red {
  color: var(--red);
  background: #fee2e2;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
}

.alert-item {
  color: var(--text);
}

.alert-item:hover {
  color: var(--text);
}

.alert-item em {
  color: var(--blue);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
  display: block;
}

.live-list {
  display: grid;
  gap: 12px;
}

.live-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
}

.live-item-right {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.live-item-right small {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 28px;
}

.empty-state i {
  font-size: 34px;
  color: var(--green);
}

.empty-state strong {
  display: block;
  color: var(--text);
}

.empty-state span {
  display: block;
  font-size: 14px;
}

@media (max-width: 1300px) {
  .admin-dashboard-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  padding: 12px 14px;
  outline: 0;
  font-weight: 600;
  resize: vertical;
  min-height: 120px;
}

.form-field textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, .10);
}

.incidencias-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.incidencias-filters .btn-primary-app {
  height: 42px;
}

@media (max-width: 768px) {
  .incidencias-filters {
    width: 100%;
    justify-content: stretch;
  }

  .incidencias-filters .search-box,
  .incidencias-filters .btn-primary-app {
    width: 100%;
  }
}