﻿/* =========================================
   CLEAMGYM — SISTEMA VISUAL v3.0
   Fase 3: Vista de Reporte
   ========================================= */

/* =========================================
   TOKENS Y VARIABLES
   ========================================= */
:root {
  --bg:    #f2f1ef;
  --surf:  #ffffff;
  --surf2: #f7f6f4;
  --surf3: #eeede9;

  --border:      rgba(0, 0, 0, 0.08);
  --border-md:   rgba(0, 0, 0, 0.13);
  --border-gold: rgba(201, 154, 0, 0.30);

  --gold:       #c99a00;
  --gold-hover: #e6b000;
  --gold-dim:   rgba(201, 154, 0, 0.10);
  --gold-dim2:  rgba(201, 154, 0, 0.16);

  --text:       #1c1b18;
  --text-soft:  #7a7874;
  --text-faint: #b5b3af;

  --danger:      #e05252;
  --danger-dim:  rgba(224, 82, 82, 0.12);
  --success:     #4ec87a;
  --success-dim: rgba(78, 200, 122, 0.12);
  --info:        #5b8af5;
  --info-dim:    rgba(91, 138, 245, 0.12);

  --font: 'Satoshi', 'Segoe UI', sans-serif;
  --display-font: 'Satoshi', 'Segoe UI', sans-serif;
  --icon-weight: 400;
  --icon-fill: 0;

  --ts-xs:   0.75rem;
  --ts-sm:   0.875rem;
  --ts-base: 1rem;
  --ts-lg:   1.125rem;
  --ts-xl:   1.375rem;

  --r-sm:   8px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-full: 999px;

  --card-pad-y: 18px;
  --card-pad-x: 20px;
  --surface-blur: 0px;
  --nav-bg: var(--surf);
  --control-scale: 1;
  --app-gap: 14px;
  --task-gap: 12px;
  --task-pad-y: 13px;
  --task-pad-x: 12px;
  --progress-h: 5px;
  --nav-radius: 0px;

  --sh-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --sh-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.07);
  --sh-lg: 0 12px 40px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);

  --t-fast:   140ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-smooth: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-spring: 380ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="principal"] {
  --bg:    #f2f1ef;
  --surf:  #ffffff;
  --surf2: #f7f6f4;
  --surf3: #eeede9;

  --border:    rgba(0, 0, 0, 0.08);
  --border-md: rgba(0, 0, 0, 0.13);
  --border-gold: rgba(201, 154, 0, 0.30);

  --text:       #1c1b18;
  --text-soft:  #7a7874;
  --text-faint: #b5b3af;

  --gold:       #c99a00;
  --gold-hover: #e6b000;
  --gold-dim:   rgba(201, 154, 0, 0.10);
  --gold-dim2:  rgba(201, 154, 0, 0.16);

  --font: 'Satoshi', 'Segoe UI', sans-serif;
  --display-font: 'Satoshi', 'Segoe UI', sans-serif;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --sh-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.07);
  --sh-lg: 0 12px 40px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
}

/* =========================================
   RESET Y BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  transition: background var(--t-smooth), color var(--t-smooth);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: var(--theme-backdrop, transparent);
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' var(--icon-fill), 'wght' var(--icon-weight), 'GRAD' 0, 'opsz' 24;
}

input, textarea { -webkit-user-select: auto; user-select: auto; }
button, a, .day-chip, .task-item, .acc-header { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font-family: inherit; color: inherit; }

/* =========================================
   CONTENEDOR Y TOPBAR
   ========================================= */
.app {
  width: 100%;
  max-width: 480px;
  padding: 16px;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  gap: var(--app-gap, 14px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surf);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  gap: 12px;
}

.topbar h1 {
  font-family: var(--display-font);
  font-size: var(--ts-base);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.topbar h1 span { color: var(--gold); }

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: var(--r-full);
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1;
}

.sync-badge.syncing .material-symbols-outlined {
  animation: spin 0.9s linear infinite;
}

.sync-badge.local,
.sync-badge.offline {
  color: var(--info);
  border-color: rgba(91, 138, 245, 0.22);
  background: var(--info-dim);
}

.sync-badge.synced {
  color: var(--success);
  border-color: rgba(78, 200, 122, 0.22);
  background: var(--success-dim);
}

