/* Estética AM Produccions — manual d'estil
   Blau #0c4690 · Turquesa #66c2ce · Marí #14142a · Blanc #ffffff · Tipografia Unbounded */
:root {
  --am-blue: #0c4690;
  --am-cyan: #66c2ce;
  --am-navy: #14142a;
  --am-white: #ffffff;

  --bg: #10101f;
  --surface: #1a1c36;
  --surface-2: #232748;
  --border: #2d3260;
  --text: #f3f6fb;
  --muted: #a3acc8;
  --accent: var(--am-cyan);
  --accent-text: var(--am-navy);
  --primary: var(--am-blue);
  --ok: #5fd4a1;
  --ok-bg: rgb(95 212 161 / .14);
  --warn: #ffd27a;
  --warn-bg: rgb(255 210 122 / .13);
  --danger: #ff7a85;
  --danger-bg: rgb(255 122 133 / .12);
  --radius: 16px;
  --grad: linear-gradient(125deg, var(--am-navy) 0%, var(--am-blue) 58%, var(--am-cyan) 130%);
  --font-brand: "Unbounded", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-brand);
  font-weight: 400;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-brand); letter-spacing: -0.01em; }

/* ---- Cabecera con degradado de marca ---- */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--grad);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 0;
  box-shadow: 0 6px 24px rgb(0 0 0 / .35);
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand .logo { height: 30px; width: auto; max-width: 58vw; object-fit: contain; display: block; }
.brand .who { color: rgb(255 255 255 / .85); font-size: 12px; text-align: right; line-height: 1.35; }
.brand .who strong { display: block; font-weight: 600; color: #fff; font-size: 13px; }
.brand a.small { color: #fff; opacity: .85; font-size: 12px; }

nav.tabs { display: flex; gap: 2px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  appearance: none; border: 0; background: none; color: rgb(255 255 255 / .7);
  font: 600 13px var(--font-brand);
  padding: 11px 12px; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer;
}
nav.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--am-cyan); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--am-cyan); color: var(--am-navy); font-size: 11px; line-height: 20px; text-align: center; margin-left: 4px; font-weight: 700; }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 96px; }

