body {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4ecfb 100%);
  min-height: 100vh;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.dashboard-card,
.page-card,
.form-card,
.login-card {
  border: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.dashboard-card,
.page-card,
.form-card {
  border-radius: 1rem;
}

.login-card {
  border-radius: 1.25rem;
  width: 100%;
  max-width: 420px;
}

.title,
.page-title,
.form-title {
  font-weight: 700;
  color: #1f2937;
}

.subtitle,
.login-subtitle {
  color: #6b7280;
}

.label,
.form-label {
  font-weight: 600;
  color: #374151;
}

.value {
  color: #111827;
}

.table thead th {
  color: #374151;
  font-weight: 700;
  border-bottom-width: 1px;
  font-size: 0.95rem;
}

.table td {
  font-size: 0.95rem;
}

.btn-primary,
.btn-outline-secondary,
.btn-success {
  border-radius: 0.7rem;
  padding: 0.65rem 1.2rem;
  font-weight: 600;
}

.dashboard-action .btn-primary {
  width: 100%;
}

.quick-action-form {
  width: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-action-selects {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.quick-action-selects .form-select {
  width: 100%;
  min-width: 0;
}

.btn-auto-width {
  width: auto;
}

.user-badge {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-wrapper {
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.chart-canvas-doughnut {
  max-width: 300px;
  max-height: 300px;
}

.chart-canvas-bar {
  max-width: 400px;
  max-height: 350px;
}

.select-min-month {
  min-width: 140px;
}

.select-min-year {
  min-width: 100px;
}

.csv-actions {
  margin-left: auto;
}

.clickable-row {
  cursor: pointer;
}

.login-logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #1f2937;
}

.login-logo span {
  color: #4f46e5;
}

.login-subtitle {
  font-size: 0.95rem;
}

.form-control {
  border-radius: 0.7rem;
  padding: 0.65rem 1rem;
}

.form-control:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.btn-login {
  background: #4f46e5;
  border: none;
  border-radius: 0.7rem;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}

.btn-login:hover {
  background: #3730a3;
}

.divider {
  border-color: #e5e7eb;
}

.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 1rem;
  border: 3px solid #e5e7eb;
}

.signature-box {
  border: 1.5px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.signature-box.firma-ok {
  border-color: #10b981;
  border-style: solid;
}

.signature-box .preview-img {
  width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: 0.5rem;
  display: none;
}

.signature-box.firma-ok .preview-img {
  display: block;
}

.signature-box.firma-ok .placeholder-firma {
  display: none;
}

.placeholder-firma {
  color: #9ca3af;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.placeholder-firma span {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.3rem;
  line-height: 1;
}

.modal-firma .modal-dialog {
  margin: 0;
  max-width: 100%;
  height: 100%;
}

.modal-firma .modal-content {
  height: 100dvh;
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
}

.modal-firma .modal-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.modal-firma .modal-body {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-firma .modal-footer {
  flex-shrink: 0;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.firma-canvas-modal {
  flex: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
  display: block;
}

.instruccion-firma {
  text-align: center;
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 0.4rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  margin: 0;
}

.firma-box {
  border: 1px dashed #cbd5e1;
  border-radius: 0.8rem;
  background: #fff;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow: hidden;
}

.firma-img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

.meta-chip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.bulk-tools {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #e5e7eb;
}

.employee-cell {
  min-width: 240px;
}

.input-time {
  min-width: 130px;
}

.table-nowrap thead th {
  white-space: nowrap;
  font-size: 0.92rem;
}

.table-middle td {
  vertical-align: middle;
}

.detail-label-small {
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .topbar {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .topbar h1 {
    font-size: 1.3rem !important;
  }

  .topbar p {
    font-size: 0.9rem;
  }

  .topbar .d-flex {
    width: 100%;
    justify-content: center;
  }

  .dashboard-card {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05) !important;
  }

  .card-body {
    padding: 1.25rem !important;
  }

  .form-control,
  .form-select {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
  }

  .table-responsive {
    border-radius: 0.75rem;
  }

  .table thead {
    font-size: 0.85rem;
  }

  .table tbody tr {
    padding: 0.5rem 0;
  }

  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }

  .row.g-4 {
    gap: 1rem !important;
  }

  .row.g-2 {
    gap: 0.75rem !important;
  }

  .col-md-4,
  .col-md-6 {
    flex: 0 0 100%;
  }

  h2.h5 {
    font-size: 1.15rem !important;
  }

  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  .quick-action-form {
    padding: 0.85rem;
  }

  .employee-cell {
    min-width: 190px;
  }

  .input-time {
    min-width: 120px;
  }
}

@media (max-width: 576px) {
  .container.py-5,
  .container.py-4.py-md-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .card-body.p-4.p-md-5 {
    padding: 1rem !important;
  }

  .form-title {
    font-size: 1.2rem;
  }

  .user-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
  }

  .btn {
    font-size: 0.95rem;
    padding: 0.6rem 1rem !important;
  }

  .table td {
    padding: 0.6rem 0.35rem;
    font-size: 0.85rem;
  }

  .topbar .btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem !important;
  }

  .quick-action-selects {
    flex-direction: column;
  }

  .quick-action-selects .form-select,
  .quick-action-form .form-control {
    width: 100%;
  }

  .firma-box {
    min-height: 140px;
  }

  .mobile-stack-actions {
    flex-direction: column;
  }

  .mobile-stack-actions .btn {
    width: 100%;
  }
}
