/* Fuente alojada en el propio servidor: no se envían datos de los visitantes a terceros. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* SmoltIQ — paleta: fiordo profundo, agua teal y salmón */
:root {
  --ocean-950: #041c2c;
  --ocean-900: #06283d;
  --ocean-800: #0b3954;
  --ocean-700: #0f4c6e;
  --teal-600: #0f7c8c;
  --teal-500: #179aa8;
  --teal-100: #e1f2f4;
  --salmon-600: #e0603f;
  --salmon-500: #f2785c;
  --salmon-300: #f9b39f;
  --salmon-100: #fdece6;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --line: #dbe3e9;
  --line-soft: #ebf0f3;
  --text: #11202d;
  --muted: #5b6b7a;
  --verde: #2e9e5b;
  --verde-bg: #e3f4ea;
  --ambar: #e3a02f;
  --ambar-bg: #fdf3df;
  --rojo: #d64545;
  --rojo-bg: #fbe5e5;
  --gris: #98a6b3;
  --gris-bg: #eef1f4;
  --n0: #e3f4ea;
  --n1: #fbf3d2;
  --n2: #fde2cc;
  --n3: #f9d0d0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(6, 40, 61, .06), 0 4px 16px rgba(6, 40, 61, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; color: var(--ocean-900); }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* Barra superior */
.topbar { background: linear-gradient(90deg, var(--ocean-950), var(--ocean-800)); color: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 1.2rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--salmon-500); font-weight: 800; }
.brand small { display: block; font-size: .64rem; font-weight: 500; color: #9fc3d2; letter-spacing: .06em; text-transform: uppercase; margin-top: -2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #cfe3ec; padding: 8px 14px; border-radius: 8px; font-weight: 550; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(242,120,92,.18); color: #fff; box-shadow: inset 0 -2px 0 var(--salmon-500); }
.user { display: flex; align-items: center; gap: 12px; color: #cfe3ec; font-size: .9rem; }
.user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--salmon-500); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user form button { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #cfe3ec; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.user form button:hover { background: rgba(255,255,255,.08); color: #fff; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) { .g-main { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .nav { display: none; } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--teal-600)); }
.kpi .v { font-size: 1.7rem; font-weight: 750; color: var(--ocean-900); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn-primary { background: var(--salmon-500); color: #fff; box-shadow: 0 2px 6px rgba(224,96,63,.3); }
.btn-primary:hover { background: var(--salmon-600); }
.btn-ocean { background: var(--ocean-800); color: #fff; }
.btn-ocean:hover { background: var(--ocean-700); }
.btn-teal { background: var(--teal-600); color: #fff; }
.btn-teal:hover { background: var(--teal-500); }
.btn-ghost { background: var(--surface); color: var(--ocean-800); border-color: var(--line); }
.btn-ghost:hover { background: var(--teal-100); }
.btn-danger { background: #fff; color: var(--rojo); border-color: #f0c4c4; }
.btn-danger:hover { background: var(--rojo-bg); }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Formularios */
label { display: block; font-weight: 600; font-size: .85rem; color: var(--ocean-800); margin-bottom: 6px; }
.req::after { content: " *"; color: var(--salmon-600); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--text); background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(23,154,168,.18); }
input[readonly], input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field .err, .err { color: var(--rojo); font-size: .82rem; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 46px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--teal-600); }
.form-section { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 8px; }
.form-section h3 { display: flex; align-items: center; gap: 10px; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--ocean-800); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; font-weight: 700; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 180px; }

/* Avisos */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert-ok { background: var(--verde-bg); border-color: #b9e2c8; color: #1d6b3c; }
.alert-error { background: var(--rojo-bg); border-color: #f0c4c4; color: #9b2c2c; }
.alert-info { background: var(--teal-100); border-color: #b8dfe4; color: var(--ocean-800); }
.alert-warn { background: var(--ambar-bg); border-color: #f2d9a6; color: #8a5a07; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafb; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6fbfc; }
.cell-n0 { background: var(--n0); } .cell-n1 { background: var(--n1); } .cell-n2 { background: var(--n2); } .cell-n3 { background: var(--n3); }
table.compact td, table.compact th { padding: 6px 8px; font-size: .88rem; }

/* Semáforo y etiquetas */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.b-verde { background: var(--verde-bg); color: #1d6b3c; } .b-ambar { background: var(--ambar-bg); color: #8a5a07; }
.b-rojo { background: var(--rojo-bg); color: #9b2c2c; } .b-gris { background: var(--gris-bg); color: #4d5b67; }
.b-teal { background: var(--teal-100); color: var(--ocean-700); } .b-salmon { background: var(--salmon-100); color: #a2412a; }
.b-ocean { background: var(--ocean-800); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c, var(--gris)); }
.sem-verde { --c: var(--verde); } .sem-ambar { --c: var(--ambar); } .sem-rojo { --c: var(--rojo); } .sem-gris { --c: var(--gris); }
.row-sem td:first-child { border-left: 5px solid var(--c, var(--gris)); }

/* Lista de muestreos */
.mlist .codigo { font-weight: 650; color: var(--ocean-800); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .88rem; }
.score { font-weight: 750; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Centro de control */
.strip { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0; background: var(--ocean-900); color: #fff; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.strip > div { padding: 16px 20px; border-right: 1px solid rgba(255,255,255,.08); }
.strip > div:last-child { border-right: 0; }
.strip .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #8fb6c8; font-weight: 600; }
.strip .v { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.strip .v small { font-size: .9rem; font-weight: 500; color: #a9c8d6; }
@media (max-width: 900px) { .strip { grid-template-columns: 1fr 1fr; } }
.phase { display: flex; flex-direction: column; gap: 12px; }
.phase .top { display: flex; justify-content: space-between; align-items: center; }
.phase .n { font-size: 2rem; font-weight: 750; color: var(--ocean-900); font-variant-numeric: tabular-nums; }
.phase .n small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.progress { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-600), var(--teal-500)); border-radius: 999px; }
.progress.done > span { background: linear-gradient(90deg, var(--verde), #43b774); }
.phase-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--salmon-100); color: var(--salmon-600); display: grid; place-items: center; font-weight: 800; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* Captura: botones de nivel 0-3 grandes para guantes */
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.levels input { position: absolute; opacity: 0; pointer-events: none; }
.levels label { margin: 0; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; font-weight: 750; color: var(--ocean-800); cursor: pointer; background: #fff; user-select: none; transition: all .1s; }
.levels label:hover { border-color: var(--teal-500); }
.levels input:checked + label { color: #fff; border-color: transparent; }
.levels input[value="0"]:checked + label { background: var(--verde); }
.levels input[value="1"]:checked + label { background: #c9a227; }
.levels input[value="2"]:checked + label { background: #e8873a; }
.levels input[value="3"]:checked + label { background: var(--rojo); }
.levels input:focus-visible + label { box-shadow: 0 0 0 3px rgba(23,154,168,.35); }
.visual-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.visual-row:last-child { border-bottom: 0; }
.visual-row .vn { font-weight: 650; color: var(--ocean-800); }
.big-input input { min-height: 64px; font-size: 1.8rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.k-display { min-height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 750; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.fish-no { font-size: 3rem; font-weight: 800; color: var(--salmon-500); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-mini div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.stat-mini b { display: block; font-size: 1.25rem; color: var(--ocean-900); font-variant-numeric: tabular-nums; }
.stat-mini span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* Disección: fotos de referencia como opciones */
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photos input { position: absolute; opacity: 0; pointer-events: none; }
.photos label { margin: 0; border: 3px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; display: flex; flex-direction: column; transition: border-color .1s; }
.photos img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photos .cap { padding: 8px 10px; font-size: .85rem; display: flex; gap: 8px; align-items: center; }
.photos .cap b { font-size: 1.1rem; }
.photos input:checked + label { border-color: var(--salmon-500); box-shadow: 0 0 0 3px rgba(242,120,92,.25); }
.photos input:checked + label .cap { background: var(--salmon-100); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { min-width: 44px; min-height: 44px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--ocean-800); background: #fff; }
.pill.done { background: var(--teal-100); border-color: #b8dfe4; }
.pill.current { border-color: var(--salmon-500); background: var(--salmon-100); color: var(--salmon-600); }
.pill:hover { text-decoration: none; border-color: var(--teal-500); }

/* Resumen */
.score-hero { display: flex; gap: 24px; align-items: center; }
.score-ring { width: 150px; height: 150px; flex: none; }
.score-big { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ocean-900); }
.scale { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--verde) 0 25%, var(--ambar) 25% 70%, var(--rojo) 70% 100%); margin: 26px 0 22px; }
.scale .mark { position: absolute; top: -9px; width: 4px; height: 32px; background: var(--ocean-900); border-radius: 2px; transform: translateX(-2px); }
.scale .tick { position: absolute; top: 18px; font-size: .75rem; color: var(--muted); transform: translateX(-50%); }
.bars .bar-row { display: grid; grid-template-columns: 190px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: .9rem; }
.bars .track { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--salmon-500); border-radius: 999px; }
.lv { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 750; font-size: .85rem; }
.lv-0 { background: var(--n0); color: #1d6b3c; } .lv-1 { background: var(--n1); color: #7a6106; } .lv-2 { background: var(--n2); color: #9a4b12; } .lv-3 { background: var(--n3); color: #9b2c2c; } .lv-x { background: var(--gris-bg); color: var(--muted); }

/* Diálogos */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(4,28,44,.35); }
dialog::backdrop { background: rgba(4,28,44,.55); }
dialog .d-body { padding: 22px 24px; }
dialog .d-foot { padding: 14px 24px; background: var(--bg); display: flex; justify-content: flex-end; gap: 10px; }

/* Login */
.login-bg { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, #13607f 0, transparent 50%), linear-gradient(160deg, var(--ocean-950), var(--ocean-800) 60%, var(--teal-600)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { color: #fff; font-size: 2.4rem; max-width: 520px; }
.login-art h1 b { color: var(--salmon-500); }
.login-art p { color: #b9d6e2; max-width: 480px; font-size: 1.05rem; }
.login-art .waves { position: absolute; left: 0; right: 0; bottom: 0; opacity: .35; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form .box { width: min(400px, 100%); }
@media (max-width: 900px) { .login-bg { grid-template-columns: 1fr; } .login-art { display: none; } }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 0 10px; font-weight: 600; font-size: .9rem; }
.pagination .cur { background: var(--ocean-800); color: #fff; border-color: var(--ocean-800); }
.pagination .dis { color: var(--gris); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.ref-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ref-imgs img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
pre.mail { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-family: inherit; font-size: .92rem; max-height: 420px; overflow: auto; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 18px; margin-top: 8px; }

.g-side { grid-template-columns: 320px minmax(0, 1fr); }
@media (max-width: 1000px) { .g-side { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }
.nota-grafico { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }

/* ===== Equipos de captura (balanza, voz, tablets) ===== */
.equipos { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; margin: -4px 0 14px; background: var(--bg); border-radius: 10px; }

/* ===== Menú de administración y campana ===== */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; color: #cfe3ec; padding: 8px 14px; border-radius: 8px; font-weight: 550; font-size: .95rem; cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; font-size: .75rem; }
.nav-menu summary:hover, .nav-menu[open] summary { background: rgba(255,255,255,.08); color: #fff; }
.nav-menu.active summary { box-shadow: inset 0 -2px 0 var(--salmon-500); color: #fff; }
.nav-menu > div { position: absolute; top: 44px; left: 0; min-width: 240px; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(4,28,44,.25); padding: 6px; z-index: 50; }
.nav-menu > div a { display: flex; justify-content: space-between; align-items: center; color: var(--ocean-800); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.nav-menu > div a:hover { background: var(--teal-100); text-decoration: none; }
.bell { position: relative; color: #cfe3ec; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.bell:hover { background: rgba(255,255,255,.08); color: #fff; }
.bell-n { position: absolute; top: 2px; right: 0; background: var(--salmon-500); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 1px 5px; line-height: 1.3; }

/* ===== Conexión ===== */
.t-conn-mini { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.t-conn-mini::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.t-conn-mini.on { color: #9fe3bb; background: rgba(67,196,122,.12); }
.t-conn-mini.on::before { background: #43c47a; }
.t-conn-mini.off { color: var(--salmon-300); background: rgba(242,120,92,.15); }
.t-conn-mini.off::before { background: var(--salmon-500); }
.offline-banner { background: var(--ambar-bg); color: #8a5a07; border-bottom: 1px solid #f2d9a6; padding: 10px 20px; text-align: center; font-weight: 600; }
.offline-banner a { color: var(--salmon-600); }

/* ===== Muestreos: panel superior ===== */
.m-overview { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 1100px) { .m-overview { grid-template-columns: 1fr; } }
.m-hero { background: radial-gradient(600px 240px at 100% 0, rgba(23,154,168,.35), transparent 70%), linear-gradient(150deg, var(--ocean-950), var(--ocean-800)); color: #fff; border-radius: 16px; padding: 22px 24px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 600px) { .m-hero { grid-template-columns: 1fr; } }
.m-hero .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: #8fb6c8; font-weight: 650; }
.dist { margin-top: 10px; }
.dist-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.1); }
.dist-bar span { display: block; height: 100%; }
.dist-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: .85rem; }
.dist-legend a { color: #cfe3ec; display: inline-flex; align-items: center; gap: 6px; }
.dist-legend a:hover { color: #fff; text-decoration: none; }
.dist-legend b { color: #fff; font-variant-numeric: tabular-nums; }
.m-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.m-hero-stats a { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px; color: #fff; }
.m-hero-stats a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.m-hero-stats b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.m-hero-stats span { font-size: .72rem; color: #8fb6c8; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.farm-list { display: flex; flex-direction: column; gap: 2px; max-height: 232px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.farm { display: grid; grid-template-columns: minmax(0, 1fr) 120px 62px; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.farm:hover { background: var(--teal-100); text-decoration: none; }
.farm .fn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.farm .fn small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.farm .mini { display: flex; height: 8px; border-radius: 9px; overflow: hidden; background: var(--line-soft); }
.farm .mini span { display: block; height: 100%; }
.farm .fv { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ===== Muestreos: barra de herramientas ===== */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.seg a:hover { background: var(--bg); color: var(--ocean-800); text-decoration: none; }
.seg a.on { background: var(--ocean-800); color: #fff; }
.seg a .c { background: var(--bg); color: var(--ocean-800); border-radius: 999px; padding: 0 8px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.seg a.on .c { background: rgba(255,255,255,.18); color: #fff; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { padding-left: 40px; background: var(--surface); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select { width: auto; min-width: 210px; background-color: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--salmon-100); color: #a2412a; font-weight: 600; font-size: .85rem; }
.chip a { color: inherit; font-weight: 800; }
.chip a:hover { text-decoration: none; }

/* ===== Muestreos: filas ===== */
.month { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 18px 4px 8px; display: flex; align-items: center; gap: 10px; }
.month::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mrows { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: 6px 64px minmax(0, 1.6fr) minmax(0, 1.2fr) 190px 18px; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px 0 0; min-height: 86px; color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s; overflow: hidden; }
.mrow:hover { text-decoration: none; border-color: #c3d7e0; box-shadow: 0 8px 22px rgba(6,40,61,.08); transform: translateY(-1px); }
.mrow .sem { align-self: stretch; background: var(--c, var(--gris)); }
.tank { width: 64px; height: 56px; border-radius: 12px; background: var(--bg); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.tank small { display: block; font-size: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tank b { font-size: 1.35rem; color: var(--ocean-900); }
.mrow .id { min-width: 0; padding: 12px 0; }
.mrow .id .t { font-weight: 700; color: var(--ocean-900); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .id .t .batch { color: var(--salmon-600); }
.mrow .id .s { color: var(--muted); font-size: .84rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .id .cod { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; color: var(--muted); }
.mrow .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mprog { display: grid; gap: 5px; }
.mprog .r { display: grid; grid-template-columns: 70px 1fr 52px; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.mprog .r .tr { height: 6px; background: var(--line-soft); border-radius: 9px; overflow: hidden; }
.mprog .r .tr i { display: block; height: 100%; background: var(--teal-500); border-radius: 9px; }
.mprog .r .tr i.ok { background: var(--verde); }
.mprog .r span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ocean-800); }
.mmeta { font-size: .84rem; color: var(--muted); display: grid; gap: 4px; }
.mmeta b { color: var(--ocean-800); font-weight: 650; }
.mscore { text-align: right; }
.mscore .v { font-size: 1.55rem; font-weight: 800; color: var(--ocean-900); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mscore .v small { font-size: .85rem; color: var(--muted); font-weight: 600; }
.mscore .gauge { position: relative; height: 6px; border-radius: 9px; margin: 8px 0 7px; background: linear-gradient(90deg, var(--verde) 0 25%, var(--ambar) 25% 70%, var(--rojo) 70%); }
.mscore .gauge i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--ocean-900); transform: translateX(-2px); box-shadow: 0 0 0 2px #fff; }
.mscore.none .v { color: var(--gris); font-size: 1rem; font-weight: 650; }
.chev { color: var(--gris); font-size: 1.5rem; }
@media (max-width: 1000px) {
  .mrow { grid-template-columns: 6px 56px minmax(0, 1fr) 160px; padding-right: 12px; }
  .mrow .mid, .mrow .chev { display: none; }
}
@media (max-width: 600px) {
  .mrow { grid-template-columns: 6px 52px minmax(0, 1fr); }
  .mrow .mscore { grid-column: 2 / -1; text-align: left; padding-bottom: 12px; }
}

/* ===== Encabezado de un muestreo con pestañas ===== */
.m-head { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.m-head-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 22px; background: radial-gradient(500px 200px at 100% 0, rgba(23,154,168,.3), transparent 70%), linear-gradient(150deg, var(--ocean-950), var(--ocean-800)); color: #fff; }
.m-head-top .crumbs, .m-head-top .crumbs a { color: #8fb6c8; }
.m-head-top h1 { color: #fff; margin: 2px 0 6px; font-size: 1.4rem; }
.m-head-top .meta { color: #b9d6e2; font-size: .9rem; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.m-head-top .meta b { color: #fff; }
.m-head-top .tank { background: rgba(255,255,255,.1); width: 72px; height: 66px; }
.m-head-top .tank b { color: #fff; font-size: 1.6rem; }
.m-head-top .tank small { color: #8fb6c8; }
.m-head-score { text-align: right; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.12); min-width: 150px; }
.m-head-score .v { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.m-head-score .v small { font-size: .9rem; color: #a9c8d6; font-weight: 600; }
.m-head-score .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #8fb6c8; font-weight: 650; }
@media (max-width: 760px) { .m-head-top { grid-template-columns: 1fr; } .m-head-top .tank { display: none; } .m-head-score { text-align: left; border-left: 0; padding-left: 0; } }
.m-tabs { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; }
.m-tabs a { padding: 13px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.m-tabs a:hover { color: var(--ocean-800); text-decoration: none; background: var(--bg); }
.m-tabs a.on { color: var(--ocean-900); border-bottom-color: var(--salmon-500); }
.m-tabs .sep { width: 1px; background: var(--line); margin: 10px 6px; flex: none; }
.m-tabs .n { background: var(--bg); color: var(--ocean-800); border-radius: 999px; padding: 0 7px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.m-tabs a.on .n { background: var(--salmon-100); color: var(--salmon-600); }

/* ===== Selector de idioma (barra superior) ===== */
.idioma select { width: auto; min-height: 30px; padding: 2px 6px; font-size: .75rem; background: transparent; color: inherit; border-color: rgba(255,255,255,.25); }
.idioma select option { color: #06283d; }
.user a.avatar { text-decoration: none; }

/* ===== Calendario ===== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-d { min-height: 92px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-d.fuera { opacity: .45; }
.cal-d.hoy { border-color: var(--teal-500); box-shadow: inset 0 0 0 1px var(--teal-500); }
.cal-n { font-size: .75rem; font-weight: 700; color: var(--muted); }
.cal-e { font-size: .7rem; line-height: 1.25; padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--text); }
.cal-e.prog { background: var(--teal-100); }
.cal-e.prog.cancelado { text-decoration: line-through; opacity: .6; }
.cal-e.prog.realizado { background: var(--verde-bg); }
.cal-e.mues { background: var(--gris-bg); }
.cal-e.tras { background: var(--salmon-100); }
@media (max-width: 700px) { .cal-d { min-height: 64px; } .cal-e { font-size: .62rem; } }

/* ===== Fotos de evidencia ===== */
.fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.fotos figure { margin: 0; position: relative; }
.fotos img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.fotos figcaption { font-size: .7rem; color: var(--muted); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Avance colaborativo ===== */
.operadores { display: grid; gap: 6px; }
.operadores .op { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .85rem; }
.operadores .op .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.operadores .op .bar span { display: block; height: 100%; background: var(--teal-600); border-radius: 3px; }
.ia-texto { white-space: pre-line; line-height: 1.55; }

/* ===== Barra superior con más secciones ===== */
.nav a, .nav summary { white-space: nowrap; }
.user > span:not(.avatar):not(.t-conn-mini) { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.user > span small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1500px) { .brand small { display: none; } .nav { gap: 2px; } .nav a, .nav summary { padding-left: 9px; padding-right: 9px; } }

/* ===== Responsivo: menú en panel, encabezado compacto y sin desborde horizontal ===== */
.menu-btn { display: none; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; width: 40px; height: 40px; place-items: center; cursor: pointer; flex: none; }
.grid > *, .kpis > *, .strip > * { min-width: 0; }
img, video, canvas { max-width: 100%; }
@media (max-width: 1180px) {
  .menu-btn { display: grid; order: -1; }
  .topbar-in { gap: 12px; }
  .nav { display: none; position: fixed; top: 62px; left: 0; bottom: 0; width: min(320px, 86vw); flex-direction: column; gap: 2px; padding: 12px; background: var(--ocean-950); overflow-y: auto; box-shadow: 8px 0 30px rgba(0,0,0,.3); z-index: 40; }
  body.menu-abierto .nav { display: flex; }
  body.menu-abierto::after { content: ""; position: fixed; inset: 62px 0 0 0; background: rgba(4,20,32,.45); z-index: 35; }
  .nav a, .nav summary { padding: 12px 14px !important; font-size: 1rem; }
  .nav-menu > div { position: static; box-shadow: none; background: transparent; padding: 0 0 6px 12px; min-width: 0; }
  .nav-menu > div a { color: #cfe3ec; font-weight: 500; }
  .nav-menu > div a:hover { background: rgba(255,255,255,.08); }
  .user { margin-left: auto; }
}
@media (max-width: 760px) {
  .topbar-in { padding: 0 12px; gap: 8px; }
  .brand span small, .user > span:not(.avatar):not(.t-conn-mini), .user form:not(.idioma):not(#form-logout) { display: none; }
  .brand span { font-size: 1.05rem; }
  .user { gap: 8px; }
  .t-conn-mini { display: none; }
  .wrap { padding: 16px 12px 48px; }
  .card { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .kpi .v { font-size: 1.35rem; }
  .strip { grid-template-columns: 1fr 1fr !important; }
  .strip > div { padding: 12px 14px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 1.45rem; }
  .card table:not(.kv) { display: block; overflow-x: auto; }
  .filters .field { min-width: 0; flex: 1 1 140px; }
  .sticky-actions .btn-lg { min-width: 0 !important; flex: 1; }
  dialog { width: 96vw !important; }
  .cal { gap: 2px; }
  .cal-h { font-size: .62rem; }
}

/* ===== Muestreos: filas compactas, filtros y vista de tabla ===== */
.toolbar { justify-content: space-between; }
.modo { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.modo a { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); }
.modo a:hover { background: var(--bg); color: var(--ocean-800); }
.modo a.on { background: var(--ocean-800); color: #fff; }
.filtros-m { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; }
.filtros-m .search { flex: 1 1 260px; }
.filtros-m select { width: auto; min-width: 170px; flex: 0 1 auto; background-color: var(--surface); }
.filtro-chip { margin: 0; padding: 0 12px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .88rem; white-space: nowrap; }
.resultado-m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 2px 0; min-height: 26px; }
.mrows { gap: 6px; }
.mrow { grid-template-columns: 5px 52px minmax(0, 1.5fr) minmax(0, 1fr) 150px 14px; gap: 14px; min-height: 64px; border-radius: 12px; }
.mrow .tank { width: 52px; height: 44px; border-radius: 10px; }
.mrow .tank b { font-size: 1.15rem; }
.mrow .tank small { font-size: .55rem; }
.mrow .id { padding: 9px 0; }
.mrow .id .t { font-size: .97rem; }
.mrow .id .s { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; white-space: normal; }
.mrow .id .s .badge { padding: 1px 8px; font-size: .72rem; }
.mrow .mmeta { gap: 2px; }
.mrow .mprog { gap: 3px; }
.mrow .mscore { display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; gap: 2px 8px; }
.mrow .mscore .v { font-size: 1.3rem; }
.mrow .mscore .gauge { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; height: 4px; }
.mrow .mscore .gauge i { top: -3px; height: 10px; width: 3px; }
.mrow .mscore.none { display: block; }
.mrow .mscore.none .v { display: block; font-size: .95rem; }
.proximo { color: var(--salmon-600) !important; }
.tabla-m { padding: 0; overflow: hidden; }
.tabla-m table { margin: 0; }
.tabla-m th { position: sticky; top: 0; background: var(--bg); z-index: 1; }
.tabla-m tr { border-left: 4px solid transparent; }
.tabla-m tr.sem-verde { border-left-color: var(--verde); }
.tabla-m tr.sem-ambar { border-left-color: var(--ambar); }
.tabla-m tr.sem-rojo { border-left-color: var(--rojo); }
.tabla-m .batch-t { color: var(--salmon-600); font-weight: 650; }
@media (max-width: 1000px) {
  .mrow { grid-template-columns: 5px 48px minmax(0, 1fr) 130px; }
}
@media (max-width: 600px) {
  .mrow { grid-template-columns: 5px 46px minmax(0, 1fr); gap: 10px; }
  .mrow .mscore { grid-column: 2 / -1; justify-content: start; padding-bottom: 10px; }
  .mrow .mscore .gauge { display: none; }
  .filtros-m select { flex: 1 1 140px; min-width: 0; }
  .toolbar .seg { width: 100%; }
}

/* ===== Menú de administración agrupado (mega menú) ===== */
.nav-mega > div { left: auto; right: 0; width: min(860px, 92vw); padding: 14px; }
.mega-grupos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.mega-grupo { display: grid; gap: 2px; align-content: start; }
.mega-t { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.nav-mega .mega-grupo a { display: flex !important; justify-content: flex-start !important; align-items: flex-start; gap: 10px; padding: 8px 10px !important; }
.nav-mega .mega-grupo a b { display: block; font-size: .9rem; color: var(--ocean-900); font-weight: 650; }
.nav-mega .mega-grupo a small { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; line-height: 1.3; margin-top: 1px; }
.nav-mega .mega-grupo a.on { background: var(--teal-100); }
.mega-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); color: var(--teal-600); }
.mega-todo { display: block !important; margin-top: 8px; padding: 10px 12px !important; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px !important; font-size: .85rem !important; color: var(--teal-600) !important; }
@media (max-width: 1180px) {
  .nav-mega > div { width: auto; padding: 0 0 6px 6px; }
  .mega-grupos { grid-template-columns: 1fr; gap: 2px; }
  .mega-t { color: #7fa3b5; padding: 10px 8px 2px; }
  .nav-mega .mega-grupo a b { color: #e1eef3; font-weight: 550; }
  .nav-mega .mega-grupo a small, .mega-ico { display: none; }
  .nav-mega .mega-grupo a.on { background: rgba(255,255,255,.08); }
  .mega-todo { border-top-color: rgba(255,255,255,.1); color: #7fd6df !important; }
}

/* ===== Inicio de administración ===== */
.admin-grupos { display: grid; gap: 22px; }
.admin-grupo h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.admin-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.admin-tarjeta { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); transition: box-shadow .15s, border-color .15s, transform .15s; }
.admin-tarjeta:hover { text-decoration: none; border-color: #c3d7e0; box-shadow: 0 8px 22px rgba(6,40,61,.08); transform: translateY(-1px); }
.admin-tarjeta .mega-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-100); }
.admin-tarjeta b { display: block; color: var(--ocean-900); font-size: 1rem; }
.admin-tarjeta small { display: block; color: var(--muted); font-size: .85rem; margin-top: 3px; line-height: 1.4; }
.mrow { grid-template-columns: 5px 52px minmax(0, 1.5fr) minmax(0, 1fr) 200px 14px; }
.mrow .mscore .v { white-space: nowrap; }
@media (max-width: 1000px) { .mrow { grid-template-columns: 5px 48px minmax(0, 1fr) 190px; } }
@media (max-width: 600px) { .mrow { grid-template-columns: 5px 46px minmax(0, 1fr); } }
@media (min-width: 1181px) {
  /* El panel se centra en la pantalla: anclado al botón se salía por la izquierda. */
  .nav-mega > div { position: fixed; top: 58px; left: 50%; right: auto; transform: translateX(-50%); }
}

/* --- Traslados, grupo, vitrina, ayuda y tour --------------------------------------------- */
.viaje { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.viaje-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.escenario.mejor { border: 2px solid var(--verde); }
.lista-aprob { list-style: none; padding: 0; margin: 0; }
.lista-aprob li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.lista-aprob li:last-child { border-bottom: 0; }
.comentario { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.comentario-txt { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.mencion { color: var(--ocean-800); font-weight: 600; background: rgba(14, 116, 144, .08); border-radius: 4px; padding: 0 3px; }
.mencion-lista { position: absolute; z-index: 20; left: 0; top: 100%; margin: 2px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(4, 28, 44, .14); min-width: 240px; }
.mencion-lista li { padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.mencion-lista li.activo, .mencion-lista li:hover { background: var(--bg); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
.legal-in.ancho { max-width: 1180px; }
.vitrina { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.vitrina .lote { margin: 0; }
.vitrina .lote h2 { font-size: 1.05rem; margin: 0; }
.reserva > summary { list-style: none; display: inline-flex; margin-top: 8px; }
.reserva > summary::-webkit-details-marker { display: none; }
.ayuda-cat h2 { margin: 22px 0 8px; font-size: 1.05rem; }
.ayuda-art { margin: 0 0 8px; padding: 12px 16px; }
.ayuda-art summary { cursor: pointer; }
.ayuda-art ul { margin: 10px 0 0 18px; line-height: 1.6; }
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-velo { position: absolute; inset: 0; background: rgba(4, 28, 44, .45); }
.tour-caja { position: fixed; width: min(340px, calc(100vw - 32px)); background: #fff; color: var(--text); border-radius: 14px; padding: 16px 18px; box-shadow: 0 16px 40px rgba(4, 28, 44, .3); }
.tour-foco { position: relative; z-index: 101; outline: 3px solid var(--salmon-500); outline-offset: 3px; border-radius: 8px; }
@media (max-width: 700px) { .vitrina { grid-template-columns: 1fr; } }
/* Barra superior: con todos los módulos, el nombre del usuario se oculta antes de que falte espacio. */
@media (min-width: 1181px) and (max-width: 1560px) {
  .topbar-in { gap: 16px; }
  .nav a, .nav-menu > summary { padding: 8px 10px; }
  .user > span { display: none; }
}

/* --- Operación, trazabilidad, auditoría y uso ---------------------------------------------- */
.item-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: inherit; }
.item-fila:last-child { border-bottom: 0; }
a.item-fila:hover { text-decoration: none; background: var(--bg); }
.item-fila > :first-child { min-width: 0; flex: 1; }
.kv-2 { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 6px 16px; }
.kv-2 dt, .kv-2 dd { margin: 0; }
.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 6px; border-left: 2px solid var(--line); }
.linea-tiempo li { display: flex; gap: 12px; padding: 8px 0 8px 14px; position: relative; }
.lt-icono { position: absolute; left: -15px; top: 9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: #fff; border: 2px solid var(--line); color: var(--ocean-800); }
.linea-tiempo li > div { padding-left: 10px; }
.lt-muestreo .lt-icono { border-color: var(--teal-600); color: var(--teal-600); }
.lt-tratamiento .lt-icono, .lt-reclamo .lt-icono { border-color: var(--rojo); color: var(--rojo); }
.lt-traslado .lt-icono, .lt-mar .lt-icono { border-color: var(--ocean-800); }
.lt-cosecha .lt-icono, .lt-certificado .lt-icono { border-color: var(--verde); color: var(--verde); }
.lt-inventario .lt-icono, .lt-manejo .lt-icono { border-color: var(--salmon-500); color: var(--salmon-500); }
.auditoria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.auditoria-item { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px; text-align: center; }
.auditoria-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); }
.auditoria-item .btn-row { justify-content: center; }
.barra-uso { display: grid; grid-template-columns: 120px 1fr 60px; gap: 10px; align-items: center; padding: 4px 0; font-size: .9rem; }
.barra-uso div { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.barra-uso i { display: block; height: 100%; background: var(--teal-600); border-radius: 4px; }
.barra-uso b { text-align: right; font-weight: 600; }
.checks-estanques { max-height: 220px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 10px; }
@media (max-width: 700px) { .kv-2 { grid-template-columns: max-content 1fr; } .barra-uso { grid-template-columns: 90px 1fr 50px; } }
/* Barra superior en teléfonos: el logo sin el nombre y menos espacio, para que «Salir» siempre quepa. */
@media (max-width: 460px) {
  .topbar-in { gap: 8px; padding: 0 10px; }
  .topbar .brand > span { display: none; }
  .user { gap: 6px; }
  .user form button { padding: 6px 8px; }
}

/* Consola de la plataforma */
.plat-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plat-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ocean-800); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); background: #fff; }
.plat-nav a:hover { text-decoration: none; border-color: var(--teal-600); }
.plat-nav a.activo { background: var(--ocean-800); color: #fff; border-color: var(--ocean-800); }
.acciones-usuario { position: relative; }
.acciones-usuario > summary { list-style: none; }
.acciones-usuario > summary::-webkit-details-marker { display: none; }
.acciones-usuario > div { position: static; margin-top: 6px; display: grid; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(4, 28, 44, .15); min-width: 240px; }
.acciones-usuario form button { width: 100%; justify-content: flex-start; }
.aviso-global { font-weight: 600; }

/* Páginas de error */
.pagina-error { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(170deg, var(--ocean-950), var(--ocean-800)); color: #fff; padding: 24px; }
.pagina-error main { max-width: 520px; text-align: center; }
.pagina-error .brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }
.pagina-error .brand b { color: var(--salmon-500); }
.pagina-error .codigo { font-size: 4rem; font-weight: 800; color: var(--salmon-500); line-height: 1; }
.pagina-error h1 { color: #fff; margin: 10px 0; }
.pagina-error p { color: #b9d6e2; line-height: 1.6; margin-bottom: 24px; }
.pagina-error .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.login-marca-movil { display: none; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; color: var(--ocean-900); margin-bottom: 18px; }
.login-marca-movil b { color: var(--salmon-500); }
@media (max-width: 900px) { .login-marca-movil { display: inline-flex; } }

/* Paginación */
.paginacion { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.paginacion p { margin: 0; }
.paginacion ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.pag-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ocean-800); font-weight: 600; font-size: .9rem; }
a.pag-btn:hover { border-color: var(--teal-600); text-decoration: none; }
.pag-btn.actual { background: var(--ocean-800); border-color: var(--ocean-800); color: #fff; }
.pag-btn.deshabilitado { color: var(--muted); opacity: .55; }
.pag-btn.puntos { border: 0; background: none; min-width: 24px; }
