/* SIMALQUI · estilos */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --ink: #1d2320;
  --ink-2: #4d5652;
  --muted: #7b847f;
  --line: #e2e4df;
  --line-2: #cfd3cc;
  --side: #17312a;
  --side-ink: #c9d8d1;
  --side-hover: #21423a;
  --accent: #1f7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ea;
  --blue: #2e5f9e; --blue-soft: #e5edf8;
  --green: #227a4f; --green-soft: #e1f3e8;
  --amber: #9a6300; --amber-soft: #fbf0d9;
  --red: #b23a32; --red-soft: #fbe6e3;
  --gray: #5f6763; --gray-soft: #eceeeb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 1px 1px rgba(20, 30, 25, .03);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; margin-top: 1.2em; } h4 { font-size: 13px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: #3fae86; color: #0d2a21; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-text { font-weight: 700; letter-spacing: .04em; font-size: 15px; display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-weight: 400; letter-spacing: 0; color: #9db8ad; font-size: 11.5px; }
.sidebar nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 1px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; font-size: 13.5px; text-decoration: none; }
.sidebar nav a:hover { background: var(--side-hover); color: #fff; }
.sidebar nav a.active { background: #2b5a4c; color: #fff; }
.sidebar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .9; }
.sidebar-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: #7f9b90; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; color: var(--ink); padding: 6px; }
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn:hover { background: var(--surface); }
.search { flex: 1; max-width: 520px; }
.search input { width: 100%; background: var(--surface-2); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; line-height: 1.2; }
.user-chip small { display: block; font-size: 11.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.content { padding: 22px 24px 48px; max-width: 1400px; width: 100%; }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
/* Línea de recorrido (sustituye a los enlaces fijos de encima del título) */
.con-ruta .content .page-head .breadcrumb { display: none; }
.ruta { margin: -6px 0 14px; font-size: 13px; }
.ruta ol { display: flex; flex-wrap: nowrap; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; overflow: hidden; }
.ruta li { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; }
.ruta li + li::before { content: '›'; color: var(--muted); margin: 0 8px; flex: none; }
.ruta a, .ruta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ruta a { color: var(--accent); }
.ruta span[aria-current] { color: var(--ink-2); font-weight: 600; }
.ruta li:last-child { flex-shrink: 0; max-width: 60%; }
.ruta-mas { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0 7px; line-height: 20px; cursor: pointer; color: var(--muted); font: inherit; }
.ruta-mas:hover { color: var(--ink); }
.ruta-todo ol { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 640px) { .ruta a, .ruta span { max-width: 140px; } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card-head h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 14px 18px 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 23px; font-weight: 680; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.warn .value { color: var(--amber); } .kpi.bad .value { color: var(--red); } .kpi.good .value { color: var(--green); }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbf9; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table input[type=checkbox] { margin: 0; }
.table.compact td, .table.compact th { padding: 6px 10px; }

/* Forms */
.form label, label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=search], input[type=tel], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; min-height: 36px; width: 100%; font-weight: 400;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 122, 92, .25); border-color: var(--accent); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 450 !important; color: var(--ink) !important; font-size: 13.5px !important; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form { display: block; }
.form .grid-2, .form .grid-3, .form .grid-4, .grid-2, .grid-3, .grid-4 { display: grid; gap: 12px 16px; margin-bottom: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.form h3 { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 22px 0 12px; }
.form h3:first-of-type { margin-top: 4px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.narrow { max-width: 760px; }
.help { font-size: 12px; color: var(--muted); font-weight: 400; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.filters select, .filters input { min-width: 150px; width: auto; }
.req::after { content: " *"; color: var(--red); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13.5px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 7px 14px; cursor: pointer; text-decoration: none !important; min-height: 36px; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger-ghost { background: var(--surface); color: var(--red); border-color: #e5b9b4; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 12.5px; }
.btn-xs { padding: 2px 8px; min-height: 24px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

/* Badges & alerts */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-gray { background: var(--gray-soft); color: var(--gray); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; position: relative; }
.alert-success { background: var(--green-soft); border-color: #bfe2cc; color: #18583a; }
.alert-error { background: var(--red-soft); border-color: #f0c4be; color: #8d2a23; }
.alert-warning { background: var(--amber-soft); border-color: #efd8a8; color: #6d4700; }
.alert-info { background: var(--blue-soft); border-color: #c9d8ee; color: #234a7c; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h1 { font-size: 40px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.pager span { margin-right: auto; }

/* Bars (dashboard) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar .stack { width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.bars .bar .s1 { background: var(--accent); }
.bars .bar .s2 { background: #e2b04a; }
.bars .bar small { font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.meter { height: 8px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; font-weight: 550; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

/* Invoice editor */
.lines td { padding: 5px 6px; }
.lines input, .lines select { min-height: 32px; padding: 5px 8px; }
.lines .w-concept { min-width: 260px; }
.lines .w-num { width: 110px; }
.lines .w-sm { width: 82px; }
.totals { margin-left: auto; width: 320px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 4px; }

pre.code { background: #1a201d; color: #d9e6df; padding: 14px; border-radius: 8px; overflow: auto; font: 12px/1.5 var(--mono); max-height: 520px; white-space: pre-wrap; word-break: break-all; text-align: left; }
.qr svg { width: 110px; height: 110px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: var(--green); } .dot-amber { background: #d99a1b; } .dot-red { background: var(--red); } .dot-gray { background: var(--line-2); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% 0%, #dcebe3, transparent), var(--bg); }
.login-card { background: var(--surface); width: 100%; max-width: 380px; padding: 28px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(20, 40, 30, .08); display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.brand-lg { padding: 0 0 8px; color: var(--ink); }
.brand-lg .brand-text small { color: var(--muted); }

@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -240px; z-index: 50; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .cols-2, .cols-3, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .content { padding: 16px; }
  .user-chip span:last-child { display: none; }
  .dl { grid-template-columns: 1fr; }
  .totals { width: 100%; }
}
@media print {
  .sidebar, .topbar, .actions, .filters, .pager, .btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* Instalador */
.auth-body { background: radial-gradient(1200px 600px at 20% 0%, #dcebe3, transparent), var(--bg); }
.install-wrap { max-width: 760px; margin: 32px auto; padding: 0 16px; }
.install-wrap .card-body h2 { margin-top: 22px; }
.brand-dark { padding: 0 0 10px; color: var(--ink); }
.brand-dark .brand-text small { color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; columns: 2; font-size: 13px; }
.checklist li { padding: 2px 0; }
.checklist .ok { color: var(--green); } .checklist .ko { color: var(--red); font-weight: 600; } .checklist .warn { color: var(--amber); }
@media (max-width: 640px) { .checklist { columns: 1; } }

/* Utilidades añadidas */
.text-right { text-align: right; } .nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row-muted td { color: var(--muted); }
.chain { font-family: var(--mono); font-size: 11.5px; word-break: break-all; color: var(--ink-2); }
.stat-line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat-line:last-child { border-bottom: 0; }
.report-title { display: none; }
@media print { .report-title { display: block; } }
.text-red { color: var(--red); }

/* Ayuda */
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-toc { position: sticky; top: 70px; }
.help-toc input { margin-bottom: 10px; }
.help-toc nav { display: flex; flex-direction: column; gap: 1px; }
.help-toc nav a { padding: 5px 10px; border-radius: 6px; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.help-toc nav a:hover { background: var(--accent-soft); color: var(--accent); }
.help-body { max-width: 860px; }
.help-sec { scroll-margin-top: 70px; line-height: 1.6; }
.help-sec h3 { margin-top: 18px; }
.help-sec ul, .help-sec ol { padding-left: 20px; margin: 0 0 10px; }
.help-sec li { margin-bottom: 5px; }
.help-dl { grid-template-columns: 170px 1fr; gap: 8px 16px; }
.tip { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-top: 12px; font-size: 13.5px; }
.help-sec details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.help-sec summary { cursor: pointer; font-weight: 600; }
.help-sec details p { margin: 8px 0 4px; color: var(--ink-2); }
@media (max-width: 860px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; } .help-dl { grid-template-columns: 1fr; } }
@media print { .help-toc { display: none; } .help-layout { display: block; } .help-sec details { display: block; } .help-sec details > p { display: block; } }

/* Incidencias */
input[type=datetime-local] { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; min-height: 36px; width: 100%; }
.timeline li { align-items: flex-start; }
.tl-ico { display: inline-block; width: 20px; }
.kpi .value small { font-size: 15px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
a.kpi-link { display: block; color: inherit; text-decoration: none !important; }
a.kpi-link:hover { border-color: var(--accent); }

/* Fila de indicadores de Inicio (5 tarjetas) */
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-row .kpi .value { font-size: 21px; }
@media (max-width: 1250px) { .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cols-5 { grid-template-columns: 1fr; } }

/* Libro de rentas (Inicio) */
.link-sm { font-size: 13px; }
.libro-rentas th.lr-mes, .libro-rentas td.lr-mes { text-align: center; width: 52px; padding-left: 4px; padding-right: 4px; }
.libro-rentas th.lr-mes { text-transform: lowercase; }
.libro-rentas td { vertical-align: middle; }
.libro-rentas .lr-ref { font-weight: 600; }
.libro-rentas td.num { white-space: nowrap; }
.lr-c { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 24px; border-radius: 4px;
  font-size: 13px; font-weight: 700; font-style: normal; line-height: 1; text-decoration: none; box-sizing: border-box; }
a.lr-c:hover { text-decoration: none; filter: brightness(1.08); box-shadow: 0 0 0 2px var(--accent-soft); }
.lr-cobrada { background: var(--green); color: #fff; }
.lr-pendiente { background: var(--amber-soft); border: 1px solid #e9c77e; color: var(--amber); }
.lr-parcial { background: var(--amber-soft); border: 1px solid #e9c77e; color: var(--amber); }
.lr-vencida { background: var(--red); color: #fff; }
.lr-borrador { background: var(--surface, #fff); border: 1.5px dashed var(--line-2); color: var(--gray); font-size: 12px; }
.lr-sin { border: 1.5px dotted #b9beb6; }
.lr-vacia { width: 34px; }
.lr-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 18px 14px; border-top: 1px solid var(--line, #e3e6e1); font-size: 12px; color: var(--muted); }
.lr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lr-legend .lr-c { width: 20px; height: 14px; font-size: 9px; border-radius: 3px; }
.libro-rentas .meta { font-size: 12px; color: var(--muted); }
.libro-rentas td.lr-contrato { max-width: 320px; }
/* Libro de rentas con más de 8 contratos: ventana de 8 filas con desplazamiento y cabecera fija */
.lr-scroll { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; }
.lr-scroll .libro-rentas thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.card-head .lr-total { font-size: 12px; margin-left: auto; margin-right: 14px; }
/* Plegar y desplegar el Libro de rentas pulsando su título */
.lr-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.lr-toggle:hover { color: var(--accent, inherit); }
.lr-toggle:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 4px; }
.lr-flecha { flex: none; color: var(--muted); transition: transform .15s ease; }
.lr-plegado .lr-flecha { transform: rotate(-90deg); }
.lr-plegado #lr-cuerpo, .lr-plegado .lr-hint { display: none; }
.lr-card.lr-plegado .card-head { margin-bottom: 0; padding-bottom: 14px; }
.libro-rentas .lr-linea { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libro-rentas .lr-dir { color: var(--ink, #2b322e); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dash-emisor { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.dash-emisor select { min-width: 240px; max-width: 340px; }
@media (max-width: 640px) { .dash-emisor, .dash-emisor select { width: 100%; min-width: 0; max-width: none; } }
.ue-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; margin: 8px 0 4px; }
.ue-acceso { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; margin: 14px 0 6px; }
.ue-acceso legend { font-weight: 600; padding: 0 6px; }
.ue-opciones > .check { display: block; margin: 4px 0; }
/* Meses de facturación del contrato */
.meses-fact { margin: 4px 0 2px; }
.meses-tabla { border-collapse: separate; border-spacing: 0; width: 100%; max-width: 640px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.meses-tabla th, .meses-tabla td { text-align: center; padding: 6px 2px; border-right: 1px solid var(--line); }
.meses-tabla th:last-child, .meses-tabla td:last-child { border-right: 0; }
.meses-tabla th { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.meses-tabla th label { display: block; cursor: pointer; margin: 0; }
.meses-tabla td input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.meses-acciones { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.meses-resumen { font-size: 13px; color: var(--ink-2); }
@media (max-width: 560px) { .meses-tabla th { font-size: 10px; } .meses-tabla td input { width: 16px; height: 16px; } }
.lr-nofac { color: var(--muted); font-weight: 400; font-size: 14px; }
/* IBI en la ficha del inmueble */
.ibi-tabla td { vertical-align: top; }
.ibi-det { margin: 4px 0 6px; font-size: 13px; }
.ibi-det summary { cursor: pointer; color: var(--accent); }
.ibi-det ul { margin: 6px 0 0; padding-left: 18px; }
.ibi-det li { margin: 3px 0; }
.ibi-form { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
.ibi-form > summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.text-amber { color: var(--amber); }
.nowrap { white-space: nowrap; }
.ibi-acc { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ibi-acc .btn { width: 100%; justify-content: center; }
/* Seguros en la ficha del inmueble */
.poliza { border-top: 1px solid var(--line); padding: 12px 18px 10px; }
.poliza:first-of-type { border-top: 0; }
.poliza-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.poliza-head .meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.poliza-acc { flex: 0 0 118px; }
.poliza .table-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.poliza-renovar { margin: 10px 0 0; padding: 10px 12px; background: var(--amber-soft); border-radius: 8px; align-items: flex-end; }
.poliza-sin { font-size: 12.5px; margin-top: 8px; color: var(--ink-2); }
@media (max-width: 700px) { .poliza-head { flex-direction: column; } .poliza-acc { flex: none; flex-direction: row; flex-wrap: wrap; } .poliza-acc .btn { width: auto; } }
.sin-seguro { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 10px 0 0; }
.sin-seguro legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
/* Formularios por apartados: explicación a la izquierda, campos a la derecha */
.fsec { display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr); gap: 32px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.fsec-info h2 { font-size: 16px; margin: 0 0 8px; }
.fsec-info p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0 0 8px; }
.fsec-campos > .grid-3:last-child, .fsec-campos > .grid-2:last-child { margin-bottom: 0; }
.fsec-campos .grid-3 { gap: 14px 16px; margin-bottom: 14px; }
.fsec-checks { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.fsec-sub { display: block; margin: 4px 0 0 24px; }
.fsec-acciones { display: flex; gap: 8px; justify-content: flex-end; margin: 4px 0 24px; }
@media (max-width: 900px) { .fsec { grid-template-columns: 1fr; gap: 14px; padding: 18px 16px; } .fsec-hueco { display: none; } }
@media (min-width: 600px) and (max-width: 860px) {
  .fsec-campos .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fsec-campos .span-2 { grid-column: span 2; }
  .fsec-campos .span-all { grid-column: 1 / -1; }
}
/* Apartado con tabla: explicación arriba y tabla a todo el ancho */
.fsec.fsec-ancha { grid-template-columns: 1fr; gap: 14px; }
.fsec-ancha .fsec-info { display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr); column-gap: 32px; }
.fsec-ancha .fsec-info h2 { grid-row: 1 / span 3; }
.fsec-ancha .lines input[data-name=concepto] { min-width: 220px; }
@media (max-width: 900px) { .fsec-ancha .fsec-info { display: block; } }
.fsec-logo { display: flex; align-items: center; }
.fsec-logo img { max-height: 56px; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.fsec-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* Barra de filtros: las casillas no heredan el ancho mínimo de los campos y se alinean con ellos */
.filters input[type=checkbox], .filters input[type=radio] { min-width: 0; width: 16px; flex: none; }
.filters label.check { align-self: flex-end; min-height: 38px; padding: 0 2px; white-space: nowrap; }
.filters select { min-width: 120px; max-width: 220px; }
.filters input[type=search] { width: 190px; }
/* Tarjeta Situación en la ficha del inmueble */
.kpi-situacion .inq { margin-top: 3px; font-size: 13px; font-weight: 500; line-height: 1.3; }
.kpi-situacion .inq a { color: var(--blue); text-decoration: none; }
.kpi-situacion .inq a:hover { text-decoration: underline; }
/* Cuadro de confirmación */
dialog.confirmar { border: 0; border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(15, 30, 25, .25); color: var(--ink); background: var(--surface); }
dialog.confirmar::backdrop { background: rgba(15, 30, 25, .45); }
dialog.confirmar form { padding: 22px 24px 18px; margin: 0; }
dialog.confirmar h2 { font-size: 17px; margin: 0 0 10px; }
.confirmar-texto p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.confirmar-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Portal del inquilino (portal.php) ---------- */
.pt-body { background: var(--bg); }
.pt-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.pt-top-in { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-marca { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; font-weight: 700; line-height: 1.2; min-width: 0; }
.pt-marca > span:last-child { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-marca small { font-weight: 400; color: var(--muted); font-size: 12px; }
.pt-marca .brand-mark { width: 32px; height: 32px; flex: none; font-size: 16px; }
.pt-nav { max-width: 860px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.pt-nav::-webkit-scrollbar { display: none; }
.pt-nav a { padding: 10px 12px; color: var(--ink-2); font-weight: 550; white-space: nowrap; border-bottom: 2px solid transparent; text-decoration: none !important; }
.pt-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.pt-main { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.pt-h1 { font-size: 22px; margin: 0 0 14px; }
.pt-h3 { font-size: 14px; margin: 16px 0 4px; }
.pt-bienvenida { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; color: var(--ink); }
.pt-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pt-accion { margin: 0 0 16px; }
.pt-recibos { list-style: none; margin: 0; padding: 0; }
.pt-recibo { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pt-recibo:last-child { border-bottom: 0; }
.pt-recibo-a { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-recibo-a .meta, .pt-recibo-b .meta { font-size: 12px; color: var(--muted); }
.pt-recibo-b { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.pt-importe { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.pt-resumen { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.pt-filtro { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.pt-filtro label { display: flex; align-items: center; gap: 8px; font-weight: 550; color: var(--ink-2); }
.pt-filtro select { max-width: 100%; }
.pt-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.pt-seg a { padding: 6px 14px; color: var(--ink-2); text-decoration: none !important; }
.pt-seg a.active { background: var(--accent); color: var(--accent-ink); }
.pt-dl { grid-template-columns: 150px 1fr; }
.pt-pago { background: var(--bg); border-radius: 8px; padding: 12px; margin-top: 10px; }
.pt-nota { color: var(--muted); font-size: 13px; }
.pt-pie { color: var(--muted); font-size: 12px; text-align: center; margin-top: 28px; }
.pt-acceso { gap: 12px; }
.pt-acceso-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pt-acceso-cab > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.pt-acceso-cab small { color: var(--muted); }
.pt-acceso .pt-h1 { font-size: 18px; margin: 4px 0 0; }
.pt-acceso p { margin: 0; }
.pt-form { display: flex; flex-direction: column; gap: 12px; }
.pt-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.pt-enlace { text-align: center; font-size: 13px; }
@media (max-width: 560px) {
  .pt-kpis { grid-template-columns: 1fr; }
  .pt-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .pt-dl dd { margin-bottom: 8px; }
  .pt-recibo { flex-direction: column; }
  .pt-recibo-b { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; }
  .pt-h1 { font-size: 20px; }
}
/* Portal en la ficha del inquilino */
.portal-dl { grid-template-columns: 110px 1fr; font-size: 13px; }
.portal-acc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.portal-enlace { display: block; width: 100%; margin-top: 8px; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.doc-portal { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.doc-portal input { width: 14px; height: 14px; margin: 0; }
.pt-main .mono { white-space: nowrap; }
/* Celda de texto largo recortada con «…» (el texto completo sale al pasar el ratón) */
.celda-corta { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Gastos: columna «Proveedor y concepto» */
.gasto-pc { min-width: 260px; line-height: 1.4; }
/* Título del filtro aplicado junto al botón Filtrar */
.filtro-fin { display: flex; align-items: center; gap: 14px; }
.filtro-titulo { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
/* Importe enlazado en informes (p. ej. gastos → desglose) */
.enlace-importe { color: var(--blue); font-weight: 700; }
.enlace-importe:hover { text-decoration: underline; }
/* Informe de rentabilidad: barras de comparación ingresos / gastos */
.cmp { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.cmp-barra { display: block; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cmp-barra > span { display: block; height: 100%; border-radius: 4px; min-width: 0; }
.cmp-ing > span { background: var(--blue); }
.cmp-gas > span { background: #d08a12; }
@media print { .cmp-barra { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Incidencias: inquilino bajo el inmueble */
.inc-inquilino { font-size: 13.5px; color: var(--ink-2); }
/* Contador en el menú lateral (p. ej. facturas en borrador) */
.nav-contador { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #c8860d; color: #1d1405; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

/* ---------- Pantallas de acceso (entrar, recuperar y nueva contraseña) ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; background: var(--bg); }
.acceso-lado { background: radial-gradient(900px 500px at 0% 0%, #1f4237, transparent), var(--side); color: var(--side-ink); padding: 40px 44px; display: flex; flex-direction: column; }
.acceso-marca { display: flex; align-items: center; gap: 10px; color: #fff; }
.acceso-marca .brand-text small { color: #9db8ad; }
.acceso-lema { margin-top: 64px; max-width: 460px; }
.acceso-lema h1 { color: #fff; font-size: 34px; line-height: 1.18; font-weight: 700; letter-spacing: -.02em; margin: 0 0 14px; }
.acceso-lema p { font-size: 15px; line-height: 1.55; margin: 0; color: var(--side-ink); }
.acceso-pie { margin-top: auto; font-size: 12.5px; color: #8fa89e; }
.acceso-main { display: grid; place-items: center; padding: 40px 24px; }
.acceso-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.acceso-form h2 { font-size: 24px; margin: 0 0 4px; }
.acceso-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.acceso-form input { min-height: 40px; }
.acceso-form .btn { min-height: 40px; margin-top: 4px; }
.acceso-form .help, .acceso-form .alert { margin: 0; }
.acceso-enlace { font-size: 13px; }
@media (max-width: 860px) {
  .acceso { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acceso-lado { padding: 18px 20px; }
  .acceso-lema, .acceso-pie { display: none; }
  .acceso-main { place-items: start center; padding: 32px 20px; }
}
/* Portal: incidencias */
.pt-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-cab .pt-h1 { margin: 0; }
.pt-botones { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pt-desc { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pt-mensajes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pt-mensajes li { padding: 10px 12px; border-radius: 10px; max-width: 88%; line-height: 1.45; }
.pt-msg-quien { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.pt-msg-mio { background: var(--accent-soft); align-self: flex-end; }
.pt-msg-arr { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
/* Incidencias: mensajes del inquilino en el historial */
.timeline li.nota-inquilino { background: var(--accent-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
@media (max-width: 480px) { .pt-nav { padding: 0 4px; gap: 0; justify-content: space-between; } .pt-nav a { padding: 10px 5px; font-size: 13.5px; } }
@media (max-width: 380px) { .pt-nav a { padding: 10px 3px; font-size: 12.5px; } }
/* Ventanas con formulario (p. ej. «Añadir concepto» en el contrato) */
dialog.dialogo { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(15, 30, 25, .25); color: var(--ink); background: var(--surface); }
dialog.dialogo::backdrop { background: rgba(15, 30, 25, .45); }
dialog.dialogo form { padding: 22px 24px 18px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
dialog.dialogo h2 { font-size: 17px; margin: 0; }
dialog.dialogo label { display: flex; flex-direction: column; gap: 4px; }
dialog.dialogo label.check { flex-direction: row; align-items: center; gap: 8px; }
.dialogo-checks { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding-bottom: 6px; }
.dialogo-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.opcional { font-weight: 400; color: var(--muted); }
/* Ajustes › Importar datos */
.imp-pasos { margin: 8px 0 10px; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.imp-tipos { align-items: start; }
.imp-paso { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; margin-right: 4px; }
.imp-subir { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.imp-subir input[type=file] { flex: 1; min-width: 200px; }
.imp-cols summary, .imp-avisos summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-top: 8px; }
.imp-cols table { margin-top: 8px; }
.imp-kpis { margin: 4px 0 14px; }
.imp-informe h3 { font-size: 14px; margin: 12px 0 6px; }
.imp-avisos ul { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }

.empresa-activa{display:flex;flex-direction:column;justify-content:center;min-width:140px;max-width:240px;padding:0 12px;border-right:1px solid var(--border,#ddd);line-height:1.2}.empresa-activa small{font-size:11px;color:var(--muted,#667085)}.empresa-activa strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media (min-width:861px){.shell.sidebar-collapsed .sidebar{width:72px;min-width:72px}.shell.sidebar-collapsed .sidebar .brand-text,.shell.sidebar-collapsed .sidebar nav a span:not(.nav-contador),.shell.sidebar-collapsed .sidebar .sidebar-foot{display:none}.shell.sidebar-collapsed .sidebar .brand{justify-content:center}.shell.sidebar-collapsed .sidebar nav a{justify-content:center;padding:12px}.shell.sidebar-collapsed .sidebar nav a svg{margin:0}.shell.sidebar-collapsed .sidebar nav a .nav-contador{position:absolute;margin-left:30px;margin-top:-22px}.shell.sidebar-collapsed .sidebar nav a{position:relative}}.drop-zone.dragover{background:#eef4ff;border-color:#356ae6!important}

/* Selector de emisor en la barra superior, situado antes de Buscar. */
.empresa-selector{display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:170px;max-width:260px;padding:0 12px;border-right:1px solid var(--line);margin:0}
.empresa-selector label{font-size:11px;color:var(--muted,#667085);line-height:1.2}
.empresa-selector select{width:100%;min-width:0;max-width:100%;padding:5px 28px 5px 8px;font-size:13px;font-weight:600;background:var(--surface-2);border:1px solid var(--line);border-radius:7px;color:var(--ink)}
@media(max-width:800px){.empresa-selector{min-width:115px;max-width:42vw;padding:0 5px}.empresa-selector select{font-size:12px}.topbar{gap:8px;padding:8px 10px}.search{min-width:80px}}

/* Zona de carga documental: bloque independiente bajo el título, sin solapamientos. */
.documentos-card > .card-head { margin-bottom: 12px; }
.documentos-upload-form { display: block; width: 100%; min-width: 0; margin: 0 0 14px; clear: both; }
.documentos-drop-zone { box-sizing: border-box; position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 104px; margin: 0 0 10px; padding: 18px 16px; border: 2px dashed #98a2b3; border-radius: 9px; text-align: center; cursor: pointer; overflow: visible; }
.documentos-drop-zone .documentos-drop-title { display: block; font-weight: 700; }
.documentos-drop-zone .documentos-drop-help { display: block; color: #667085; font-size: .88em; }
.documentos-drop-zone input[type="file"] { display: block; position: static; max-width: 100%; width: auto; margin: 5px auto 0; }
.documentos-upload-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; clear: both; }
.documentos-upload-controls > input[name="nombre"] { flex: 1 1 220px; min-width: 160px; }
.documentos-upload-controls .doc-portal { margin: 0; }
.documentos-card > .list { clear: both; }

/* Validación de archivos en la propia zona de documentos */
.documentos-drop-message{display:block;margin:10px auto 0;max-width:760px;padding:9px 12px;border-radius:7px;background:#fff1f0;color:#a61b1b;font-weight:600;text-align:center}
.documentos-drop-error{border-color:#c62828!important;background:#fff8f7!important}

/* Gráfico de evolución mensual en Informes > Facturación */
.informe-evolucion-barras { display:flex; align-items:stretch; gap:10px; min-height:230px; padding:12px 4px 0; overflow-x:auto; }
.informe-evolucion-col { flex:1 0 58px; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:7px; }
.informe-evolucion-valor { max-width:100%; font-size:10px; line-height:1.2; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.informe-evolucion-pista { width:min(100%,42px); height:160px; display:flex; align-items:flex-end; background:var(--surface-2, #f1f3f5); border-radius:6px 6px 0 0; overflow:hidden; }
.informe-evolucion-barra { width:100%; min-height:2px; background:var(--accent); border-radius:5px 5px 0 0; }
.informe-evolucion-mes { text-align:center; font-size:11px; line-height:1.25; white-space:nowrap; }
.informe-evolucion-mes small { color:var(--muted); font-size:10px; }
@media (max-width:700px) { .informe-evolucion-barras { gap:7px; } .informe-evolucion-col { flex-basis:52px; } .informe-evolucion-pista { height:135px; } }

/* Diseño de factura (Emisores › Diseño de factura) */
.dz { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.dz-ajustes { flex: 1 1 380px; max-width: 460px; min-width: 0; padding: 0 0 18px; }
.dz-vista { flex: 999 1 560px; min-width: 0; background: #e9ebe7; }
.dz-tabs { display: flex; flex-wrap: wrap; gap: 0; padding: 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.dz-tabs button { min-height: 42px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; }
.dz-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.dz-panel { padding: 0 18px; }
.dz-panel label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dz-panel input:not([type=radio]):not([type=checkbox]):not([type=color]), .dz-panel textarea { width: 100%; margin-top: 4px; }
.dz-panel textarea { resize: vertical; font: 13px/1.45 var(--font); }
.dz-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }
.dz-panel > .dz-lbl:first-child { margin-top: 0; }
.dz-fila { display: flex; flex-wrap: wrap; gap: 14px; }
.dz-fila > * { flex: 1 1 160px; }
.dz-fila-auto > * { flex: 0 0 auto; }
.dz-fila-auto .dz-seg { flex-wrap: nowrap; }
.dz-plantillas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dz-plantilla { position: relative; padding: 10px; border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; background: #fff; font-weight: 400 !important; }
.dz-plantilla:has(input:checked) { border: 2px solid var(--accent); padding: 9px; }
.dz-plantilla input { position: absolute; opacity: 0; pointer-events: none; }
.dz-plantilla:has(input:focus-visible) { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.dz-plantilla b { display: block; font-size: 13px; color: var(--ink); margin-top: 8px; }
.dz-plantilla small { display: block; font-size: 11.5px; color: var(--muted); }
.dz-mini { display: block; height: 62px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.dz-mini i { display: block; margin: 0 6px; border-radius: 2px; }
.dz-mini .b { height: 0; margin: 0; }
.dz-mini .l { height: 4px; margin-top: 6px; background: #d9ddd7; }
.dz-mini .l.c { width: 55%; margin-top: 3px; background: #e6e9e4; }
.dz-mini .t { height: 14px; margin-top: 7px; background: var(--accent); }
.dz-pl-moderna .dz-mini .b { height: 14px; background: var(--accent); }
.dz-pl-moderna .dz-mini .t { background: var(--accent-soft); }
.dz-pl-compacta .dz-mini .t { height: 22px; background: #e6e9e4; }
.dz-colores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dz-sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.dz-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.dz-otro { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 500 !important; }
.dz-otro input { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; }
.dz-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.dz-seg label { margin: 0; font-weight: 500 !important; }
.dz-seg input { position: absolute; opacity: 0; pointer-events: none; }
.dz-seg span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-right: 1px solid var(--line); cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.dz-seg label:last-child span { border-right: 0; }
.dz-seg input:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.dz-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.dz-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.dz-cols label.check { font-weight: 500; font-size: 13px; color: var(--ink); }
.dz-cols input:not([type=checkbox]) { margin-top: 0 !important; }
.dz-bloques { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dz-bloques li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.dz-bl-n { width: 18px; font: 12px var(--mono); color: var(--muted); }
.dz-bl-t { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.dz-candado { display: inline-flex; color: var(--muted); }
.dz-candado svg, .dz-ico svg { fill: none; stroke: currentColor; stroke-width: 2; }
.dz-pie { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 8px 8px 34px; border: 1px dashed var(--line-2); border-radius: 8px; }
.dz-ver, .dz-ico, .dz-candado { flex: none; }
.dz-ver { display: inline-flex !important; align-items: center; gap: 5px; font-weight: 500 !important; font-size: 12px !important; }
.dz-ico { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-2); cursor: pointer; padding: 0; }
.dz-ico:disabled { opacity: .35; cursor: default; }
.dz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dz-chip { min-height: 28px; padding: 0 9px; border: 1px dashed #9fb8ad; border-radius: 14px; background: #f3f8f5; color: var(--accent); font: 12px var(--mono); cursor: pointer; }
.dz-extra { display: flex !important; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-weight: 400 !important; font-size: 13px !important; color: var(--ink) !important; cursor: pointer; }
.dz-extra input { margin-top: 3px; }
.dz-extra small { color: var(--muted); }
.dz-vista-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dz-vista-bar label { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.dz-vista-bar select { max-width: 340px; }
.dz-marco { position: relative; height: 1000px; max-height: calc(100vh - 150px); min-height: 560px; border-radius: 6px; overflow: hidden; background: #d9dcd6; }
.dz-marco iframe { width: 100%; height: 100%; border: 0; background: #d9dcd6; }
.dz-cargando { position: absolute; top: 10px; right: 14px; padding: 3px 10px; border-radius: 12px; background: rgba(29, 35, 32, .75); color: #fff; font-size: 12px; }
.dz-copiar { display: inline-flex; gap: 6px; align-items: center; }
.dz-copiar select { max-width: 200px; }

/* Informes › Cuadro de mando */
.cm-nota { margin: -6px 0 16px; }
.cm-banda { margin: 0; padding: 9px; text-align: center; font-size: 15px; font-weight: 650; letter-spacing: 1px; color: #fff; border-radius: 8px; }
.cm-banda-res { background: #2f3e4e; margin-bottom: 12px; }
.cm-banda-ing { background: #3f7f4f; }
.cm-banda-gas { background: #7d2a35; }
.cm-res { margin-bottom: 20px; }
.cm-res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cm-card { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cm-ct { margin: 0; padding: 8px 12px; font-size: 13.5px; font-weight: 650; text-align: center; }
.cm-c-res { border-color: #d5dce3; } .cm-c-res .cm-ct { background: #e9edf1; color: #2f3e4e; }
.cm-c-ing { border-color: #c9dfcd; } .cm-c-ing .cm-ct { background: #e6f1e8; color: #245a33; }
.cm-c-gas { border-color: #e7c9cd; } .cm-c-gas .cm-ct { background: #f6e6e8; color: #6a222c; }
.cm-kpi { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 10px 16px; text-align: center; }
.cm-valor { font-size: 28px; font-weight: 650; letter-spacing: -.5px; white-space: nowrap; }
.cm-grande .cm-valor { font-size: 34px; }
.cm-bien { color: #227a4f; } .cm-mal { color: #b23a32; }
.cm-marca { font-size: .7em; margin-left: 6px; }
.cm-prev { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.cm-gris { color: var(--muted); }
.cm-card svg { display: block; width: 100%; height: auto; }
.cm-acum svg { flex: 1 1 auto; max-height: 280px; margin: auto 0; }
.cm-bval { font-size: 11.5px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.cm-beje { font-size: 12px; fill: var(--ink-2); text-anchor: middle; }
.cm-base { stroke: #cfd3cc; } .cm-cero { stroke: #b23a32; stroke-width: 1.5; stroke-dasharray: 5 4; }
.cm-rejilla { stroke: #eceeeb; }
.cm-etq { font-size: 9.5px; font-weight: 700; fill: #fff; text-anchor: middle; }
.cm-mes { font-size: 11px; fill: var(--ink-2); text-anchor: middle; }
.cm-mes-sel { font-weight: 700; fill: var(--ink); }
.cm-leyenda { display: flex; gap: 16px; padding: 10px 14px 0; font-size: 12px; color: var(--ink-2); }
.cm-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cm-leyenda i { width: 12px; height: 12px; border-radius: 50%; }
.cm-vacio { margin: 30px 20px 40px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .cm-res-grid { grid-template-columns: minmax(0, 1fr); }
  .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-grid > * { grid-column: auto !important; grid-row: auto !important; }
  .cm-grid > .cm-banda, .cm-grid > .cm-card:not(.cm-acum) { grid-column: 1 / -1 !important; }
}
@media print { .cm-grid, .cm-res-grid { break-inside: avoid; } }
