/* Portal de Soporte — Project Elit, SRL
   Identidad: naranja #E17000, gris #A2A4A3, texto #333333, durazno #FDEBD9, Arial. */
:root {
  --orange: #E17000; --orange-dark: #B85C00; --orange-soft: #FDEBD9; --orange-tint: #FFF6EE;
  --gray: #A2A4A3; --gray-dark: #6E7170; --text: #333333; --muted: #6E7170;
  --bg: #F5F5F4; --surface: #FFFFFF; --line: #E4E4E2; --line-strong: #CFCFCC;
  --ok: #2E7D4F; --ok-soft: #E3F2E8; --warn: #B7791F; --warn-soft: #FDF3DC;
  --bad: #C0392B; --bad-soft: #FBE5E2; --info: #2B6CB0; --info-soft: #E3EEF9;
  --p1: #C0392B; --p2: #E17000; --p3: #B7791F; --p4: #6E7170;
  --radius: 8px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --sidebar: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* Franja de ambiente (pruebas) */
.envbar { position: sticky; top: 0; z-index: 80; background: repeating-linear-gradient(135deg, #B85C00 0 14px, #E17000 14px 28px); color: #fff; text-align: center; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 18px 14px; border-bottom: 3px solid var(--orange); }
.brand img { width: 160px; display: block; }
.brand .tag { font-size: 11px; color: var(--gray-dark); letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }
.nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: var(--text); font-weight: 600; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--orange-soft); color: var(--orange-dark); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.side-foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--gray-dark); }
.side-foot strong { color: var(--text); display: block; font-size: 12.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar .org { font-weight: 700; }
.topbar .org small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.icon-btn.menu-btn { display: none; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; background: var(--orange); color: #fff; font-size: 10.5px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 22px; border: 1px solid transparent; background: none; }
.user-chip:hover { border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.avatar.client { background: var(--gray-dark); }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who small { color: var(--muted); font-size: 11.5px; display: block; }
.view { padding: 24px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 14.5px; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--line-strong); }
.kpi.accent { border-top-color: var(--orange); }
.kpi.good { border-top-color: var(--ok); } .kpi.bad { border-top-color: var(--bad); } .kpi.warn { border-top-color: var(--warn); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn.danger { color: var(--bad); border-color: #E7B7B1; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 11px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--gray-dark); border: 1px solid var(--line); }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-nuevo { background: var(--info-soft); color: var(--info); border-color: transparent; }
.b-asignado { background: #EEE8F7; color: #5B3E96; border-color: transparent; }
.b-en_progreso { background: var(--orange-soft); color: var(--orange-dark); border-color: transparent; }
.b-en_espera { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.b-resuelto { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.b-cerrado, .b-cancelado { background: var(--bg); color: var(--gray-dark); }
.prio { display: inline-block; min-width: 28px; text-align: center; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; color: #fff; }
.prio.P1 { background: var(--p1); } .prio.P2 { background: var(--p2); } .prio.P3 { background: var(--p3); } .prio.P4 { background: var(--p4); }
.sla { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.sla.en_tiempo, .sla.cumplido { color: var(--ok); } .sla.riesgo, .sla.pausado { color: var(--warn); } .sla.vencido, .sla.incumplido { color: var(--bad); } .sla.n\/a { color: var(--gray); }
.lvl { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--gray-dark); }
.lvl.l2 { border-color: var(--orange); color: var(--orange-dark); } .lvl.l3 { background: var(--bad); color: #fff; border-color: var(--bad); }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.st::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gray); }
.st.operativo::before { background: var(--ok); } .st.degradado::before { background: var(--warn); } .st.fuera_servicio::before { background: var(--bad); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-dark); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFAF9; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--orange-tint); }
.tbl .subject { font-weight: 600; }
.table-wrap { overflow-x: auto; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters input[type=search] { min-width: 240px; flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: none; background: var(--surface); padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 12.5px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--orange); color: #fff; }

label.f { display: block; font-weight: 700; font-size: 12.5px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.filters select, .filters input { width: auto; }
.choice { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice label { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: block; }
.choice label:hover { border-color: var(--orange); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--orange); background: var(--orange-tint); box-shadow: inset 0 0 0 1px var(--orange); }
.choice b { display: block; font-size: 13px; }
.choice span { font-size: 12px; color: var(--muted); }
.prio-preview { display: flex; gap: 14px; align-items: center; padding: 12px 14px; background: var(--orange-tint); border: 1px solid var(--orange-soft); border-radius: 8px; }
.prio-preview .prio { font-size: 15px; padding: 4px 10px; }

.notice { padding: 12px 14px; border-radius: 8px; border: 1px solid; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); border-color: #F1D9A6; }
.notice.bad { background: var(--bad-soft); border-color: #EFC2BC; }
.notice.info { background: var(--orange-tint); border-color: var(--orange-soft); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: none; }
.list li.click { cursor: pointer; } .list li.click:hover { background: var(--orange-tint); }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datebox { width: 46px; text-align: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.datebox .m { background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1px 0; }
.datebox .d { font-size: 17px; font-weight: 700; padding: 1px 0; }
.datebox.late .m { background: var(--bad); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar { height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 5px; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.progress .p-rec { background: var(--ok); } .progress .p-eje { background: #7BC096; } .progress .p-late { background: var(--bad); }

/* Timeline del caso */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: none; }
.tl .body { flex: 1; min-width: 0; }
.tl .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tl .meta b { color: var(--text); }
.tl .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl.sys { padding-top: 8px; padding-bottom: 8px; background: #FAFAF9; }
.tl.sys .txt { font-size: 12.5px; color: var(--gray-dark); }
.tl.sys .ic { width: 32px; display: grid; place-items: center; color: var(--gray); }
.tl.sys .ic svg { width: 15px; height: 15px; }
.tl.internal { background: #FFF9E6; }
.tl.esc { background: var(--bad-soft); }
.tl.esc .txt { color: var(--bad); font-weight: 600; }
.composer { padding: 14px 16px; border-top: 1px solid var(--line); background: #FAFAF9; border-radius: 0 0 var(--radius) var(--radius); }
.composer textarea { min-height: 80px; background: var(--surface); }
.composer.internal textarea { background: #FFF9E6; border-color: #EBD27A; }
.composer .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: none; background: none; padding: 11px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--orange-dark); border-bottom-color: var(--orange); }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.dl dt { color: var(--muted); font-weight: 600; } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.slabox { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.slabox .top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; }
.slabox .progress { margin: 7px 0 5px; }
.slabox .progress i { background: var(--ok); }
.slabox.riesgo .progress i { background: var(--warn); } .slabox.vencido .progress i, .slabox.incumplido .progress i { background: var(--bad); }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.files svg { width: 15px; height: 15px; color: var(--gray-dark); flex: none; }
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--line-strong); padding: 0; line-height: 1; }
.stars button.on { color: var(--orange); }

/* Objetos de servicio */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.asset { cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s; }
.asset:hover { border-color: var(--orange); }
.asset .top { padding: 14px 16px 10px; display: flex; gap: 12px; }
.asset .cat { width: 42px; height: 42px; border-radius: 8px; background: var(--orange-soft); color: var(--orange-dark); display: grid; place-items: center; flex: none; }
.asset .cat svg { width: 22px; height: 22px; }
.asset .code { font-weight: 700; font-size: 15px; }
.asset .foot { margin-top: auto; padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 8px; }
.group-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-dark); font-weight: 700; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.group-h::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* Cronograma (matriz) */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
.matrix th { background: #FAFAF9; font-weight: 700; padding: 6px 4px; color: var(--gray-dark); font-size: 11px; min-width: 40px; }
.matrix th.yr { background: var(--orange); color: #fff; border-right-color: #F2A35E; }
.matrix th.now { background: var(--orange-soft); color: var(--orange-dark); }
.matrix td.asset-c { text-align: left; padding: 6px 10px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.matrix td.asset-c b { display: block; font-size: 12.5px; }
.matrix td.cellm { height: 38px; }
.mcell { width: 30px; height: 26px; margin: 0 auto; border-radius: 5px; display: grid; place-items: center; font-weight: 700; font-size: 11px; cursor: pointer; border: 1px solid transparent; }
.mcell.programado, .mcell.confirmado { background: var(--orange-soft); color: var(--orange-dark); border-color: #F5C597; }
.mcell.confirmado { background: var(--orange); color: #fff; }
.mcell.reprogramado { background: var(--warn-soft); color: var(--warn); border-color: #EBCB85; }
.mcell.ejecutado { background: #CDE9D7; color: var(--ok); }
.mcell.recibido { background: var(--ok); color: #fff; }
.mcell.cancelado { background: var(--bg); color: var(--gray); text-decoration: line-through; }
.mcell.late { background: var(--bad); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 12px 16px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .mcell { width: 18px; height: 16px; cursor: default; font-size: 9px; }
.cycle { padding: 16px; }
.cycle .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cycle .amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cycle .progress { margin: 10px 0 8px; height: 10px; }

/* Evidencias de mantenimiento */
.ev h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 6px 0 8px; }
.ev h3 svg { width: 16px; height: 16px; color: var(--orange); }
.ev .files li { border-bottom: 1px solid var(--line); }
.ev .files .del, .chip button { margin-left: auto; }
.ev-empty { margin: 0 0 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 8px; }
.gallery:empty { display: none; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.thumb > button:not(.del) { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.new { outline: 2px dashed var(--orange); outline-offset: -2px; }
.del { width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.del svg { width: 13px; height: 13px; }
.thumb .del { position: absolute; top: 5px; right: 5px; }
.files .del { background: var(--bg); color: var(--gray-dark); border: 1px solid var(--line); }
.files .del:hover { background: var(--bad-soft); color: var(--bad); }
.drop { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px dashed var(--line-strong); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; margin: 6px 0 8px; }
.drop:hover { border-color: var(--orange); background: var(--orange-tint); }
.drop svg { width: 18px; height: 18px; color: var(--orange); flex: none; }
.drop .muted { font-weight: 400; }
.pend:empty { display: none; }
.chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px dashed var(--orange); border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.chip svg { width: 15px; height: 15px; }
.chip button { border: none; background: none; cursor: pointer; color: var(--gray-dark); display: grid; padding: 2px; }
.evb { display: inline-flex; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--gray-dark); white-space: nowrap; }
.lightbox { position: fixed; inset: 0; background: rgba(15,15,15,.92); z-index: 70; display: grid; place-items: center; padding: 48px 56px; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { color: #DDD; font-size: 13px; text-align: center; }
.lightbox figcaption a { color: #F2A35E; }
.lb-x, .lb-nav { position: absolute; border: none; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.lb-x { top: 14px; right: 14px; width: 40px; height: 40px; } .lb-x svg { width: 20px; height: 20px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.lb-x:hover, .lb-nav:hover { background: rgba(255,255,255,.25); }

/* Modal, menús y avisos */
.backdrop { position: fixed; inset: 0; background: rgba(30,30,30,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-h { padding: 16px 20px; border-bottom: 3px solid var(--orange); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #FAFAF9; }
.pop { position: absolute; top: 52px; right: 16px; width: 380px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.15); z-index: 40; overflow: hidden; }
.pop .card-h { padding: 12px 14px; }
.pop .list { max-height: 420px; overflow: auto; }
.pop .list li { align-items: flex-start; font-size: 13px; }
.pop .list li.unread { background: var(--orange-tint); }
.pop .menu a, .pop .menu button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: none; cursor: pointer; color: var(--text); font-weight: 600; }
.pop .menu a:hover, .pop .menu button:hover { background: var(--bg); text-decoration: none; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2A2A2A; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 600; }
.toast.err { background: var(--bad); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: linear-gradient(150deg, #2B2B2B 0%, #3A3A3A 60%, #4A3626 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 50px solid rgba(225,112,0,.25); }
.login .hero h1 { font-size: 34px; max-width: 460px; }
.login .hero h1 em { color: var(--orange); font-style: normal; }
.login .hero p { color: #D6D6D4; max-width: 440px; font-size: 15px; }
.login .hero ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: #E8E8E6; }
.login .hero li::before { content: '—'; color: var(--orange); margin-right: 10px; font-weight: 700; }
.login .hero .lfoot { font-size: 12px; color: #A9A9A7; position: relative; z-index: 1; }
.login .pane { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login form { width: 100%; max-width: 360px; }
.login form img { width: 210px; margin-bottom: 26px; }
.login form h2 { font-size: 20px; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn.ms { border-color: #8C8C8C; color: #262626; gap: 10px; }
.btn.ms:hover { background: #F3F3F3; }
.login .err { color: var(--bad); font-weight: 600; font-size: 13px; min-height: 20px; margin-bottom: 6px; }

@media (max-width: 1100px) { .g-main { grid-template-columns: 1fr; } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .icon-btn.menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .topbar .org, .user-chip .who { display: none; }
  .view { padding: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .choice { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .hero { display: none; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; }
}
@media print { .sidebar, .topbar, .btn, .composer { display: none !important; } .app { display: block; } .card { box-shadow: none; } }
