/* =====================================================================
   SHP Reporte Diario — sistema de diseño (modo día / noche)
   ===================================================================== */
@font-face { font-family: 'Inter'; src: url('../fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #EEF2F7; --bg-grad: radial-gradient(1200px 600px at 100% -10%, #DCE6F5 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #E7ECF4 0%, transparent 60%);
  --surface: #FFFFFF; --surface-2: #F6F8FB; --surface-3: #EDF1F7; --border: #DFE5EE; --border-2: #CBD4E1;
  --text: #0E1A2B; --text-2: #3F4F66; --muted: #74839A;
  --primary: #1F3A68; --primary-2: #2B5BA8; --primary-soft: #E3EBF8; --on-primary: #FFFFFF;
  --accent: #E39B00; --accent-soft: #FFF3D6;
  --ok: #128A47; --ok-soft: #DDF5E6; --warn: #B87400; --warn-soft: #FFF0CC; --bad: #D93036; --bad-soft: #FDE3E4; --info: #2F5597; --info-soft: #E2EAF8;
  --shadow-1: 0 1px 2px rgba(15, 30, 60, .06), 0 1px 1px rgba(15, 30, 60, .04);
  --shadow-2: 0 6px 18px -6px rgba(15, 30, 60, .16), 0 2px 6px rgba(15, 30, 60, .06);
  --shadow-3: 0 24px 48px -12px rgba(15, 30, 60, .28);
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px; --top-h: 60px; --rail-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A111E; --bg-grad: radial-gradient(1200px 600px at 100% -10%, #132445 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #0F1D33 0%, transparent 60%);
  --surface: #111A2B; --surface-2: #162236; --surface-3: #1C2A42; --border: #22314B; --border-2: #2E4060;
  --text: #E7EEF8; --text-2: #AEBBD0; --muted: #7C8BA5;
  --primary: #6C9CF5; --primary-2: #8DB4FF; --primary-soft: #1A2C4E; --on-primary: #08101E;
  --accent: #FFC23D; --accent-soft: #3A2E10;
  --ok: #3DD68C; --ok-soft: #0F3324; --warn: #FFB547; --warn-soft: #3A2A0E; --bad: #FF6B6F; --bad-soft: #3D1619; --info: #7FA8FF; --info-soft: #18294A;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
  --shadow-3: 0 28px 60px -12px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01', 'tnum'; overflow-x: hidden; transition: background-color .35s var(--ease), color .35s var(--ease); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-2); }
.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 26px; height: 26px; } .ic.xl { width: 34px; height: 34px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); }
.mono { font-variant-numeric: tabular-nums; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------------------------------------------------------------- shell */
.app { min-height: 100%; display: flex; }
.rail { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.topbar .grow { flex: 1; min-width: 0; }
.brand-mini { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow-2); flex: none; padding: 4px; border: 1px solid var(--border); }
.brand-mini img { width: 100%; height: 100%; object-fit: contain; }
.content { flex: 1; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1280px; width: 100%; margin: 0 auto; animation: rise .35s var(--ease); }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(6, 1fr); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; min-width: 0; white-space: nowrap; font-weight: 600; position: relative; transition: color .2s; }
.bottomnav a .ic { transition: transform .25s var(--ease); }
.bottomnav a.active { color: var(--primary-2); }
.bottomnav a.active .ic { transform: translateY(-2px) scale(1.08); }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary-2); }
@media (min-width: 960px) {
  .rail { display: flex; flex-direction: column; width: var(--rail-w); flex: none; position: sticky; top: 0; height: 100vh; padding: 18px 14px; gap: 4px; background: var(--surface); border-right: 1px solid var(--border); }
  .rail .brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; }
  .rail .brand b { display: block; font-size: 15px; letter-spacing: -.01em; } .rail .brand small { color: var(--muted); font-size: 12px; }
  .rail a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
  .rail a:hover { background: var(--surface-2); color: var(--text); }
  .rail a.active { background: var(--primary-soft); color: var(--primary-2); }
  .rail .sep { height: 1px; background: var(--border); margin: 10px 6px; }
  .rail .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 12px 4px; font-weight: 700; }
  .rail .foot { margin-top: auto; }
  .bottomnav { display: none; }
  .content { padding: 24px 28px 40px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .topbar .brand-mini { display: none; }
}

