@charset "UTF-8";
/* ============================================================
   Plataforma ADS · Ingeniería LMP
   Sistema visual alineado con el CRM LMP (C:\laragon\www\CRM):
   mismos tokens de marca, header de color con velo tras el logo,
   franjas diagonales en el panel, menú lateral con borde activo
   y modo oscuro por [data-theme="dark"] en <html>.
   Paleta del logo: L #50A0AA · M #005050 · P #8264AA
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Source+Sans+3:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens (claro) ---------- */
:root {
  color-scheme: light;
  --lmp-cyan: #50A0AA;
  --lmp-dark: #005050;
  --lmp-purple: #8264AA;

  /* Marca — mismos valores y criterio de contraste que el CRM */
  --brand-ink: #005050;          /* títulos (9.28:1) */
  --brand-action: #2F7C85;       /* botones y enlaces (4.84:1 AA) */
  --brand-hover: #1F646D;
  --brand-tint: #e0f2f3;
  --brand-accent: #8264AA;
  --brand-accent-dk: #6a4f90;
  --brand-accent-tint: #ede8f5;
  --brand-spark: #50A0AA;        /* solo adornos, sin texto encima */
  --brand-head-1: #2F7C85;       /* franjas del header: oscuras en ambos temas */
  --brand-head-2: #005050;
  --brand-head-3: #8264AA;
  --on-fill: #ffffff;            /* texto sobre relleno sólido de marca */

  --ink: #2d3242;
  --ink-2: #414857;
  --ink-3: #565f6e;
  --nav-text: #3f4757;
  --line: #dde1e9;
  --line-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --bg: #f4f6f8;
  --input-bg: #ffffff;
  --input-line: #cfd6de;
  --hover-row: #f7fafa;

  --success: #146b48;  --success-soft: #e4f5ed;
  --warning: #8a5a12;  --warning-soft: #fdf3e3;
  --danger:  #a32c20;  --danger-soft:  #fce8e7;
  --info:    #1a5c85;  --info-soft:    #e3f0f8;

  --note-bg: #fbf8ec;  --note-line: #efe6c8;  --note-ink: #6d5510;
  --review-bg: #faf8fd;
  --resp-bg: #f5fafa;
  --unread-bg: #f1f8f8;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.14);
  --header-h: 58px;
  --sidebar-w: 240px;
  --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* alias usados por las vistas */
  --primary: var(--brand-action);
  --primary-soft: var(--brand-tint);
  --accent: var(--brand-accent);
  --accent-soft: var(--brand-accent-tint);
}

