/* =========================================================
   DigiWork 2.0 - style.css
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}
.contenido:has(.cal-wrap) {
    max-width: 1400px;
}
:root {
  --dw-primary: #0057ff;
  --dw-primary-dark: #0047d4;
  --dw-bg: #f4f6f9;
  --dw-card: #ffffff;
  --dw-text: #1f2937;
  --dw-muted: #6b7280;
  --dw-border: #e5e7eb;
  --dw-success: #1f7a3b;
  --dw-success-bg: #dff3e5;
  --dw-error: #a61b1b;
  --dw-error-bg: #ffe1e1;
  --dw-warning: #7a5a00;
  --dw-warning-bg: #fff4d6;
  --dw-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  --dw-radius: 14px;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  background: var(--dw-bg);
  color: var(--dw-text);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

input,
select,
textarea,
button {
  font: inherit;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: var(--dw-primary);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.topbar h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.topbar img {
  width: 38px;
  height: 38px;
  margin-left: auto;
  object-fit: contain;
}

.menu-btn {
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  max-width: calc(100vw - 32px);
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 18px rgba(0, 0, 0, 0.12);
  transition: left 0.25s ease;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  background: var(--dw-primary);
  color: #fff;
  padding: 20px;
}

.sidebar-header h4 {
  font-size: 1rem;
}

.sidebar a {
  padding: 15px 20px;
  text-decoration: none;
  color: #374151;
  font-weight: 700;
  border-bottom: 1px solid rgba(229, 231, 235, 0.45);
}

.sidebar a:hover,
.sidebar a:active {
  background: #f8fafc;
}

.logout {
  margin-top: auto;
  color: #c62828 !important;
}

/* OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.42);
  z-index: 1150;
}

.overlay.active {
  display: block;
}

/* CONTENIDO */
.contenido {
  padding: 12px 14px 24px;
}

.contenido h2 {
  text-align: center;
  font-style: italic;
  font-size: 1.35rem;
  margin: 4px 0 14px;
}

.contenido h3 {
  text-align: center;
  font-style: italic;
  font-size: 1.05rem;
  margin: 10px 0 14px;
}

/* CARDS */
.cards_puntos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.card {
  background: var(--dw-card);
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius);
  padding: 14px;
  margin: 12px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.card-resumen-dia,
.card-resumen-mes {
  margin: 0;
}

.muted {
  color: var(--dw-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.puntos_totales {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin: 4px 0 8px;
}

.puntos_sobre {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin: 16px 0 12px;
}

.valor-positivo {
  color: #16a34a;
  font-weight: 700;
}

.valor-negativo {
  color: #dc2626;
  font-weight: 700;
}

.valor-cero {
  color: inherit;
  font-weight: 700;
}

.fila {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

/* FORMULARIOS */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--dw-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--dw-shadow);
  overflow: hidden;
  border: 1px solid #eef0f3;
}

.auth-header {
  background: var(--dw-primary);
  color: #fff;
  padding: 14px 18px;
}

.auth-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.auth-header p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.auth-body {
  padding: 18px;
}

.auth-body label {
  display: block;
  font-size: 0.92rem;
  margin: 10px 0 6px;
  color: #374151;
  font-weight: 700;
}

.auth-input,
input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dfe3ea;
  background: #fff;
  outline: none;
  margin-bottom: 12px;
  font-size: 16px;
}

.auth-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--dw-primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

textarea.auth-input {
  min-height: 96px;
}

.auth-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-btn,
.guardar,
.btn {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.2s ease;
}

.auth-btn:active,
.guardar:active,
.btn:active {
  transform: translateY(1px);
}

.auth-btn-primary,
.guardar,
.btn {
  background: var(--dw-primary);
  color: #fff;
}

.auth-btn-primary:hover,
.guardar:hover,
.btn:hover {
  background: var(--dw-primary-dark);
}

.auth-link {
  text-align: center;
  font-size: 0.95rem;
  color: var(--dw-primary);
  text-decoration: none;
  padding-top: 2px;
}

.auth-error,
.error {
  background: var(--dw-error-bg);
  color: #7a1d1d;
  border: 1px solid #ffc2c2;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.ok {
  background: var(--dw-success-bg);
  color: #14532d;
  border: 1px solid #b7e4c7;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.auth-foot {
  padding: 14px 18px 18px;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  background: #fafbfc;
  border-top: 1px solid #eef0f3;
}

/* TOAST */
.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: calc(100% - 24px);
  padding: 12px 14px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  z-index: 2000;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
}

