  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: Arial, sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

  .app { display: flex; height: 100vh; overflow: hidden; }

  /* Sidebar */
  .sidebar { width: 420px; background: #1e293b; color: #e2e8f0; display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
  .sidebar-header { padding: 20px; background: #0f172a; }
  .sidebar-header h1 { font-size: 18px; font-weight: 700; color: #fff; }
  .sidebar-header p { font-size: 12px; color: #94a3b8; margin-top: 4px; }

  .month-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #0f172a; border-top: 1px solid #334155; }
  .month-nav button { background: #334155; border: none; color: #e2e8f0; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
  .month-nav button:hover { background: #475569; }
  .month-nav span { font-weight: 600; font-size: 15px; }

  .calendar { padding: 12px 16px; flex: 1; overflow-y: auto; }
  .cal-days-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
  .cal-days-header span { text-align: center; font-size: 11px; color: #64748b; font-weight: 600; padding: 4px 0; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .cal-day { min-height: 52px; background: #334155; border-radius: 6px; cursor: pointer; padding: 5px; transition: background 0.15s; position: relative; }
  .cal-day:hover { background: #3d5068; }
  .cal-day.empty { background: transparent; cursor: default; }
  .cal-day.today { background: #1d4ed8; }
  .cal-day.selected { background: #2563eb; box-shadow: 0 0 0 2px #60a5fa; }
  .cal-day.has-hours { background: #1e3a5f; }
  .cal-day.today.selected { background: #1d4ed8; box-shadow: 0 0 0 2px #60a5fa; }
  .cal-day.weekend { background: #2d3748; opacity: 0.7; }
  .cal-day.festivo { background: #4a1942; cursor: default; }
  .cal-day.festivo:hover { background: #5a2252; }
  .cal-day.festivo.selected { background: #6b2d63; box-shadow: 0 0 0 2px #c084fc; }
  .cal-day-num { font-size: 12px; font-weight: 600; color: #cbd5e1; }
  .cal-day.today .cal-day-num, .cal-day.selected .cal-day-num { color: #fff; }
  .cal-day.weekend .cal-day-num { color: #64748b; }
  .cal-day.festivo .cal-day-num { color: #f0abfc; }
  .cal-day-hours { font-size: 10px; color: #94a3b8; margin-top: 2px; }
  .cal-day.has-hours .cal-day-hours { color: #34d399; }
  .cal-day-dot { width: 4px; height: 4px; background: #34d399; border-radius: 50%; position: absolute; bottom: 5px; right: 5px; }
  .cal-day-festivo-label { font-size: 9px; color: #e879f9; margin-top: 2px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .cal-day.missing .cal-day-num { color: #f87171; }
  .cal-day.incomplete { background: #3b2e0f; }
  .cal-day.incomplete .cal-day-hours { color: #fbbf24; }
  .cal-day.incomplete .cal-day-dot { background: #fbbf24; }

  /* Week progress bar in day panel */
  .week-progress { background: #f1f5f9; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
  .week-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #64748b; margin-bottom: 6px; }
  .week-progress-label strong { color: #1e293b; }
  .week-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
  .week-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
  .week-bar-fill.ok { background: #34d399; }
  .week-bar-fill.warn { background: #fbbf24; }
  .week-bar-fill.over { background: #60a5fa; }
  .day-expected { font-size: 12px; color: #94a3b8; margin-top: 2px; }

  /* Monthly summary modal */
  .sum-modal { width: 620px; max-height: 85vh; display: flex; flex-direction: column; }
  .sum-body { flex: 1; overflow-y: auto; }
  .sum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .sum-table th { background: #f8fafc; padding: 8px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; border-bottom: 2px solid #e2e8f0; }
  .sum-table th.num { text-align: right; }
  .sum-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; color: #374151; }
  .sum-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .sum-table tr:hover td { background: #f8fafc; }
  .sum-table tr.total td { font-weight: 700; border-top: 2px solid #e2e8f0; background: #f8fafc; }
  .sum-table .an { color: #1d4ed8; font-weight: 600; }
  .sum-table .pr { color: #7e22ce; font-weight: 600; }
  .sum-table .jp { color: #166534; font-weight: 600; }
  .sum-weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 8px; margin-bottom: 16px; }
  .sum-week-box { background: #f8fafc; border-radius: 8px; padding: 10px 12px; border: 1px solid #e2e8f0; }
  .sum-week-box .wlabel { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
  .sum-week-box .whours { font-size: 18px; font-weight: 700; color: #1e293b; }
  .sum-week-box .whours.ok { color: #059669; }
  .sum-week-box .whours.warn { color: #d97706; }
  .sum-week-box .wexp { font-size: 11px; color: #94a3b8; }

  /* Backup banner */
  .backup-banner { background: #fef3c7; border-bottom: 1px solid #fde68a; padding: 8px 24px; font-size: 13px; color: #92400e; display: none; justify-content: space-between; align-items: center; }
  .backup-banner a { color: #b45309; font-weight: 600; cursor: pointer; text-decoration: underline; }

  .legend { padding: 10px 16px; border-top: 1px solid #334155; display: flex; flex-wrap: wrap; gap: 8px; }
  .legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #94a3b8; }
  .legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
  .legend-dot.laboral { background: #334155; }
  .legend-dot.weekend { background: #2d3748; opacity: 0.7; }
  .legend-dot.festivo { background: #4a1942; }
  .legend-dot.with-hours { background: #1e3a5f; border: 1px solid #34d399; }

  .month-summary { padding: 12px 16px; border-top: 1px solid #334155; }
  .month-summary h3 { font-size: 11px; text-transform: uppercase; color: #64748b; letter-spacing: 0.05em; margin-bottom: 8px; }
  .summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-box { background: #334155; border-radius: 8px; padding: 10px; }
  .stat-box .label { font-size: 11px; color: #94a3b8; }
  .stat-box .value { font-size: 16px; font-weight: 700; color: #34d399; margin-top: 2px; }

  /* Main panel */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .main-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .main-header h2 { font-size: 18px; font-weight: 700; color: #1e293b; }
  .main-header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .desplegable { position: relative; }
  .desplegable-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 190px; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12); padding: 4px; display: flex; flex-direction: column; }
  .desplegable-menu button { background: none; border: none; text-align: left; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #334155; cursor: pointer; }
  .desplegable-menu button:hover { background: #f1f5f9; }
  .desplegable-fondo { position: fixed; inset: 0; z-index: 55; }

  .btn { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.15s; }
  .btn-primary { background: #2563eb; color: #fff; }
  .btn-primary:hover { background: #1d4ed8; }
  .btn-success { background: #059669; color: #fff; }
  .btn-success:hover { background: #047857; }
  .btn-danger { background: #dc2626; color: #fff; }
  .btn-danger:hover { background: #b91c1c; }
  .btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
  .btn-secondary:hover { background: #e2e8f0; }
  .btn-warning { background: #d97706; color: #fff; }
  .btn-warning:hover { background: #b45309; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }

  /* Role toggle */
  .role-toggle { display: flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
  .role-btn { flex: 1; padding: 7px 0; border: none; cursor: pointer; font-size: 13px; font-weight: 700; background: #f8fafc; color: #94a3b8; transition: all 0.15s; }
  .role-btn.active-an { background: #dbeafe; color: #1d4ed8; }
  .role-btn.active-pr { background: #fae8ff; color: #7e22ce; }
  .role-btn.active-jp { background: #dcfce7; color: #166534; }
  .role-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; margin-left: 6px; }
  .role-badge.an { background: #dbeafe; color: #1d4ed8; }
  .role-badge.pr { background: #fae8ff; color: #7e22ce; }
  .role-badge.jp { background: #dcfce7; color: #166534; }

  .main-body { flex: 1; overflow-y: auto; padding: 24px; }
  .day-panel { max-width: 800px; }
  .day-info { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 20px; border: 1px solid #e2e8f0; }
  .day-info h3 { font-size: 16px; font-weight: 700; color: #1e293b; }
  .day-info .day-total { font-size: 13px; color: #64748b; margin-top: 4px; }
  .day-info .day-total span { color: #2563eb; font-weight: 700; font-size: 16px; }
  .day-info-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  @media (max-width: 768px) { #btn-add { display: none; } } /* en el móvil está el botón flotante + */

  /* Entries */
  .entries-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .entry-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; }
  .entry-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
  .entry-project-badge { font-size: 12px; font-weight: 600; color: #1e293b; }
  .entry-hours-badge { background: #dbeafe; color: #1d4ed8; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
  .entry-body { padding: 14px 16px; }
  .entry-meta { display: flex; gap: 16px; flex-wrap: wrap; }
  .entry-meta-item { font-size: 12px; color: #64748b; }
  .entry-meta-item strong { color: #475569; }
  .entry-comment { margin-top: 8px; font-size: 13px; color: #475569; font-style: italic; }
  .entry-actions { display: flex; gap: 6px; margin-top: 10px; }

  /* Form */
  .entry-form { background: #fff; border-radius: 12px; border: 2px dashed #bfdbfe; padding: 20px; }
  .entry-form h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 16px; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-group.full { grid-column: 1 / -1; }
  .form-group label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
  .form-group select, .form-group input, .form-group textarea {
    border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #1e293b;
    background: #fff; outline: none; transition: border-color 0.15s; width: 100%;
  }
  .form-group select:focus, .form-group input:focus, .form-group textarea:focus { border-color: #2563eb; }
  .form-group textarea { resize: vertical; min-height: 60px; font-family: Arial, sans-serif; }
  .form-actions { display: flex; gap: 8px; margin-top: 14px; }

  /* Empty / No-day states */
  .empty-state { text-align: center; padding: 48px 24px; color: #94a3b8; }
  .empty-state .icon { font-size: 48px; margin-bottom: 12px; }
  .empty-state h3 { font-size: 16px; color: #64748b; margin-bottom: 6px; }
  .empty-state p { font-size: 13px; }
  .no-day { display: flex; align-items: center; justify-content: center; height: 100%; }
  .no-day-content { text-align: center; color: #94a3b8; }
  .no-day-content .icon { font-size: 64px; margin-bottom: 16px; }
  .no-day-content h3 { font-size: 18px; color: #64748b; margin-bottom: 8px; }

  /* Festivos modal */
  .fest-modal { width: 580px; max-height: 85vh; display: flex; flex-direction: column; }
  .fest-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
  .fest-body { flex: 1; overflow-y: auto; }
  .fest-year { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 0 4px; }
  .fest-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
  .fest-item:hover { background: #f8fafc; }
  .fest-date { font-weight: 600; color: #1e293b; min-width: 100px; }
  .fest-name { flex: 1; color: #475569; }
  .fest-add { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
  .fest-add input { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; }
  .fest-add input:focus { border-color: #2563eb; }
  .fest-import { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
  .fest-import label { font-size: 12px; font-weight: 600; color: #64748b; display: block; margin-bottom: 6px; }
  .fest-import textarea { width: 100%; height: 100px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 12px; font-family: monospace; resize: vertical; outline: none; }
  .fest-import textarea:focus { border-color: #2563eb; }
  .fest-import-actions { display: flex; gap: 8px; margin-top: 8px; }

  /* Project management modal */
  .proy-modal { width: 64vw !important; min-width: 64vw; max-height: 90vh; display: flex; flex-direction: column; }
  .proy-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
  .proy-body { flex: 1; overflow-y: auto; }
  .proy-group { margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
  .proy-group-header { background: #f8fafc; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
  .proy-group-name { font-weight: 700; font-size: 13px; color: #475569; flex: 1; }
  .proy-group-name input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 700; color: #475569; width: 250px; }
  .proy-group-actions { display: flex; gap: 4px; }
  .proy-item { display: grid; grid-template-columns: 1fr 180px 90px; gap: 8px; align-items: center; padding: 7px 12px; border-top: 1px solid #f1f5f9; font-size: 13px; }
  .proy-item:hover { background: #fafafa; }
  .proy-item input { border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 7px; font-size: 12px; width: 100%; }
  .proy-item input:focus { border-color: #2563eb; outline: none; }
  .proy-item select { border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 6px; font-size: 12px; width: 100%; }
  .proy-item .proy-name { color: #1e293b; }
  .proy-item .proy-cod { color: #64748b; text-align: center; }
  .proy-item .proy-tarea { color: #64748b; text-align: center; }
  .proy-item .proy-com { color: #64748b; text-align: center; font-size: 11px; }
  .proy-item-actions { display: flex; gap: 3px; }
  .proy-col-header { display: grid; grid-template-columns: 1fr 180px 90px; gap: 8px; padding: 4px 12px; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; border-top: 1px solid #e2e8f0; background: #f8fafc; }
  .btn-icon { padding: 4px 8px; font-size: 12px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; cursor: pointer; color: #64748b; }
  .btn-icon:hover { background: #e2e8f0; }
  .btn-icon.danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
  .proy-add-item { padding: 8px 12px; border-top: 1px solid #f1f5f9; }
  .proy-footer { padding-top: 14px; margin-top: 14px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
  .proy-item.deleted { opacity: 0.45; background: #fef2f2; }
  .proy-item.deleted input, .proy-item.deleted select { background: #fef2f2; text-decoration: line-through; color: #9ca3af; }
  .proy-footer-note { font-size: 12px; color: #94a3b8; }

  /* Replicate modal */
  .rep-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: #166534; }
  .rep-info strong { display: block; font-size: 14px; margin-bottom: 2px; }
  .rep-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .rep-cal-header span { font-weight: 600; font-size: 14px; }
  .rep-cal-header button { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 14px; }
  .rep-grid-header { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 3px; }
  .rep-grid-header span { text-align: center; font-size: 11px; color: #94a3b8; font-weight: 600; }
  .rep-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; margin-bottom: 12px; }
  .rep-day { height: 36px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; border: 2px solid transparent; background: #f1f5f9; color: #475569; transition: all 0.1s; }
  .rep-day:hover { background: #e2e8f0; }
  .rep-day.empty { background: transparent; cursor: default; pointer-events: none; }
  .rep-day.weekend { background: #f8fafc; color: #94a3b8; }
  .rep-day.festivo { background: #fdf4ff; color: #a21caf; }
  .rep-day.origin { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
  .rep-day.selected { background: #dcfce7; color: #166534; border-color: #4ade80; }
  .rep-day.selected.has-entry { background: #fef9c3; color: #854d0e; border-color: #fde047; }
  .rep-day .rep-day-sub { font-size: 9px; font-weight: 400; margin-top: 1px; }
  .rep-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
  .rep-count { font-size: 12px; color: #64748b; margin-bottom: 12px; }
  .rep-count strong { color: #1e293b; }

  /* Modals */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
  .modal { background: #fff; border-radius: 16px; padding: 28px; width: 480px; max-width: 95vw; box-sizing: border-box; }
  .modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
  .modal p { font-size: 13px; color: #64748b; margin-bottom: 20px; }
  .modal-form { display: flex; flex-direction: column; gap: 12px; }
  .modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
  .hidden { display: none; }

  .festivo-dot { width: 6px; height: 6px; background: #f87171; border-radius: 50%; display: inline-block; margin-left: 4px; vertical-align: middle; }
  select option.sep { font-weight: 700; color: #94a3b8; background: #f1f5f9; }
  .form-error { color: #ef4444; font-size: 12px; margin-top: 3px; display: none; }
  .form-group.has-error input, .form-group.has-error select, .form-group.has-error textarea { border-color: #ef4444; }
  .form-group.has-error .form-error { display: block; }
  .undo-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 10px; display: flex; align-items: center; gap: 16px; font-size: 14px; z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,0.3); white-space: nowrap; }
  .undo-toast-btn { background: none; border: 1px solid rgba(255,255,255,0.6); border-radius: 6px; color: #fff; font-size: 13px; padding: 4px 12px; cursor: pointer; font-weight: 600; }
  .undo-toast-btn:hover { background: rgba(255,255,255,0.15); }
  .prevision-badge { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
  .vac-badge { background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
  .form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
  .form-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: #2563eb; cursor: pointer; flex-shrink: 0; }
  .form-check span { font-size: 13px; font-weight: 500; color: #374151; text-transform: none; letter-spacing: 0; }
  .notif-hora-chip { display: inline-flex; align-items: center; gap: 4px; background: #eff6ff; color: #1e40af; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 8px; }
  .notif-hora-chip button { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
  .notif-hora-chip button:hover { color: #1e40af; }
  .config-modal { width: 540px; max-height: 80vh; overflow-y: auto; }
  .config-section-title { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
  .cfg-hours-grid { display: flex; gap: 8px; }
  .cfg-day-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .cfg-day-col span { font-size: 12px; font-weight: 600; color: #64748b; }
  .cfg-day-col input { width: 52px; text-align: center; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 4px; font-size: 13px; }
  .cfg-mes-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
  .cfg-mes-sel { border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; font-size: 13px; cursor: pointer; }
  .entry-prevision { border-left: 3px solid #f59e0b; }
  .confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 2000; }
  .confirm-box { background: #fff; border-radius: 12px; padding: 24px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
  .confirm-box p { font-size: 14px; color: #374151; margin-bottom: 16px; }
  .confirm-box .confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
  .emp-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 2px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
  .emp-card:hover { border-color: #a5b4fc; background: #f8f7ff; }
  .emp-card.selected { border-color: #6366f1; background: #eef2ff; }
  .emp-card-avatar { width: 36px; height: 36px; border-radius: 50%; background: #6366f1; color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .emp-card-name { font-weight: 600; color: #1e293b; font-size: 14px; }
  .emp-card-tr { font-size: 12px; color: #64748b; margin-top: 1px; }

  /* ── Proyecto combobox ── */
  .proy-combo { position: relative; }
  .proy-combo input {
    width: 100%; box-sizing: border-box;
    border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 6px 10px; font-size: 13px;
  }
  .proy-combo input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px #e0e7ff; }

  .proy-dropdown {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0;
    background: white; border: 1px solid #e2e8f0; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    max-height: 220px; overflow-y: auto;
    z-index: 200; list-style: none; margin: 0; padding: 4px 0;
  }
  .proy-dropdown.hidden { display: none; }

  .proy-group-hdr {
    padding: 4px 10px; font-size: 11px; font-weight: 700;
    color: #94a3b8; letter-spacing: .04em; cursor: default;
  }
  .proy-item { padding: 6px 10px; font-size: 13px; color: #1e293b; cursor: pointer; }
  .proy-item:hover, .proy-item.active { background: #f1f5f9; }
  .proy-item.selected { font-weight: 600; color: #4f46e5; }

  /* ── Vista móvil (≤ 768 px): dos pantallas, calendario y día ─────────────── */
  .solo-movil { display: none; }
  @media (max-width: 768px) {
    .solo-movil { display: inline-flex; }
    body { overflow: auto; }
    .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
    .app.vista-calendario .main { display: none; }
    .app.vista-dia .sidebar { display: none; }

    /* Pantalla 1: calendario */
    .sidebar { width: 100%; min-height: 100vh; overflow: visible; }
    .sidebar-header { position: relative; padding: 14px 16px; }
    .sidebar-header h1 { font-size: 17px; padding-right: 44px; }
    .btn-menu-movil { align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px;
      border: none; background: #334155; color: #e2e8f0; font-size: 20px; cursor: pointer; }
    .sidebar-header .btn-menu-movil { position: absolute; top: 12px; right: 14px; }
    .month-nav { padding: 12px 16px; }
    .month-nav button { width: 38px; height: 38px; font-size: 18px; }
    .month-nav span { font-size: 16px; }
    .calendar { padding: 10px 8px; overflow: visible; flex: none; }
    .cal-grid { gap: 4px; }
    .cal-day { min-height: 56px; padding: 4px; }
    .cal-day-num { font-size: 14px; }
    .cal-day-hours { font-size: 11px; }
    .cal-day-festivo-label { display: none; }
    .legend { padding: 8px 12px; gap: 6px 10px; }
    .month-summary { padding: 12px; }

    /* Pantalla 2: día */
    .main { min-height: 100vh; overflow: visible; }
    .main-header { position: sticky; top: 0; z-index: 50; padding: 10px 12px; flex-wrap: nowrap; gap: 8px; }
    .main-header h2 { font-size: 15px; flex: 1; min-width: 0; }
    .main-header-actions { display: none; }
    .btn-volver-movil { align-items: center; border: none; background: #f1f5f9; color: #1e293b; border-radius: 8px;
      padding: 8px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
    .btn-menu-dia { background: #f1f5f9; color: #1e293b; }
    .main-body { overflow: visible; padding: 14px 12px 96px; }
    .backup-banner { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .week-progress-label { flex-wrap: wrap; gap: 4px; }
    .entry-actions { flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
    /* 16 px evita que iOS haga zoom al escribir */
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; }
    /* "+ Añadir entrada" como botón flotante */
    .fab-anadir { position: fixed; right: 18px; bottom: 22px; z-index: 60; width: 58px; height: 58px; border-radius: 50%;
      border: none; background: #2563eb; color: #fff; font-size: 30px; line-height: 1; align-items: center; justify-content: center;
      box-shadow: 0 6px 18px rgba(37,99,235,0.45); cursor: pointer; }

    /* Menú */
    .menu-movil-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 900; display: flex; justify-content: flex-end; }
    .menu-movil { background: #fff; width: 78vw; max-width: 320px; height: 100%; padding: 16px 12px; display: flex; flex-direction: column;
      gap: 4px; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,0.2); }
    .menu-movil-titulo { font-weight: 700; color: #1e293b; padding: 6px 10px 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 6px; }
    .menu-movil button { text-align: left; background: none; border: none; padding: 12px 10px; border-radius: 8px; font-size: 15px; color: #1e293b; cursor: pointer; }
    .menu-movil button:active { background: #f1f5f9; }

    /* Ventanas a pantalla completa */
    .modal-overlay { align-items: stretch; }
    .modal, .modal[style] { width: 100% !important; min-width: 0 !important; max-width: 100% !important; max-height: 100vh !important;
      height: 100%; border-radius: 0; padding: 18px 14px; overflow-y: auto; }
    .proy-item { grid-template-columns: 1fr 96px 74px; }
    .cfg-hours-grid { gap: 4px; }
    .cfg-mes-row { flex-wrap: wrap; }
    .undo-toast { bottom: 90px; width: calc(100% - 24px); justify-content: space-between; }
  }

  /* ── Vista de semana e informe anual ── */
  .semana-modal { width: 720px; max-height: 90vh; overflow-y: auto; }
  .semana-scroll { overflow-x: auto; }
  .semana-tabla th.semana-dia { cursor: pointer; white-space: nowrap; }
  .semana-tabla th.semana-dia:hover { color: #2563eb; text-decoration: underline; }
  .semana-tabla th.semana-dia.hoy { color: #2563eb; }
  .semana-festivo { color: #c026d3; }
  .semana-tabla td.semana-ok { color: #059669; font-weight: 700; }
  .semana-tabla td.semana-falta { color: #d97706; font-weight: 700; }
  .semana-tabla td.semana-vacio { color: #ef4444; font-weight: 700; }
  .semana-tabla tr.semana-esperadas td { color: #94a3b8; font-size: 12px; }
  .anual-modal { width: 640px; max-height: 92vh; overflow-y: auto; }
  .anual-meses { display: flex; flex-direction: column; gap: 5px; }
  .anual-fila { display: grid; grid-template-columns: 34px 1fr 150px; align-items: center; gap: 8px; font-size: 12px; }
  .anual-mes { color: #475569; font-weight: 600; }
  .anual-barra { position: relative; height: 14px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
  .anual-esperado { position: absolute; inset: 0 auto 0 0; background: #e2e8f0; }
  .anual-horas { position: absolute; inset: 3px auto 3px 0; border-radius: 3px; }
  .anual-cifra { color: #64748b; text-align: right; white-space: nowrap; }
  @media (max-width: 768px) {
    .anual-fila { grid-template-columns: 30px 1fr 112px; font-size: 11px; }
    .semana-tabla th, .semana-tabla td { padding: 7px 4px; font-size: 12px; }
    .semana-tabla th:first-child, .semana-tabla td:first-child { padding-left: 6px; }
  }

  /* ── Festivos: pestañas y reglas de cada año ── */
  .fest-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
  .fest-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 6px 12px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; margin-bottom: -1px; }
  .fest-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
  .fest-regla-desc { color: #64748b; font-size: 12px; min-width: 120px; text-align: right; }
  .fest-regla.inactiva .fest-name, .fest-regla.inactiva .fest-regla-desc { color: #cbd5e1; text-decoration: line-through; }
  .fest-regla-form { display: grid; grid-template-columns: 1fr 90px auto auto; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; align-items: center; }
  .fest-regla-form #regla-nombre { grid-column: 1 / -1; }
  .fest-regla-form input, .fest-regla-form select { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; min-width: 0; }
  .fest-regla-form input:focus, .fest-regla-form select:focus { border-color: #2563eb; }
  @media (max-width: 768px) {
    .fest-regla-form { grid-template-columns: 1fr 1fr; }
    .fest-regla-desc { min-width: 0; }
  }

  /* ── Varios días seleccionados en el calendario ── */
  .cal-grid { user-select: none; }
  .cal-day.arrastrando-sel, .cal-day.en-seleccion { outline: 2px solid #f59e0b; outline-offset: -2px; box-shadow: inset 0 0 0 100px rgba(245, 158, 11, 0.18); }
  .barra-seleccion { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    max-width: 800px; margin-bottom: 16px; padding: 10px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 13px; color: #92400e; }
  .barra-seleccion-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

  /* ── Buscar en el historial ── */
  .buscar-modal { width: 640px; max-height: 88vh; display: flex; flex-direction: column; }
  .buscar-input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; }
  .buscar-input:focus { border-color: #2563eb; }
  .buscar-estado { font-size: 12px; color: #94a3b8; margin: 8px 0; }
  .buscar-resultados { flex: 1; overflow-y: auto; }
  .buscar-item { display: flex; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #334155; }
  .buscar-item:hover { background: #f1f5f9; }
  .buscar-fecha { min-width: 110px; font-weight: 600; color: #2563eb; }
  .buscar-comentario { color: #64748b; font-size: 12px; margin-top: 2px; }
  @media (max-width: 768px) { .buscar-input { font-size: 16px; } .buscar-item { flex-direction: column; gap: 2px; } }

  /* ── Tema oscuro (data-tema="oscuro" en <html>, lo pone AppRaiz / interop.aplicarTema) ──
     La barra lateral ya es oscura; aquí se oscurece el panel principal y las ventanas.
     Algunos colores van en estilos en línea: se reasignan con selectores de atributo. */
  :root[data-tema="oscuro"] { color-scheme: dark; }
  [data-tema="oscuro"] body { background: #0b1120; color: #e2e8f0; }
  [data-tema="oscuro"] :is(.main-header, .day-info, .entry-card, .entry-form, .modal, .desplegable-menu, .confirm-box, .proy-dropdown) {
    background: #1e293b; border-color: #334155; color: #e2e8f0; }
  [data-tema="oscuro"] .entry-form { border-color: #1e40af; }
  [data-tema="oscuro"] :is(.week-progress, .entry-header, .sum-table th, .sum-table tr.total td, .sum-week-box, .proy-group-header, .btn-icon,
    .rep-cal-header button, .role-btn, .anual-barra) { background: #172033; border-color: #334155; color: #cbd5e1; }
  [data-tema="oscuro"] .week-bar, [data-tema="oscuro"] .anual-esperado { background: #334155; }
  [data-tema="oscuro"] :is(.sum-table tr:hover td, .fest-item:hover, .buscar-item:hover, .desplegable-menu button:hover, .proy-item:hover,
    .proy-item.active, .btn-icon:hover, .emp-card:hover) { background: #273449; }
  [data-tema="oscuro"] :is(.sum-table td, .proy-item, .proy-group, .fest-toolbar, .fest-add, .fest-import, .proy-toolbar, .proy-footer,
    .cfg-mes-row, .fest-tabs, .emp-card) { border-color: #334155; }
  [data-tema="oscuro"] :is(.main-header h2, .day-info h3, .entry-project-badge, .entry-form h4, .modal h3, .modal strong, .fest-date,
    .proy-item .proy-name, .emp-card-name, .rep-count strong, .week-progress-label strong, .sum-week-box .whours, .proy-item,
    .sum-table td, .rep-cal-header span, .buscar-item, .desplegable-menu button, .form-check span) { color: #e2e8f0; }
  [data-tema="oscuro"] :is(.modal p, .entry-meta-item, .entry-meta-item strong, .entry-comment, .fest-name, .form-group label,
    .config-section-title, .cfg-day-col span, .proy-group-name, .proy-group-name input, .emp-card-tr, .day-info .day-total, .rep-count,
    .anual-cifra, .anual-mes, .buscar-comentario, .week-progress-label) { color: #94a3b8; }
  [data-tema="oscuro"] .btn-secondary { background: #273449; color: #cbd5e1; border-color: #334155; }
  [data-tema="oscuro"] .btn-secondary:hover { background: #334155; }
  [data-tema="oscuro"] :is(.main, .modal-overlay, .confirm-overlay) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background: #0f172a; color: #e2e8f0; border-color: #475569; }
  [data-tema="oscuro"] .entry-hours-badge { background: #1e3a8a; color: #bfdbfe; }
  [data-tema="oscuro"] .prevision-badge { background: #422006; color: #fcd34d; }
  [data-tema="oscuro"] .vac-badge { background: #172554; color: #bfdbfe; }
  [data-tema="oscuro"] .emp-card.selected { background: #1e1b4b; border-color: #6366f1; }
  [data-tema="oscuro"] .rep-day { background: #273449; color: #e2e8f0; }
  [data-tema="oscuro"] .rep-day.weekend { background: #172033; color: #64748b; }
  [data-tema="oscuro"] .rep-day.festivo { background: #4a1942; color: #f0abfc; }
  [data-tema="oscuro"] .rep-day.origin { background: #1e3a8a; color: #bfdbfe; }
  [data-tema="oscuro"] .rep-day.selected { background: #14532d; color: #bbf7d0; }
  [data-tema="oscuro"] .rep-info { background: #052e16; border-color: #166534; color: #bbf7d0; }
  [data-tema="oscuro"] .proy-item.deleted, [data-tema="oscuro"] .proy-item.deleted :is(input, select) { background: #3b1d1d; }
  [data-tema="oscuro"] :is(.barra-seleccion, .backup-banner) { background: #422006; border-color: #92400e; color: #fde68a; }
  [data-tema="oscuro"] .backup-banner a { color: #fbbf24; }
  [data-tema="oscuro"] .notif-hora-chip { background: #172554; color: #bfdbfe; }
  [data-tema="oscuro"] .menu-movil { background: #1e293b; }
  [data-tema="oscuro"] .menu-movil button { color: #e2e8f0; border-color: #334155; }
  /* Estilos en línea */
  [data-tema="oscuro"] :is(.main, .modal-overlay) :is([style*="background:#f8fafc"], [style*="background:#f1f5f9"], [style*="background:#fff;"]) { background: #172033 !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) :is([style*="color:#1e293b"], [style*="color:#374151"]) { color: #e2e8f0 !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="color:#475569"] { color: #cbd5e1 !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="solid #e2e8f0"] { border-color: #334155 !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="background:#fffbeb"] { background: #422006 !important; border-color: #92400e !important; color: #fde68a !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="color:#b45309"] { color: #fbbf24 !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="background:#eff6ff"] { background: #172554 !important; border-color: #1e40af !important; color: #bfdbfe !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="background:#eef2ff"] { background: #1e1b4b !important; border-color: #4338ca !important; color: #c7d2fe !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) [style*="background:#fee2e2"] { background: #3b1d1d !important; color: #fecaca !important; }
  [data-tema="oscuro"] :is(.main, .modal-overlay) input[readonly] { background: #172033 !important; color: #94a3b8 !important; }