/* ---- Tarjetas ---- */
.banner { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--am-cyan); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.banner strong { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.banner p { margin: 0 0 10px; color: var(--muted); font: 14px/1.45 var(--font-text); }
.banner p:last-child { margin-bottom: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.card.highlight { border-color: var(--am-cyan); box-shadow: 0 0 0 1px var(--am-cyan); }
.card.urgent { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.card h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; font-weight: 700; }
.card .when { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.card .where { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card details { margin: 8px 0 4px; }
.card summary { cursor: pointer; color: var(--am-cyan); font-size: 13px; font-weight: 600; }
.card .desc { white-space: pre-wrap; font: 15px/1.5 var(--font-text); margin-top: 8px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.status { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.wait { background: rgb(102 194 206 / .15); color: var(--am-cyan); }
.status.off { background: var(--surface-2); color: var(--muted); }
.status.danger { background: var(--danger-bg); color: var(--danger); }

/* ---- Botones ---- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: 600 13px var(--font-brand); border-radius: 12px; padding: 12px 16px; cursor: pointer;
  min-height: 46px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--am-cyan); border-color: var(--am-cyan); color: var(--am-navy); }
.btn.blue { background: var(--am-blue); border-color: var(--am-blue); color: #fff; }
.btn.ok { background: var(--am-cyan); border-color: var(--am-cyan); color: var(--am-navy); }
.btn.ghost { background: none; }
.btn.danger { color: var(--danger); background: none; border-color: rgb(255 122 133 / .4); }
.btn.grow { flex: 1; }
.btn:disabled { opacity: .5; cursor: default; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 13px; }
.empty .big { font-size: 38px; margin-bottom: 10px; }

/* ---- Formularios ---- */
form.grid { display: grid; gap: 12px; }
form.grid .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
label.f { display: grid; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
input, textarea, select {
  font: 16px var(--font-text); color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--am-cyan); outline-offset: 1px; }
textarea { min-height: 110px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset legend { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.checks input { width: auto; margin: 0; accent-color: var(--am-cyan); }
.check-urgent { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--danger); }
.check-urgent input { width: auto; accent-color: var(--danger); }

.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 10px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- Fichaje ---- */
.clock-hero {
  background: var(--grad); border-radius: 22px; padding: 22px 18px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 10px 30px rgb(12 70 144 / .35);
}
.clock-hero .time { font-size: 46px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock-hero .date { color: rgb(255 255 255 / .8); font-size: 12px; margin-top: 4px; }
.clock-hero .state { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: rgb(0 0 0 / .25); padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.working { background: var(--ok); box-shadow: 0 0 0 4px rgb(95 212 161 / .25); }
.dot.paused { background: var(--warn); }
.clock-btns { display: grid; gap: 10px; margin: 14px 0; }
.clock-btns .btn { min-height: 64px; font-size: 16px; border-radius: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.stat.link { cursor: pointer; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
table.data td { padding: 9px 6px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; vertical-align: top; }
.table-wrap { overflow-x: auto; }

.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  border-radius: 999px; padding: 14px 20px; box-shadow: 0 8px 24px rgb(0 0 0 / .45); z-index: 6;
}

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--am-white); color: var(--am-navy); padding: 12px 18px; border-radius: 12px; font: 600 13px var(--font-brand);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 20; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.login { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--grad); }
.login .inner { max-width: 380px; }
.login img { height: 70px; margin-bottom: 26px; }
.login h1 { font-size: 20px; margin: 0 0 12px; }
.login p { color: rgb(255 255 255 / .85); font: 15px/1.5 var(--font-text); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Imágenes, solicitudes, cuenta atrás ---- */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 5px 10px; border-radius: 999px; }
.req-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.req-status.pending { color: var(--warn); } .req-status.approved, .req-status.resolved { color: var(--ok); } .req-status.rejected { color: var(--danger); }
.reply { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font: 14px/1.45 var(--font-text); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.seg input { display: none; }
.seg label:has(input:checked) { border-color: var(--am-cyan); background: rgb(102 194 206 / .15); }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stats.three .n { font-size: 17px; }
.map { height: 260px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--border); }
.entry-edit { color: var(--am-cyan); cursor: pointer; text-decoration: underline dotted; }
.void { text-decoration: line-through; opacity: .5; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); }
.pill.travel { background: rgb(255 210 122 / .15); color: var(--warn); }
.pill.working { background: var(--ok-bg); color: var(--ok); }

/* ---- Diseño tipo app: barra de pestañas inferior, letra más grande ---- */
body { font-size: 16px; }
header.top { padding-bottom: 14px; }
.card h3 { font-size: 17px; }
.card .when { font-size: 14px; }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; margin: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; overflow: visible;
  background: rgb(16 16 31 / .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
nav.tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 2px; border: 0; border-radius: 14px; position: relative;
  font: 600 10.5px/1.1 var(--font-brand); color: var(--muted); white-space: nowrap;
}
nav.tabs button .ic { font-size: 23px; line-height: 1; filter: grayscale(.6); opacity: .8; }
nav.tabs button[aria-selected="true"] { color: #fff; background: rgb(102 194 206 / .16); border-bottom: 0; }
nav.tabs button[aria-selected="true"] .ic { filter: none; opacity: 1; }
nav.tabs .badge { position: absolute; top: 1px; left: calc(50% + 6px); margin: 0; min-width: 18px; line-height: 18px; font-size: 10px; }
main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.fab { bottom: calc(88px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(96px + env(safe-area-inset-bottom)); }


/* =====================================================================
   ORDENADOR (≥ 900 px): menú lateral fijo, cabecera superior y contenido en columnas.
   En móvil se mantiene la barra de pestañas inferior.
   ===================================================================== */
@media (min-width: 900px) {
  :root { --side: 236px; }
  body { font-size: 15px; }

  /* Menú lateral */
  nav.tabs {
    top: 0; bottom: 0; left: 0; right: auto; width: var(--side); transform: none;
    display: flex; flex-direction: column; gap: 4px; padding: 96px 14px 24px;
    border-top: 0; border-right: 1px solid var(--border); border-radius: 0;
    background: linear-gradient(180deg, var(--am-navy) 0%, #12163a 100%);
  }
  nav.tabs::before {
    content: ""; position: absolute; top: 26px; left: 22px; width: 64px; height: 30px;
    background: url(/am-iso.png) left center / contain no-repeat;
  }
  nav.tabs button {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px;
    font-size: 13px; text-align: left; border-radius: 12px;
  }
  nav.tabs button:hover { background: rgb(255 255 255 / .05); color: #fff; }
  nav.tabs button .ic { font-size: 19px; width: 24px; text-align: center; }
  nav.tabs button[aria-selected="true"] { background: rgb(102 194 206 / .16); box-shadow: inset 3px 0 0 var(--am-cyan); }
  nav.tabs .badge { position: static; margin-left: auto; }

  /* Cabecera y contenido desplazados a la derecha del menú */
  header.top { margin-left: var(--side); padding: 18px 32px; }
  .brand .logo { height: 34px; }
  .brand .who { font-size: 13px; }
  .brand .who strong { font-size: 15px; }
  main { margin-left: var(--side); max-width: 1240px; padding: 28px 32px 60px; }
  .fab { right: 32px; bottom: 32px; }
  .toast { bottom: 32px; left: calc(50% + var(--side) / 2); }

  /* Listas de tarjetas en columnas (encargos, solicitudes, equipo…) */
  #view { columns: 2 440px; column-gap: 18px; }
  #view > * { break-inside: avoid; }
  #view > .stats, #view > .section-title, #view > .empty, #view > .clock-hero, #view > .clock-btns,
  #view > p, #view > .actions, #view > div:not(.card):not(.stats) { column-span: all; }
  .card { margin-bottom: 18px; }
  .banner { margin-bottom: 20px; }

  /* Métricas en una fila */
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
  .stats.three { grid-template-columns: repeat(3, 1fr); }
  .stat .n { font-size: 26px; }

  /* Pantalla de fichar: reloj y botones lado a lado */
  .clock-hero { padding: 34px; }
  .clock-hero .time { font-size: 64px; }
  .clock-btns { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

  /* Tablas y formularios con más aire */
  table.data { font-size: 13px; }
  .thumbs img { width: 110px; height: 110px; }
  .map { height: 340px; }
  .login .inner { max-width: 440px; }
}

/* Pantallas muy anchas: tres columnas */
@media (min-width: 1500px) {
  #view { columns: 3 400px; }
}

/* =====================================================================
   VISTA EN LISTA: filas compactas que se despliegan
   ===================================================================== */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; margin-bottom: 18px; }
.list-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 4px 10px; }
.list-title h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0; font-weight: 600; }
.list-title span { font-size: 12px; color: var(--muted); }
details.item { border-bottom: 1px solid var(--border); }
details.item:last-child { border-bottom: 0; }
details.item > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 64px; transition: background .15s;
}
details.item > summary::-webkit-details-marker { display: none; }
details.item > summary:hover { background: rgb(255 255 255 / .03); }
details.item[open] > summary { background: rgb(102 194 206 / .07); }
.item-ic {
  flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.item.urgent .item-ic { background: var(--danger-bg); border-color: rgb(255 122 133 / .4); }
.item.mine .item-ic { background: var(--ok-bg); border-color: rgb(95 212 161 / .35); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.item > summary .status { margin: 0; flex: 0 0 auto; font-size: 10px; padding: 4px 9px; }
.chev { flex: 0 0 auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 2px; transition: transform .2s; }
details.item[open] .chev { transform: rotate(225deg); margin-bottom: -2px; }
.item-body { padding: 4px 16px 16px 68px; }
.item-body .when { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; font-size: 13px; margin: 6px 0; }
.item-body .where { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.item-body .desc { white-space: pre-wrap; font: 14px/1.5 var(--font-text); margin-top: 8px; overflow-wrap: anywhere; }
.item-body .actions { margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
@media (max-width: 899px) {
  .item-body { padding: 2px 14px 14px; }
  details.item > summary { padding: 12px 14px; gap: 10px; }
  .item-ic { flex-basis: 36px; height: 36px; font-size: 17px; }
}
@media (min-width: 900px) {
  /* En ordenador las listas ocupan una sola columna ancha */
  #view { columns: auto; max-width: 1000px; }
}
@media (min-width: 1500px) { #view { columns: auto; } }
/* Títulos de fila en dos líneas para que se lean enteros */
.item-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 899px) {
  details.item > summary .status { font-size: 9px; padding: 3px 7px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.clock-btn { flex-direction: column; gap: 3px; }
.clock-btn small { font: 500 11px var(--font-text); opacity: .75; }

/* ---- Hoja inferior (gastos al terminar la jornada) ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-wrap.show { background: rgb(0 0 0 / .55); }
.sheet {
  width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s ease-out;
}
.sheet-wrap.show .sheet { transform: none; }
.sheet h3 { margin: 0 0 8px; font-size: 18px; }
.ticket-preview { display: block; max-width: 100%; max-height: 220px; margin: 10px auto; border-radius: 12px; border: 1px solid var(--border); }
@media (min-width: 900px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }

/* =====================================================================
   TEMA CLARO TIPO PANEL (inspirado en los paneles de RR. HH.)
   Fondo gris muy suave, tarjetas blancas con sombra ligera, menú lateral blanco.
   Mantiene los colores de AM Produccions como acentos.
   ===================================================================== */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --border: #e6e9f2;
  --text: #1c1f33;
  --muted: #6b7290;
  --am-cyan: #17808f;          /* turquesa de marca, algo más oscuro para leerse sobre blanco */
  --am-cyan-soft: #66c2ce;
  --ok: #1e9b61;   --ok-bg: #e4f6ec;
  --warn: #b26b00; --warn-bg: #fff2dc;
  --danger: #d23c56; --danger-bg: #fde8ec;
  --green: #3fb873;
  --shadow: 0 1px 2px rgb(20 20 42 / .04), 0 6px 20px rgb(20 20 42 / .06);
  --radius: 16px;
  color-scheme: light;
}
body { background: var(--bg); color: var(--text); font-family: var(--font-text); }
h1, h2, h3 { font-family: var(--font-text); font-weight: 700; }

/* Cabecera blanca */
header.top { background: rgb(255 255 255 / .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.brand .logo { filter: brightness(0) invert(.12); height: 26px; }
.brand .who { color: var(--muted); }
.brand .who strong { color: var(--text); }
.brand a.small { color: var(--am-blue); opacity: 1; font-weight: 600; }

/* Tarjetas y listas */
.card, .list, .stat { background: var(--surface); border: 1px solid #edf0f6; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; font-weight: 700; }
.banner { background: #eef6f8; border: 1px solid #d6ecef; border-left: 4px solid var(--am-cyan-soft); }
.banner p { color: #4a5270; }
.chip, .pill, .item-ic, .checks label, .seg label { background: var(--surface-2); border-color: var(--border); }
.section-title, .list-title h2 { color: #8a90aa; }
details.item > summary:hover { background: #f8f9fc; }
details.item[open] > summary { background: #f2f7fb; }
.item.urgent .item-ic { background: var(--danger-bg); border-color: #f6c5cf; }
.item.mine .item-ic { background: var(--ok-bg); border-color: #bfe8d2; }
.stat .n { color: var(--am-navy); }
.stat.link:hover { box-shadow: 0 2px 4px rgb(20 20 42 / .05), 0 10px 26px rgb(12 70 144 / .10); }
.reply { background: var(--surface-2); }

/* Botones */
.btn { background: #fff; border-color: #dfe3ee; color: var(--text); font-family: var(--font-text); font-weight: 600; font-size: 14px; border-radius: 10px; }
.btn:hover { filter: brightness(.98); }
.btn.primary, .btn.blue { background: var(--am-blue); border-color: var(--am-blue); color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #f3c0ca; background: #fff; }
.badge { background: var(--am-blue); color: #fff; }
.status.wait { background: #e3f3f5; color: var(--am-cyan); }

/* Formularios */
input, textarea, select { background: #fff; border-color: #dfe3ee; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid rgb(12 70 144 / .35); border-color: var(--am-blue); }
.checks input, .seg input { accent-color: var(--am-blue); }
.seg label:has(input:checked) { border-color: var(--am-blue); background: #e8eef8; color: var(--am-blue); }

/* Bloques de marca que siguen en oscuro: el texto va en blanco */
.clock-hero, .login { color: #fff; }
.clock-hero { box-shadow: 0 10px 30px rgb(12 70 144 / .22); }
.login input { background: rgb(255 255 255 / .95); }
.toast { background: var(--am-navy); color: #fff; font-family: var(--font-text); }
.sheet { background: #fff; border-color: var(--border); }
.sheet-wrap.show { background: rgb(20 20 42 / .45); }
table.data th { color: #8a90aa; }

/* Barra inferior (móvil) */
nav.tabs { background: rgb(255 255 255 / .96); border-top: 1px solid var(--border); }
nav.tabs button { color: #8a90aa; font-family: var(--font-text); font-size: 11px; }
nav.tabs button .ic { filter: grayscale(1); opacity: .65; }
nav.tabs button[aria-selected="true"] { color: var(--am-blue); background: #e9effa; }

/* Saludo y tablero (Inicio del panel) */
.hello { display: flex; align-items: center; gap: 16px; margin: 4px 2px 20px; }
.hello-av { flex: 0 0 56px; height: 56px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; color: #fff; font: 700 20px var(--font-brand); }
.hello-date { color: var(--am-blue); font-size: 13px; font-weight: 600; text-transform: capitalize; }
.hello h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.hello .sub { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.dash { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.dash .card { margin: 0; padding: 20px; }
.dash .card h3 { margin-bottom: 12px; }
.who-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef0f5; }
.who-row:last-child { border-bottom: 0; padding-bottom: 0; }
.who-dot { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #f2f4f9; display: grid; place-items: center; }
.who-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.who-l { font-size: 14px; font-weight: 600; }
.who-n { font-size: 12px; color: var(--muted); line-height: 1.45; }
.who-n a { color: var(--am-cyan); }
.alert-row { padding: 10px 0; border-bottom: 1px solid #eef0f5; font-size: 13px; }
.alert-row:last-child { border-bottom: 0; }

@media (min-width: 900px) {
  nav.tabs { background: #fff; border-right: 1px solid var(--border); padding-top: 92px; }
  nav.tabs::before { filter: brightness(0) invert(.12); }
  nav.tabs button { color: #4f5672; font-size: 14px; font-weight: 500; }
  nav.tabs button:hover { background: #f4f6fb; color: var(--text); }
  nav.tabs button .ic { filter: grayscale(1); opacity: .6; }
  nav.tabs button[aria-selected="true"] { background: #e9effa; color: var(--am-blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--am-blue); }
  nav.tabs button[aria-selected="true"] .ic { filter: none; opacity: 1; }
  header.top { padding: 14px 32px; }
  .hello h1 { font-size: 30px; }
  #view:has(.dash) { max-width: 1240px; }
}
@media (min-width: 900px) { header.top .brand .logo { visibility: hidden; } }

/* =====================================================================
   ESTÉTICA iOS — fondo de sistema, listas agrupadas, títulos grandes,
   barras translúcidas, controles segmentados y hojas con tirador.
   ===================================================================== */
:root {
  --tint: #0a5ad4;                       /* azul AM más luminoso, como color de acento iOS */
  --tint-bg: rgb(10 90 212 / .11);
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #f2f2f7;
  --border: rgb(60 60 67 / .14); --sep: rgb(60 60 67 / .18);
  --text: #000; --muted: rgb(60 60 67 / .6);
  --ok: #248a3d; --ok-bg: rgb(52 199 89 / .15);
  --warn: #c76a00; --warn-bg: rgb(255 149 0 / .15);
  --danger: #ff3b30; --danger-bg: rgb(255 59 48 / .12);
  --green: #34c759;
  --am-cyan: var(--tint);
  --radius: 12px;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}
body { font: 17px/1.35 var(--font-text); letter-spacing: -0.01em; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: var(--font-display); }

/* Barra de navegación translúcida */
header.top { background: rgb(249 249 249 / .82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); padding-bottom: 10px; }
.brand a.small { color: var(--tint); font-size: 15px; font-weight: 400; }
.brand .who { font-size: 12px; }
.brand .who strong { font-size: 15px; font-weight: 600; }

/* Título grande de cada pantalla */
.large-title { font: 700 34px/1.12 var(--font-display); letter-spacing: .01em; margin: 6px 4px 14px; }
.large-title:empty { display: none; }

/* Listas agrupadas (como Ajustes) */
.card, .list, .stat { border: 0; box-shadow: none; border-radius: var(--radius); background: var(--surface); }
.card { padding: 14px 16px; }
.card h3 { font-size: 17px; font-weight: 600; }
.list-title { margin: 22px 16px 7px; }
.list-title h2, .section-title { font: 400 13px var(--font-text); text-transform: uppercase; letter-spacing: 0; color: var(--muted); }
.section-title { margin: 22px 16px 7px; }
details.item { border-bottom: 0; position: relative; }
details.item + details.item::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--sep); }
details.item > summary { min-height: 56px; padding: 10px 14px; gap: 12px; }
details.item > summary:hover { background: transparent; }
details.item > summary:active, details.item[open] > summary { background: rgb(60 60 67 / .06); }
.item-ic { flex: 0 0 34px; height: 34px; border-radius: 8px; border: 0; font-size: 18px; background: var(--surface-2); }
.item.mine .item-ic { background: rgb(52 199 89 / .18); border: 0; }
.item.urgent .item-ic { background: rgb(255 59 48 / .15); border: 0; }
.item-title { font-size: 17px; font-weight: 400; }
.item-sub { font-size: 14px; }
.chev { width: 8px; height: 8px; border-color: rgb(60 60 67 / .3); border-width: 0 2px 2px 0; transform: rotate(-45deg); margin: 0 2px; }
details.item[open] .chev { transform: rotate(45deg); margin: 0 2px 4px; }
.item-body { padding: 2px 16px 16px 62px; }
@media (max-width: 899px) { .item-body { padding: 2px 14px 14px; } }
.kv dt { color: var(--muted); }
.timeline li { border-bottom: .5px solid var(--sep); font-size: 15px; }
.who-row, .alert-row { border-bottom: .5px solid var(--sep); }

/* Estados tipo iOS */
.status { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; }
details.item > summary .status { font-size: 12px; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.wait { background: var(--tint-bg); color: var(--tint); }
.status.danger { background: var(--danger-bg); color: var(--danger); }
.status.off { background: rgb(118 118 128 / .12); color: var(--muted); }
.chip, .pill { background: rgb(118 118 128 / .12); border: 0; font-weight: 500; }
.badge { background: var(--danger); color: #fff; font-weight: 600; }

/* Botones iOS: rellenos, tintados y destructivos */
.btn { font: 600 17px var(--font-text); letter-spacing: -0.01em; border: 0; border-radius: 12px; min-height: 50px; padding: 12px 18px; background: var(--tint-bg); color: var(--tint); }
.btn:hover { filter: none; }
.btn:active { opacity: .7; transform: none; }
.btn.primary, .btn.blue { background: var(--tint); color: #fff; }
.btn.ok { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; color: var(--tint); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border: 0; }
.item-body .btn, .card .actions .btn, .dash .btn { min-height: 40px; font-size: 15px; padding: 9px 14px; border-radius: 10px; }
.fab { border-radius: 999px; box-shadow: 0 6px 20px rgb(10 90 212 / .35); }

/* Campos */
input, textarea, select { font: 17px var(--font-text); background: var(--surface); border: .5px solid var(--sep); border-radius: 10px; padding: 11px 12px; }
.card input, .card select, .card textarea, .item-body input, .item-body select, .item-body textarea, .sheet input, .sheet select, .sheet textarea { background: var(--surface-2); border: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgb(10 90 212 / .45); outline-offset: 0; border-color: transparent; }
label.f, fieldset legend { font: 400 13px var(--font-text); text-transform: none; letter-spacing: 0; color: var(--muted); }
.checks label { background: rgb(118 118 128 / .12); border: 0; font: 500 15px var(--font-text); padding: 8px 13px; }
.checks label:has(input:checked) { background: var(--tint-bg); color: var(--tint); }
.checks input { accent-color: var(--tint); }

/* Control segmentado */
.seg { background: rgb(118 118 128 / .12); padding: 2px; border-radius: 9px; gap: 0; }
.seg label { background: transparent; border: 0; border-radius: 7px; padding: 8px 4px; font: 500 14px var(--font-text); }
.seg label:has(input:checked) { background: #fff; color: var(--text); box-shadow: 0 3px 8px rgb(0 0 0 / .12), 0 3px 1px rgb(0 0 0 / .04); border: 0; }

/* Métricas y reloj */
.stat .n { font: 600 24px var(--font-display); color: var(--text); }
.stat .l { text-transform: none; letter-spacing: 0; font-size: 13px; }
.clock-hero { border-radius: 20px; }
.clock-hero .time { font-family: var(--font-display); font-weight: 600; }
.clock-btns .btn { border-radius: 14px; min-height: 60px; }
.banner { background: var(--surface); border: 0; border-left: 0; border-radius: var(--radius); }
.banner strong { font-size: 15px; }
.reply { background: var(--surface-2); border-radius: 10px; }

/* Hoja inferior con tirador */
.sheet { border: 0; border-radius: 14px 14px 0 0; padding-top: 26px; position: relative; }
.sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: rgb(60 60 67 / .3); }
.toast { background: rgb(30 30 30 / .9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 14px; font: 600 15px var(--font-text); }

/* Barra de pestañas iOS */
nav.tabs { background: rgb(249 249 249 / .86); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); padding: 6px 4px calc(4px + env(safe-area-inset-bottom)); }
nav.tabs button { color: #8e8e93; font: 500 10px var(--font-text); gap: 2px; padding: 3px 2px; background: none; border-radius: 0; }
nav.tabs button .ic { display: grid; place-items: center; height: 28px; filter: none; opacity: 1; }
nav.tabs button .ic svg { width: 27px; height: 27px; }
nav.tabs button[aria-selected="true"] { color: var(--tint); background: none; box-shadow: none; }
nav.tabs .badge { top: 0; left: calc(50% + 8px); }

/* Ordenador / iPad: barra lateral estilo iPadOS */
@media (min-width: 900px) {
  nav.tabs { background: #f2f2f7; border-top: 0; border-right: .5px solid var(--sep); padding: 92px 12px 24px; gap: 2px; }
  nav.tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 9px 12px; border-radius: 10px; font: 400 16px var(--font-text); color: var(--text); }
  nav.tabs button .ic { height: auto; color: var(--tint); }
  nav.tabs button .ic svg { width: 22px; height: 22px; }
  nav.tabs button:hover { background: rgb(118 118 128 / .1); color: var(--text); }
  nav.tabs button[aria-selected="true"] { background: var(--tint); color: #fff; box-shadow: none; font-weight: 600; }
  nav.tabs button[aria-selected="true"] .ic { color: #fff; }
  nav.tabs button[aria-selected="true"] .badge { background: #fff; color: var(--tint); }
  header.top { background: rgb(255 255 255 / .8); }
  .large-title { margin-top: 0; }
  .dash .card { padding: 18px 20px; }
}

/* ---- Semana / barra del día ---- */
.tbar { position: relative; height: 22px; border-radius: 6px; background: rgb(118 118 128 / .1); overflow: hidden; min-width: 120px; }
.tbar i { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgb(60 60 67 / .18); }
.tseg { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; display: inline-block; }
.tseg.work { background: var(--tint); }
.tseg.travel { background: #ff9f0a; }
.tseg.pause { background: rgb(142 142 147 / .55); }
.tseg.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.tlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
.tlegend span { display: inline-flex; align-items: center; gap: 5px; }
.tlegend .tseg { position: static; width: 12px; height: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 0; padding: 8px 10px; font-size: 15px; background: var(--surface); }
.toolbar input[type=search] { flex: 1 1 160px; }
.weeknav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 10px; padding: 3px; }
.weeknav button { appearance: none; border: 0; background: none; color: var(--tint); font: 600 18px var(--font-text); width: 34px; height: 32px; border-radius: 8px; cursor: pointer; }
.weeknav button:active { background: var(--tint-bg); }
.weeknav span { font: 600 15px var(--font-text); padding: 0 8px; white-space: nowrap; }
.seg.views { display: inline-grid; grid-template-columns: repeat(3, auto); width: auto; }
.seg.views label { padding: 7px 14px; }
.wgrid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.wgrid th { font: 500 12px var(--font-text); color: var(--muted); text-align: center; padding: 10px 6px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.wgrid th.today { color: var(--tint); }
.wgrid th:first-child, .wgrid td:first-child { text-align: left; padding-left: 14px; }
.wgrid td { padding: 9px 6px; border-bottom: .5px solid var(--sep); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wgrid tr:last-child td { border-bottom: 0; }
.wgrid tbody tr { cursor: pointer; }
.wgrid tbody tr:hover td { background: rgb(118 118 128 / .05); }
.wgrid .cell { display: inline-flex; flex-direction: column; align-items: center; min-width: 46px; padding: 4px 6px; border-radius: 8px; line-height: 1.15; }
.wgrid .cell.on { background: var(--tint-bg); color: var(--tint); font-weight: 600; }
.wgrid .cell.live { background: rgb(52 199 89 / .16); color: var(--ok); }
.wgrid .cell small { font-size: 10.5px; font-weight: 500; color: #c76a00; }
.wgrid .tot { font-weight: 700; }
.wgrid .who { display: flex; align-items: center; gap: 10px; }
.wgrid tfoot td { font-weight: 600; background: var(--surface-2); }
.av { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font-text); color: #fff; background: var(--c, #8e8e93); }
.wwrap { overflow-x: auto; border-radius: var(--radius); margin-bottom: 14px; }
.dayrows { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.dayrow { display: grid; grid-template-columns: minmax(150px, 220px) 74px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: .5px solid var(--sep); cursor: pointer; }
.dayrow:last-child { border-bottom: 0; }
.dayrow .h { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.dayaxis { display: grid; grid-template-columns: minmax(150px, 220px) 74px 1fr; gap: 12px; padding: 8px 14px 0; font-size: 11px; color: var(--muted); }
.dayaxis div:last-child { display: flex; justify-content: space-between; }
.chipf { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgb(118 118 128 / .12); font-size: 12px; font-weight: 500; margin: 2px 4px 2px 0; }
.chipf button { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 0 0 2px; }
/* Mi semana (trabajador) */
.myweek { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.myday { display: grid; grid-template-columns: 54px 1fr 58px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: .5px solid var(--sep); }
.myday:last-child { border-bottom: 0; }
.myday .d { font-size: 13px; line-height: 1.15; color: var(--muted); } .myday .d b { display: block; font-size: 17px; color: var(--text); }
.myday.today .d b { color: var(--tint); }
.myday .h { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
@media (max-width: 899px) {
  .dayrow, .dayaxis { grid-template-columns: 1fr 60px; }
  .dayrow .tbar, .dayaxis div:last-child { grid-column: 1 / -1; }
  .dayaxis div:first-child, .dayaxis div:nth-child(2) { display: none; }
}
.item-ic:has(.av) { background: none; }
.item-ic .av { flex-basis: 34px; height: 34px; font-size: 12px; }
/* ---- Mapa en directo ---- */
.live-grid { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; margin-bottom: 10px; }
.map.live { height: min(68vh, 640px); margin: 0; border: 0; border-radius: var(--radius); }
#live-list { max-height: min(68vh, 640px); overflow: auto; margin: 0; }
#live-list .who-row { gap: 10px; align-items: center; }
.livepin { width: 38px; height: 38px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 13px var(--font-text); border: 3px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
.livepin.moving { animation: livepulse 1.8s ease-out infinite; }
.livepin.stale { opacity: .55; filter: grayscale(.6); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgb(255 159 10 / .6), 0 2px 8px rgb(0 0 0 / .35); } 100% { box-shadow: 0 0 0 16px rgb(255 159 10 / 0), 0 2px 8px rgb(0 0 0 / .35); } }
@media (max-width: 899px) { .live-grid { grid-template-columns: 1fr; } .map.live { height: 52vh; } .seg.views { grid-template-columns: repeat(2, auto); } }
.seg.views { grid-template-columns: repeat(4, auto); }
@media (max-width: 899px) { .seg.views { grid-template-columns: repeat(2, auto); } }
.av { width: 32px; }
.item-ic .av { width: 34px; }
@media (max-width: 899px) { nav.tabs button { font-size: 9.5px; letter-spacing: -0.02em; } nav.tabs button .ic svg { width: 25px; height: 25px; } }
.dayents, .dayaudit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.dayaudit { font-size: 12px; color: var(--muted); display: block; }
.ent { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgb(118 118 128 / .1); white-space: nowrap; }
.ent b { font-variant-numeric: tabular-nums; } .ent i { font-style: normal; color: var(--warn); }
.ent.travel { background: rgb(255 159 10 / .14); } .ent.in, .ent.resume { background: var(--tint-bg); } .ent.out { background: rgb(52 199 89 / .14); } .ent.km { background: none; color: var(--muted); }
/* ---- Tutorial guiado y ayuda ---- */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgb(0 0 0 / .55); transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; background: #fff; border-radius: 16px; padding: 18px 18px 14px; box-shadow: 0 12px 40px rgb(0 0 0 / .3); transition: top .25s, left .25s; }
.tour-card h3 { margin: 4px 0 6px; font-size: 19px; }
.tour-card p { margin: 0; font-size: 15px; line-height: 1.45; color: #3a3a3c; }
.tour-step { font-size: 12px; color: var(--muted); font-weight: 600; }
.tour-dots { display: flex; gap: 5px; justify-content: center; margin: 14px 0 10px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgb(60 60 67 / .2); }
.tour-dots i.on { background: var(--tint); width: 16px; border-radius: 3px; }
.tour-btns { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-btns span { display: flex; gap: 6px; }
.tour-btns .btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.help-btn { appearance: none; border: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--tint-bg); color: var(--tint); font: 700 17px var(--font-text); cursor: pointer; flex: 0 0 32px; }
.help-btn:active { opacity: .7; }
.brand { gap: 10px; }
.help-opts { display: grid; gap: 8px; margin-top: 8px; }
.help-opt { appearance: none; border: 0; text-align: left; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: var(--text); }
.help-opt b { font-size: 16px; } .help-opt span { font-size: 13px; color: var(--muted); }
.chat { max-height: 50vh; min-height: 160px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.4; }
.bubble.assistant { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.user { background: var(--tint); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble.sys { align-self: center; font-size: 13px; color: var(--muted); background: none; text-align: center; }
.bubble.typing { opacity: .6; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { min-height: 44px; flex: 1; resize: none; }
.chat-form .btn { min-height: 44px; }
/* ---- Campanita ---- */
.bell-btn { position: relative; appearance: none; border: 0; background: none; color: var(--tint); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: 0 0 36px; }
.bell-btn svg { width: 25px; height: 25px; }
.bell-btn:active { background: var(--tint-bg); }
.bell-n { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font-text); text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.brand-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.notif { appearance: none; border: 0; width: 100%; text-align: left; background: none; font: inherit; color: var(--text); display: flex; gap: 10px; padding: 11px 14px; border-bottom: .5px solid var(--sep); cursor: pointer; }
.notif:last-child { border-bottom: 0; }
.notif-dot { flex: 0 0 9px; height: 9px; margin-top: 6px; border-radius: 50%; }
.notif.unread .notif-dot { background: var(--tint); }
.notif-main { display: grid; gap: 1px; } .notif-main b { font-size: 15px; font-weight: 500; } .notif.unread .notif-main b { font-weight: 700; }
.notif-main span { font-size: 13px; color: var(--muted); } .notif-main i { font-style: normal; font-size: 12px; color: var(--muted); }
/* ---- Modo vacaciones ---- */
.vac-hero { background: linear-gradient(135deg, #30b0c7, #5ac8fa 60%, #ffd60a 140%); color: #fff; border-radius: 20px; padding: 26px 20px; text-align: center; margin-bottom: 14px; }
.vac-hero .big { font-size: 54px; line-height: 1; } .vac-hero h2 { margin: 10px 0 4px; font-size: 24px; } .vac-hero p { margin: 0; opacity: .95; }
.vac-chip { display: inline-block; font-size: 11px; font-weight: 700; color: #0b7285; background: #e3f6f9; border-radius: 999px; padding: 2px 8px; margin-top: 2px; }
.bell-n { top: -3px; right: -5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; border-width: 1.5px; }
@media (max-width: 899px) { .brand .who { font-size: 11px; max-width: 34vw; } .brand .who strong { font-size: 14px; } .brand .who span { display: none; } .brand .who .vac-chip { display: inline-block; } }
.act-pick { margin: 0 0 10px; }
.act-seg { grid-template-columns: repeat(4, 1fr); }
.act-seg label { font-size: 13px; padding: 9px 2px; }
@media (max-width: 480px) { .act-seg { grid-template-columns: 1fr 1fr; gap: 2px; } }
/* ---- Cambios masivos ---- */
.sel-day, .sel-ent, .sel-user, #sel-all { width: 18px; height: 18px; accent-color: var(--tint); vertical-align: middle; margin: 0 2px 0 0; }
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 25; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  background: rgb(30 30 30 / .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; padding: 8px 10px; border-radius: 16px; max-width: calc(100vw - 20px); box-shadow: 0 10px 30px rgb(0 0 0 / .3); }
.bulk-bar .btn { min-height: 36px; padding: 6px 11px; font-size: 14px; background: rgb(255 255 255 / .12); color: #fff; }
.bulk-bar .btn.danger { background: rgb(255 59 48 / .85); }
.bulk-n { font-weight: 600; font-size: 14px; padding: 0 6px; }
.undo-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 12px; align-items: center; background: rgb(30 30 30 / .94); color: #fff; padding: 10px 12px 10px 16px; border-radius: 14px; font: 500 14px var(--font-text); max-width: calc(100vw - 24px); box-shadow: 0 10px 30px rgb(0 0 0 / .3); }
.undo-toast button { appearance: none; border: 0; background: var(--tint); color: #fff; font: 600 14px var(--font-text); border-radius: 10px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
@media (min-width: 900px) { .bulk-bar { bottom: 24px; left: calc(50% + var(--side) / 2); } .undo-toast { bottom: 90px; left: calc(50% + var(--side) / 2); } }
/* ---- Chat ---- */
.chat-sheet { height: min(92vh, 860px); display: flex; flex-direction: column; }
.chat-sheet .chat-list { overflow: auto; flex: 1; }
.chat-row { appearance: none; border: 0; width: 100%; background: none; font: inherit; color: var(--text); display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: .5px solid var(--sep); cursor: pointer; text-align: left; }
.chat-row:last-child { border-bottom: 0; }
.chat-av { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--tint-bg); display: grid; place-items: center; font-size: 19px; }
.chat-main { flex: 1; min-width: 0; display: grid; } .chat-main b { font-size: 16px; font-weight: 600; } .chat-main span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: grid; justify-items: end; gap: 3px; } .chat-meta i { font-style: normal; font-size: 12px; color: var(--muted); }
.chat-meta em { font-style: normal; background: var(--tint); color: #fff; border-radius: 10px; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.chat-head { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: .5px solid var(--sep); }
.chat-title { flex: 1; min-width: 0; display: grid; } .chat-title b { font-size: 16px; } .chat-title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-msgs { flex: 1; max-height: none; min-height: 0; }
.chat-msgs .bubble { position: relative; padding-bottom: 16px; }
.chat-msgs .bubble i { position: absolute; right: 10px; bottom: 3px; font-size: 10.5px; font-style: normal; opacity: .65; }
.chat-msgs .bubble.sys { padding-bottom: 4px; } .chat-msgs .bubble .who { display: block; font-size: 12px; color: var(--tint); margin-bottom: 1px; }
.chat-msgs .bubble img { display: block; max-width: 220px; max-height: 240px; border-radius: 12px; margin: 2px 0 4px; }
.chat-sheet .chat-form { padding-top: 8px; border-top: .5px solid var(--sep); }
.chat-sheet .chat-form textarea { min-height: 42px; max-height: 120px; border-radius: 21px; padding: 10px 14px; }
.chat-sheet .chat-form .btn { min-height: 42px; border-radius: 21px; padding: 8px 14px; }
.chat-photo { cursor: pointer; font-size: 18px; }
html, body { overflow-x: hidden; }
.brand { min-width: 0; }
.brand .logo { min-width: 0; flex-shrink: 1; }
@media (max-width: 899px) {
  .brand a.small { display: none; }
  .brand .logo { height: 22px; max-width: 42vw; }
  .brand-tools { gap: 0; }
  .help-btn { width: 30px; height: 30px; flex-basis: 30px; font-size: 15px; }
  .bell-btn { width: 34px; height: 34px; flex-basis: 34px; }
}
.chat-sheet { max-height: 92vh; overflow: hidden; }
.chat-sheet .chat-msgs { overflow-y: auto; }
.direct-assign { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.direct-assign .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.update-bar { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; background: var(--tint); color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px; display: flex; gap: 10px; align-items: center; font: 600 14px var(--font-text); box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.update-bar button { appearance: none; border: 0; background: #fff; color: var(--tint); font: 700 13px var(--font-text); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
/* ---- Documentos y hoja de trabajo ---- */
.job-extras { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.jx-files { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; align-items: flex-start; }
.jx-file { display: flex; align-items: center; gap: 8px; width: 100%; } .jx-file a { color: var(--tint); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.jx-file .btn { min-height: 28px; padding: 2px 8px; }
.task-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.task-list label { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 15px; }
.task-list input { width: 20px; height: 20px; accent-color: var(--green); margin-top: 1px; flex: 0 0 20px; }
.task-list .done span { text-decoration: line-through; color: var(--muted); }
/* ---- Estado del sistema, propuestas y encuestas ---- */
.status-card { position: relative; padding-left: 40px !important; }
.status-card h3 { margin: 0 0 6px; font-size: 15px; }
.light { position: absolute; left: 16px; top: 22px; width: 12px; height: 12px; border-radius: 50%; }
.light.ok { background: #34c759; box-shadow: 0 0 0 4px rgb(52 199 89 / .18); } .light.warn { background: #ff9f0a; box-shadow: 0 0 0 4px rgb(255 159 10 / .2); }
.light.bad { background: #ff3b30; box-shadow: 0 0 0 4px rgb(255 59 48 / .2); } .light.off { background: #c7c7cc; }
.props { display: grid; gap: 10px; } .prop { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.sv-q { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; } .sv-q input { flex: 1 1 200px; } .sv-q .btn { min-height: 34px; padding: 4px 10px; }
.sv-res { padding: 8px 0; border-bottom: .5px solid var(--sep); } .sv-res:last-of-type { border-bottom: 0; }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 56px; margin-top: 4px; } .bars span { display: grid; justify-items: center; font-size: 11px; color: var(--muted); width: 22px; }
.bars i { display: block; width: 16px; background: var(--tint); border-radius: 4px 4px 0 0; }
.survey-q { margin-bottom: 14px; } .survey-q .q { font-weight: 600; margin-bottom: 6px; }
.stars { display: flex; gap: 6px; } .stars label { flex: 1; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.stars input { display: none; } .stars label:has(input:checked) { background: var(--tint); color: #fff; }
/* ---- Actualizaciones del encargo ---- */
.upd-box { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.upd-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.upd-list li { background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 15px; border-left: 3px solid var(--tint); }
.upd-list li.from-worker { border-left-color: var(--green); } .upd-list li.unread { box-shadow: 0 0 0 2px var(--tint-bg); }
.upd-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; } .upd-read { font-size: 12px; color: var(--muted); margin-top: 4px; }
.upd-form { display: flex; gap: 8px; align-items: flex-end; } .upd-form textarea { min-height: 42px; flex: 1; } .upd-form .btn { min-height: 42px; }
.upd-dot { color: var(--tint); font-size: 12px; vertical-align: middle; }
/* ---- Nombres completos y textos sin cortar en móvil ---- */
.who-full { font-weight: 600; color: var(--text); }
details.item > summary .item-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
details.item > summary .status { max-width: none !important; white-space: nowrap; }
.item-body select, .card select, .toolbar select { max-width: 100%; }
@media (max-width: 899px) { .item-body select, .item-body .actions select { width: 100%; flex: 1 1 100%; } }
/* ---- Acceso (revisión de diseño) ---- */
.login .inner { width: min(400px, 100%); max-width: 400px; }
.login img { height: 56px; margin-bottom: 18px; }
.login h1 { font-size: 26px; margin: 0 0 8px; }
.login-form { margin-top: 22px; display: grid; gap: 8px; text-align: left; }
.login-label { font: 600 15px var(--font-text); color: #fff; }
.login-form input { text-align: left; font-size: 16px; min-height: 48px; }
.login-form input[aria-invalid="true"] { outline: 2px solid #ffd60a; }
.login-err { margin: 0; color: #ffe69a; font: 500 14px var(--font-text); }
.login-form .btn { min-height: 48px; font-size: 16px; margin-top: 4px; }
.login-link { color: #fff; opacity: .85; font-size: 14px; }
.login { background: linear-gradient(160deg, #14142a 0%, #0c4690 70%, #2a6fb5 100%); padding: 24px 16px; }
/* ---- Botones y foco comunes ---- */
.btn, a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:is(.btn, button, a, input, select, textarea, summary):focus-visible { outline: 3px solid rgb(10 90 212 / .55); outline-offset: 2px; }
.login :is(.btn, a, input):focus-visible { outline: 3px solid #ffd60a; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: progress; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
h1.large-title { font-size: clamp(26px, 6vw, 34px); }
.card h3 { font-size: 18px; }
.desc, .reply, .banner p { line-height: 1.5; }
/* ---- Equipo del encargo ---- */
.team-box { margin-bottom: 8px; }
.team-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; margin: 8px 0 2px; align-items: center; }
.team-m { background: rgb(255 159 10 / .14); border-radius: 999px; padding: 3px 10px; } .team-m.ok { background: var(--ok-bg); } .team-m.self { outline: 2px solid var(--tint-bg); }
button.chipf { border: 0; cursor: pointer; font: 500 13px var(--font-text); color: var(--tint); background: var(--tint-bg); }
/* ---- Redes (publicaciones de Telegram) ---- */
.soc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.soc-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.soc-card.approved { box-shadow: inset 0 0 0 2px rgb(52 199 89 / .5); } .soc-card.rejected { opacity: .6; }
.soc-card img, .soc-noimg { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--surface-2); }
.soc-noimg { display: grid; place-items: center; font-size: 40px; }
.soc-body { padding: 10px 12px; } .soc-text { margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.soc-body select, .soc-body input { padding: 6px 8px; font-size: 14px; } .soc-body .btn { min-height: 34px; padding: 4px 10px; font-size: 14px; }

/* ---- Móvil: marcos que no se pisen ---- */
.rep-full { white-space: normal; word-break: break-word; font-size: 15px; line-height: 1.5; background: var(--fill, rgb(120 120 128 / .08)); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.row > *, .row-between > * { min-width: 0; }
.f input, .f select, .f textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
.f input[type=date], .f input[type=time] { -webkit-appearance: none; appearance: none; width: 100%; }
.upd-form textarea { font-size: 15px; line-height: 1.35; }
.actions { flex-wrap: wrap; }
@media (max-width: 899px) {
  .fab { width: 56px; height: 56px; min-height: 56px; padding: 0; font-size: 0; right: 16px; }
  .fab::before { content: '＋'; font-size: 28px; line-height: 1; }
  main { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
  nav.tabs .lb { font-size: 10px; letter-spacing: -.2px; }
}

.notify-pick { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--fill, rgb(120 120 128 / .08)); }
.notify-pick label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; font-size: 15px; flex-wrap: wrap; }
.notify-pick input { width: auto; margin: 0; }

/* ---- Pantalla «Instala la app» ---- */
#install-gate .inner { max-width: 460px; }
.ig-card { margin-top: 14px; }
.ig-os { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.ig-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 16px; line-height: 1.45; }
.ig-code { display: flex; gap: 8px; align-items: center; }
.ig-code code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--fill, rgb(120 120 128 / .08)); }
#install-gate .ig-card { color: #1c1c1e; background: #fff; text-align: left; }
#install-gate .ig-card p, #install-gate .ig-card li, #install-gate .ig-card b, #install-gate .ig-os { color: #1c1c1e; }
#install-gate .ig-card .muted { color: #6e6e73; }
#install-gate .ig-code code { color: #1c1c1e; background: #f2f2f7; }
#install-gate > .inner > .btn:not(.primary) { background: rgb(255 255 255 / .16); color: #fff; }

/* ---- Menú «⋯» de acciones secundarias ---- */
details.more { position: relative; display: inline-block; }
details.more > summary { list-style: none; min-width: 44px; justify-content: center; font-size: 20px; font-weight: 700; letter-spacing: 1px; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > .more-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / .18), 0 0 0 1px rgb(0 0 0 / .05); }
details.more > .more-list .btn { width: 100%; justify-content: flex-start; text-align: left; background: transparent; box-shadow: none; border: 0; min-height: 44px; font-weight: 500; color: var(--text); }
details.more > .more-list .btn:hover { background: var(--fill, rgb(120 120 128 / .1)); }
details.more > .more-list .danger-text, .btn.danger-text { color: var(--danger) !important; }
@media (max-width: 899px) {
  details.more > .more-list { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); min-width: 0; padding: 8px; border-radius: 18px; }
  details.more[open]::before { content: ''; position: fixed; inset: 0; background: rgb(0 0 0 / .25); z-index: 39; }
}

/* ---- Mejora continua ---- */
.prop-done { opacity: .6; }
.dev-chat { max-height: 420px; min-height: 60px; overflow-y: auto; }
.dev-acts { display: grid; gap: 6px; margin-top: 8px; }
.dev-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; background: rgb(255 255 255 / .6); }
.dev-act .btn { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.dev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dev-list li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
.dev-list li > div { min-width: 0; flex: 1; }

/* Resaltado al llegar desde una notificación */
@keyframes flashIn { 0% { box-shadow: 0 0 0 0 rgb(10 132 255 / .0); background-color: rgb(10 132 255 / .18); } 100% { box-shadow: 0 0 0 0 rgb(10 132 255 / 0); background-color: transparent; } }
.flash { animation: flashIn 2.4s ease-out; border-radius: 12px; }