/* ---------- Tokens (oscuro) — en impresión mandan los claros ---------- */
@media screen {
[data-theme="dark"] {
  color-scheme: dark;
  --brand-ink: #6BBABA;
  --brand-action: #6BBABA;
  --brand-hover: #82c8c8;
  --brand-tint: #0d2828;
  --brand-accent: #a080c8;
  --brand-accent-dk: #b898d8;
  --brand-accent-tint: #1e1428;
  --brand-spark: #6BBABA;
  --brand-head-1: #0B3B3E;
  --brand-head-2: #04292B;
  --brand-head-3: #3B2E52;
  --on-fill: #0f1219;

  --ink: #e8ecf4;
  --ink-2: #d8dee9;
  --ink-3: #b0b9ca;
  --nav-text: #dfe5ee;
  --line: #2a3045;
  --line-2: #1e2330;
  --surface: #1a1f2e;
  --surface-2: #141820;
  --bg: #0f1219;
  --input-bg: #141820;
  --input-line: #353c52;
  --hover-row: #1f2536;

  --success: #3ec98a;  --success-soft: #10261d;
  --warning: #f0a83a;  --warning-soft: #2a1f0d;
  --danger:  #e05c4a;  --danger-soft:  #2a1210;
  --info:    #5aabde;  --info-soft:    #0d1f2b;

  --note-bg: #231f12;  --note-line: #3a3218;  --note-ink: #e6d49a;
  --review-bg: #1c1a27;
  --resp-bg: #152326;
  --unread-bg: #12262a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-action); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-ui); font-weight: 600; }
h1 { font-size: 1.4rem; font-weight: 700; color: var(--brand-ink); letter-spacing: -.01em; }
h2 { font-size: .95rem; color: var(--brand-ink); }
h3 { font-size: .9rem; }
p { margin: 0 0 .75em; }
small, .small { font-size: 12.5px; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
svg { flex-shrink: 0; }

/* Logos que cambian con el tema */
.only-dark { display: none !important; }
[data-theme="dark"] .only-light { display: none !important; }
[data-theme="dark"] .only-dark { display: block !important; }

/* ============================================================
   LAYOUT: header a todo el ancho + menú lateral + contenido
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--header-h) 1fr; min-height: 100vh; }

.app-header {
  grid-column: 1 / -1; grid-row: 1;
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 12px; padding: 0 18px 0 0;
  background: var(--brand-head-2); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.app-header > * { position: relative; z-index: 1; }

/* Panel: tres franjas con corte diagonal, como el CRM */
body.section-panel .app-header { background: var(--brand-head-1); }
body.section-panel .app-header::before,
body.section-panel .app-header::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 0; }
body.section-panel .app-header::before {
  left: 33.33%; width: calc(33.33% + 20px); background: var(--brand-head-2);
  clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
}
body.section-panel .app-header::after {
  right: 0; width: calc(33.33% + 20px); background: var(--brand-head-3);
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%);
}
body.section-clientes .app-header { background: var(--brand-head-1); }
body.section-proyectos .app-header { background: var(--brand-head-2); }
body.section-referencias .app-header,
body.section-configuracion .app-header { background: var(--brand-head-3); }

/* Bloque de marca con velo (sube el contraste del isotipo sobre el header) */
.brand-block {
  align-self: stretch; display: flex; align-items: center; gap: 14px;
  padding-left: 20px; padding-right: 28px; min-width: var(--sidebar-w);
  color: #fff; text-decoration: none;
}
.brand-block:hover { text-decoration: none; color: #fff; }
.brand-block::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: 0; bottom: 0; left: 0; right: -3rem;
  background: linear-gradient(90deg, rgba(0,0,0,.62), rgba(0,0,0,.5) 40%, rgba(0,0,0,0));
}
.brand-block .mark { height: 34px; width: auto; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.wordmark b { font: 700 22px var(--font-ui); letter-spacing: -.01em; color: #fff; }
.wordmark small { font: 600 9.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.powered { display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1; }
.powered small { font: 600 9px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.68); }
.powered img { height: 22px; width: auto; display: block; }
.logo-sep { width: 1px; height: 24px; background: rgba(255,255,255,.35); }
.logo-producto { font: 500 13px var(--font-ui); letter-spacing: .02em; opacity: .85; white-space: nowrap; }

.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.hbtn {
  position: relative; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 0; color: rgba(255,255,255,.85); cursor: pointer;
}
.hbtn:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.hbtn svg { width: 20px; height: 20px; }
.hbtn .dot {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #e05c4a; color: #fff; font: 700 10.5px/17px var(--font-ui); text-align: center;
  border: 2px solid var(--brand-head-2);
}
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 8px;
  background: none; border: 0; color: rgba(255,255,255,.9); cursor: pointer; font: 500 13.5px var(--font-ui);
}
.user-btn:hover { background: rgba(255,255,255,.12); }
.user-btn .avatar { border: 2px solid rgba(255,255,255,.25); background: var(--brand-accent); color: var(--on-fill); }
.user-btn .nm { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn svg { width: 12px; height: 12px; }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 230px; z-index: 300;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .16s ease, visibility 0s; }
.user-dropdown .ud-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.user-dropdown .ud-head b { display: block; font: 600 14px var(--font-ui); }
.user-dropdown .ud-head span { display: block; font-size: 12.5px; color: var(--ink-3); }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none;
  color: var(--ink); font: 14px var(--font-ui); text-align: left; cursor: pointer;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.user-dropdown svg { width: 16px; height: 16px; opacity: .75; }
.user-dropdown .danger { color: var(--danger); }
.user-dropdown .danger:hover { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .user-dropdown { transition-duration: .01ms; transform: none; } }

/* ---------- Menú lateral ---------- */
.sidebar {
  grid-column: 1; grid-row: 2; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; z-index: 150;
  display: flex; flex-direction: column;
}
.nav { padding: 16px 0 12px; flex: 1; }
.sidebar-foot { padding: 14px 18px 16px; border-top: 1px solid var(--line-2); }
.sidebar-foot .powered { align-items: flex-start; gap: 5px; }
.sidebar-foot .powered small { color: var(--ink-3); }
.sidebar-foot .powered img { height: 24px; }
.nav-label { padding: 14px 18px 6px; font: 600 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav-label:first-child { padding-top: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 18px; color: var(--nav-text);
  font: 14px var(--font-ui); border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.nav a svg { width: 20px; height: 20px; opacity: .7; }
.nav a:hover { background: var(--brand-tint); color: var(--brand-ink); text-decoration: none; }
.nav a:hover svg, .nav a.active svg { opacity: 1; }
.nav a.active { background: var(--brand-tint); color: var(--brand-hover); border-left-color: var(--brand-action); font-weight: 600; }
[data-theme="dark"] .nav a.active { color: var(--brand-action); }
.nav .count { margin-left: auto; background: var(--brand-accent); color: var(--on-fill); font: 700 11px var(--font-ui); border-radius: 10px; padding: 0 7px; line-height: 18px; }

.main { grid-column: 2; grid-row: 2; min-width: 0; }
.content { padding: 24px 28px 40px; max-width: 1380px; width: 100%; }
.crumbs { font: 13px var(--font-ui); color: var(--ink-3); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand-action); }
.crumbs span + span::before { content: '/'; margin: 0 8px; opacity: .5; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font: 600 12px var(--mono); color: var(--brand-action); letter-spacing: .02em; margin-bottom: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.eyebrow .badge, .eyebrow .tag { font-family: var(--font-ui); letter-spacing: 0; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { flex: 1; }
.card-head .sub { color: var(--ink-3); font: 400 12.5px var(--font-body); }
.card-body { padding: 16px 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--k, var(--brand-ink)); }
.kpi .v { font: 700 26px/1.1 var(--font-ui); color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.kpi a { color: inherit; }
.kpi a:hover { text-decoration: none; }
.kpi.accent { --k: var(--brand-accent); }
.kpi.cyan { --k: var(--brand-spark); }
.kpi.warn { --k: var(--warning); }
.kpi.danger { --k: var(--danger); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px;
  border-radius: var(--radius); border: 1px solid transparent; font: 600 13.5px var(--font-ui); cursor: pointer; white-space: nowrap;
  background: var(--brand-action); color: var(--on-fill); transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--brand-hover); color: var(--on-fill); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-accent { background: var(--brand-accent); }
.btn-accent:hover { background: var(--brand-accent-dk); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--surface-2); color: var(--ink); border-color: var(--input-line); }
.btn-ghost { background: transparent; color: var(--ink-2); font-weight: 500; }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-3); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px/18px var(--font-ui); padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-teal { background: var(--brand-tint); color: var(--brand-hover); }
.badge-purple { background: var(--brand-accent-tint); color: var(--brand-accent-dk); }
.badge-muted { background: var(--line-2); color: var(--ink-3); }
[data-theme="dark"] .badge-teal { color: var(--brand-action); }
.tag { display: inline-block; font: 600 11px var(--font-ui); letter-spacing: .03em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); }
.tag.lmp { background: var(--brand-tint); color: var(--brand-hover); }
.tag.client { background: var(--brand-accent-tint); color: var(--brand-accent-dk); }
[data-theme="dark"] .tag.lmp { color: var(--brand-action); }
.rev { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 4px; font: 600 12px var(--mono); background: var(--ink); color: var(--surface); }
.rev.old { background: var(--line); color: var(--ink-2); }
.prio-alta { color: var(--danger); font-weight: 600; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font: 600 11.5px var(--font-ui); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover-row); }
.table .title-cell b { display: block; font: 600 14px var(--font-ui); color: var(--ink); }
.table .title-cell span { color: var(--ink-3); font-size: 12.5px; }
.table td > svg { width: 16px; height: 16px; color: var(--success); }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; color: inherit; }
.row-link:hover b { color: var(--brand-action); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }
.field label, .label { display: block; font: 600 12.5px var(--font-ui); color: var(--ink-2); margin-bottom: 5px; }
.field .req { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--input-line); border-radius: var(--radius); background: var(--input-bg);
  font: 15px var(--font-body); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:disabled { opacity: .7; }
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-spark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-spark) 22%, transparent); }
::placeholder { color: var(--ink-3); opacity: .75; }
.input-unit { display: flex; }
.input-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-unit span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--input-line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--brand-action); }
.form-section { font: 600 12px var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--brand-action); padding-top: 8px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.form-section:first-child { border: 0; margin: 0; padding: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.form-foot { border-top: 1px solid var(--line-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { width: auto; height: 34px; font-size: 14px; }
.filters input[type=search] { min-width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg label { cursor: pointer; margin: 0; }
.seg input { display: none; }
.seg span { display: block; padding: 7px 12px; font: 500 13px var(--font-ui); color: var(--ink-2); border-right: 1px solid var(--line); background: var(--surface); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand-tint); color: var(--brand-hover); }
[data-theme="dark"] .seg input:checked + span { color: var(--brand-action); }

/* ---------- Avisos ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.flash-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-3); font: 500 14px var(--font-ui); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-action); border-bottom-color: var(--brand-action); font-weight: 600; }
.tabs .n { font-size: 11px; background: var(--line-2); color: var(--ink-2); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.tabs a.active .n { background: var(--brand-tint); color: var(--brand-action); }

/* ---------- Cabecera de proyecto ---------- */
.project-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 22px; margin-bottom: 18px; position: relative; overflow: hidden; }
.project-hero::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--lmp-cyan) 0 33%, var(--lmp-dark) 33% 66%, var(--lmp-purple) 66%); }
.project-hero .top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.project-hero h1 { font-size: 1.35rem; }
.meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
.meta div { min-width: 110px; }
.meta dt { font: 600 11px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.meta dd { margin: 2px 0 0; font-weight: 600; }
.late { color: var(--danger); font-weight: 600; }
.soon { color: var(--warning); font-weight: 600; }

.progress { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--lmp-cyan), var(--brand-action)); border-radius: 4px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-bottom: 5px; font-weight: 400; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-3); }
.checklist .ico svg { width: 15px; height: 15px; }
.checklist .aprobado .ico { background: var(--success-soft); color: var(--success); }
.checklist .recibido .ico { background: var(--info-soft); color: var(--info); }
.checklist .observado .ico { background: var(--warning-soft); color: var(--warning); }
.checklist .no_aplica { opacity: .6; }
.checklist .txt { flex: 1; min-width: 0; }
.checklist .txt b { font: 600 14px var(--font-ui); display: block; }
.checklist .txt span { font-size: 13px; color: var(--ink-3); }
.checklist .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Bitácora ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: 12.5px; color: var(--ink-3); }
.timeline .msg { font-size: 14px; }
.timeline .msg b { font-weight: 600; }
.timeline .note { background: var(--note-bg); border: 1px solid var(--note-line); color: var(--ink); border-radius: var(--radius); padding: 8px 11px; margin-top: 6px; white-space: pre-wrap; font-size: 14px; }
.timeline .internal { font: 700 10.5px var(--font-ui); letter-spacing: .05em; text-transform: uppercase; color: var(--warning); margin-left: 6px; }
.tl-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.tl-ico svg { width: 16px; height: 16px; }
.tl-ico.t-documento, .tl-ico.t-revision { background: var(--brand-tint); color: var(--brand-action); }
.tl-ico.t-revisado { background: var(--brand-accent-tint); color: var(--brand-accent); }
.tl-ico.t-observacion { background: var(--warning-soft); color: var(--warning); }
.tl-ico.t-estado { background: var(--info-soft); color: var(--info); }
.tl-ico.t-nota { background: var(--note-bg); color: var(--note-ink); }