/* =========================================
   CARDS
   ========================================= */
.card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--card-pad-y) var(--card-pad-x);
  box-shadow: var(--sh-sm);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ts-xs);
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title .material-symbols-outlined {
  font-size: 16px;
  color: var(--gold);
  opacity: 0.85;
}

/* =========================================
   BOTONES
   ========================================= */
.btn-primary {
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-size: var(--ts-sm);
  border: none;
  padding: 13px 18px;
  border-radius: var(--r-lg);
  cursor: pointer;
  width: 100%;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 2px 8px rgba(245, 197, 24, 0.22);
  letter-spacing: 0.01em;
  min-height: calc(44px * var(--control-scale));
}

.btn-primary:hover  { background: var(--gold-hover); }
.btn-primary:active { transform: scale(0.96); box-shadow: none; }

.btn-secondary {
  background: var(--surf2);
  border: 1px solid var(--border-md);
  color: var(--text);
  font-size: var(--ts-sm);
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  min-height: calc(42px * var(--control-scale));
}

.btn-secondary:hover  { background: var(--surf3); }
.btn-secondary:active { transform: scale(0.97); }

.btn-icon {
  width: 38px; height: 38px; min-width: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surf2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.btn-icon:hover  { background: var(--surf3); color: var(--text); }
.btn-icon:active { transform: scale(0.92); }

.btn-danger { color: var(--danger) !important; border-color: rgba(224,82,82,0.25) !important; }
.btn-danger:hover { background: var(--danger-dim) !important; }

.btn-with-icon { display: flex; align-items: center; justify-content: center; gap: 7px; }

/* Botón con estado de carga */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}

.btn-loading .btn-label { opacity: 0; }

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   INPUTS
   ========================================= */
.input-base {
  width: 100%;
  padding: 12px 15px;
  background: var(--surf2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  outline: none;
  font-size: var(--ts-base);
  color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  min-height: calc(44px * var(--control-scale));
}

.input-base::placeholder { color: var(--text-faint); }

.input-base:focus {
  border-color: var(--gold);
  background: var(--surf);
  box-shadow: 0 0 0 3px var(--gold-dim2);
}

label {
  display: block;
  font-size: var(--ts-xs);
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* =========================================
   NAVEGACIÓN INFERIOR
   ========================================= */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--nav-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 4px;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  border-top: 1px solid var(--border);
  z-index: 1000;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
  color: var(--text-faint);
  gap: 3px; flex: 1; cursor: pointer; padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t-fast);
}

.nav-icon-container {
  width: 52px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  transition: background var(--t-smooth), color var(--t-smooth);
}

.nav-item .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0;
  transition: font-variation-settings var(--t-smooth);
}

.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.nav-item.active { color: var(--text); }
.nav-item.active .nav-icon-container { background: var(--gold-dim2); color: var(--gold); }
.nav-item.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; color: var(--gold); }
.nav-item.active .nav-label { color: var(--gold); }

/* =========================================
   PIN Y TECLADO
   ========================================= */
.pin-grid {
  font-size: 28px; letter-spacing: 14px; text-align: center;
  color: var(--gold); height: 44px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center;
}

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; width: 100%; max-width: 290px; margin: 0 auto;
}

.keypad button {
  padding: 16px; font-size: 20px; font-weight: 700;
  border-radius: var(--r-lg);
  background: var(--surf2); border: 1px solid var(--border-md);
  cursor: pointer; color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast), color var(--t-fast);
}

.keypad button:hover  { background: var(--surf3); }
.keypad button:active { background: var(--gold); color: #000; transform: scale(0.93); }

/* =========================================
   MODALES — BOTTOM SHEET
   ========================================= */
.modal-clone, #reportModal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000; display: none;
  align-items: flex-end; justify-content: center;
}

.modal-content {
  background: var(--surf);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 22px 24px;
  width: 100%; max-width: 480px;
  position: absolute; bottom: 0;
  animation: slideUp var(--t-smooth) forwards;
}

.modal-content::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border-md);
  border-radius: var(--r-full);
  margin: 12px auto 20px;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0);    opacity: 1;   }
}

/* =========================================
   TOASTS
   ========================================= */
#toast-container {
  position: fixed;
  top: env(safe-area-inset-top, 16px);
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 420px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}

