/* ===== Natura Viva Gardens — estilos v3 ===== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f3;
  --bg-tertiary: #ebebe7;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-tertiary: #999;
  --border: #d8d8d4;
  --border-soft: #e8e8e4;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --green-dark: #1a3818;
  --green: #2a6020;
  --green-light: #7ec850;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-tertiary); color: var(--text-primary); overscroll-behavior: none; }

.app {
  background: var(--bg-tertiary);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar { background: var(--green-dark); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-text { color: #fff; font-size: 13px; font-weight: 500; letter-spacing: 1px; line-height: 1.1; }
.logo-sub { color: rgba(255,255,255,.5); font-size: 9px; letter-spacing: 3px; }
.bell { color: rgba(255,255,255,.7); font-size: 17px; cursor: pointer; }

.nav-tabs { display: flex; background: var(--green-dark); border-bottom: 1px solid rgba(255,255,255,.15); padding: 0 6px; overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { padding: 10px 14px; font-size: 12px; color: rgba(255,255,255,.6); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; transition: color .15s; }
.nav-tab.active { color: #fff; border-bottom-color: var(--green-light); font-weight: 500; }

.content { padding: 12px; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.mnav-btn { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--text-primary); }

/* ===== MES ===== */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.month-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.day-hdr { text-align: center; font-size: 9px; font-weight: 500; color: var(--text-secondary); padding: 3px 0; }
.month-day { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); min-height: 62px; padding: 3px; cursor: pointer; overflow: hidden; min-width: 0; }
.month-day.other-month { opacity: .3; pointer-events: none; }
.month-day.today-day { /* ver abajo */ }
.month-day.weekend-day { background: #f2f7f0; }
.md-num { font-size: 10px; font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; }
.md-num.today-num { /* ver abajo */ }
.md-pip { border-radius: 2px; padding: 1px 3px; font-size: 8px; font-weight: 500; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.pip-t { background: #e03030; color: #fff; font-size: 7px; font-weight: 800; padding: 0 2px; border-radius: 2px; line-height: 1.4; flex-shrink: 0; }
.pip-e { line-height: 1.4; flex-shrink: 0; display:flex;align-items:center; }
.pip-c { line-height: 1.4; flex-shrink: 0; display:flex;align-items:center; }
/* pip-r: badge azul con asterisco para recordatorios (antes era fucsia con !) */
.pip-r { background: #1565c0; color: #fff; font-size: 7px; font-weight: 800; padding: 0 2px; border-radius: 2px; line-height: 1.4; flex-shrink: 0; }
.md-wknd-task { background: #e0eed8; border-radius: 2px; padding: 2px 3px; font-size: 8px; color: #1a4010; margin-bottom: 1px; line-height: 1.3; word-break: break-word; overflow-wrap: break-word; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; max-width: 100%; }
.md-wknd-add { font-size: 9px; color: #7ab870; margin-top: 2px; }

/* ===== SEMANA ===== */
.week-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.week-title { font-size: 13px; font-weight: 500; }
.reminder { background: #fff8e8; color: #7a4a10; border: 1px solid #e8c870; border-radius: var(--radius-md); padding: 7px 11px; font-size: 11px; margin-bottom: 8px; }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; cursor: grab; user-select: none; }
.cal-wrap:active { cursor: grabbing; }
.cal-grid { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); gap: 2px; min-width: 480px; }
.chdr { background: var(--green-dark); color: #fff; text-align: center; padding: 5px 2px; border-radius: var(--radius-sm); line-height: 1.4; }
.chdr-day { font-size: 10px; font-weight: 500; }
.chdr-date { font-size: 9px; opacity: .7; }
.chdr.today-c { /* ver abajo */ }
.chdr.weekend-c { background: #2c4a28; }
.tslot { color: var(--text-tertiary); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; height: 30px; font-size: 9px; }
.ccell { border-radius: var(--radius-sm); min-height: 30px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-align: center; padding: 2px 2px; line-height: 1.2; position: relative; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.cell-name { font-size: 9px; font-weight: 500; text-align: center; line-height: 1.1; word-break: break-word; overflow-wrap: break-word; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; padding: 0 1px; }
.cell-emps { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: center; max-width: 100%; margin-top: 1px; }
.cell-emp-dot { width: 14px; height: 14px; border-radius: 50%; background: transparent; border: 0.5px solid #000; color: #000; font-size: 7px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; letter-spacing: -0.3px; box-sizing: border-box; }
.cell-badges { display: flex; gap: 1px; position: absolute; top: 1px; right: 1px; flex-wrap: wrap; max-width: 52px; justify-content: flex-end; }
.cb-t { background: #e03030; color: #fff; font-size: 7px; font-weight: 900; width: 11px; height: 11px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.3); flex-shrink: 0; }
.cb-e { width: 13px; height: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cb-c { width: 13px; height: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* cb-r: dot azul con asterisco para recordatorios (antes era fucsia sin texto) */
.cb-r { background: #1565c0; color: #fff; font-size: 7px; font-weight: 900; width: 11px; height: 11px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.3); flex-shrink: 0; cursor: pointer; }
.c-tonyna { background: #ffc5c5; color: #6a1010; border-color: #e89090; }
.c-tagomago { background: #e8b4d8; color: #4a1040; border-color: #c880b0; }
.c-seahouse { background: #b8d0f0; color: #0a2a60; border-color: #70a0d0; }
.c-greco { background: #f5d9b0; color: #6a3a05; border-color: #d0a060; }
.c-batle { background: #b8d8f0; color: #0a2a55; border-color: #60a0d0; }
.c-cabrera { background: #c8c870; color: #303008; border-color: #909040; }
.c-savinya { background: #90d0b8; color: #053020; border-color: #40a080; }
.c-borras { background: #a8e0a8; color: #083808; border-color: #50b050; }
.c-puig { background: #e0c898; color: #483008; border-color: #b08848; }
.c-miro { background: #c8b0e0; color: #280848; border-color: #9068b8; }
.c-gerret { background: #ffd098; color: #582000; border-color: #d08040; }
.c-alzina { background: #c8e0a8; color: #183800; border-color: #78b048; }
.c-libre { background: var(--bg-secondary); color: var(--text-tertiary); border-color: var(--border-soft); }
.c-custom { background: #ffe9c2; color: #7a4f10; border-color: #e8c870; }
.c-tarea { background: #dbeafe; color: #1e3a5f; border-color: #93c5fd; }
.c-nota  { background: #dcfce7; color: #14532d; border-color: #86efac; }
.c-hora-libre { background: #f3e8ff; color: #581c87; border-color: #c084fc; }
/* Wheel picker */
.wheel-wrap { width:72px; height:90px; overflow:hidden; border:1px solid var(--border-soft); border-radius:10px; background:#fff; position:relative; }
.wheel { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; cursor:ns-resize; gap:2px; padding:4px 0; touch-action:none; }
.wheel-item { width:100%; text-align:center; padding:3px 0; font-weight:600; color:var(--text-primary); transition:opacity .1s,font-size .1s; }
.wheel-item.wheel-sel { color:#1a3818; background:#e9f1e3; border-radius:6px; }
.wheel-wrap::before,.wheel-wrap::after { content:''; position:absolute; left:0; right:0; height:28px; pointer-events:none; z-index:2; }
.wheel-wrap::before { top:0; background:linear-gradient(to bottom,#fff,transparent); }
.wheel-wrap::after  { bottom:0; background:linear-gradient(to top,#fff,transparent); }
.c-wknd { background: #f0f5ee; color: var(--green); border-color: #c8dcc0; }
.wknd-cell-text { font-size: 7px; color: #1a5010; font-weight: 500; text-align: center; line-height: 1.2; width: 100%; overflow: hidden; padding: 0 1px; word-break: break-word; overflow-wrap: break-word; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; max-width: 100%; }
.wknd-add-lbl { font-size: 8px; color: #7ab870; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal-box { background: var(--bg-primary); border-radius: var(--radius-lg); border: 1px solid var(--border-soft); padding: 16px; width: 330px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 12px; }
.modal-list { max-height: 200px; overflow-y: auto; margin-bottom: 8px; }
.modal-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; background: #f8faf6; border-radius: var(--radius-sm); margin-bottom: 4px; border: 1px solid #d8e8d0; }
.modal-item-text { font-size: 12px; color: var(--text-primary); flex: 1; white-space: pre-wrap; word-break: break-word; line-height: 1.45; cursor: pointer; }
.modal-item-text.done-item { text-decoration: line-through; color: var(--text-tertiary); }
.modal-check { width: 16px; height: 16px; border: 1.5px solid #5a8a50; border-radius: var(--radius-sm); flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; margin-top: 1px; }
.modal-check.done { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.del-btn { background: none; border: none; cursor: pointer; color: #b03030; font-size: 16px; padding: 0 4px; line-height: 1; flex-shrink: 0; }
.edit-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 13px; padding: 0 3px; line-height: 1; flex-shrink: 0; }
.modal-box textarea, .modal-box input, .modal-box select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text-primary); background: var(--bg-secondary); margin-bottom: 10px; line-height: 1.5; }
.modal-box textarea { resize: vertical; min-height: 70px; max-height: 160px; }
.modal-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.btn-cancel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.btn-ok { background: var(--green-dark); color: #fff; border: none; border-radius: var(--radius-md); padding: 6px 14px; font-size: 12px; cursor: pointer; }
.btn-danger { background: #fff; color: #b03030; border: 1px solid #e8b0b0; border-radius: var(--radius-md); padding: 6px 12px; font-size: 12px; cursor: pointer; margin-right: auto; }

.field-label { font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }

/* Botones rápidos horas extras */
.quick-hours { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.q-hr-btn { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 10px; font-size: 11px; cursor: pointer; color: var(--text-primary); }
.q-hr-btn.plus { color: var(--green); border-color: #b8d8b0; }
.q-hr-btn.minus { color: #b03030; border-color: #e8c0c0; }
.q-hr-btn.zero { color: var(--text-secondary); }

/* ===== COMBUSTIBLE ===== */
.fuel-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fuel-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.fuel-day-hdr { text-align: center; font-size: 9px; font-weight: 500; color: var(--text-secondary); padding: 3px 0; }
.fuel-day-cell { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); min-height: 44px; padding: 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.fuel-day-cell.fueled { background: #fff8e8; border-color: #BA7517; }
.fuel-day-cell.other { opacity: .25; pointer-events: none; }
.fuel-day-num { font-size: 10px; font-weight: 500; color: var(--text-secondary); }

/* ===== TAREAS ===== */
.task-global-item { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 9px 11px; margin-bottom: 5px; display: flex; align-items: flex-start; gap: 8px; }
.task-global-item.sel { background: #e8f4e0; border-color: #5a9a30; }
.tcheck { width: 16px; height: 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; margin-top: 1px; cursor: pointer; background: #fff; }
.tcheck.done { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.sel-box { width: 17px; height: 17px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 1px; background: #fff; }
.sel-box.checked { background: #3a7020; border-color: #3a7020; color: #fff; }
.tinfo { flex: 1; min-width: 0; cursor: pointer; }
.ttitle { font-size: 12px; color: var(--text-primary); }
.ttitle.done { text-decoration: line-through; color: var(--text-tertiary); }
.tmeta { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tbadge { font-size: 9px; padding: 2px 6px; border-radius: 20px; flex-shrink: 0; }
.b-u { background: #FCEBEB; color: #A32D2D; }
.b-n { background: #E6F1FB; color: #185FA5; }
.bulk-bar { background: var(--green-dark); color: #fff; border-radius: var(--radius-md); padding: 9px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; font-size: 11px; flex-wrap: wrap; }
.bulk-btn { background: rgba(255,255,255,.18); border: none; color: #fff; border-radius: var(--radius-md); padding: 5px 11px; font-size: 11px; cursor: pointer; }
.add-task-box { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 12px; margin-top: 10px; }
.add-task-box input { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 9px; font-size: 12px; font-family: inherit; color: var(--text-primary); background: var(--bg-secondary); margin-bottom: 8px; }
.add-task-box select, .add-box select { box-sizing: border-box; max-width: 100%; }
.add-box input { box-sizing: border-box; }
.add-task-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.add-task-row select { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 7px; font-size: 11px; color: var(--text-primary); background: var(--bg-secondary); }
.btn-send { background: var(--green-dark); color: #fff; border: none; border-radius: var(--radius-md); padding: 6px 13px; font-size: 11px; cursor: pointer; margin-left: auto; }
.assign-row { margin: 8px 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.assign-label { font-size: 11px; color: var(--text-secondary); margin-right: 4px; font-weight: 500; }
.emp-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.emp-pill { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 11px; cursor: pointer; color: var(--text-secondary); user-select: none; transition: all .12s; }
.emp-pill.on { background: var(--green-dark); color: #fff; border-color: var(--green-dark); font-weight: 500; }
.filter-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.filter-btn { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 11px; cursor: pointer; color: var(--text-secondary); }
.filter-btn.active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.sel-toggle { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 11px; cursor: pointer; color: var(--text-secondary); margin-left: auto; }
.sel-toggle.on { background: #3a7020; color: #fff; border-color: #3a7020; }

.mode-row { display: flex; gap: 5px; margin-bottom: 10px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px; }
.mode-btn { flex: 1; text-align: center; padding: 6px 8px; font-size: 11px; border-radius: 5px; cursor: pointer; color: var(--text-secondary); }
.mode-btn.active { background: var(--bg-primary); color: var(--text-primary); font-weight: 500; border: 1px solid var(--border-soft); }
.group-card { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 9px 11px; margin-bottom: 5px; cursor: pointer; display: flex; align-items: center; gap: 8px; }

/* ===== DETALLE CASA ===== */
.hv-back { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-secondary); font-size: 12px; margin-bottom: 10px; }
.hv-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
.hv-color { width: 8px; height: 44px; border-radius: 4px; flex-shrink: 0; }
.hv-name { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.hv-time { font-size: 11px; color: var(--text-secondary); }
.tabs2 { display: flex; gap: 2px; margin-bottom: 10px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px; }
.tab2 { flex: 1; text-align: center; padding: 7px 4px; font-size: 11.5px; border-radius: 6px; cursor: pointer; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab2.active { background: var(--bg-primary); color: var(--text-primary); font-weight: 500; border: 1px solid var(--border-soft); }
.nota-item { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 9px 11px; margin-bottom: 5px; display: flex; gap: 8px; align-items: flex-start; }
.nota-text { font-size: 12px; color: var(--text-primary); margin-bottom: 3px; white-space: pre-wrap; word-break: break-word; flex: 1; cursor: pointer; }
.nota-meta { font-size: 10px; color: var(--text-tertiary); }
.nota-actions { display: flex; gap: 4px; flex-shrink: 0; }
.add-box { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 11px; margin-top: 8px; }
.add-box textarea, .add-box input { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 9px; font-size: 12px; font-family: inherit; color: var(--text-primary); background: var(--bg-secondary); }
.add-box textarea { resize: vertical; min-height: 50px; max-height: 120px; line-height: 1.5; }
/* Date inputs en formularios — evitar que se desborden y normalizar tamaño en iOS */
.add-task-box input[type="date"],
.add-box input[type="date"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  height: 34px;
  padding: 6px 9px;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  display: block;
  min-height: 0;
}
.add-task-box input[type="date"]::-webkit-date-and-time-value,
.add-box input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}
.box-btns { display: flex; gap: 6px; margin-top: 7px; align-items: center; flex-wrap: wrap; }
.box-btns select { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 7px; font-size: 11px; color: var(--text-primary); background: var(--bg-secondary); }
.btn-save { background: var(--green-dark); color: #fff; border: none; border-radius: var(--radius-md); padding: 6px 12px; font-size: 11px; cursor: pointer; margin-left: auto; }
.task-item { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 9px 11px; margin-bottom: 5px; display: flex; align-items: flex-start; gap: 8px; }

/* ===== EQUIPO ===== */
/* Steppers de cantidad (materiales/fitosanitarios): ocultar flechitas nativas
   porque usamos botones propios − / + (las nativas no salen en iOS) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.emp-card { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background .12s; }
.emp-av { width: 36px; height: 36px; border-radius: 50%; background: #d0e8c8; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 12px; color: var(--green-dark); flex-shrink: 0; }
.emp-name { font-size: 13px; font-weight: 500; }
.emp-zone { font-size: 11px; color: var(--text-secondary); }
.emp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-on { background: #3a9820; }
.dot-off { background: var(--border); }
.notif-b { background: #FCEBEB; color: #A32D2D; font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 20px; }
.sec-lbl { font-size: 10px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; margin-top: 14px; }

/* ===== DETALLE EMPLEADO ===== */
.empd-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 14px; background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
.empd-av { width: 48px; height: 48px; border-radius: 50%; background: #d0e8c8; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 16px; color: var(--green-dark); flex-shrink: 0; }
.empd-name { font-size: 16px; font-weight: 500; }
.empd-zone { font-size: 11px; color: var(--text-secondary); }
.empd-tabs { display: flex; gap: 2px; margin-bottom: 12px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px; }
.empd-tab { flex: 1; text-align: center; padding: 8px; font-size: 12px; border-radius: 6px; cursor: pointer; color: var(--text-secondary); }
.empd-tab.active { background: var(--bg-primary); color: var(--text-primary); font-weight: 500; border: 1px solid var(--border-soft); }

.hr-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hr-view-toggle { display: flex; gap: 3px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px; margin-bottom: 10px; }
.hr-view-btn { flex: 1; text-align: center; padding: 6px; font-size: 11px; border-radius: 5px; cursor: pointer; color: var(--text-secondary); }
.hr-view-btn.active { background: var(--bg-primary); color: var(--text-primary); font-weight: 500; border: 1px solid var(--border-soft); }
.hr-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hr-day-cell { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); min-height: 50px; padding: 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.hr-day-cell.weekend { background: #f4f8f1; }
.hr-day-cell.other { opacity: .25; pointer-events: none; }
.hr-day-num { font-size: 10px; font-weight: 500; color: var(--text-secondary); }
.hr-day-val { font-size: 12px; font-weight: 700; margin-top: 2px; }
.hr-day-val.plus { color: var(--green); }
.hr-day-val.minus { color: #b03030; }

.hr-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; }
.hr-week-day { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 8px 4px; cursor: pointer; text-align: center; min-height: 64px; display: flex; flex-direction: column; justify-content: space-between; }
.hr-week-day.weekend { background: #f4f8f1; }
.hr-week-day.today { border-color: var(--green); border-width: 1.5px; }
.hr-wd-label { font-size: 10px; color: var(--text-secondary); font-weight: 500; }
.hr-wd-date { font-size: 9px; color: var(--text-tertiary); margin-top: 2px; }
.hr-wd-val { font-size: 14px; font-weight: 700; margin-top: 4px; }
.hr-wd-val.plus { color: var(--green); }
.hr-wd-val.minus { color: #b03030; }
.hr-wd-empty { font-size: 16px; color: var(--text-tertiary); margin-top: 4px; }

.hr-summary { background: var(--bg-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 12px 14px; margin-top: 12px; }
.hr-sum-title { font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.hr-sum-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; }
.hr-sum-row.total { border-top: 1px solid var(--border-soft); margin-top: 6px; padding-top: 9px; font-weight: 700; font-size: 15px; }
.hr-sum-val.plus { color: var(--green); }
.hr-sum-val.minus { color: #b03030; }

.no-task { font-size: 12px; color: var(--text-tertiary); padding: 12px 0; text-align: center; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--green-dark); color: #fff; padding: 8px 16px; border-radius: var(--radius-md); font-size: 12px; opacity: 0; transition: opacity .3s; z-index: 300; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }

/* ===== FOTOS EN NOTAS ===== */
.nota-photo {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-md);
  margin-top: 5px;
  display: block;
  object-fit: cover;
  cursor: pointer;
}
.photo-preview-mini {
  display: inline-block;
  margin-right: 8px;
  position: relative;
}
.photo-preview-mini img {
  max-height: 50px;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}
.photo-preview-mini .remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #b03030;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.file-input-hidden { display: none; }
.btn-foto-lbl {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-block;
}
.modal-photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  display: block;
}

/* ===== LOGO EN HEADER (imagen) ===== */
.header-logo {
  height: 32px;
  object-fit: contain;
}
.user-badge {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 12px;
  font-weight: 500;
}
.logout-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logout-btn:hover { background: rgba(255,255,255,.2); }

/* ===== PANTALLA DE LOGIN ===== */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 12px 36px rgba(0,0,0,.3);
}
.login-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 8px;
  object-fit: contain;
}
.login-subtitle {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.login-field {
  margin-bottom: 12px;
}
.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.login-field input:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}
.login-error {
  color: #b03030;
  font-size: 12.5px;
  min-height: 0;
  text-align: center;
  margin: 4px 0 8px;
  line-height: 1.4;
}
.login-error:not(:empty) {
  background: #fdecec;
  border: 1px solid #f3c4c4;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0 10px;
}
.login-error.ok:not(:empty) {
  color: #2e7d32;
  background: #e8f5e9;
  border-color: #b6e0bb;
}
.login-submit {
  width: 100%;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.login-submit:hover { background: var(--green); }
.login-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ===== INPUT TEXTO PEQUEÑO PARA COMENTARIOS ===== */
.hr-comment-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  margin-bottom: 8px;
}
.hr-day-comment {
  font-size: 7px;
  color: var(--text-tertiary);
  line-height: 1.1;
  margin-top: 1px;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hr-wd-comment {
  font-size: 8px;
  color: var(--text-tertiary);
  margin-top: 2px;
  padding: 0 2px;
  line-height: 1.1;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== COMPRAS — estilos reutilizan .group-card y .task-global-item ===== */

/* ===== BOTÓN COLAPSABLE FORMULARIOS ===== */
.add-toggle-btn {
  display: block;
  margin: 12px 0 0;
  text-align: center;
  background: var(--green-dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.add-toggle-btn:active { background: var(--green); }

/* ===== HORA ACTUAL EN SEMANA ===== */
.current-hour-label {
  color: var(--green-dark) !important;
  font-weight: 700 !important;
}
.current-hour-cell {
  box-shadow: inset 0 0 0 2px var(--green-dark) !important;
  background: rgba(46,125,50,0.07) !important;
}

/* ===== HORAS TARDE — TOGGLE ===== */
.evening-toggle {
  margin: 6px 0 0;
  padding: 7px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

/* ===== AJUSTES ===== */
.ajustes-section-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
}
.ajustes-section-hdr.open {
  border-color: var(--green-dark);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.ajustes-chevron { font-size: 11px; color: var(--text-tertiary); }
.ajustes-section-body {
  background: var(--bg-card);
  border: 1px solid var(--green-dark);
  border-top: none;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 8px;
}
.ajustes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ajustes-row:last-child { border-bottom: none; }
.ajustes-label { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.ajustes-value { font-size: 12px; font-weight: 500; }
.ajustes-finca-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.ajustes-finca-row:last-of-type { border-bottom: none; }
.ajustes-finca-color {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,.1);
}
.ajustes-finca-name { flex: 1; font-size: 13px; }
.ajustes-emp-init {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
.ajustes-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
}
.ajustes-icon-btn.danger { color: #c62828; border-color: #ffcdd2; }
.ajustes-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ===== HOY MÁS VISIBLE EN CALENDARIOS ===== */
.today-c {
  background: #e9f1e3 !important;
  color: var(--green-dark) !important;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(46,125,50,0.4);
  border: 2px solid var(--green-dark) !important;
  outline: 2px solid #fff;
  outline-offset: -4px;
}
.today-c .chdr-day { 
  color: var(--green-dark) !important; 
  font-weight: 800;
  font-size: 11px;
}
.today-c .chdr-date { 
  color: var(--green-dark) !important; 
  font-weight: 700;
  opacity: 1 !important;
}
.today-day {
  background: rgba(46,125,50,0.10) !important;
  outline: 2.5px solid var(--green-dark) !important;
  outline-offset: -1px;
  border-radius: 4px;
}
.today-num {
  background: var(--green-dark) !important;
  color: #fff !important;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(46,125,50,0.5);
}

/* ===== PERMISOS ===== */
.perm-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.perm-row:last-child { border-bottom: none; }
.perm-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.perm-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green-dark);
  flex-shrink: 0;
  cursor: pointer;
}

/* ===== COMBUSTIBLE MÚLTIPLE ===== */
.fuel-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.fuel-entry-row:last-child { border-bottom: none; }
.fuel-entry-row span:first-child { flex: 1; }

/* ===== MANO DE OBRA SCOPE PILLS ===== */
.mo-scope-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--border-soft);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all .15s;
}
.mo-scope-pill.mo-scope-on {
  background: #1a3818;
  color: #fff;
  border-color: #1a3818;
  font-weight: 600;
}
