:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #ecebe5;
  --ink: #0b0b0b;
  --ink-2: #3a3a37;
  --muted: #74736c;
  --line: #dddbd3;
  --inv: #ffffff;
  --late: #b42318;
  --late-bg: #fbe9e7;
  --soon: #a15c07;
  --soon-bg: #fdf1dc;
  --ok: #2f6b3b;
  --ok-bg: #e6f1e7;
  --info: #24539c;
  --info-bg: #e5edf8;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 20px -12px rgba(0,0,0,.25);
  --mono: 'Space Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d; --surface: #181816; --surface-2: #22221f; --ink: #f2f1ec; --ink-2: #cfcec8;
    --muted: #96958d; --line: #2e2e2a; --inv: #0b0b0b;
    --late: #f08a7c; --late-bg: #3a1714; --soon: #e9b45a; --soon-bg: #33260d;
    --ok: #86c793; --ok-bg: #15291a; --info: #8fb4ef; --info-bg: #142338;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 8px 24px -14px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40vh 0 0; text-align: center; font-family: var(--mono); color: var(--muted); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--inv);
  display: flex; align-items: center; gap: 18px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { height: 22px; width: auto; display: block; }
.brand span { font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  text-decoration: none; padding: 6px 10px; font: 500 14px var(--sans); opacity: .7; border-bottom: 2px solid transparent;
}
.nav a:hover { opacity: 1; }
.nav a.on { opacity: 1; border-color: var(--inv); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.me .who { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.me .who b { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; padding: 1px 5px; margin-left: 6px; opacity: .8; }
.btn-ghost-inv svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.drive-box { border: 1px solid var(--line); background: var(--surface); padding: 12px; }
.drive-box.vacio { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.drive-box.vacio p { margin: 4px 0 0; }
.drive-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.drive-h b { flex: 1 1 200px; font-size: 14px; }
.drive-frame { display: block; width: 100%; height: 60vh; min-height: 320px; max-height: 620px; border: 1px solid var(--line); background: #fff; }
.drive-ayuda { margin: 8px 0 0; }
.buscar { position: relative; margin: 4px 0 18px; }
.buscar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.buscar input { width: 100%; box-sizing: border-box; padding: 12px 12px 12px 40px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0; -webkit-appearance: none; appearance: none; }
.buscar input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
[hidden] { display: none !important; }
.btn-ghost-inv { background: none; border: 1px solid rgba(255,255,255,.35); color: var(--inv); padding: 8px 12px; min-height: 36px; cursor: pointer; font-size: 13px; touch-action: manipulation; }
@media (prefers-color-scheme: dark) { .btn-ghost-inv { border-color: rgba(0,0,0,.35); } }

.demo-bar {
  background: var(--soon-bg); color: var(--soon); font-size: 13px; padding: 8px 16px;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
}
.demo-bar select { background: var(--surface); border: 1px solid var(--line); padding: 3px 6px; color: var(--ink); }
.demo-bar button { background: none; border: 0; text-decoration: underline; cursor: pointer; color: inherit; padding: 0; font-size: 13px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 110px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kicker { font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
h2.sec { font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--inv);
  border: 1px solid var(--ink); padding: 9px 14px; cursor: pointer; text-decoration: none; font-weight: 500; font-size: 14px;
}
.btn:hover { opacity: .88; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); opacity: 1; }
.btn.danger { background: transparent; color: var(--late); border-color: var(--late-bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: wait; }
.icon-btn { background: none; border: 1px solid transparent; width: 34px; height: 34px; cursor: pointer; color: var(--muted); flex: none; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-f { background: transparent; border: 1px solid var(--line); padding: 5px 11px; cursor: pointer; font-size: 13px; }
.chip-f.on { background: var(--ink); color: var(--inv); border-color: var(--ink); }

.tag { display: inline-block; font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag.late { color: var(--late); background: var(--late-bg); border-color: transparent; }
.tag.soon { color: var(--soon); background: var(--soon-bg); border-color: transparent; }
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag.info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.tag.solid { background: var(--ink); color: var(--inv); border-color: var(--ink); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); padding: 16px; text-decoration: none; display: block;
  box-shadow: var(--shadow); transition: border-color .15s;
}
a.card:hover { border-color: var(--ink); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.num { font: 700 13px var(--mono); }
.card h3 { margin: 8px 0 2px; font-size: 18px; letter-spacing: -.01em; line-height: 1.2; }
.sub { color: var(--muted); font-size: 13px; }
.bar { height: 6px; background: var(--surface-2); margin: 14px 0 6px; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.kpis { display: flex; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; flex-wrap: wrap; }
.kpis b { font-family: var(--mono); font-size: 15px; }
.kpis .hot b { color: var(--late); }
.next { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.money-line { margin-top: 6px; font-size: 13px; color: var(--muted); }
.money-line b { color: var(--ink); font-family: var(--mono); font-weight: 400; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; }
.stat .l { font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 700 24px/1.15 var(--mono); margin-top: 10px; letter-spacing: -.02em; word-break: break-word; }
.stat .v.sm { font-size: 16px; font-family: var(--sans); letter-spacing: 0; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Agenda ---------- */
.agenda { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ag { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; text-decoration: none; }
.ag:hover { border-color: var(--ink); }
.ag .date { width: 46px; flex: none; text-align: center; border-right: 1px solid var(--line); padding-right: 10px; }
.ag .date b { display: block; font: 700 20px/1 var(--mono); }
.ag .date span { font: 700 10px var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .1em; }
.ag.late .date b { color: var(--late); }
.ag .txt { min-width: 0; }
.ag .txt div:first-child { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag .txt div:last-child { font-size: 12px; color: var(--muted); }

/* ---------- Obra ---------- */
.obra-h { background: var(--surface); border: 1px solid var(--line); padding: 18px; margin-bottom: 0; }
.obra-h h1 { margin: 6px 0 4px; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.obra-h .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.facts { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.facts b { color: var(--ink); font-weight: 500; }
.tabs {
  display: flex; gap: 0; overflow-x: auto; border: 1px solid var(--line); border-top: 0; background: var(--surface);
  margin-bottom: 18px; scrollbar-width: none; position: sticky; top: 50px; z-index: 10;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { text-decoration: none; padding: 12px 14px; white-space: nowrap; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.tabs a .n { font: 700 10px var(--mono); background: var(--surface-2); color: var(--ink); padding: 2px 5px; margin-left: 5px; }
.tabs a .n.hot { background: var(--late); color: #fff; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px; font-size: 12.5px; color: var(--muted); align-items: center; }
.item.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.state {
  flex: none; width: 92px; padding: 6px 0; border: 1px solid var(--line); background: transparent; cursor: pointer;
  font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.state.s-pendiente { color: var(--late); border-color: var(--late); }
.state.s-pedido { color: var(--soon); border-color: var(--soon); }
.state.s-resuelto, .state.s-cumplida { color: var(--ok); border-color: transparent; background: var(--ok-bg); }
.check {
  flex: none; width: 24px; height: 24px; border: 1.5px solid var(--ink); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px;
}
.check.on { background: var(--ink); color: var(--inv); }
.check svg { width: 14px; height: 14px; }
.due.late { color: var(--late); font-weight: 600; }
.due.soon { color: var(--soon); font-weight: 600; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); background: var(--surface); }

/* timeline */
.tl { position: relative; padding-left: 4px; }
.tl .item { position: relative; }

/* docs */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.doc { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 10px 10px 10px 12px; }
.doc:hover { border-color: var(--ink); }
.doc a.main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; text-decoration: none; }
.doc .ic { width: 40px; height: 40px; flex: none; background: var(--ink); color: var(--inv); display: grid; place-items: center; font: 700 11px var(--mono); }
.doc .tt { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .mm { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* money */
.money-card { background: var(--ink); color: var(--inv); padding: 18px; }
.money-card .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.money-card .l { font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.money-card .v { font: 700 20px/1.2 var(--mono); margin-top: 8px; word-break: break-word; }
.money-card .bar { background: rgba(255,255,255,.18); }
.money-card .bar i { background: var(--inv); }
@media (prefers-color-scheme: dark) { .money-card .bar { background: rgba(0,0,0,.18); } }
.amt { font-family: var(--mono); white-space: nowrap; }

table.t { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
table.t th { text-align: left; font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
.scroll-x { overflow-x: auto; }

.users .item { align-items: center; flex-wrap: wrap; }
.users select { border: 1px solid var(--line); background: var(--surface); padding: 6px 8px; }

.note { background: var(--info-bg); color: var(--info); padding: 12px 14px; font-size: 13.5px; margin-top: 14px; }

/* caja */
.mov { flex: none; width: 28px; height: 28px; display: grid; place-items: center; font: 700 16px var(--mono); margin-top: 1px; }
.mov.in { background: var(--ok-bg); color: var(--ok); }
.mov.out { background: var(--late-bg); color: var(--late); }
.amt.pos { color: var(--ok); }
.amt.neg { color: var(--ink); }
.item > .amt { align-self: center; font-size: 14px; }

/* parte diario */
.rec-card { background: var(--surface); border: 1px solid var(--line); padding: 26px 18px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.rec-card p { margin: 0; max-width: 520px; }
.rec-card.recording { border-color: var(--late); }
.rec-btn {
  display: inline-flex; align-items: center; gap: 12px; background: var(--ink); color: var(--inv); border: 0;
  padding: 18px 26px; font-size: 17px; font-weight: 600; cursor: pointer; width: 100%; max-width: 360px; justify-content: center;
}
.rec-btn .dot, .rec-live .dot { width: 14px; height: 14px; border-radius: 50%; background: #e5484d; display: inline-block; }
.rec-live { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.rec-live b { font-size: 26px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.parte-res { background: var(--surface); border: 1px solid var(--ink); padding: 18px; }
.parte-res .foot { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.parte-res .foot .spacer { flex: 1; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
details.tx { margin-top: 14px; font-size: 13px; }
details.tx summary { cursor: pointer; color: var(--muted); }
details.tx .pre { margin-top: 8px; font-size: 13px; }
details.parte { padding: 12px 14px; border-bottom: 1px solid var(--line); }
details.parte:last-child { border-bottom: 0; }
details.parte > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none; }
details.parte > summary::-webkit-details-marker { display: none; }
details.parte > summary::before { content: '+'; font: 700 14px var(--mono); width: 12px; color: var(--muted); }
details.parte[open] > summary::before { content: '−'; }
details.parte > .pre { margin: 12px 0 4px 22px; }

/* FAB */
.fab {
  position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 30;
  background: var(--ink); color: var(--inv); border: 0; padding: 14px 18px; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); display: flex; gap: 8px; align-items: center;
}

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,10,10,.5); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-top: 4px solid var(--ink); }
.modal h3 { margin: 0 0 16px; font-size: 19px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.fields label.full { grid-column: 1 / -1; }
.fields input, .fields select, .fields textarea {
  border: 1px solid var(--line); background: var(--bg); padding: 10px; font-size: 15px; color: var(--ink); width: 100%; border-radius: 0;
}
.fields input:focus, .fields select:focus, .fields textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.fields textarea { min-height: 90px; resize: vertical; }
.fields label.cb { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); grid-column: 1 / -1; }
.fields label.cb input { width: 18px; height: 18px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal .foot .spacer { flex: 1; }
.note .spinner { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
/* semáforo de compras */
.sem { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.sem.urgente { background: #d93a3a; }
.sem.media { background: #e9b10c; }
.sem.baja { background: #2e9e5b; }
.sem.ok { background: var(--line); }
.item.compra { align-items: center; }
.item.compra .sem { width: 18px; height: 18px; }
.item.compra .meta a { color: var(--ink); }
.compra-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.sem-tag.urgente { background: #d93a3a; color: #fff; border-color: #d93a3a; }
.sem-tag.media { background: #e9b10c; color: #111; border-color: #e9b10c; }
.sem-tag.baja { background: #2e9e5b; color: #fff; border-color: #2e9e5b; }
.sem-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.sem-box { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); }
.sem-box b { font-size: 22px; line-height: 1; }
.sem-box span:last-child { font-size: 12px; color: var(--muted); }
.fields .sem-pick { grid-column: 1 / -1; }
.fields label.sem-opt { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.sem-pick .lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.sem-opts { display: grid; gap: 6px; }
.sem-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; color: var(--ink); }
.sem-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sem-opt em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.sem-opt:has(input:checked) { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: -2px; }
.sem-opt:has(input:focus-visible) { outline: 2px solid var(--ink); }
.nav .badge { display: inline-block; min-width: 18px; padding: 1px 5px; margin-left: 4px; background: var(--late, #c0392b); color: #fff; font-size: 11px; font-weight: 700; text-align: center; border-radius: 9px; line-height: 16px; }
a.item.aviso { text-decoration: none; color: inherit; }
a.item.aviso.nuevo { background: var(--info-bg); }
a.item.aviso .tag { flex: none; margin-top: 2px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.media-th { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); background: var(--line); cursor: pointer; overflow: hidden; display: block; width: 100%; }
.media-th img, .media-th video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.media-th .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.media-th .cap, .media-th .who { position: absolute; left: 0; right: 0; padding: 3px 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.media-th .cap { bottom: 0; }
.media-th .who { top: 0; background: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.media-th .media-x { font-size: 11px; color: var(--muted); }
.media-th.urg { outline: 3px solid var(--late); outline-offset: -3px; }
.media-th.med { outline: 3px solid var(--soon); outline-offset: -3px; }
.media-th .prio { position: absolute; top: 22px; left: 4px; padding: 1px 6px; font-size: 10px; font-weight: 600; color: #fff; background: rgba(0,0,0,.65); border-radius: 3px; }
.media-full img, .media-full video { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.contacto { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.contacto a.chip-f { text-decoration: none; color: var(--ink); }
.fin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.fin-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); border: 1px solid var(--ink); padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px; touch-action: manipulation; }
.fin-btn .box { width: 16px; height: 16px; border: 1.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center; }
.fin-btn .box svg { width: 12px; height: 12px; }
.fin-btn.on { background: var(--ink); color: var(--inv); }
.fin-btn.ro { cursor: default; }
.fin-btn.sm { padding: 4px 10px; min-height: 32px; font-size: 12px; gap: 6px; }
.vistos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
details.parte summary .tag { margin-left: 6px; }
.rep-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rep-h { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.rep-pre { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fields.rep-f { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rep-sum { margin-top: 8px; color: var(--muted); }
.err { color: var(--late); background: var(--late-bg); padding: 8px 10px; font-size: 13px; margin-top: 12px; overflow-wrap: anywhere; max-width: 100%; box-sizing: border-box; }
.rec-card .err { width: 100%; margin-top: 0; }
.okmsg { color: var(--ok); background: var(--ok-bg); padding: 8px 10px; font-size: 13px; margin-top: 12px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ink); }
.login-card { background: var(--surface); width: 100%; max-width: 380px; padding: 28px 24px; }
.login-card .logo { color: var(--ink); }
.login-card .logo svg { height: 34px; width: auto; }
.login-card h1 { font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 14px 0 22px; }
.login-card .fields { grid-template-columns: 1fr; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 16px; padding: 12px; }
.login-card .links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.login-card .links button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .top { gap: 10px; flex-wrap: wrap; }
  .brand span { display: none; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .me .who { max-width: 120px; }
  .tabs { top: 88px; }
  .page-h h1 { font-size: 23px; }
  .obra-h h1 { font-size: 22px; }
  .fields { grid-template-columns: 1fr; }
  .money-card .grid3 { grid-template-columns: 1fr; }
  .state { width: 78px; }
  .hide-m { display: none; }
}

/* ---- v2026-11-13.3: observaciones, autorización, instalar, Drive ---- */
.obs-det { font-size: 13.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.cnt { color: var(--muted); font-size: 11px; }
.login { align-content: center; gap: 14px; }
.login-inst { width: 100%; max-width: 380px; background: var(--surface); padding: 12px 16px; font-size: 13.5px; }
.login-inst summary { cursor: pointer; font-weight: 600; }
.inst-banner { background: var(--surface); border: 1px solid var(--line); padding: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.inst-h { display: flex; gap: 12px; align-items: flex-start; }
.inst-h > div { flex: 1; min-width: 0; }
.inst-ic { width: 40px; height: 40px; flex: none; background: var(--ink); color: #fff; display: grid; place-items: center; }
.inst-ic svg { width: 30px; height: auto; }
.inst-g { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.inst-p { border: 1px solid var(--line); padding: 8px 12px; background: var(--surface); }
.inst-p summary { cursor: pointer; font-weight: 600; }
.inst-p ol { margin: 8px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.item.pend { border-left: 3px solid var(--late); flex-wrap: wrap; }
.pend-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pasos { padding-left: 20px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
textarea.code { width: 100%; font: 12px/1.45 var(--mono); white-space: pre; margin: 10px 0 8px; }