.in-app-toast {
  background: var(--surf2); color: var(--text);
  border: 1px solid var(--border-md);
  padding: 12px 16px; border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  font-size: var(--ts-sm); font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(-10px) scale(0.97);
  transition: opacity var(--t-spring), transform var(--t-spring);
  pointer-events: all;
}

.in-app-toast .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.in-app-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.in-app-toast.success .material-symbols-outlined { color: var(--success); }
.in-app-toast.error   .material-symbols-outlined { color: var(--danger);  }
.in-app-toast.info    .material-symbols-outlined { color: var(--info);    }

/* =========================================
   SPA
   ========================================= */
.view { display: none; }
.view.active {
  display: block;
  animation: fadeView 200ms cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes fadeView {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* =========================================
   TAREAS — day chips, progress, items, turnos
   (de fase 2, sin cambios)
   ========================================= */
.day-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.day-scroll::-webkit-scrollbar { display: none; }

.day-chip {
  padding: 7px 14px;
  background: var(--surf2); border: 1px solid var(--border-md);
  border-radius: var(--r-full);
  font-size: var(--ts-xs); font-weight: 700; color: var(--text-soft);
  white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  letter-spacing: 0.03em; text-transform: uppercase;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.day-chip:active { transform: scale(0.95); }
.day-chip.active { background: var(--gold-dim2); border-color: var(--gold); color: var(--gold); }
.day-chip.done   { background: var(--success-dim); border-color: rgba(78,200,122,0.35); color: var(--success); }
.day-chip .material-symbols-outlined { font-size: 13px; font-variation-settings: 'FILL' 1; }

.progress-header { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; margin-bottom: 6px; }
.progress-label  { font-size: var(--ts-xs); font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.progress-count  { font-size: var(--ts-xs); font-weight: 700; color: var(--text-soft); }
.progress-count span { color: var(--gold); }
.progress-bar  { height: var(--progress-h); background: var(--surf3); border-radius: var(--r-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hover)); border-radius: var(--r-full); width: 0%; transition: width 0.5s cubic-bezier(0.175,0.885,0.32,1.275); }
.progress-fill.complete { background: linear-gradient(90deg, var(--success), #6ee89a); }

.task-item {
  display: flex; align-items: center; gap: var(--task-gap);
  padding: var(--task-pad-y) var(--task-pad-x);
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 6px; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.task-item:active { transform: scale(0.985); }
.task-item:hover  { background: var(--surf3); border-color: var(--border-md); }
.task-item.done   { background: var(--surf); border-color: var(--border); opacity: 0.72; }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-soft); }

.task-cb { width: 22px; height: 22px; border: 2px solid var(--border-md); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--t-fast), border-color var(--t-fast); }
.task-item.done .task-cb { background: var(--gold); border-color: var(--gold); color: #000; }
.task-icon { display: flex; align-items: center; justify-content: center; color: var(--text-faint); flex-shrink: 0; }
.task-text { flex: 1; min-width: 0; font-size: var(--ts-sm); color: var(--text); line-height: 1.4; }
.task-del  { color: var(--text-faint); background: none; border: none; padding: 4px; cursor: pointer; display: flex; align-items: center; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); flex-shrink: 0; }
.task-del:hover, .task-del:active { color: var(--danger); background: var(--danger-dim); }

.task-zone-select {
  width: clamp(92px, 22vw, 116px);
  min-height: 32px;
  flex-shrink: 0;
  padding: 6px 22px 6px 9px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-full);
  background: var(--surf);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.task-zone-select:focus {
  border-color: var(--gold);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--gold-dim2);
}

.task-zone-select.has-zone {
  color: var(--text);
}

.task-with-subtasks {
  display: block;
}

.task-main-row {
  display: flex;
  align-items: center;
  gap: var(--task-gap);
}

.task-text small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-sub-toggle {
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}

.task-sub-toggle:hover,
.task-sub-toggle:active {
  color: var(--gold);
  background: var(--gold-dim);
}

.subtask-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.subtask-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px;
  padding: 8px 9px;
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.subtask-check {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border-md);
  border-radius: 6px;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.subtask-item.done .subtask-check {
  background: var(--gold);
  border-color: var(--gold);
}

.subtask-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.subtask-text {
  min-width: 0;
  color: var(--text);
  font-size: var(--ts-sm);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.subtask-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.subtask-zone-select {
  width: clamp(86px, 20vw, 108px);
  min-height: 28px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 10px;
}

@media (max-width: 420px) {
  .task-main-row {
    flex-wrap: wrap;
  }

  .task-text {
    flex-basis: calc(100% - 96px);
  }

  .task-zone-select {
    width: clamp(88px, 26vw, 108px);
  }

  .subtask-zone-select {
    width: clamp(84px, 28vw, 104px);
  }
}

.subtask-item.done .subtask-text {
  color: var(--text-soft);
  text-decoration: line-through;
}

.reported-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--success-dim);
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shift-done-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.subtask-del {
  display: flex;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 3px;
  border-radius: var(--r-sm);
}

.subtask-del:hover,
.subtask-del:active {
  color: var(--danger);
  background: var(--danger-dim);
}

.subtask-add {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.subtask-add .input-base {
  padding: 10px 12px;
}

.subtask-add .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.subtask-empty {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: var(--ts-xs);
}

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 16px; gap: 8px; }
.empty-state .material-symbols-outlined { font-size: 36px; color: var(--text-faint); font-variation-settings: 'FILL' 0; }
.empty-state p { font-size: var(--ts-sm); color: var(--text-soft); max-width: 28ch; line-height: 1.5; }

.shift-item { display: flex; justify-content: space-between; align-items: center; background: var(--surf2); padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--border); font-size: var(--ts-sm); margin-bottom: 6px; transition: background var(--t-fast); }
.shift-item:last-child { margin-bottom: 0; }
.shift-times { display: flex; align-items: center; gap: 10px; }
.shift-badge { display: flex; align-items: center; gap: 4px; font-size: var(--ts-xs); font-weight: 700; letter-spacing: 0.04em; }
.shift-badge.entry { color: var(--success); }
.shift-badge.exit  { color: var(--danger);  }
.shift-badge .material-symbols-outlined { font-size: 14px; }
.shift-sep { color: var(--text-faint); font-size: var(--ts-xs); }
.shift-del { color: var(--text-faint); background: none; border: none; padding: 4px; cursor: pointer; display: flex; align-items: center; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.shift-del:hover, .shift-del:active { color: var(--danger); background: var(--danger-dim); }

.sunday-msg { text-align: center; padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sunday-msg .material-symbols-outlined { font-size: 48px; color: var(--gold); font-variation-settings: 'FILL' 1; }
.sunday-msg h2 { font-size: var(--ts-lg); color: var(--gold); font-weight: 700; }
.sunday-msg p  { color: var(--text-soft); font-size: var(--ts-sm); max-width: 30ch; line-height: 1.5; }

.day-selector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.day-opt { padding: 11px; border: 1px solid var(--border-md); border-radius: var(--r-md); text-align: center; font-size: var(--ts-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; color: var(--text-soft); background: var(--surf2); transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.day-opt:active { transform: scale(0.96); }
.day-opt.selected { background: var(--gold-dim2); border-color: var(--gold); color: var(--gold); }
.day-opt.disabled { opacity: 0.28; cursor: not-allowed; pointer-events: none; }

.active-shift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-gold);
  border-radius: var(--r-lg);
  background: var(--gold-dim);
  box-shadow: var(--sh-sm);
}

.active-shift-banner > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.active-shift-banner .material-symbols-outlined {
  color: var(--gold);
  font-size: 20px;
  flex-shrink: 0;
}

.active-shift-banner strong,
.active-shift-banner small {
  display: block;
  overflow-wrap: anywhere;
}

.active-shift-banner strong {
  font-size: var(--ts-sm);
  color: var(--text);
  line-height: 1.1;
}

.active-shift-banner small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1.25;
}

.active-shift-banner button {
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  background: var(--surf);
  color: var(--gold);
  font-size: var(--ts-xs);
  font-weight: 800;
  cursor: pointer;
}

.active-shift-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* =========================================
   FASE 3 — REPORTE: SELECTOR DE HORAS
   ========================================= */
.report-shift-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.report-shift-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ts-xs);
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.report-shift-row label .material-symbols-outlined {
  font-size: 14px;
}

.report-shift-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.report-shift-chip {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  background: var(--surf2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.report-shift-chip:active {
  transform: scale(0.97);
}

.report-shift-chip.active {
  border-color: var(--gold);
  background: var(--gold-dim2);
  box-shadow: inset 0 0 0 1px var(--border-gold);
}

.report-shift-chip > .material-symbols-outlined {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--surf);
  color: var(--text-soft);
  font-size: 16px;
}

.report-shift-chip.active > .material-symbols-outlined {
  color: var(--gold);
  background: var(--surf);
  font-variation-settings: 'FILL' 1;
}

.report-shift-chip span:last-child {
  min-width: 0;
}

.report-shift-chip strong,
.report-shift-chip small {
  display: block;
  overflow-wrap: anywhere;
}

.report-shift-chip strong {
  font-size: var(--ts-xs);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.report-shift-chip small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1.25;
}

.report-shift-empty {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--border-md);
  border-radius: var(--r-md);
  color: var(--text-soft);
  font-size: var(--ts-sm);
  font-weight: 700;
  background: var(--surf2);
}

.report-shift-empty .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-faint);
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.time-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-field label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--ts-xs);
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.time-field label .material-symbols-outlined {
  font-size: 14px;
}

