:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #dbeafe;
  --primary-grad: #3b82f6;
  --primary-rgb: 37, 99, 235;
  --success: #10b981;
  --success-strong: #059669;
  --success-soft: #d1fae5;
  --duo: #58cc02;
  --duo-soft: #e9f7d4;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .12);
  --font: 'Open Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --sidebar-w: 244px;

  /* Botones globales: un solo color de fondo, de texto y de hover */
  --btn-bg: var(--primary);
  --btn-text: #fff;
  --btn-hover: var(--primary-strong);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--text); font-weight: 700; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
small { color: var(--muted); }

/* ---------- Boot ---------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-subtle);
  color: var(--muted);
}
.boot-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-grad));
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  z-index: 40;
  padding: 20px 14px;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.sidebar-brand .logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-grad));
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand .bname { font-weight: 800; font-size: 15px; line-height: 1.1; }
.sidebar-brand .bsub { font-size: 11px; color: var(--muted); font-weight: 500; }
.sidebar-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 18px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 13.5px;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-item .ico { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; }
.nav-badge { margin-left: auto; background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.mini-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-user .u-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.mini-user .u-role { font-size: 11px; color: var(--muted); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 60px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
}
.topbar .page-title { font-size: 16px; font-weight: 800; }
.topbar .spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.burger { display: none; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text-2); }
.tenant-switch { position: relative; flex-shrink: 0; }
.ts-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 13px; font-size: 12.5px; font-weight: 700; color: var(--text);
  max-width: 220px; transition: border .15s, box-shadow .15s;
}
.ts-btn:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.ts-btn #ts-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 220px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px;
}
.ts-menu.open { display: block; }
.ts-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: none; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.ts-item:hover { background: var(--primary-soft); color: var(--primary-strong); }
.ts-item .small { margin-left: auto; text-transform: capitalize; }
.tenant-view { color: var(--duo) !important; border-color: var(--duo) !important; flex-shrink: 0; }
@media (max-width: 860px) {
  .tenant-switch { display: none; }
  .tenant-view { display: none; }
}

.content { padding: 24px; flex: 1; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 13.5px; font-family: inherit;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  background: var(--btn-bg); color: var(--btn-text);
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { --btn-bg: #fff; --btn-text: var(--text-2); --btn-hover: var(--bg-hover); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--border-strong); }
.btn.success { --btn-bg: var(--success); --btn-text: #fff; --btn-hover: var(--success-strong); }
.btn.danger { --btn-bg: var(--danger); --btn-text: #fff; --btn-hover: #dc2626; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 8px; width: 34px; height: 34px; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card.pad { padding: 20px; }
.card .card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card .card-head h3 { font-size: 15px; }
.card .card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.pad { padding: 20px; }
.grid.pad-sm { padding: 14px; }
.grid.gap-sm { gap: 10px; }
.grid.align-stretch > * { align-self: stretch; }
.stat {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat .s-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .s-value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat .s-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .s-ico { font-size: 20px; }
.stat.row2 { display: flex; align-items: center; gap: 14px; }
.stat.row2 .s-ico { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.ico-blue { background: var(--primary-soft); }
.ico-green { background: var(--success-soft); }
.ico-yellow { background: var(--warning-soft); }
.ico-red { background: var(--danger-soft); }
.ico-orange { background: #ffedd5; }
.ico-purple { background: var(--primary-soft); color: var(--primary-strong); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.green { background: var(--success-soft); color: var(--success-strong); }
.badge.red { background: var(--danger-soft); color: #991b1b; }
.badge.yellow { background: var(--warning-soft); color: #92400e; }
.badge.blue { background: var(--primary-soft); color: var(--primary-strong); }
.badge.orange { background: #ffedd5; color: #9a3412; }
.badge.gray { background: var(--bg-hover); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  transition: border .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14); }
textarea.input { resize: vertical; min-height: 84px; }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid.fg-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .form-grid.fg-3 { grid-template-columns: 1fr; } }
.select-wrap { position: relative; }
.select-wrap .input { appearance: none; padding-right: 30px; }
.select-wrap:after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-subtle); }
.tbl .t-actions { display: flex; gap: 6px; }
.mono { font-family: 'Open Sans', sans-serif; font-size: 13px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; min-width: 0; }
.k-col { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 360px; }
.k-col.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.k-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.k-col-head .k-title { font-weight: 700; font-size: 13px; }
.k-col-head .k-count { background: #fff; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 8px; }
.k-body { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; }
.k-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; cursor: grab; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.k-card:hover { box-shadow: var(--shadow-md); }
.k-card.dragging { opacity: .5; }
.k-card .k-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.k-card .k-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.k-card .k-docs { margin-top: 9px; }
.k-card .k-docs .pill { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 4px 10px; font-size: 11.5px; border: 1px solid transparent; }
.k-card .k-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.k-card .k-owner { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; font-weight: 600; color: var(--primary-strong); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.k-card .k-owner .fa-user-tie { flex-shrink: 0; font-size: 10px; }
.score-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.score-pill .fa-star { font-size: 10px; }
.score-high { background: var(--success-soft); color: var(--success-strong); }
.score-mid { background: var(--warning-soft); color: #92400e; }
.score-low { background: var(--bg-hover); color: var(--muted); }

/* ---------- WhatsApp ---------- */