.toast.show {
  display: block;
}

.toast.ok {
  background: var(--dw-success);
}

.toast.err {
  background: var(--dw-error);
}

/* BOTONES / EXTRAS */
.botones-tipo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.botones-tipo button {
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid #d9dde5;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  color: #1f2937;
}

.botones-tipo button.activo {
  background: var(--dw-primary);
  color: #fff;
  border-color: var(--dw-primary);
}

.extras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.extras label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f7fa;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e3e6ea;
  cursor: pointer;
  font-size: 0.96rem;
  min-height: 48px;
}

.extras input[type="checkbox"],
.extras input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

/* TABLAS */
.tabla {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.95rem;
}

.tabla th,
.tabla td {
  border: 1px solid #eceff3;
  padding: 9px 8px;
  text-align: left;
}

.tabla th {
  background: #f8fafc;
}

.miniBtn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

/* MODALES */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 3000;
  padding: 14px;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modalBox {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.xbtn {
  border: none;
  background: #eee;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* CALENDARIO */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.cal-head {
  text-align: center;
  font-weight: 700;
  color: var(--dw-muted);
  padding: 4px 0;
}

.cal-cell {
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  padding: 4px;
  text-align: left;
  min-height: 78px;
  background: #fff;
}

.cal-cell.empty {
  border: none;
  background: transparent;
}

.cal-cell.completo {
  background: #d6f5d6;
}

.cal-cell.medio {
  background: #ffdb10;
}

.cal-cell.sabado {
  box-shadow: inset 0 0 0 999px rgba(255, 100, 198, 0.35);
}

.cal-cell.domingo {
  box-shadow: inset 0 0 0 999px rgba(255, 0, 0, 0.28);
}

.cal-day {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}

.cal-total,
.cal-sobre {
  font-size: 0.82rem;
}

.cal-sobre {
  font-weight: 800;
}

/* BARRA PROGRESO */
.progress-wrap {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .35s ease;
}

.progress-fill.low {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-fill.ok {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-extra {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.progress-extra.positivo {
  color: #16a34a;
}

.progress-extra.negativo {
  color: #dc2626;
}

.progress-extra.neutro {
  color: #6b7280;
}

/* UTILIDADES */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* RESPONSIVE */
@media (max-width: 767px) {
  .cards_puntos {
    grid-template-columns: 1fr;
  }

  .fila {
    flex-direction: column;
    align-items: stretch;
  }

  .contenido {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card {
    padding: 12px;
  }

  .extras,
  .botones-tipo {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .contenido {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 18px;
  }

  .botones-tipo {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* =========================================================
   Pedidos — lista de artículos (reemplaza tabla)
========================================================= */
.pedido-grupo-card {
  padding: 12px 14px !important;
}

.pedido-grupo-titulo {
  font-size: .85rem;
  font-weight: 800;
  color: var(--dw-text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dw-border);
}

.pedido-lista {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cabecera de columnas */
.pedido-lista-header {
  display: grid;
  grid-template-columns: 36px 1fr 58px 78px;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--dw-muted);
}

/* Fila de artículo */
.pedido-fila {
  display: grid;
  grid-template-columns: 36px 1fr 58px 78px;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 10px;
  margin-bottom: 3px;
  opacity: .45;
  transition: opacity .15s, background .15s;
}

.pedido-fila:last-child {
  margin-bottom: 0;
}

.pedido-fila:hover {
  background: var(--dw-bg);
}

.pedido-fila.activo {
  opacity: 1;
  background: var(--dw-bg);
}

/* Columnas */
.pedido-col-chk {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pedido-chk {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  accent-color: var(--dw-primary);
  flex-shrink: 0;
}

.pedido-col-nombre {
  font-size: .82rem;
  line-height: 1.35;
  word-break: break-word;
  color: var(--dw-text);
}

.pedido-col-qty,
.pedido-col-mot {
  display: flex;
  align-items: center;
}

.pedido-input-qty {
  width: 100% !important;
  padding: 5px 4px !important;
  border-radius: 8px !important;
  border: 1px solid var(--dw-border) !important;
  background: var(--dw-card) !important;
  color: var(--dw-text) !important;
  font-size: .82rem !important;
  text-align: center !important;
  margin: 0 !important;
}

.pedido-select-mot {
  width: 100% !important;
  padding: 5px 4px !important;
  border-radius: 8px !important;
  border: 1px solid var(--dw-border) !important;
  background: var(--dw-card) !important;
  color: var(--dw-text) !important;
  font-size: .75rem !important;
  margin: 0 !important;
}