.time-field label.entry-label { color: var(--success); }
.time-field label.exit-label  { color: var(--danger);  }

.time-field input[type="time"] {
  width: 100%;
  padding: 11px 13px;
  background: var(--surf2);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  outline: none;
  font-size: var(--ts-base);
  font-weight: 700;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.time-field input[type="time"]:focus {
  border-color: var(--gold);
  background: var(--surf);
  box-shadow: 0 0 0 3px var(--gold-dim2);
}

.time-field.entry input[type="time"]:focus { border-color: var(--success); box-shadow: 0 0 0 3px rgba(78,200,122,0.14); }
.time-field.exit  input[type="time"]:focus { border-color: var(--danger);  box-shadow: 0 0 0 3px rgba(224,82,82,0.12);  }

/* =========================================
   FASE 3 — REPORTE: ACORDEONES DE ZONAS
   ========================================= */
.acc-item {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  background: var(--surf2);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.acc-item:last-child { margin-bottom: 0; }

.acc-item.open {
  border-color: var(--border-md);
  box-shadow: var(--sh-sm);
}

.acc-header {
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--ts-sm);
  color: var(--text);
  gap: 10px;
  transition: background var(--t-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.acc-header:active { background: var(--surf3); }

.acc-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.acc-zone-icon {
  width: 28px; height: 28px;
  background: var(--surf3);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast);
}

.acc-zone-icon .material-symbols-outlined {
  font-size: 15px;
  color: var(--text-soft);
}

.acc-item.open .acc-zone-icon {
  background: var(--gold-dim);
}

.acc-item.open .acc-zone-icon .material-symbols-outlined {
  color: var(--gold);
}

.acc-zone-name {
  font-size: var(--ts-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.acc-badge {
  background: var(--surf3);
  color: var(--text-soft);
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--ts-xs);
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast);
}

/* Badge dorado cuando hay acciones completadas */
.acc-badge.has-done {
  background: var(--gold-dim2);
  color: var(--gold);
}

.acc-chevron {
  font-size: 18px;
  color: var(--text-faint);
  transition: transform var(--t-smooth), color var(--t-smooth);
  font-variation-settings: 'FILL' 0;
}

.acc-item.open .acc-chevron {
  transform: rotate(180deg);
  color: var(--text-soft);
}

/* Separador cuando está abierto */
.acc-item.open .acc-header {
  border-bottom: 1px solid var(--border);
}

.acc-body {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.acc-item.open .acc-body {
  max-height: 2000px;
  padding: 12px 14px 14px;
}

/* =========================================
   FASE 3 — REPORTE: ACCIONES DENTRO DE ZONA
   ========================================= */
.rep-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  margin-bottom: 4px;
  transition: background var(--t-fast);
  cursor: pointer;
}

.rep-action:last-child { margin-bottom: 0; }
.rep-action:hover { background: var(--surf3); }

.rep-action input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
}

.rep-action-text {
  flex: 1;
  font-size: var(--ts-sm);
  color: var(--text);
  line-height: 1.35;
  transition: color var(--t-fast), text-decoration var(--t-fast);
}

.rep-action.checked .rep-action-text {
  color: var(--text-soft);
  text-decoration: line-through;
}

.del-btn {
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}

.del-btn:hover { color: var(--danger); background: var(--danger-dim); }

.del-btn .material-symbols-outlined { font-size: 16px; }

/* Formulario para agregar acción */
.acc-add-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.acc-add-row input {
  flex: 1;
  padding: 9px 12px;
  background: var(--surf);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  outline: none;
  font-size: var(--ts-sm);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.acc-add-row input::placeholder { color: var(--text-faint); }
.acc-add-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim2); }