/* ---------------------------------------------------------------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .12s var(--ease), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; user-select: none; }
.btn:hover { border-color: var(--border-2); box-shadow: var(--shadow-1); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
:root[data-theme="dark"] .btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); }
.btn.accent { background: var(--accent); border-color: transparent; color: #1A1200; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); transition: background .2s, transform .12s; flex: none; position: relative; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.bordered { border-color: var(--border); background: var(--surface); }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 35; height: 56px; padding: 0 22px 0 18px; border-radius: 18px; border: 0; background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: var(--on-primary); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; box-shadow: var(--shadow-3); cursor: pointer; transition: transform .2s var(--ease); }
.fab:active { transform: scale(.95); }
@media (min-width: 960px) { .fab { bottom: 28px; right: 32px; } }

/* ---------------------------------------------------------------- tarjetas y layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card.pad { padding: 16px; }
.card.raised { box-shadow: var(--shadow-2); }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-title .btn { text-transform: none; letter-spacing: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 2px 12px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.section-title .line { flex: 1; height: 1px; background: var(--border); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- dashboard */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 22px 20px; color: #fff; background: linear-gradient(135deg, #14294D 0%, #1F3A68 48%, #2B5BA8 100%); box-shadow: var(--shadow-3); }
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #0E1D38 0%, #15305C 55%, #1F4B8F 100%); border: 1px solid #22355A; }
.hero::after { content: ''; position: absolute; inset: auto -60px -120px auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 61, .35), transparent 65%); pointer-events: none; }
.hero .contour { position: absolute; inset: 0; opacity: .14; pointer-events: none; }
.hero .hi { font-size: 13px; opacity: .8; font-weight: 500; }
.hero .date { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 12px; padding-right: 76px; line-height: 1.15; }
.hero .date::first-letter { text-transform: uppercase; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .chip { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.hero .shift { position: absolute; right: 18px; top: 18px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); }
.hero .shift .ic { width: 32px; height: 32px; color: #FFD166; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; animation: rise .4s var(--ease) both; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi .foot { font-size: 12px; color: var(--text-2); }
.kpi .ic.bgi { position: absolute; right: -6px; bottom: -8px; width: 64px; height: 64px; opacity: .07; }
.modcards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .modcards { grid-template-columns: repeat(3, 1fr); } }
.modcard { position: relative; overflow: hidden; padding: 18px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; text-decoration: none; color: inherit; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; animation: rise .45s var(--ease) both; }
.modcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: var(--border-2); }
.modcard:active { transform: translateY(-1px) scale(.99); }
.modcard .glyph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 20px -8px var(--g1); background: linear-gradient(135deg, var(--g1), var(--g2)); transition: transform .35s var(--ease); }
.modcard:hover .glyph { transform: rotate(-6deg) scale(1.06); }
.modcard .glyph .ic { width: 26px; height: 26px; }
.modcard h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.modcard p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modcard .stats { display: flex; gap: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.modcard .stats b { display: block; font-size: 20px; } .modcard .stats span { font-size: 12px; color: var(--muted); }
.modcard .go { position: absolute; right: 16px; top: 18px; color: var(--muted); transition: transform .25s var(--ease); }
.modcard:hover .go { transform: translateX(4px); color: var(--primary-2); }
.modcard .bgshape { position: absolute; right: -30px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g1) 18%, transparent), transparent 70%); pointer-events: none; }
.m-minado { --g1: #E08A00; --g2: #F5B82E; } .m-perf { --g1: #2B5BA8; --g2: #4F8BEA; } .m-pic { --g1: #6D3FC4; --g2: #9B6BF0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); animation: rise .3s var(--ease) both; }
.feed li:first-child { border-top: 0; }
.feed .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.feed .dot.create { background: var(--ok-soft); color: var(--ok); } .feed .dot.update { background: var(--info-soft); color: var(--info); } .feed .dot.delete { background: var(--bad-soft); color: var(--bad); } .feed .dot.conflict { background: var(--warn-soft); color: var(--warn); }
.feed .txt { font-size: 13.5px; min-width: 0; } .feed .txt b { font-weight: 650; } .feed .when { font-size: 12px; color: var(--muted); }
.feed .chg { font-size: 12px; color: var(--text-2); margin-top: 2px; word-break: break-word; }

/* ---------------------------------------------------------------- chips, badges, avatares */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid transparent; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.info { background: var(--info-soft); color: var(--info); } .chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip .ic { width: 14px; height: 14px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; }
.mat { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--ok); } .st.bad { color: var(--bad); } .st.info { color: var(--info); } .st.warn { color: var(--warn); } .st.neutral { color: var(--text-2); }
.avatars { display: flex; } .avatars .av { margin-left: -8px; border: 2px solid var(--surface); } .avatars .av:first-child { margin-left: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; position: relative; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.online::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.syncpill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 650; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); }
.syncpill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.syncpill.online .led { background: var(--ok); animation: pulse 2.4s infinite; }
.syncpill.offline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); } .syncpill.offline .led { background: var(--bad); }
.syncpill.syncing .led { background: var(--info); }
.syncpill.pending { color: var(--warn); }
@media (max-width: 520px) { .syncpill .txt { display: none; } .syncpill { padding: 0 10px; } }

