/* ====================================================
   Gestonet Control Horario — Frontend Styles
   ==================================================== */

:root {
  --gch-primary:   #1a56db;
  --gch-secondary: #ffffff;
  --gch-bg:        #f8fafc;
  --gch-card:      #ffffff;
  --gch-border:    #e2e8f0;
  --gch-text:      #1e293b;
  --gch-muted:     #64748b;
  --gch-success:   #16a34a;
  --gch-warning:   #d97706;
  --gch-danger:    #dc2626;
  --gch-radius:    12px;
  --gch-shadow:    0 4px 24px rgba(0,0,0,.08);
}

/* Container */
.gch-wrap {
  max-width: 560px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--gch-text);
}

/* Card */
.gch-card {
  background: var(--gch-card);
  border: 1px solid var(--gch-border);
  border-radius: var(--gch-radius);
  box-shadow: var(--gch-shadow);
  padding: 28px;
  margin-bottom: 20px;
}

/* Header */
.gch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gch-border);
}
.gch-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gch-logo-wrap img {
  max-height: 36px;
  width: auto;
}
.gch-empresa-nombre {
  font-weight: 700;
  font-size: 15px;
  color: var(--gch-text);
}
.gch-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gch-muted);
}

/* Clock */
.gch-clock-section {
  text-align: center;
  margin-bottom: 24px;
}
.gch-clock {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--gch-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.gch-date {
  font-size: 14px;
  color: var(--gch-muted);
  margin-top: 4px;
  text-transform: capitalize;
}

/* Status badge */
.gch-status-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.gch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px solid var(--gch-border);
  transition: all .3s;
}
.gch-badge.estado-dentro   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.gch-badge.estado-descanso { background: #fef9c3; color: #92400e; border-color: #fde68a; }
.gch-badge.estado-fuera    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.gch-horas-hoy {
  font-size: 14px;
  color: var(--gch-muted);
}
.gch-horas-hoy strong {
  color: var(--gch-text);
  font-variant-numeric: tabular-nums;
}

/* Action buttons */
.gch-acciones {
  display: grid;
  gap: 10px;
}
.gch-acciones.two-cols { grid-template-columns: 1fr 1fr; }

.gch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.gch-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.gch-btn-primary {
  background: var(--gch-primary);
  color: var(--gch-secondary);
}
.gch-btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,86,219,.35);
}
.gch-btn-danger {
  background: #fef2f2;
  color: var(--gch-danger);
  border: 1px solid #fecaca;
}
.gch-btn-danger:hover:not(:disabled) {
  background: #fee2e2;
}
.gch-btn-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.gch-btn-warning:hover:not(:disabled) {
  background: #fef3c7;
}
.gch-btn-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.gch-btn-success:hover:not(:disabled) {
  background: #dcfce7;
}
.gch-btn-outline {
  background: transparent;
  color: var(--gch-muted);
  border: 1px solid var(--gch-border);
  font-size: 13px;
  padding: 8px 16px;
}
.gch-btn-outline:hover {
  background: var(--gch-bg);
}

/* Feedback */
.gch-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.gch-feedback.success { background: #dcfce7; color: #15803d; }
.gch-feedback.error   { background: #fee2e2; color: #991b1b; }

/* Historial */
.gch-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}
.gch-historial-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gch-historial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gch-bg);
  font-size: 14px;
}
.gch-historial-item .evento-label { font-weight: 600; }
.gch-historial-item .evento-hora  { color: var(--gch-muted); font-variant-numeric: tabular-nums; }

.gch-ver-mas-wrap {
  text-align: center;
  margin-top: 12px;
}

/* Loading */
.gch-loading {
  text-align: center;
  color: var(--gch-muted);
  font-size: 14px;
  padding: 20px;
}

/* Login notice */
.gch-login-notice {
  text-align: center;
  padding: 40px 20px;
  color: var(--gch-muted);
}

/* Modal */
.gch-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gch-modal-inner {
  background: #fff;
  border-radius: var(--gch-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gch-modal-wide { max-width: 700px; }
.gch-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gch-border);
}
.gch-modal-header h3 { margin: 0; font-size: 17px; }
.gch-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gch-muted);
  padding: 4px 8px;
  border-radius: 4px;
}
.gch-modal-close:hover { background: var(--gch-bg); }
.gch-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Historial table in modal */
.gch-historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gch-historial-table th,
.gch-historial-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gch-border);
  text-align: left;
}
.gch-historial-table th { font-weight: 600; color: var(--gch-muted); }

.gch-dia-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--gch-primary);
  padding: 12px 0 4px;
  border-bottom: 2px solid var(--gch-border);
  display: flex;
  justify-content: space-between;
}

/* Spinner */
@keyframes gch-spin { to { transform: rotate(360deg); } }
.gch-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: gch-spin .6s linear infinite;
  display: inline-block;
}

/* Responsive */
@media (max-width: 480px) {
  .gch-clock { font-size: 40px; }
  .gch-card  { padding: 20px; }
  .gch-acciones.two-cols { grid-template-columns: 1fr; }
}