.acc-add-btn {
  width: 36px; height: 36px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--gold);
  flex-shrink: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}

.acc-add-btn:hover  { background: var(--gold-dim2); }
.acc-add-btn:active { transform: scale(0.92); }
.acc-add-btn .material-symbols-outlined { font-size: 18px; }

/* =========================================
   FASE 3 — REPORTE: MODAL DE VISTA PREVIA
   ========================================= */
.modal-preview {
  background: var(--surf);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px 24px;
  width: 100%; max-width: 480px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  position: absolute; bottom: 0;
  animation: slideUp var(--t-smooth) forwards;
}

.modal-preview::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border-md);
  border-radius: var(--r-full);
  margin: 12px auto 16px;
}

.modal-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-preview-header h3 {
  font-size: var(--ts-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-preview-header h3 .material-symbols-outlined {
  font-size: 18px;
  color: var(--gold);
}

.preview-meta {
  font-size: var(--ts-xs);
  color: var(--text-soft);
}

.modal-preview textarea {
  flex: 1;
  min-height: 220px;
  padding: 14px;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  outline: none;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text);
  resize: none;
  margin-bottom: 14px;
  transition: border-color var(--t-fast);
  -webkit-user-select: text;
  user-select: text;
}

.modal-preview textarea:focus {
  border-color: var(--border-md);
}

.modal-preview-actions {
  display: flex;
  gap: 8px;
}

.btn-whatsapp {
  flex: 2;
  background: #25D366;
  color: #fff;
  border: none;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: var(--ts-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--t-fast), transform var(--t-fast);
}

.btn-whatsapp:hover  { background: #1ebe57; }
.btn-whatsapp:active { transform: scale(0.96); }

.btn-copy {
  flex: 1;
  background: var(--surf2);
  color: var(--text);
  border: 1px solid var(--border-md);
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: var(--ts-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--t-fast), transform var(--t-fast);
}

.btn-copy:hover  { background: var(--surf3); }
.btn-copy:active { transform: scale(0.96); }

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px;
  display: flex; align-items: center;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}

.btn-close-modal:hover { color: var(--text); background: var(--surf2); }

/* =========================================
   ADMIN
   ========================================= */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #000; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.role-badge { font-size: 10px; background: var(--surf); border: 1px solid var(--border); padding: 4px 8px; border-radius: 8px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* =========================================
   MODO OSCURO
   ========================================= */
[data-mode="dark"][data-theme="principal"] {
  --bg: #141414;
  --surf: #1f1f1f;
  --surf2: #282828;
  --surf3: #333333;

  --border: rgba(255, 255, 255, 0.08);
  --border-md: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(245, 197, 24, 0.32);

  --text: #f7f7f7;
  --text-soft: #b8b8b8;
  --text-faint: #737373;

  --gold: #f5c518;
  --gold-hover: #ffd84d;
  --gold-dim: rgba(245, 197, 24, 0.10);
  --gold-dim2: rgba(245, 197, 24, 0.18);

  --sh-sm: 0 2px 8px rgba(0,0,0,0.22);
  --sh-md: 0 8px 24px rgba(0,0,0,0.30);
  --sh-lg: 0 18px 44px rgba(0,0,0,0.38);
}
/* =========================================
   UTILIDADES
   ========================================= */
.hidden { display: none !important; }
.text-muted  { color: var(--text-soft);  }
.text-faint  { color: var(--text-faint); }
.text-gold   { color: var(--gold);       }
.text-danger { color: var(--danger);     }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.icon-sm { font-size: 16px; vertical-align: middle; }
.icon-md { font-size: 20px; vertical-align: middle; }
.icon-lg { font-size: 24px; vertical-align: middle; }