/* ---------------------------------------------------------------- barra de reporte */
.reportbar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 20; margin: -16px -16px 16px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
@media (min-width: 960px) { .reportbar { margin: -24px -28px 20px; padding: 14px 28px; } }
.reportbar .r1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.datebox { display: inline-flex; align-items: center; gap: 4px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 4px; }
.datebox input { border: 0; background: transparent; height: 38px; padding: 0 4px; font-weight: 650; min-width: 0; width: 140px; outline: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); height: 42px; }
.seg button { border: 0; background: transparent; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg button.on.dia .ic { color: var(--accent); } .seg button.on.noche .ic { color: var(--primary-2); }
.header-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.header-fields .fld { margin: 0; }
.lockbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13px; margin-bottom: 14px; }

/* ---------------------------------------------------------------- tabs de sección */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-bottom: 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 650; font-size: 13.5px; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); }
.tab .n { min-width: 22px; height: 22px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--surface-3); font-size: 12px; }
.tab.on { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: var(--shadow-2); }
.tab.on .n { background: rgba(255, 255, 255, .2); }

/* ---------------------------------------------------------------- filas (tarjetas) */
.rows { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .rows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rowcard { position: relative; padding: 14px 14px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: pop .3s var(--ease) both; overflow: hidden; }
.rowcard:hover { box-shadow: var(--shadow-2); border-color: var(--border-2); }
.rowcard:active { transform: scale(.99); }
.rowcard.flash { animation: flash 1.6s ease-out; }
.rowcard .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.rowcard .top { display: flex; align-items: center; gap: 8px; }
.rowcard .idx { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--text-2); flex: none; }
.rowcard .title { font-weight: 750; font-size: 15px; letter-spacing: -.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowcard .kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 12px; }
.rowcard .kv div { min-width: 0; } .rowcard .kv small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.rowcard .kv span { display: block; font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowcard .note { margin-top: 10px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.rowcard .meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.rowcard .meta .pend { color: var(--warn); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.rowcard .editing { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.rowcard .editing .av { width: 20px; height: 20px; font-size: 9px; }
.empty { text-align: center; padding: 34px 16px; border: 1.5px dashed var(--border-2); border-radius: var(--radius); color: var(--muted); }
.empty .ic { width: 38px; height: 38px; opacity: .5; margin-bottom: 6px; }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }
.addrow { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border-radius: var(--radius); border: 1.5px dashed var(--border-2); background: transparent; color: var(--text-2); font-weight: 650; cursor: pointer; transition: all .2s; }
.addrow:hover { border-color: var(--primary-2); color: var(--primary-2); background: var(--primary-soft); }

/* ---------------------------------------------------------------- formularios */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.fld > label { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; display: flex; justify-content: space-between; gap: 6px; }
.fld > label .who { font-weight: 500; color: var(--muted); font-size: 11px; }
.input, .select, textarea.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; font-size: 15px; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { border-color: var(--primary-2); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.input:disabled { opacity: .55; }
.picker { position: relative; display: flex; align-items: center; height: 46px; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; gap: 8px; transition: border-color .2s, box-shadow .2s; text-align: left; width: 100%; }
.picker:hover { border-color: var(--border-2); }
.picker:focus-visible { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.picker .v { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker .ph { color: var(--muted); font-weight: 500; }
.picker.disabled { opacity: .5; pointer-events: none; }
.picker.invalid { border-color: var(--warn); }
.picker .clear { color: var(--muted); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.fgrid .full { grid-column: 1 / -1; }
@media (min-width: 720px) { .fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 650; font-size: 13.5px; cursor: pointer; transition: all .15s var(--ease); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.opt:hover { border-color: var(--border-2); }
.opt.on { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: var(--shadow-1); }
.chips-select.bancos { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.chips-select.bancos .opt { justify-content: center; padding: 0 6px; font-variant-numeric: tabular-nums; }
.chips-select.sugg { margin-top: 6px; gap: 5px; } .chips-select.sugg:empty { display: none; }
.chips-select.sugg .opt { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
input[data-free] { text-transform: uppercase; }
.opt.on.ok { background: var(--ok); color: #fff; } .opt.on.bad { background: var(--bad); color: #fff; } .opt.on.info { background: var(--info); color: #fff; } .opt.on.warn { background: var(--warn); color: #fff; }
.hint { font-size: 12px; color: var(--muted); }
.warnline { font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.more { margin: 4px 0 12px; }
.more summary { cursor: pointer; font-weight: 650; color: var(--primary-2); font-size: 13.5px; list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary .ic { transform: rotate(180deg); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 999px; transition: .25s var(--ease); cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: .25s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------------------------------------------------------------- hojas modales */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(5, 12, 24, .48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s var(--ease); }
.scrim.show { opacity: 1; }
.sheet { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-3); transform: translateY(100%); transition: transform .34s var(--ease); padding-bottom: env(safe-area-inset-bottom); border: 1px solid var(--border); border-bottom: 0; }
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 8px auto 0; flex: none; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid var(--border); flex: none; }
.sheet .sh-head h3 { margin: 0; font-size: 17px; flex: 1; min-width: 0; letter-spacing: -.01em; }
.sheet .sh-head .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.sheet .sh-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet .sh-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex: none; background: var(--surface); }
.sheet .sh-foot .btn { flex: 1; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(680px, 94vw); max-height: 88vh; border-radius: 22px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .28s var(--ease), opacity .22s; border-bottom: 1px solid var(--border); padding-bottom: 0; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet.wide { width: min(960px, 94vw); }
}
.optlist { display: flex; flex-direction: column; gap: 4px; }
.optlist button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; font-weight: 600; font-size: 15px; transition: background .15s; }
.optlist button:hover { background: var(--surface-2); }
.optlist button.on { background: var(--primary-soft); color: var(--primary-2); border-color: color-mix(in srgb, var(--primary-2) 30%, transparent); }
.optlist button .grow { flex: 1; }
.optlist .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); padding: 10px 14px 4px; }
.searchbox { position: relative; margin-bottom: 10px; }
.searchbox .ic { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.searchbox .input { padding-left: 42px; }
.timegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.timegrid button { height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.timegrid button.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 12px); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-3); font-size: 14px; animation: pop .28s var(--ease); }
.toast .ic { margin-top: 1px; }
.toast.ok .ic { color: var(--ok); } .toast.bad .ic { color: var(--bad); } .toast.warn .ic { color: var(--warn); } .toast.info .ic { color: var(--info); }
.toast .grow { flex: 1; min-width: 0; } .toast b { display: block; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }

/* ---------------------------------------------------------------- tablas (historial / admin) */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.inactive td { opacity: .5; }
.tblwrap { overflow-x: auto; border-radius: var(--radius); }
.replist { display: flex; flex-direction: column; gap: 10px; }
.repitem { display: grid; grid-template-columns: auto 56px minmax(0, 1fr); grid-template-areas: "sel date info" "sel date counts"; column-gap: 12px; row-gap: 10px; align-items: center; padding: 14px 16px; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s; animation: rise .3s var(--ease) both; }
.repitem.nosel { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "date info" "date counts"; }
.repitem:hover { box-shadow: var(--shadow-2); }
.repitem > input[type=checkbox] { grid-area: sel; }
.repitem .datebadge { grid-area: date; align-self: stretch; display: flex; flex-direction: column; justify-content: center; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--navy-soft, var(--surface-3)); }
.repitem .datebadge b { display: block; font-size: 22px; line-height: 1.05; color: var(--navy-2, var(--text)); } .repitem .datebadge small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.repitem .info { grid-area: info; min-width: 0; }
.repitem .info .t { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; min-width: 0; }
.repitem .info .t .turno { display: inline-flex; align-items: center; gap: 5px; font-weight: 750; font-size: 15px; white-space: nowrap; }
.repitem .info .t .turno svg { flex: none; }
.repitem .info .t .chip { height: 22px; font-size: 11.5px; white-space: nowrap; }
.repitem .info .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repitem .counts { grid-area: counts; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px dashed var(--border); }
.repitem .counts .cnt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.repitem .counts .cnt svg { flex: none; width: 16px; height: 16px; color: var(--navy, var(--primary)); }
.repitem .counts .cnt b { font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.repitem .counts .cnt.zero { opacity: .55; }
.repitem .info .t .pl { font-size: 13px; font-weight: 650; color: var(--navy-2); white-space: nowrap; }
.repitem .info .t .st { margin-left: auto; }
@media (max-width: 560px) { .repitem .counts .cnt .lbl { display: none; } .repitem .counts .cnt { padding: 0 8px; } }
@media (min-width: 900px) { .repitem { grid-template-columns: auto 56px minmax(0, 1fr) auto; grid-template-areas: "sel date info counts"; } .repitem.nosel { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "date info counts"; } .repitem .counts { border-top: 0; padding-top: 0; } }
.repitem > input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary-2); }
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.filters .fld { margin: 0; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline .ev { position: relative; padding: 0 0 16px; }
.timeline .ev::before { content: ''; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary-2); }
.timeline .ev.delete::before { border-color: var(--bad); } .timeline .ev.create::before { border-color: var(--ok); } .timeline .ev.conflict::before { border-color: var(--warn); }
.timeline .ev .h { font-size: 13.5px; } .timeline .ev .w { font-size: 12px; color: var(--muted); }
.diff { margin-top: 6px; font-size: 12.5px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.diff .k { color: var(--muted); font-weight: 600; } .diff del { color: var(--bad); text-decoration: line-through; opacity: .8; } .diff ins { color: var(--ok); text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth .bgart { position: absolute; inset: 0; z-index: 0; opacity: .5; }
.auth .panel { position: relative; z-index: 1; width: min(420px, 100%); padding: 28px 24px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--border); box-shadow: var(--shadow-3); animation: pop .45s var(--ease); }
.auth .logo { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: #fff; padding: 9px; margin-bottom: 16px; box-shadow: var(--shadow-2); border: 1px solid var(--border); }
.auth .logo img { width: 100%; height: 100%; object-fit: contain; }
.auth h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; } .auth p { margin: 4px 0 22px; color: var(--muted); }
.err { color: var(--bad); font-size: 13.5px; margin: 4px 0 10px; min-height: 18px; }
.conflicts { border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); background: var(--warn-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.conflicts .row { color: var(--warn); font-weight: 700; }
.perm-grid td:not(:first-child), .perm-grid th:not(:first-child) { text-align: center; width: 110px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.listnav { display: flex; flex-direction: column; gap: 2px; }
.listnav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 14px; }
.listnav button:hover { background: var(--surface-2); } .listnav button.on { background: var(--primary-soft); color: var(--primary-2); }
.listnav button .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.admin-cat { display: grid; gap: 14px; }
@media (min-width: 960px) { .admin-cat { grid-template-columns: 300px 1fr; align-items: start; } }
.catitem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 6px; transition: opacity .2s; }
.catitem.off { opacity: .5; } .catitem .v { flex: 1; font-weight: 650; min-width: 0; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 40%; background: var(--primary-2); animation: prog 1.2s infinite var(--ease); }
@keyframes prog { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.noanim *, .noanim { animation: none !important; }
.noanim .rowcard.flash { animation: flash 1.6s ease-out !important; }
@media (max-width: 560px) { .hide-sm { display: none; } .reportbar .datebox input { width: 128px; } .header-fields { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- aviso de actualización (estilo Telegram) */
.updbar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px; background: linear-gradient(135deg, #1F6FEB, #2B5BA8); color: #fff; box-shadow: var(--shadow-3); transform: translateY(140%); opacity: 0; transition: transform .35s var(--ease), opacity .3s; cursor: pointer; overflow: hidden; }
.updbar.show { transform: none; opacity: 1; }
.updbar .ico { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.updbar .txt { flex: 1; min-width: 0; line-height: 1.25; }
.updbar .txt b { display: block; font-size: 14.5px; }
.updbar .txt small { display: block; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.updbar .go { border: 0; background: #fff; color: #1F4FA8; font-weight: 800; height: 36px; padding: 0 14px; border-radius: 11px; cursor: pointer; flex: none; }
.updbar .later { border: 0; background: transparent; color: #fff; opacity: .8; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; flex: none; }
.updbar .prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.2); display: none; }
.updbar .prog i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.updbar.busy .prog { display: block; } .updbar.busy .go, .updbar.busy .later { display: none; }
body.has-updbar .fab { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .updbar { left: auto; right: 28px; bottom: 28px; width: 420px; } }

/* ---------------------------------------------------------------- selector de planta (Inicio) */
.plantpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.plantcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; box-shadow: var(--shadow-1); transition: all .2s var(--ease); }
.plantcard:hover { border-color: var(--border-2); }
.plantcard .pi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.plantcard .pt { flex: 1; min-width: 0; } .plantcard .pt b { display: block; font-size: 16px; } .plantcard .pt small { color: var(--muted); font-size: 12.5px; }
.plantcard.on { border-color: var(--primary-2); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.plantcard.on .pi { background: var(--primary-2); color: #fff; } .plantcard.on > .ic { color: var(--primary-2); }

/* ---------------------------------------------------------------- Publicar */
.pubgrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pubgrid { grid-template-columns: 2fr 1fr 1fr; } }
.stats3 { display: flex; gap: 18px; margin-top: 8px; } .stats3 b { display: block; font-size: 22px; } .stats3 span { font-size: 12px; color: var(--muted); }
.preview { padding: 12px; min-height: 220px; background: var(--surface-3); }
.pvempty { display: grid; place-items: center; gap: 10px; min-height: 200px; text-align: center; }
.pvpages { display: flex; flex-direction: column; gap: 14px; }
.pvpage canvas { display: block; background: #fff; border-radius: 6px; box-shadow: var(--shadow-2); }
.pvpage .hint { text-align: center; margin-top: 6px; }
.pubbar { position: fixed; z-index: 36; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
.pubbar .btn { flex: none; }
@media (max-width: 520px) { .pubbar { flex-wrap: wrap; } .pubbar label { flex-basis: 100%; } .pubbar .btn { flex: 1; } }
@media (min-width: 960px) { .pubbar { left: var(--rail-w); bottom: 0; padding: 12px 28px; } }
body.has-updbar .pubbar { bottom: calc(var(--nav-h) + 80px + env(safe-area-inset-bottom)); }

.pvpage canvas { cursor: zoom-in; }
.pvzoom { position: fixed; inset: 0; z-index: 130; background: #1b2230; display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.pvzoom.show { opacity: 1; }
.pvzbar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px 16px; color: #fff; background: #111826; }
.pvzbar .hint { flex: 1; color: #9fb0c8; } .pvzbar .iconbtn { color: #fff; }
.pvzbody { flex: 1; overflow: auto; padding: 14px; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.pvzbody img { display: block; width: 230%; max-width: none; background: #fff; border-radius: 6px; margin-bottom: 14px; }
@media (min-width: 960px) { .pvzbody img { width: 140%; } }

/* ---------------------------------------------------------------- supervisor: planta por días y vista de reporte */
.plantcard.big { text-decoration: none; color: inherit; padding: 16px; }
.plantcard.big .pt b { font-size: 18px; }
.monthnav { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; margin-bottom: 14px; }
.monthnav div { text-align: center; } .monthnav b { display: block; font-size: 17px; } .monthnav small { color: var(--muted); font-size: 12.5px; }
.monthnav .iconbtn:disabled { opacity: .3; }
.daylist { display: flex; flex-direction: column; gap: 10px; }
.dayrow { display: flex; gap: 10px; align-items: stretch; animation: rise .3s var(--ease) both; }
.dayrow .dd { width: 52px; flex: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dayrow .dd b { font-size: 20px; line-height: 1.1; } .dayrow .dd small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.dayrow .tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.shifttile { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; box-shadow: var(--shadow-1); min-width: 0; position: relative; transition: transform .15s var(--ease), box-shadow .2s; }
.shifttile:active { transform: scale(.98); } .shifttile:hover { box-shadow: var(--shadow-2); }
.shifttile .sh { font-weight: 750; font-size: 13.5px; display: flex; align-items: center; gap: 5px; }
.shifttile .sh em { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; }
.shifttile .st { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.shifttile .st i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.shifttile.ok .st { color: var(--ok); } .shifttile.ok .st i { background: var(--ok); }
.shifttile.info .st { color: var(--info); } .shifttile.info .st i { background: var(--info); }
.shifttile.ok { border-left: 4px solid var(--ok); } .shifttile.info { border-left: 4px solid var(--info); }
.shifttile.empty { background: transparent; border-style: dashed; box-shadow: none; }
.shifttile.now { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.shifttile .gl { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shifttile .ct { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; } .shifttile .ct .ic { width: 13px; height: 13px; margin-left: 4px; } .shifttile .ct .ic:first-child { margin-left: 0; }
.verhead { padding: 16px; }
.kvgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.kvgrid > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; } .kvgrid small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; } .kvgrid b { font-size: 14.5px; }
.vsec { margin-bottom: 10px; overflow: hidden; }
.vsh { padding: 10px 14px; font-weight: 750; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.vempty { padding: 12px 14px; font-size: 13.5px; } .vtext { padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.tbl.vt { font-size: 13px; } .tbl.vt th { white-space: nowrap; } .tbl.vt td { white-space: nowrap; padding: 8px 10px; } .tbl.vt td.wrap { white-space: normal; min-width: 180px; }

.plantpick.big { grid-template-columns: 1fr; } @media (min-width: 720px) { .plantpick.big { grid-template-columns: 1fr 1fr; } }
.plantcard.big .pt b { white-space: nowrap; }

/* ---------------------------------------------------------------- identidad: azul corporativo (navy del formato SHP) */
:root { --navy: #1F3A68; --navy-2: #2B5BA8; --navy-soft: #E6EEFA; }
:root[data-theme="dark"] { --navy: #2C4F8F; --navy-2: #6C9CF5; --navy-soft: #172846; }
.section-title { color: var(--navy-2); }
.section-title .line { background: linear-gradient(90deg, color-mix(in srgb, var(--navy-2) 45%, transparent), transparent); }
.kpi .lbl .ic { color: var(--navy-2); }
.kpi { border-top: 3px solid var(--navy-2); }
.plantcard .pi { background: var(--navy-soft); color: var(--navy-2); }
.plantcard.big:hover { border-color: var(--navy-2); }
.vsh { background: var(--navy); color: #fff; border-bottom: 0; }
.vsh .chip { background: rgba(255,255,255,.18); color: #fff; }
.tbl.vt th { background: var(--navy-soft); color: var(--navy-2); }
.verhead { border-top: 4px solid var(--navy-2); }
.page-head h2 .ic { color: var(--navy-2); }
.feed .dot.update { background: var(--navy-soft); color: var(--navy-2); }

/* ---------------------------------------------------------------- planta: lista compacta */
.monthnav { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
.monthnav small { color: rgba(255,255,255,.8); } .monthnav .iconbtn { color: #fff; } .monthnav .iconbtn:hover { background: rgba(255,255,255,.14); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; font-weight: 600; color: var(--text-2); margin: -4px 2px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.pub { background: var(--navy-2); } .lg.run { background: var(--accent); } .lg.none { border: 1.5px dashed var(--border-2); }
.daylist { display: flex; flex-direction: column; gap: 6px; }
.dayhead, .dayrow { display: grid; grid-template-columns: 46px 1fr 1fr; gap: 6px; align-items: stretch; }
.dayhead { font-size: 11.5px; font-weight: 800; color: var(--navy-2); text-transform: uppercase; letter-spacing: .05em; padding: 0 2px; }
.dayhead span { display: flex; align-items: center; gap: 5px; padding-left: 4px; } .dayhead .ic { width: 14px; height: 14px; }
.dayrow { animation: none; }
.dayrow .dd { width: auto; border-radius: 10px; padding: 4px 0; background: var(--surface); border: 1px solid var(--border); }
.dayrow .dd b { font-size: 16px; } .dayrow .dd small { font-size: 10px; }
.dayrow.today .dd { background: var(--navy); border-color: var(--navy); color: #fff; } .dayrow.today .dd small { color: rgba(255,255,255,.8); }
.stile { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: inherit; border: 1px solid var(--border); background: var(--surface); min-width: 0; transition: transform .12s var(--ease), box-shadow .2s; }
.stile:active { transform: scale(.98); } .stile:hover { box-shadow: var(--shadow-1); }
.stile .sl { display: flex; align-items: center; gap: 4px; color: var(--muted); flex: none; } .stile .sl .ic { width: 14px; height: 14px; }
.stile .sl i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.stile .pr { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pchip { font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--navy); color: #fff; letter-spacing: .02em; }
.pnone { font-size: 12px; color: var(--muted); }
.stile.pub { background: var(--navy-soft); border-color: color-mix(in srgb, var(--navy-2) 35%, transparent); } .stile.pub .sl { color: var(--navy-2); } .stile.pub .sl i { background: var(--navy-2); }
.stile.run { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); } .stile.run .sl { color: var(--warn); } .stile.run .sl i { background: var(--accent); }
.stile.run .pchip { background: var(--surface-3); color: var(--text); }
.stile.none { border-style: dashed; background: transparent; }
.stile.now { box-shadow: 0 0 0 2px var(--accent); }
.pubfiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.pubfile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--navy-soft); color: var(--navy-2); cursor: pointer; text-align: left; }
.pubfile span { flex: 1; min-width: 0; color: var(--text); } .pubfile b { display: block; } .pubfile small { color: var(--muted); font-size: 11.5px; }
.pubfile:hover { border-color: var(--navy-2); }

.fld > label .clr { margin-left: auto; font-weight: 600; font-size: 11.5px; color: var(--navy-2); text-decoration: none; }

/* copiar turno anterior */
.copybar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--navy-soft); border: 1px solid color-mix(in srgb, var(--navy-2) 30%, transparent); }
.copybar .ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); color: #fff; }
.copybar .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.copybar b { font-size: 14px; color: var(--text); } .copybar span { font-size: 12.5px; color: var(--text-2); }
.copybar .btn { flex: none; }
@media (max-width: 520px) { .copybar { flex-wrap: wrap; } .copybar .btn { flex: 1 1 100%; } }
.copylist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.copylist > div { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.35; }
.copylist .n { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.copylist .mat { height: 20px; min-width: 30px; font-size: 11px; } .copylist .st { font-size: 11px; }
input[data-free]::placeholder { text-transform: none; }
@media (max-width: 380px) { .repitem { grid-template-columns: auto 44px minmax(0, 1fr); column-gap: 8px; padding: 12px; } .repitem.nosel { grid-template-columns: 44px minmax(0, 1fr); } .repitem .datebadge b { font-size: 18px; } .repitem .counts { gap: 4px; } .repitem .counts .cnt { padding: 0 6px; gap: 4px; } }