/* ---------- Archivos ---------- */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.files li + li { border-top: 1px dashed var(--line); }
.fext { width: 34px; height: 34px; flex: none; border-radius: 6px; display: grid; place-items: center; font: 600 9.5px var(--mono); text-transform: uppercase; color: #fff; background: #6b7384; }
.fext.pdf { background: #c0392b; } .fext.dwg, .fext.dxf { background: #2c6e8f; }
.fext.docx, .fext.doc { background: #2b5797; } .fext.xlsx, .fext.xls, .fext.xlsm, .fext.csv { background: #1e7145; }
.fext.zip, .fext.rar, .fext.7z { background: #7a5c2e; } .fext.jpg, .fext.jpeg, .fext.png, .fext.tif { background: #8264AA; }
.fext.kmz, .fext.kml { background: #2F7C85; }
.files .fn { flex: 1; min-width: 0; }
.files .fn a { font-weight: 600; overflow-wrap: anywhere; }
.files .fn span { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------- Cargador ---------- */
.dropzone {
  border: 1.5px dashed var(--input-line); border-radius: var(--radius); background: var(--surface-2); padding: 22px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-spark); background: var(--brand-tint); }
.dropzone svg { width: 28px; height: 28px; color: var(--brand-spark); }
.dropzone b { display: block; margin-top: 6px; font: 600 14px var(--font-ui); }
.dropzone span { font-size: 13px; color: var(--ink-3); }
.dropzone input[type=file] { display: none; }
.upl-list { list-style: none; margin: 10px 0 0; padding: 0; }
.upl-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; background: var(--surface); }
.upl-list .nm { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.upl-list .st { font-size: 12px; color: var(--ink-3); }
.upl-list .bar { height: 4px; background: var(--line-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.upl-list .bar i { display: block; height: 100%; width: 0; background: var(--brand-spark); transition: width .2s; }
.upl-list li.done .bar i { background: var(--success); }
.upl-list li.err { border-color: var(--danger); background: var(--danger-soft); }
.upl-list li.err .st { color: var(--danger); }
.upl-list button { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }

/* ---------- Revisiones ---------- */
.rev-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.rev-card + .rev-card { margin-top: 14px; }
.rev-card.superseded { background: var(--surface-2); box-shadow: none; }
.rev-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rev-head .grow { flex: 1; min-width: 200px; }
.rev-head .grow b { font: 600 14px var(--font-ui); }
.rev-head .grow span { color: var(--ink-3); font-size: 13px; display: block; }
.rev-body { padding: 12px 16px; }
.rev-notes { background: var(--line-2); border-radius: var(--radius); padding: 8px 11px; font-size: 14px; white-space: pre-wrap; margin-bottom: 10px; }
.rev-notes.boxed { background: var(--surface); border: 1px solid var(--line); }
.review { border-top: 1px solid var(--line-2); padding: 12px 16px; background: var(--review-bg); }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.review-head .who2 { font: 600 14px var(--font-ui); }
.review-head .when { font-size: 12.5px; color: var(--ink-3); }
.obs { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 8px; }
.obs-main { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; padding: 10px 12px; align-items: start; }
.obs-n { font: 600 12px var(--mono); color: var(--ink-2); background: var(--line-2); border-radius: 4px; text-align: center; padding: 3px 0; }
.obs-text { white-space: pre-wrap; font-size: 14px; }
.obs-ref { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.obs-resp { border-top: 1px dashed var(--line); padding: 9px 12px 10px 58px; font-size: 14px; background: var(--resp-bg); }
.obs-resp .by { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.obs-resp p { white-space: pre-wrap; margin: 0; }
.obs-actions { padding: 0 12px 10px 58px; }
.obs-actions form { display: flex; gap: 8px; align-items: flex-start; }
.obs-actions textarea { min-height: 38px; height: 38px; }
.obs-rows .obs-row { display: grid; grid-template-columns: 28px 170px 1fr 32px; gap: 8px; align-items: start; margin-top: 8px; }
.obs-rows .num { font: 600 12px var(--mono); color: var(--ink-3); padding-top: 11px; text-align: right; }
.obs-rows textarea { min-height: 38px; height: 38px; }
.review-head svg, .obs-ref svg, .dl a svg, .small svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Pendientes / notificaciones ---------- */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { border-bottom: 1px solid var(--line-2); }
.todo li:last-child { border-bottom: 0; }
.todo a { display: flex; gap: 12px; align-items: center; padding: 11px 20px; color: inherit; }
.todo a:hover { background: var(--hover-row); text-decoration: none; color: inherit; }
.todo a.unread { background: var(--unread-bg); }
.todo a.read b { font-weight: 400; }
.todo .k { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--info); }
.todo .k.warn { background: var(--warning); } .todo .k.acc { background: var(--brand-accent); } .todo .k.off { background: var(--line); }
.todo .t { flex: 1; min-width: 0; }
.todo .t b { font: 600 14px var(--font-ui); display: block; }
.todo .t span { font-size: 13px; color: var(--ink-3); }
.user-row { display: flex; gap: 10px; align-items: center; padding: 11px 20px; }
.user-row .t b { font: 600 14px var(--font-ui); display: block; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-accent-tint); color: var(--brand-accent-dk); font: 700 12px var(--font-ui); }
.avatar.lmp { background: var(--brand-tint); color: var(--brand-hover); }

/* ---------- Tarjetas de proyecto (cliente) ---------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; color: inherit; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--brand-spark); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.pcard .code { font: 600 12px var(--mono); color: var(--brand-action); }
.pcard h3 { font-size: 15px; margin: 4px 0 2px; color: var(--ink); }
.pcard .loc { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.pcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

.sbars { list-style: none; margin: 0; padding: 6px 0; }
.sbars li { display: grid; grid-template-columns: 170px 1fr 28px; gap: 10px; align-items: center; padding: 5px 20px; font-size: 13.5px; }
.sbars a { color: inherit; }
.sbars .b { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.sbars .b i { display: block; height: 100%; background: var(--brand-spark); border-radius: 4px; }
.sbars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty svg { width: 34px; height: 34px; color: var(--ink-3); opacity: .5; }
.empty b { display: block; color: var(--ink-2); margin: 8px 0 4px; font: 600 15px var(--font-ui); }

/* ---------- Diálogos ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(10, 20, 28, .55); }
dialog .dlg-head { display: flex; align-items: center; padding: 14px 18px; background: var(--brand-head-2); color: #fff; }
dialog .dlg-head h2 { flex: 1; color: #fff; }
dialog .dlg-head .icon-btn { color: rgba(255,255,255,.8); }
dialog .dlg-head .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
dialog .dlg-body { padding: 16px 18px; }
dialog .dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ============================================================
   ACCESO (login, invitación, recuperación) — como el login del CRM
   ============================================================ */
.guest {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(135deg, var(--brand-head-2) 0%, var(--brand-head-1) 55%, var(--brand-head-3) 100%);
  position: relative;
}
.guest .hbtn { position: absolute; top: 14px; right: 14px; }
.guest-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px 32px 24px; }
.guest-card.wide { max-width: 600px; }
.guest-logo { text-align: center; margin-bottom: 24px; }
.guest-brand { display: inline-flex; align-items: center; gap: 12px; }
.guest-brand .mark { height: 52px; width: auto; }
.guest-brand .app-name { font: 700 2.3rem/1 var(--font-ui); color: var(--brand-ink); letter-spacing: -.02em; }
.guest-logo .slogan { font-size: 15px; color: var(--ink-2); margin: 12px auto 0; max-width: 340px; line-height: 1.4; }
.guest-card h2 { font-size: 1.15rem; margin-bottom: 6px; }
.guest-card .lead { color: var(--ink-3); margin-bottom: 18px; font-size: 14px; }
.guest-card .field + .field { margin-top: 14px; }
.guest-card .form-grid .field + .field { margin-top: 0; }   /* dentro de la grilla manda el gap */
.guest-card .btn { height: 44px; margin-top: 20px; font-size: 15px; }
.guest-card .alt { margin-top: 14px; font-size: 13.5px; text-align: center; }
.guest-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-3); }
.guest-foot .powered small { color: var(--ink-3); }
.by-lmp { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--ink-3); }
.by-lmp:hover { text-decoration: none; }
.by-lmp small { font: 600 9px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.by-lmp img { height: 34px; width: auto; }
.by-lmp img.lmp-h { height: 16px; margin: 6px 0; }
.guest-foot .powered { align-items: flex-end; }
.guest-foot .powered img { height: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .sidebar { position: fixed; left: 0; top: var(--header-h); width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 140; }
  .menu-toggle { display: grid; margin-left: 6px; }
  .brand-block { min-width: 0; padding-left: 6px; padding-right: 16px; gap: 10px; }
  .brand-block .mark { height: 28px; }
  .wordmark b { font-size: 19px; }
  .logo-sep, .logo-producto, .user-btn .nm { display: none; }
  .app-header { padding-right: 8px; gap: 4px; }
  body.section-panel .app-header::before, body.section-panel .app-header::after { display: none; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid > [class*=col-] { grid-column: span 12; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .obs-rows .obs-row { grid-template-columns: 24px 1fr 32px; }
  .obs-rows .obs-row .ref { grid-column: 2 / 3; }
  .obs-resp, .obs-actions { padding-left: 12px; }
  .sbars li { grid-template-columns: 110px 1fr 24px; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .card-head { flex-wrap: wrap; }
  .card-head .sub { display: none; }
  .checklist li { flex-wrap: wrap; padding: 11px 14px; }
  .checklist .txt { flex-basis: calc(100% - 40px); }
  .checklist .acts { width: 100%; justify-content: flex-start; padding-left: 38px; }
  .project-hero .actions .btn { flex: 1 1 auto; }
  .meta div { min-width: 42%; }
  .guest-card { padding: 28px 20px 20px; }
}
@media (max-width: 480px) {
  .app-header { overflow: hidden; }
  .hbtn { width: 34px; height: 34px; }
  .menu-toggle { margin-left: 4px; }
  .brand-block { padding-left: 2px; padding-right: 10px; gap: 7px; }
  .wordmark small { font-size: 8.5px; }
  .user-btn { padding: 4px; }
  .user-btn svg { display: none; }
  .user-btn .avatar { width: 30px; height: 30px; }
}

@media print {
  .sidebar, .app-header, .actions, .form-actions, .tabs { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* ---------- Secciones desplegables opcionales (ficha del proyecto) ---------- */
.opt { font: 600 10.5px var(--font-ui); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
  background: var(--line-2); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.folds { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.fold { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.fold[open] { box-shadow: var(--shadow-sm); }
.fold > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; border-radius: var(--radius-lg); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary:focus-visible { outline: 2px solid var(--brand-spark); outline-offset: 2px; }
.fold[open] > summary { border-bottom: 1px solid var(--line-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.fold-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-tint); color: var(--brand-action); }
.fold-ico svg { width: 17px; height: 17px; }
.fold-title { flex: 1; min-width: 0; }
.fold-title b { display: block; font: 600 14.5px var(--font-ui); color: var(--ink); }
.fold-title small { display: block; font-size: 12.5px; color: var(--ink-3); }
.fold-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.fold-meta .opt { margin: 0; }
.fold-count { font: 600 12px var(--font-ui); color: var(--ink-3); white-space: nowrap; }
.fold-count.has { color: var(--success); }
.fold-chev { width: 18px; height: 18px; color: var(--ink-3); transition: transform .18s ease; }
.fold[open] .fold-chev { transform: rotate(180deg); }
.fold-body { padding: 16px; }
@media (max-width: 860px) {
  .fold-title small, .fold-meta .opt { display: none; }
}
