/* CLIMA CR · panel de administración */
:root {
  --bg: #f0f4f8; --card: #fff; --ink: #0b1b27; --ink-2: #27394a; --muted: #64768a; --line: #e1e8ef; --line-2: #cfdae4;
  --navy: #0a1621; --navy-2: #0f2536; --teal: #19a7b5; --teal-b: #2bd0de; --teal-d: #0c7482; --teal-soft: #e2f6f8;
  --blue: #2f80ed; --purple: #7b61ff; --amber: #e08a2c; --green: #1f9d55; --red: #d63a40; --gray: #8394a5;
  --r: 14px; --r-sm: 10px; --sh: 0 1px 2px rgba(11, 27, 39, .05), 0 4px 14px rgba(11, 27, 39, .05); --sh-lg: 0 24px 60px rgba(11, 27, 39, .25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-h: 'Poppins', 'Inter', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-h); margin: 0; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 600; } h4 { font-size: .9rem; margin-bottom: 10px; color: var(--ink-2); }
p { margin: 0 0 .8em; } a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
.ic { vertical-align: -.2em; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(43, 208, 222, .6); outline-offset: 1px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .pre { white-space: pre-wrap; }
.up { color: var(--green); font-weight: 600; } .down { color: var(--red); font-weight: 600; }
.spacer { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--teal-d); font-weight: 600; text-decoration: none; font-size: .88rem; display: inline-flex; gap: 4px; align-items: center; }
.link:hover { text-decoration: underline; }

/* Botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: #f5f9fc; border-color: #b9c8d5; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--teal-b); border-color: var(--teal-b); color: #03202a; }
.btn-primary:hover { background: #4ddae7; border-color: #4ddae7; box-shadow: 0 4px 14px rgba(43, 208, 222, .4); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; } .btn-danger:hover { background: #c02f35; }
.btn-ghost-danger { color: var(--red); border-color: transparent; background: transparent; } .btn-ghost-danger:hover { background: #fdecec; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-wa-soft { background: #e6f8ed; border-color: #c4ecd2; color: #11793c; } .btn-wa-soft:hover { background: #d5f3e0; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); flex-shrink: 0; position: relative; }
.icon-btn:hover { background: #e7eef4; } .icon-btn.bordered { border: 1px solid var(--line-2); background: #fff; } .icon-btn.danger:hover { background: #fdecec; color: var(--red); }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.fld input, .fld select, .fld textarea, .in-sm { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s; }
.fld input[type=color] { padding: 3px; height: 40px; }
.in-sm { width: auto; padding: 7px 11px; font-size: .88rem; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .in-sm:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(25, 167, 181, .18); }
.fld textarea { resize: vertical; }
.help { color: var(--muted); font-size: .78rem; } .req { color: var(--red); font-style: normal; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.one { grid-template-columns: 1fr; } .form-grid .wide, .wide { grid-column: 1 / -1; }
.form-error { background: #fdecec; color: #a42a2f; border-radius: 9px; padding: 10px 14px; font-size: .88rem; margin-top: 4px; }
.form-error[hidden] { display: none; }
.form-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

/* Inicio de sesión */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(135deg, #06090d, #0b1f2f 55%, #0e3a56); color: #fff; display: grid; place-items: center; padding: 48px; position: relative; overflow: hidden; }
.login-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 400px at 70% 80%, rgba(43, 208, 222, .25), transparent 70%), linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / 40px 40px; }
.la-in { position: relative; max-width: 420px; } .la-in h1 { font-size: 2.6rem; margin: 18px 0 10px; font-weight: 700; letter-spacing: .02em; }
.la-in p { color: #a9bccb; font-size: 1.05rem; } .la-in ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; color: #dce8f0; } .la-in li { display: flex; gap: 12px; align-items: center; } .la-in li .ic { color: var(--teal-b); }
.login-card { align-self: center; justify-self: center; width: min(400px, calc(100% - 40px)); display: grid; gap: 14px; padding: 40px 0; }
.login-card h2 { font-size: 1.7rem; } .login-logo { display: none; }
.pw { position: relative; } .pw input { padding-right: 44px; } .pw .icon-btn { position: absolute; right: 3px; top: 2px; }
.back-link { text-align: center; color: var(--muted); font-size: .88rem; text-decoration: none; } .back-link:hover { color: var(--teal-d); }

/* Estructura */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 252px; background: linear-gradient(180deg, #08121b, #0b1d2b); color: #b4c4d1; display: flex; flex-direction: column; z-index: 60; padding: 18px 14px; }
.side-brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: #fff; padding: 4px 8px 20px; }
.side-brand strong { display: block; font-family: var(--font-h); font-size: 1.15rem; letter-spacing: .03em; } .side-brand small { color: #7f93a3; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.side-nav { display: grid; gap: 3px; align-content: start; flex: 1; overflow-y: auto; }
.side-nav a, .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #b4c4d1; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.side-nav a:hover, .side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: rgba(43, 208, 222, .14); color: var(--teal-b); }
.side-nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal-b); }
.nb { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: #2a1500; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; font-style: normal; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: grid; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(255, 255, 255, .05); border-radius: 12px; } .me > div { flex: 1; min-width: 0; line-height: 1.25; }
.me strong { display: block; color: #fff; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me small { color: #7f93a3; font-size: .75rem; }
.me .icon-btn { color: #b4c4d1; } .me .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; font-family: var(--font-h); }
.main { margin-left: 252px; min-width: 0; }
.top { position: sticky; top: 0; z-index: 40; background: rgba(240, 244, 248, .9); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.menu-btn { display: none; }
.search { position: relative; margin-left: auto; width: min(380px, 100%); } .search .s-ic { position: absolute; left: 12px; top: 9px; color: var(--muted); }
.search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; }
.search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(25, 167, 181, .18); }
.s-res { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--sh-lg); border: 1px solid var(--line); max-height: 380px; overflow: auto; padding: 6px; z-index: 50; }
.s-res a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; } .s-res a:hover { background: #f0f6fa; } .s-res small { display: block; color: var(--muted); } .s-res p { padding: 10px; margin: 0; }
.bell .nb { position: absolute; top: -2px; right: -2px; }
.view { padding: 24px 28px 60px; max-width: 1500px; outline: none; }
.loading { display: flex; gap: 8px; justify-content: center; padding: 80px 0; } .loading i { width: 11px; height: 11px; border-radius: 50%; background: var(--teal); animation: bl 1s infinite; } .loading i:nth-child(2) { animation-delay: .15s; } .loading i:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }

/* Tarjetas y listas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--sh); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; } .card-h.pad { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.grid-2, .grid-3, .grid-2-1 { display: grid; gap: 18px; margin-bottom: 18px; } .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2-1 { grid-template-columns: 2fr 1fr; }
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; } .hello h2 { font-size: 1.6rem; } .hello p { color: var(--muted); margin: 4px 0 0; } .hello-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11, 27, 39, .1); }
.kpi small { color: var(--muted); font-weight: 500; display: block; } .kpi strong { display: block; font-family: var(--font-h); font-size: 1.55rem; line-height: 1.2; } .kpi em { font-style: normal; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.kpi-ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic.teal { background: var(--teal-soft); color: var(--teal-d); } .kpi-ic.blue { background: #e6effd; color: var(--blue); } .kpi-ic.amber { background: #fdf0e0; color: var(--amber); } .kpi-ic.purple { background: #efebff; color: var(--purple); } .kpi-ic.green { background: #e2f6ea; color: var(--green); }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.mini-kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; } .mini-kpis small { color: var(--muted); display: block; font-size: .8rem; } .mini-kpis strong { font-family: var(--font-h); font-size: 1.25rem; } .mini-kpis em { display: block; font-style: normal; font-size: .78rem; color: var(--muted); }
.mini-kpis.tight { margin-bottom: 16px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; } .row-item:last-child { border-bottom: 0; } .row-item:hover { background: #f5f9fc; }
.ri-main { flex: 1; min-width: 0; } .ri-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ri-main small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; } .ri-ic.amber { background: #fdf0e0; color: var(--amber); } .ri-ic.teal, .ri-ic.blue { background: var(--teal-soft); color: var(--teal-d); } .ri-ic.purple { background: #efebff; color: var(--purple); }
.date-chip { width: 46px; text-align: center; background: var(--teal-soft); color: var(--teal-d); border-radius: 10px; padding: 4px 0; flex-shrink: 0; } .date-chip small { display: block; text-transform: uppercase; font-size: .66rem; letter-spacing: .06em; font-weight: 700; } .date-chip strong { font-family: var(--font-h); font-size: 1.15rem; line-height: 1; }
.prio { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--gray); } .p-media { background: var(--blue); } .p-alta { background: var(--amber); } .p-urgente { background: var(--red); box-shadow: 0 0 0 3px rgba(214, 58, 64, .2); }
.empty-li { color: var(--muted); padding: 18px 6px; list-style: none; text-align: center; }
.act li { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; font-size: .88rem; } .act small { display: block; color: var(--muted); } .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); margin-top: 6px; flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge.amber { background: #fdf0e0; color: #a35f10; } .badge.blue { background: #e6effd; color: #1c5fc4; } .badge.purple { background: #efebff; color: #5a41d6; } .badge.green { background: #e2f6ea; color: #14773f; } .badge.gray { background: #eaeff3; color: #586a7b; } .badge.red { background: #fdecec; color: #b1272d; } .badge.teal { background: var(--teal-soft); color: var(--teal-d); }
.tag { display: inline-block; background: #eaeff3; padding: 1px 9px; border-radius: 999px; font-size: .78rem; }

/* Barra de herramientas */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tb-title { font-size: 1.05rem; font-weight: 600; margin: 0 4px; }
.seg { display: inline-flex; background: #e4ebf1; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: .86rem; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11, 27, 39, .15); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; } .tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { background: #e4ebf1; } .tabs button.active { background: var(--navy); color: #fff; } .tabs b { background: rgba(11, 27, 39, .1); border-radius: 10px; padding: 0 7px; font-size: .75rem; } .tabs button.active b { background: rgba(255, 255, 255, .2); }
.tabs.sm { margin: 14px 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.nav-btns { display: flex; gap: 6px; align-items: center; }
.hint { color: var(--muted); font-size: .86rem; margin: 0 0 16px; }
.custom-range { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); } .custom-range input { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 9px; }
.dropdown { position: relative; } .dropdown .menu { position: absolute; right: 0; top: 44px; background: #fff; border-radius: 12px; box-shadow: var(--sh-lg); border: 1px solid var(--line); padding: 6px; min-width: 170px; z-index: 20; } .dropdown .menu a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; } .dropdown .menu a:hover { background: #f0f6fa; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 16px; background: #f7fafc; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr[data-id] { cursor: pointer; } .tbl tbody tr:hover { background: #f5f9fc; } .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; } .tbl .act { width: 50px; text-align: right; }
.who { display: flex; align-items: center; gap: 11px; } .who small { display: block; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; display: grid; gap: 8px; justify-items: center; } .empty .ic { color: #b7c5d2; }

/* Gráficos */
.chart { width: 100%; height: auto; display: block; } .bar-val { font-size: 11px; fill: var(--ink-2); font-weight: 600; } .bar-lbl { font-size: 11.5px; fill: var(--muted); } .bar-g rect { transition: opacity .15s; } .bar-g:hover rect { opacity: .8; }
.hbars { display: grid; gap: 12px; } .hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 4px; } .hb-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb-top strong { white-space: nowrap; }
.hb-track { height: 8px; background: #edf2f6; border-radius: 6px; overflow: hidden; } .hb-track i { display: block; height: 100%; border-radius: 6px; }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; } .donut svg { width: 150px; height: 150px; flex-shrink: 0; } .d-big { font-family: var(--font-h); font-size: 19px; font-weight: 700; fill: var(--ink); } .d-sm { font-size: 10px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 150px; font-size: .86rem; } .legend li { display: flex; align-items: center; gap: 8px; } .legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; } .legend span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; } .rk { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; } .rk small { color: var(--muted); display: block; } .rk strong { font-family: var(--font-h); font-size: 1.45rem; display: block; line-height: 1.25; } .rk em { font-style: normal; color: var(--muted); font-size: .78rem; }
#rBody > .card, #rBody > .grid-2, #rBody > .grid-3 { margin-bottom: 18px; }
.print-head { display: none; }

/* Modales */
.modal-back { position: fixed; inset: 0; background: rgba(6, 14, 22, .55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; overflow: auto; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--sh-lg); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal.sm { max-width: 440px; } .modal.md { max-width: 620px; } .modal.lg { max-width: 780px; } .modal.xl { max-width: 960px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; align-items: flex-start; } .modal-head h2 { font-size: 1.2rem; } .modal-head p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.modal-body { padding: 4px 24px 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fafcfd; border-radius: 0 0 18px 18px; }
.confirm-msg { margin: 6px 0 0; font-size: 1rem; }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; } .dl > div { min-width: 0; } .dl dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; } .dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.sub-h { margin: 22px 0 10px; font-size: .95rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.img-field { display: flex; gap: 14px; align-items: center; } .img-prev { width: 110px; height: 82px; border-radius: 10px; background: #eef3f7; display: grid; place-items: center; color: #a9b9c7; overflow: hidden; flex-shrink: 0; border: 1px dashed var(--line-2); } .img-prev img { width: 100%; height: 100%; object-fit: cover; } .img-prev.loading { opacity: .5; }
.img-actions { display: grid; gap: 6px; justify-items: start; }
.checklist-ed { display: grid; gap: 8px; } .cl-row { display: flex; gap: 8px; align-items: center; } .cl-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--teal); } .cl-text { flex: 1; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; }
.quote-note { background: #fff8ec; border: 1px solid #f4dfba; border-radius: 10px; padding: 10px 14px; white-space: pre-wrap; }
.lines input { width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; } .lines td { padding: 6px 8px; } .lines th { padding: 8px; } .lines .n, .n { text-align: right; white-space: nowrap; }
.line-actions { display: flex; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.q-foot { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.totals { background: #f4f8fb; border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; } .totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .totals input { width: 110px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 8px; text-align: right; }
.totals .grand { border-top: 2px solid var(--navy); padding-top: 10px; font-size: 1.15rem; font-family: var(--font-h); }
.c-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; } .c-stats { display: flex; gap: 22px; } .c-stats small { color: var(--muted); display: block; font-size: .76rem; } .c-stats strong { font-family: var(--font-h); font-size: 1.15rem; } .c-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; } .timeline li:hover { background: #f5f9fc; }

/* Calendario */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wk-col { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 280px; display: flex; flex-direction: column; overflow: hidden; } .wk-col.today { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(25, 167, 181, .2); }
.wk-col header { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7fafc; } .wk-col.today header { background: var(--teal-soft); } .wk-col header small { text-transform: uppercase; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); } .wk-col header strong { font-family: var(--font-h); font-size: 1.2rem; } .wk-col header .icon-btn { margin-left: auto; width: 26px; height: 26px; align-self: center; }
.wk-body { padding: 8px; display: grid; gap: 7px; align-content: start; flex: 1; } .wk-empty { color: #b0bfcc; text-align: center; font-size: .82rem; margin: 18px 0; }
.ev { position: relative; text-align: left; border: 0; background: #f1f6fa; border-left: 4px solid var(--gray); border-radius: 8px; padding: 7px 9px; display: grid; gap: 1px; width: 100%; } .ev:hover { filter: brightness(.97); }
.ev .ev-t { font-size: .72rem; font-weight: 700; color: var(--muted); } .ev strong { font-size: .84rem; line-height: 1.25; } .ev small { color: var(--muted); font-size: .76rem; } .ev-tech { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.s-pendiente { border-left-color: var(--amber); } .s-confirmada { border-left-color: var(--blue); } .s-en_camino { border-left-color: var(--purple); } .s-completada { border-left-color: var(--green); opacity: .8; } .s-cancelada, .s-no_asistio { border-left-color: var(--gray); opacity: .55; text-decoration: line-through; }
.month { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; } .mo-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #f7fafc; border-bottom: 1px solid var(--line); } .mo-head span { padding: 9px; text-align: center; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); } .mo-cell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; } .mo-cell:hover { background: #f8fbfd; } .mo-cell:nth-child(7n) { border-right: 0; } .mo-cell b { font-size: .82rem; color: var(--ink-2); } .mo-cell.out { background: #fafbfc; } .mo-cell.out b { color: #b4c0cb; } .mo-cell.today b { background: var(--teal-b); color: #03202a; border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.mo-ev { border: 0; background: #f1f6fa; border-left: 3px solid var(--gray); border-radius: 5px; font-size: .72rem; padding: 2px 5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; } .mo-more { font-size: .72rem; color: var(--muted); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; } .kanban.k3 { grid-template-columns: repeat(3, minmax(260px, 1fr)); }
.kcol { background: #e8eef4; border-radius: 14px; padding: 10px; min-height: 220px; border: 2px dashed transparent; transition: background .15s, border-color .15s; } .kcol.over { background: #dff3f6; border-color: var(--teal); }
.kcol > header { display: flex; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; font-size: .84rem; color: var(--ink-2); } .kcol > header b { background: #fff; border-radius: 10px; padding: 0 9px; font-size: .78rem; }
.kbody { display: grid; gap: 9px; } .k-empty { text-align: center; color: #9aaab8; font-size: .82rem; padding: 18px 0; margin: 0; }
.kcard, .tcard { background: #fff; border-radius: 11px; padding: 11px 12px; box-shadow: 0 1px 3px rgba(11, 27, 39, .1); cursor: grab; display: grid; gap: 6px; border: 1px solid transparent; } .kcard:hover, .tcard:hover { border-color: var(--teal); } .dragging { opacity: .45; cursor: grabbing; }
.kmeta { font-size: .78rem; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.tcard.late { border-left: 4px solid var(--red); } .tc-top { display: flex; justify-content: space-between; align-items: center; } .tc-num { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; } .tc-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); } .tc-meta span { display: inline-flex; gap: 4px; align-items: center; } .tc-foot { display: flex; justify-content: space-between; align-items: center; }

/* Contenido y mensajes */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.ccard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh); cursor: pointer; transition: transform .15s, box-shadow .15s; } .ccard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(11, 27, 39, .1); } .ccard.off { opacity: .65; }
.cc-img { aspect-ratio: 16 / 9; background: #e9f1f6; overflow: hidden; display: grid; place-items: center; } .cc-img img { width: 100%; height: 100%; object-fit: cover; } .cc-img.ic { aspect-ratio: auto; height: 76px; color: var(--teal-d); background: var(--teal-soft); } .cc-init { width: 46px; height: 46px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: grid; place-items: center; font-family: var(--font-h); }
.cc-body { padding: 14px 16px 6px; flex: 1; } .cc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .cc-body p { color: var(--ink-2); font-size: .86rem; margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 12px 16px; }
.chat-ins { margin-top: 22px; } .chat-ins .grid-2 { margin: 0; }
.msg-list { display: grid; gap: 12px; } .msg-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; align-items: flex-start; box-shadow: var(--sh); } .msg-card.unread { border-left: 4px solid var(--teal-b); }
.mc-main { flex: 1; min-width: 0; } .mc-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .mc-main p { margin: 6px 0; white-space: pre-wrap; } .mc-actions { display: flex; gap: 6px; align-items: center; }
.settings-form h3 { margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .settings-form h3:first-child { margin-top: 0; } .settings-form.narrow { max-width: 480px; }
.stat-ed { display: grid; gap: 8px; } .stat-row { display: grid; grid-template-columns: 110px 80px 1fr; gap: 8px; } .stat-row input { padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; width: 100%; }
.day-pick { display: flex; gap: 14px; flex-wrap: wrap; } .btn-col { display: grid; gap: 8px; justify-items: start; }

/* Avisos */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-lg); animation: rise .25s ease; max-width: 360px; } .toast .ic { color: var(--teal-b); } .toast.err .ic { color: #ff8a8f; } .toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }

/* Responsive */
.side-back { display: none; }
@media (max-width: 1180px) { .kpis, .rk-grid, .mini-kpis { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) {
  .side { transform: translateX(-102%); transition: transform .25s; box-shadow: var(--sh-lg); } .side-open .side { transform: none; }
  .side-open .side-back { display: block; position: fixed; inset: 0; background: rgba(6, 14, 22, .5); z-index: 55; }
  .main { margin-left: 0; } .menu-btn { display: inline-grid; } .top { padding: 12px 16px; } .view { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .grid-2-1, .q-foot { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; } .wk-col { min-height: 0; } .wk-empty { margin: 8px 0; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; } .login-logo { display: block; }
  .top h1 { font-size: 1.05rem; } .search { display: none; }
}
@media (max-width: 640px) {
  .kpis, .rk-grid, .mini-kpis, .form-grid, .dl { grid-template-columns: 1fr; } .mini-kpis { grid-template-columns: 1fr 1fr; }
  .modal-back { padding: 0; align-items: end; } .modal { border-radius: 18px 18px 0 0; max-height: 94vh; } .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .mo-cell { min-height: 76px; } .mo-ev { display: none; } .toolbar .in-sm { flex: 1; min-width: 120px; }
  .msg-card { flex-wrap: wrap; } .stat-row { grid-template-columns: 90px 70px 1fr; }
}

/* Impresión (reportes) */
@media print {
  body { background: #fff; } .side, .top, .no-print, #toasts, .side-back { display: none !important; } .main { margin: 0; } .view { padding: 0; max-width: none; }
  .print-head { display: block; margin-bottom: 14px; } .print-head h2 { font-size: 1.5rem; } .card, .rk { box-shadow: none; break-inside: avoid; } .grid-2, .grid-3 { break-inside: avoid; }
}
.side-foot { grid-template-columns: minmax(0, 1fr); }
.legend li, .legend span { min-width: 0; }
.donut { min-width: 0; }
.donut svg { max-width: 100%; }