/* ---------- Skill tree ---------- */
.tree { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 10px 0; }

/* ---------- Unidades (tabla lite) ---------- */
tr.unit { transition: background .12s; }
tr.unit:hover { background: var(--bg-subtle); }
.table-wrap .tbl tbody tr.unit td { vertical-align: middle; }
tr.unit .u-key b { font-weight: 800; }
tr.unit.available td:last-child .badge { }
tr.unit.reserved td:first-child { border-left: 3px solid var(--warning); }
tr.unit.sold td:first-child { border-left: 3px solid var(--danger); }
tr.unit.sold .u-key b { text-decoration: line-through; opacity: .7; }
tr.unit.inactive { opacity: .6; }
tr.unit.inactive .u-key b { text-decoration: line-through; }

/* ---------- Matrix filters ---------- */
.matrix-tools { margin-bottom: 14px; }
.flt-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.flt-line:last-child { margin-bottom: 0; }
.flt-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.flt-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--text-2);
  transition: background .12s, border-color .12s, opacity .12s;
}
.flt-chip input { display: none; }
.flt-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.flt-chip .dot.green { background: #10b981; }
.flt-chip .dot.yellow { background: #f59e0b; }
.flt-chip .dot.red { background: #ef4444; }
.flt-chip .dot.gray { background: #9ca3af; }
.flt-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.flt-chip:not(.on) { opacity: .45; }
.flt-count { font-weight: 700; }
.input.sm { font-size: 12.5px; padding: 6px 10px; }
.input.sm#flt-q { flex: 1; min-width: 160px; max-width: 260px; }

/* ---------- Chips & amenities ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft);
  color: var(--primary-strong); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700;
}
.chip .chip-x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 0; opacity: .7; }
.chip .chip-x:hover { opacity: 1; }
.amen-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.amen-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.amen-check input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- Gallery ---------- */
.gal-bar { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.gal-bar i { color: var(--primary); margin-right: 6px; }
.gal-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border); border-radius: 10px; min-height: 96px;
  color: var(--muted-2); font-size: 12.5px; font-weight: 600;
}
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gal-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-subtle); aspect-ratio: 4/3; cursor: zoom-in; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item.sm { min-width: 96px; max-width: 120px; }
.gal-item .gal-del {
  position: absolute; top: 5px; right: 5px; border: none; background: rgba(220,38,38,.9); color: #fff;
  width: 26px; height: 26px; border-radius: 50%; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s; z-index: 2;
}
.gal-item:hover .gal-del { opacity: 1; }
.gal-item .gal-del:hover { background: #b91c1c; }
.gal-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 2px dashed var(--border); border-radius: 10px; aspect-ratio: 4/3; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 700; transition: border-color .15s, color .15s, background .15s;
}
.gal-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.proj-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.proj-cover {
  height: 150px; border-radius: 12px; background-size: cover; background-position: center; margin-bottom: 14px;
}
.info-list { display: grid; gap: 8px; }
.info-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.info-row i { width: 18px; text-align: center; color: var(--muted); }
.info-row a { color: var(--primary-strong); font-weight: 600; }

/* ---------- Sección de ficha dentro de modales ---------- */
.sect-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 18px 0 10px; }
.sect-title i { color: var(--primary); }
.sect-title:first-child { margin-top: 0; }

/* ---------- Hero de unidad ---------- */
.u-hero {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-grad));
  border-radius: 16px; padding: 20px 24px; color: #fff;
}
.u-hero .u-hl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.u-hero .u-price { font-size: 30px; font-weight: 800; line-height: 1.15; }
.u-hero .u-psqm { display: inline-block; margin-left: 12px; font-size: 13px; font-weight: 700; opacity: .85; vertical-align: middle; }
.u-hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.u-hero-it {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 700; backdrop-filter: blur(4px);
}
.u-hero-it i { font-size: 14px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.gap-sm { gap: 8px; }

/* ---------- Detalles extra (campos flexibles) ---------- */
.u-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.u-extra { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.u-extra b { display: block; font-size: 12px; font-weight: 800; color: var(--text); text-transform: capitalize; }
.u-extra span { font-size: 13px; color: var(--muted); }
.u-xrow { margin-bottom: 8px; }

/* ---------- Ficha unidad (ancho xl, 1 columna) ---------- */
.u-card { max-width: none; }
.u-card .u-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.res-card {
  margin-top: 16px; padding: 14px 16px; border: 1px solid #fcd34d; background: #fffbeb;
  border-radius: 12px; display: flex; flex-direction: column; gap: 8px;
}
.res-card .sect-title { margin: 0 0 2px; color: #92400e; }
.res-card .sect-title i { color: #d97706; }
.res-card.expired { border-color: #fca5a5; background: #fef2f2; }
.res-card.expired .sect-title { color: #991b1b; }
.res-card.expired .sect-title i { color: var(--danger); }
.res-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-2); }
.res-row i { margin-top: 2px; color: var(--muted); width: 14px; text-align: center; }
.res-row b { color: var(--text-1); }
@media (max-width: 760px) {
  .u-hero { padding: 16px; }
  .u-hero .u-price { font-size: 24px; }
}

/* ---------- Modal edición desarrollo (2 columnas) ---------- */
.pj-edit { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.pj-left { border-right: 1px solid var(--border); padding-right: 24px; }
.pj-id { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); }
@media (max-width: 700px) {
  .pj-edit { grid-template-columns: 1fr; }
  .pj-left { border-right: none; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(10,14,22,.9);
  display: flex; align-items: center; justify-content: center; animation: fade .15s;
}
.lightbox .lb-body { position: relative; max-width: 92vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.lightbox .lb-body img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow-lg); object-fit: contain; }
.lightbox .lb-close {
  position: absolute; top: 16px; right: 20px; border: none; background: rgba(255,255,255,.12); color: #fff;
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 2;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); border: none; background: rgba(255,255,255,.12); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; font-size: 17px; cursor: pointer; z-index: 2;
}
.lightbox .lb-nav:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-prev { left: 16px; }
.lightbox .lb-next { right: 16px; }
.lightbox .lb-count {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff;
  background: rgba(255,255,255,.15); padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 100; animation: fade .15s;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s;
}
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 1080px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-head .close { margin-left: auto; border: none; background: var(--bg-hover); border-radius: 8px; width: 32px; height: 32px; font-size: 15px; cursor: pointer; color: var(--text-2); }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; animation: toastin .25s; max-width: 360px;
}
.toast.ok { background: var(--success-strong); }
.toast.err { background: #dc2626; }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li:before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child:before { display: none; }
.timeline li .ev-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary-soft); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--primary); }
.timeline li .ev-head { font-weight: 700; font-size: 13px; }
.timeline li .ev-time { font-size: 11px; color: var(--muted); }
.timeline li .ev-notes { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ---------- Copilot ---------- */
.d-list { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.d-list li { color: var(--text-2); line-height: 1.55; }
.d-list b { color: var(--text); }
.copilot { background: linear-gradient(135deg, var(--primary-soft), #eff6ff); border: 1px solid #bfdbfe; border-radius: 14px; padding: 16px; }
.copilot .cp-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; color: var(--primary-strong); margin-bottom: 10px; }
.cp-custom { margin-bottom: 14px; }
.cp-list { display: flex; flex-direction: column; gap: 8px; }
.cp-msg { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font-size: 13px; cursor: pointer; transition: border .15s, box-shadow .15s; position: relative; }
.cp-msg:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.cp-msg .cp-label { font-size: 11px; font-weight: 700; color: var(--primary-strong); display: block; margin-bottom: 3px; }
.cp-msg .cp-copy { float: right; font-size: 11px; color: var(--muted); margin-left: 10px; }
.cp-msg .cp-wa { float: right; font-size: 11px; color: #25d366; font-weight: 700; margin-left: 10px; }
.cp-msg .cp-copy:hover, .cp-msg .cp-wa:hover { text-decoration: underline; }
.cp-msg .cp-body { margin-top: 2px; line-height: 1.45; color: var(--text); }
.cp-msg.custom { border-color: #a7f3d0; background: #ecfdf5; }
.cp-msg.custom .cp-label { color: #059669; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .empty-ico { font-size: 44px; margin-bottom: 10px; }
.avatar { border-radius: 50%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.money { font-weight: 800; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.pill { display: inline-block; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 16px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.login-badge { font-size: 11px; }
.copy-input { display: flex; gap: 8px; }
.copy-input .input { font-family: 'Open Sans', sans-serif; font-size: 13px; }

/* ---------- Utilities ---------- */
.pad { padding: 20px; }
.pad-sm { padding: 14px; }
.ml-auto { margin-left: auto; }
.ml-2 { margin-left: 8px; }
.sm { font-size: 12px; }
.btn.block { width: 100%; }
.item-hover { border-radius: 8px; transition: background .15s; }
.item-hover:hover { background: var(--bg-subtle); }
.py-1 { padding: 7px 0; }
.card.relative { position: relative; }
.card .card-body { padding: 16px 20px; }
.stat.compact { padding: 14px; }
.stat .s-value.sm { font-size: 20px; }
.stat .s-value.lg { font-size: 28px; }
.tbl .empty { padding: 28px 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: center; }
.select-sm { width: auto; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-subtle); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px; }
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-grad)); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ---------- Brand / Ajustes ---------- */
.logo-img, .boot-logo img, .login-logo img, .sidebar-brand .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.boot-logo, .login-logo, .sidebar-brand .logo { overflow: hidden; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; padding: 0; transition: transform .12s, box-shadow .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .3); }
.brand-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.preview-logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-grad)); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-logo img { width: 100%; height: 100%; object-fit: contain; }
.preview-btn { width: auto; min-width: 96px; }

/* ---------- Response ---------- */
.page-head .actions { margin-left: auto; }
.card .card-head { flex-wrap: wrap; }
.tabs { overflow-x: auto; flex-wrap: nowrap; }
.tabs .tab { white-space: nowrap; }
.copy-input { flex-wrap: wrap; }
.topbar .page-title { min-width: 0; }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(5, 320px); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .burger { display: block; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .modal.lg { max-width: 640px; }
  .modal.xl { max-width: 640px; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-auto { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .page-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .btn { padding: 10px 14px; }
  .modal { max-height: 94vh; }
  .modal-body { padding: 18px; }
  .modal-head { padding: 15px 18px; }
  .modal-foot { padding: 12px 18px; }
  .quiz-card { padding: 18px; }
  .quiz-q { font-size: 17px; }
  .login-card { padding: 26px 20px; }
  .card.pad { padding: 16px; }
  .stat { padding: 14px; }
  .stat .s-value { font-size: 22px; }
  .result-screen { padding: 18px; }
  .copy-input .input { min-width: 160px; }
  .page-head h1 { font-size: 18px; }
}
@media (max-width: 480px) {
  .topbar { height: 56px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .card .card-head { flex-direction: column; align-items: flex-start; }
  .card .card-head .actions { margin-left: 0; }
  .grid { gap: 12px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .k-card { padding: 10px; }
  .login-screen { padding: 12px; }
  .login-card { padding: 24px 18px; }
}

/* ---------- Archivos ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 12px; }
.file-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .12s, transform .12s;
}
.file-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.file-thumb {
  position: relative; height: 120px; background: var(--bg-subtle); cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-ico { font-size: 40px; color: var(--primary); opacity: .8; }
.file-vthumb {
  position: absolute; z-index: 2; font-size: 30px; color: #fff; opacity: .9;
  text-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none;
}
.file-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-info { padding: 10px 12px 4px; flex: 1; min-width: 0; }
.file-name { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.file-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }
.btn.danger { color: var(--danger, #dc2626); }
.btn.danger:hover { background: #fee2e2; border-color: #fca5a5; }
.btn.ghost.danger { --btn-bg: #fff; --btn-text: var(--danger, #dc2626); color: var(--danger, #dc2626); border-color: var(--border); }
.btn.ghost.danger:hover { background: #fee2e2; border-color: #fca5a5; }
.hidden { display: none !important; }
.file-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 120px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer;
  color: var(--muted); font-size: 12.5px; font-weight: 700; background: var(--bg-subtle);
  transition: border-color .12s, color .12s;
}
.file-add:hover { border-color: var(--primary); color: var(--primary-strong); }
.file-add i { font-size: 26px; }

/* ---------- Explorador de archivos ---------- */
.fx-head .sect-title { margin-top: 0; }
.fx-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.fx-subtab { max-width: 220px; }
.mv-opt-sub { padding-left: 26px; font-size: 12.5px; }
.fx-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fx-tab {
  display: inline-flex; align-items: center; gap: 8px; max-width: 240px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-subtle); font-size: 13px; font-weight: 700; color: var(--text-2);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s; overflow: hidden;
}
.fx-tab:hover { border-color: var(--primary); color: var(--primary-strong); }
.fx-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fx-tab i { flex-shrink: 0; }
.fx-tab {
  text-overflow: ellipsis; white-space: nowrap;
}
.fx-tab .fx-cnt { flex-shrink: 0; font-size: 11px; font-weight: 800; color: var(--muted); background: var(--bg-hover); border-radius: 999px; padding: 1px 8px; }
.fx-tab.on .fx-cnt { background: rgba(255,255,255,.25); color: #fff; }
.fx-tabw { position: relative; }
.fx-tabw .fx-tab { padding-right: 30px; }
.fx-tabw:hover .fx-del { opacity: 1; }
.fx-del { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); border: none; background: var(--bg); color: var(--muted); cursor: pointer; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; z-index: 2; }
.fx-del:hover { color: var(--danger); background: var(--danger-soft); }
.fx-empty { font-size: 12px; color: var(--muted); padding: 6px 4px; }
.mv-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.mv-opt {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 10px 12px; border: 1px solid var(--border); background: var(--bg); border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .12s, background .12s;
}
.mv-opt:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }

/* ---------- Checklist de documentos ---------- */
.doc-progress { height: 8px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.doc-bar { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--warning); transition: width .25s; }
.doc-bar.ok { background: var(--success); }
.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.doc-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; background: var(--bg); transition: border-color .12s, background .12s; user-select: none;
}
.doc-item:hover { border-color: var(--primary); }
.doc-item input { display: none; }
.doc-ico {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-subtle); color: var(--muted); font-size: 14px; flex-shrink: 0;
}
.doc-lbl { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; min-width: 0; }
.doc-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; transition: all .12s;
}
.doc-item.on { border-color: var(--success); background: var(--success-soft); }
.doc-item.on .doc-ico { background: var(--success-soft); color: var(--success); }
.doc-item.on .doc-check { background: var(--success); border-color: var(--success); color: #fff; }
.import-cols {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px;
  color: var(--text-2); margin-top: 8px; line-height: 1.6;
}
.import-ok {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px;
  background: var(--success-soft); border: 1px solid #a7f3d0; border-radius: 10px;
  color: #065f46; font-size: 13px; font-weight: 700;
}
.import-ok i { color: var(--success); font-size: 16px; }
.import-errors { margin-top: 10px; padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; font-size: 12.5px; color: #991b1b; display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow: auto; }
.import-errors b { margin-bottom: 2px; }
.import-errors .badge { font-size: 10px; }

@media print {
  .sidebar, .topbar, .toast-wrap, .page-head .actions, .matrix-tools, .modal, #view .actions, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .matrix { overflow: visible !important; }
  .matrix table { width: 100% !important; font-size: 10px; }
  .card { border: none; box-shadow: none; }
  .page-head { margin-bottom: 10px; }
}
