/* ==========================================================================
   INVENTARIO PUBLICITARIO GT · hoja de estilos principal
   Diseño mobile-first inspired by modern mapping & SaaS dashboards.
   ========================================================================== */

:root {
  --brand-900: #062f70;
  --brand-800: #0743a5;
  --brand-700: #084fd0;
  --brand-600: #0b57d0;
  --brand-500: #176cf1;
  --brand-400: #4c8df8;
  --brand-100: #dbeaff;
  --brand-050: #eff6ff;
  --ink-900: #0b1f3a;
  --ink-800: #0f2547;
  --ink-700: #1e3a5f;
  --ink-600: #334e6d;
  --muted: #64748b;
  --muted-2: #8a9bb0;
  --line: #e3e9f2;
  --line-strong: #d3ddeb;
  --bg: #f4f7fb;
  --bg-2: #eef3f9;
  --surface: #ffffff;
  --success: #12864a;
  --success-bg: #e7f8ee;
  --warning: #b45309;
  --warning-bg: #fff7e6;
  --danger: #c02636;
  --danger-bg: #fff0f1;
  --info: #0369a1;
  --info-bg: #e8f5ff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-xs: 0 1px 2px rgba(15, 37, 71, .04);
  --shadow-sm: 0 4px 12px rgba(15, 37, 71, .05);
  --shadow-md: 0 12px 34px rgba(15, 37, 71, .08);
  --shadow-lg: 0 24px 60px rgba(15, 37, 71, .13);
  --sidebar-w: 274px;
  --topbar-h: 74px;
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; }
::selection { background: var(--brand-100); color: var(--brand-900); }
:focus-visible { outline: 3px solid rgba(23, 108, 241, .35); outline-offset: 2px; }
.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;
}

/* ---------- Tipografía y utilidades ---------- */
h1, h2, h3, h4, h5, h6 { color: var(--ink-900); letter-spacing: -.02em; }
.fw-black { font-weight: 800 !important; }
.text-muted { color: var(--muted) !important; }
.text-ink { color: var(--ink-800) !important; }
.text-brand { color: var(--brand-600) !important; }
.bg-soft { background: var(--bg) !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.small-label {
  font-size: .69rem; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 800; color: var(--muted);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; opacity: 1; }
.hover-lift { transition: transform .18s ease, box-shadow .18s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.min-width-0 { min-width: 0; }
#mapa-publico-seccion { scroll-margin-top: 82px; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
[data-lucide] { width: 19px; height: 19px; stroke-width: 2; vertical-align: -.19em; }

/* ---------- Botones ---------- */
.btn {
  border-radius: 12px; font-weight: 650; letter-spacing: -.005em;
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: all .17s ease; border-width: 1px;
}
.btn-lg { min-height: 50px; border-radius: 14px; padding-inline: 1.35rem; }
.btn-sm { min-height: 34px; border-radius: 9px; font-size: .82rem; padding: .28rem .7rem; }
.btn-brand {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  border-color: var(--brand-600); color: #fff;
  box-shadow: 0 5px 14px rgba(11, 87, 208, .2);
}
.btn-brand:hover, .btn-brand:focus { background: var(--brand-700); border-color: var(--brand-700); color: #fff; box-shadow: 0 7px 20px rgba(11, 87, 208, .3); }
.btn-outline-brand { border-color: var(--brand-500); color: var(--brand-600); background: #fff; }
.btn-outline-brand:hover { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-600); }
.btn-soft {
  background: var(--bg-2); border-color: transparent; color: var(--ink-700);
}
.btn-soft:hover { background: var(--line); color: var(--ink-900); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink-900); }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-danger-soft:hover { background: #ffe1e4; color: #991b1b; }
.btn-success-soft { background: var(--success-bg); color: var(--success); border-color: transparent; }
.btn-icon {
  width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0;
  border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: 33px; min-width: 33px; height: 33px; min-height: 33px; border-radius: 9px; }
.btn [data-lucide] { width: 18px; height: 18px; }
.btn-lg [data-lucide] { width: 20px; height: 20px; }
.btn:disabled, .btn.disabled { opacity: .55; box-shadow: none; }

/* ---------- Formularios ---------- */
.form-label { font-weight: 650; font-size: .83rem; color: var(--ink-700); margin-bottom: .4rem; }
.form-label .req { color: var(--danger); }
.form-control, .form-select {
  border: 1px solid var(--line-strong); border-radius: 11px; min-height: 46px;
  color: var(--ink-800); background-color: #fff; font-size: .94rem;
  box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #a5b2c2; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(23, 108, 241, .1);
}
.form-control-sm, .form-select-sm { min-height: 38px; border-radius: 9px; font-size: .85rem; }
textarea.form-control { min-height: 100px; line-height: 1.55; }
.form-text { color: var(--muted); font-size: .76rem; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.input-group-text { border-color: var(--line-strong); background: var(--bg-2); color: var(--muted); border-radius: 11px; }
.input-group > :first-child { border-radius: 11px 0 0 11px; }
.input-group > :last-child { border-radius: 0 11px 11px 0; }
.field-error { color: var(--danger); font-size: .76rem; margin-top: .25rem; }
.is-invalid { border-color: #e88b95 !important; background-image: none; }

/* ---------- Cards ---------- */
.card-app {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-app > .card-head {
  padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-app > .card-head h2, .card-app > .card-head h3 { font-size: 1rem; margin: 0; font-weight: 750; }
.card-app > .card-body-app { padding: 1.35rem; }
.card-app > .card-foot { padding: .9rem 1.35rem; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stat-card {
  position: relative; overflow: hidden; padding: 1.15rem 1.2rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); height: 100%;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--stat-color, var(--brand-500));
}
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.stat-icon {
  width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center;
  color: var(--stat-color, var(--brand-600)); background: var(--stat-bg, var(--brand-050));
}
.stat-icon [data-lucide] { width: 21px; height: 21px; }
.stat-label { color: var(--muted); font-size: .78rem; font-weight: 650; margin: .85rem 0 .2rem; }
.stat-value { font-size: 1.85rem; font-weight: 800; color: var(--ink-900); letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-hint { color: var(--muted-2); font-size: .72rem; margin-top: .35rem; }
.stat-card.is-blue { --stat-color: var(--brand-500); --stat-bg: var(--brand-050); }
.stat-card.is-green { --stat-color: #0f9f5a; --stat-bg: #e9f9f0; }
.stat-card.is-amber { --stat-color: #d97706; --stat-bg: #fff7e7; }
.stat-card.is-violet { --stat-color: #7c3aed; --stat-bg: #f3edff; }
.stat-card.is-cyan { --stat-color: #0891b2; --stat-bg: #e8f9fd; }
.stat-card.is-rose { --stat-color: #e11d48; --stat-bg: #fff0f3; }

/* ---------- Shell privado ---------- */
.app-body { background: var(--bg); min-height: 100vh; }
.app-shell { min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w); position: fixed; inset: 0 auto 0 0; z-index: 1040;
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.15rem .95rem;
  border-bottom: 1px solid var(--line); min-height: var(--topbar-h);
}
.sidebar-brand img { height: 38px; width: auto; max-width: 205px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: .9rem .75rem 1rem; scrollbar-width: thin; }
.sidebar-section { margin-bottom: .9rem; }
.sidebar-section-title {
  font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em;
  color: var(--muted-2); padding: .55rem .7rem .35rem;
}
.side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: .72rem; padding: .62rem .75rem;
  color: var(--ink-600); font-size: .86rem; font-weight: 620; border-radius: 10px;
  transition: background .14s, color .14s;
}
.side-nav a:hover { background: var(--bg-2); color: var(--ink-900); }
.side-nav a.active { background: var(--brand-050); color: var(--brand-700); font-weight: 720; }
.side-nav a.active [data-lucide] { color: var(--brand-600); }
.side-nav a [data-lucide] { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.side-nav .nav-badge {
  margin-left: auto; font-size: .64rem; background: var(--brand-100); color: var(--brand-700);
  border-radius: 100px; padding: .12rem .45rem; font-weight: 800;
}
.sidebar-capture {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin: .2rem .75rem 1rem; padding: .78rem; border-radius: 12px; color: #fff !important;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  font-size: .86rem; font-weight: 750; box-shadow: 0 6px 16px rgba(11,87,208,.22);
}
.sidebar-capture:hover { filter: brightness(1.05); color: #fff; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .8rem; }
.sidebar-user { display: flex; align-items: center; gap: .65rem; padding: .45rem .4rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-100), #f4f9ff); color: var(--brand-700);
  font-weight: 800; font-size: .82rem; flex-shrink: 0; border: 1px solid #d9e8ff;
}
.avatar-lg { width: 54px; height: 54px; font-size: 1.05rem; }
.sidebar-user-name { font-size: .82rem; font-weight: 750; line-height: 1.2; color: var(--ink-800); }
.sidebar-user-role { font-size: .68rem; color: var(--muted); margin-top: .14rem; }
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
  height: var(--topbar-h); background: rgba(255,255,255,.9); backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 1rem; padding: 0 1.6rem;
}
.topbar-title { min-width: 0; }
.topbar-title .eyebrow { font-size: .67rem; font-weight: 800; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.topbar-title h1 { font-size: 1.14rem; font-weight: 780; margin: .1rem 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.app-content { padding: 1.5rem 1.6rem 2.5rem; width: 100%; max-width: 1560px; margin: 0 auto; flex: 1; }
.mobile-menu-btn { display: none; }

/* ---------- Page header / filtros ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.65rem; font-weight: 800; margin: 0 0 .25rem; letter-spacing: -.035em; }
.page-header p { color: var(--muted); margin: 0; font-size: .9rem; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.breadcrumb-app { display: flex; align-items: center; gap: .35rem; font-size: .73rem; color: var(--muted); list-style: none; padding: 0; margin: 0 0 .5rem; }
.breadcrumb-app li { display: inline-flex; align-items: center; gap: .35rem; }
.breadcrumb-app a { color: var(--muted); }
.breadcrumb-app a:hover { color: var(--brand-600); }
.breadcrumb-app [data-lucide] { width: 12px; height: 12px; }
.filter-bar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: .95rem; box-shadow: var(--shadow-xs); margin-bottom: 1rem;
}
.filter-bar .form-control, .filter-bar .form-select, .filter-bar .btn { min-height: 40px; font-size: .83rem; }
.search-input { position: relative; }
.search-input [data-lucide] {
  position: absolute; top: 50%; left: .78rem; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted-2); pointer-events: none;
}
.search-input .form-control { padding-left: 2.35rem; }

/* ---------- Tablas ---------- */
.table-responsive-app { border-radius: var(--radius-lg); overflow: auto; }
.table-app { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .83rem; }
.table-app thead th {
  padding: .7rem .85rem; background: #f8fafc; color: var(--muted);
  font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table-app tbody td { padding: .8rem .85rem; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr { transition: background .12s; }
.table-app tbody tr:hover { background: #f9fbfe; }
.table-app .cell-code { font-family: var(--mono); font-weight: 700; color: var(--brand-700); font-size: .78rem; white-space: nowrap; }
.table-app .cell-title { font-weight: 650; color: var(--ink-800); }
.table-app .cell-muted { color: var(--muted); font-size: .76rem; }
.table-thumb { width: 56px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); }
.table-actions { display: flex; gap: .25rem; justify-content: flex-end; }
.table-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.app-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.1rem; border-top: 1px solid var(--line); }
.pagination .page-link {
  border: 1px solid var(--line); color: var(--ink-600); border-radius: 9px !important;
  margin: 0 2px; min-width: 34px; height: 34px; display: grid; place-items: center; font-size: .8rem;
}
.pagination .page-item.active .page-link { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .page-link [data-lucide] { width: 15px; height: 15px; }
.pagination-info { color: var(--muted); font-size: .73rem; }

/* ---------- Badges ---------- */
.badge-status {
  display: inline-flex; align-items: center; gap: .35rem; border-radius: 100px;
  padding: .26rem .58rem; font-size: .67rem; font-weight: 750; line-height: 1.1;
  color: var(--badge-color, #475569); background: color-mix(in srgb, var(--badge-color, #64748b) 11%, white);
  white-space: nowrap;
}
.badge-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-soft { background: var(--brand-050); color: var(--brand-700); border-radius: 100px; padding: .28rem .62rem; font-size: .68rem; font-weight: 750; display: inline-flex; align-items: center; gap: .3rem; }
.badge-neutral { background: var(--bg-2); color: var(--ink-600); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--line);
  border-radius: 100px; padding: .32rem .65rem; font-size: .7rem; font-weight: 650; color: var(--ink-600);
}
.chip [data-lucide] { width: 13px; height: 13px; }

/* ---------- Alertas ---------- */
.app-alert { border-radius: 12px; border: 1px solid transparent; font-size: .85rem; padding: .8rem 1rem; }
.alert-success { background: var(--success-bg); color: #14532d; border-color: #c7eed7; }
.alert-danger { background: var(--danger-bg); color: #7f1d1d; border-color: #ffd4d9; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fde5b0; }
.alert-info { background: var(--info-bg); color: #0c4a6e; border-color: #bfe7fb; }

/* ---------- Mapa ---------- */
.map-shell { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #dfe8f2; box-shadow: inset 0 0 0 1px var(--line); }
.map-shell.map-public { height: 560px; }
.map-shell.map-admin { height: 590px; }
.map-shell.map-detail { height: 330px; border-radius: var(--radius); }
.map-shell.map-mini { height: 220px; border-radius: var(--radius); }
.leaflet-container { font-family: var(--font); background: #dfe8f2; }
.leaflet-control-zoom a { color: var(--ink-700) !important; border-radius: 8px !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 280px !important; font-family: var(--font); }
.leaflet-popup-tip { box-shadow: var(--shadow-md); }
.leaflet-popup-close-button { top: 8px !important; right: 8px !important; color: #fff !important; z-index: 5; width: 26px !important; height: 26px !important; background: rgba(15,37,71,.55) !important; border-radius: 50%; display: grid; place-items: center; }
.map-popup-photo { width: 100%; height: 136px; object-fit: cover; display: block; background: var(--bg-2); }
.map-popup-body { padding: .8rem .9rem .9rem; }
.map-popup-code { font-family: var(--mono); font-size: .7rem; color: var(--brand-700); font-weight: 750; }
.map-popup-title { font-size: .92rem; font-weight: 750; color: var(--ink-900); margin: .18rem 0 .35rem; }
.map-popup-meta { color: var(--muted); font-size: .73rem; line-height: 1.55; }
.map-popup-actions { display: flex; gap: .35rem; margin-top: .65rem; }
.map-popup-actions .btn { flex: 1; font-size: .7rem; min-height: 33px; padding: .25rem; }
.map-overlay-top {
  position: absolute; z-index: 500; top: .8rem; left: .8rem; right: .8rem;
  display: flex; gap: .5rem; align-items: flex-start; pointer-events: none;
}
.map-overlay-top > * { pointer-events: auto; }
.map-toolbar {
  display: flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.95);
  border: 1px solid var(--line); border-radius: 12px; padding: .32rem; box-shadow: var(--shadow-sm);
}
.map-toolbar .btn { min-height: 34px; font-size: .72rem; }
.map-legend {
  position: absolute; z-index: 500; bottom: .8rem; left: .8rem; background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 11px; padding: .45rem .65rem; font-size: .67rem;
  color: var(--muted); box-shadow: var(--shadow-sm); display: flex; gap: .8rem; flex-wrap: wrap;
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: .25rem; }
.leaflet-control-attribution { font-size: 9px !important; background: rgba(255,255,255,.8) !important; }
.marker-pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--brand-600); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(15,37,71,.35);
  display: grid; place-items: center;
}
.marker-pin span { transform: rotate(45deg); color: #fff; font-size: 10px; font-weight: 800; }
.marker-pin.is-pending { background: #f59e0b; }
.marker-pin.is-draft { background: #64748b; }
.marker-pin.is-rejected { background: #dc2626; }

/* ---------- Ficha rápida del punto (modal público) ---------- */
.punto-modal .modal-content { border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.punto-modal .modal-dialog { max-width: 760px; }
.punto-modal-hero { position: relative; height: 280px; background: #0f2547; overflow: hidden; }
.punto-modal-hero > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.punto-modal-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,20,38,.05) 20%, rgba(6,20,38,.82) 100%); }
.punto-close {
  position: absolute; top: .8rem; right: .8rem; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(6,20,38,.45); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(8px);
}
.punto-close:hover { background: rgba(6,20,38,.7); }
.punto-close [data-lucide] { width: 18px; height: 18px; }
.punto-hero-info { position: absolute; z-index: 2; left: 1.2rem; right: 3.5rem; bottom: 1rem; color: #fff; }
.punto-code { font-family: var(--mono); font-size: .72rem; font-weight: 800; color: #bcd9ff; letter-spacing: .03em; }
.punto-title { color: #fff; font-size: 1.5rem; font-weight: 850; line-height: 1.1; letter-spacing: -.035em; margin: .25rem 0 .55rem; }
.punto-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.punto-chips .chip { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22); font-size: .65rem; }
.punto-modal-body { padding: 1.1rem 1.25rem 1.3rem; }
.punto-gallery { display: flex; gap: .45rem; overflow-x: auto; margin-bottom: .85rem; padding-bottom: .2rem; }
.punto-gallery:empty { display: none; }
.punto-gallery button { width: 78px; height: 61px; border-radius: 9px; overflow: hidden; padding: 0; border: 2px solid transparent; background: var(--bg-2); flex-shrink: 0; }
.punto-gallery button img { width: 100%; height: 100%; object-fit: cover; }
.punto-gallery button.active { border-color: var(--brand-500); }
.punto-description { font-size: .86rem; line-height: 1.7; color: var(--ink-600); white-space: pre-line; margin-bottom: .9rem; }
.punto-description:empty { display: none; }
.punto-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin-bottom: .9rem; }
.punto-metric { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: .55rem .6rem; }
.punto-metric strong { display: block; font-size: 1rem; letter-spacing: -.02em; color: var(--ink-900); }
.punto-metric span { display: block; font-size: .58rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: .1rem; }
.punto-details { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; border-top: 1px solid var(--line); padding-top: .55rem; margin-bottom: .9rem; }
.punto-detail { padding: .35rem 0; font-size: .8rem; color: var(--ink-700); min-width: 0; }
.punto-detail > div { overflow-wrap: anywhere; }
.punto-detail-label { display: block; font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin-bottom: .1rem; }
.punto-share { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.punto-share .btn { font-size: .78rem; }
.btn-whatsapp { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn-whatsapp:hover { background: #168a48; border-color: #168a48; color: #fff; }
@media (max-width: 767.98px) {
  .punto-modal .modal-dialog { align-items: flex-end; min-height: calc(100% - .5rem); margin: .5rem 0 0; max-width: none; }
  .punto-modal .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .punto-modal-hero { height: 225px; }
  .punto-title { font-size: 1.25rem; }
  .punto-modal-body { padding: .9rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
  .punto-metrics { grid-template-columns: 1fr 1fr; }
  .punto-share { grid-template-columns: 1fr; }
  .punto-details { grid-template-columns: 1fr; }
}

/* ---------- Mapa público: composición ---------- */
.public-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 1rem; align-items: stretch; }
.public-list-panel { display: flex; flex-direction: column; max-height: 560px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.public-list-head { padding: .9rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.public-list-head strong { font-size: .9rem; }
.public-list-scroll { overflow-y: auto; flex: 1; }
.public-item { display: flex; gap: .7rem; padding: .75rem .9rem; border-bottom: 1px solid #eef2f7; cursor: pointer; transition: background .12s; }
.public-item:hover, .public-item.is-active { background: #f2f8ff; }
.public-item.is-active { box-shadow: inset 3px 0 0 var(--brand-500); }
.public-item img { width: 74px; height: 62px; border-radius: 9px; object-fit: cover; background: var(--bg-2); flex-shrink: 0; }
.public-item .public-check { margin: .25rem .05rem 0 0; flex-shrink: 0; }
.public-item-code { font-family: var(--mono); color: var(--brand-700); font-size: .66rem; font-weight: 700; }
.public-item-title { font-size: .8rem; font-weight: 700; color: var(--ink-800); margin-top: .12rem; }
.public-item-meta { font-size: .68rem; color: var(--muted); margin-top: .18rem; }

/* ---------- Selección y exportación pública ---------- */
.selection-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: .55rem .7rem; margin: -.35rem 0 .85rem; box-shadow: var(--shadow-xs);
}
.selection-all { display: inline-flex; align-items: center; gap: .4rem; font-size: .73rem; font-weight: 700; color: var(--ink-700); white-space: nowrap; cursor: pointer; margin: 0; }
.selection-all .form-check-input { margin-top: 0; }
.selection-resumen { color: var(--muted); font-size: .7rem; flex: 1; min-width: 160px; }
.selection-actions { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-left: auto; }
.selection-actions .btn { min-height: 32px; font-size: .7rem; }
.selection-actions .btn [data-lucide] { width: 14px; height: 14px; }
@media (max-width: 767.98px) {
  .selection-bar { gap: .4rem; }
  .selection-resumen { order: 3; width: 100%; flex-basis: 100%; }
  .selection-actions { width: 100%; }
  .selection-actions .btn { flex: 1; }
  .selection-actions .btn-whatsapp { flex-basis: 100%; }
}

/* ---------- Hero público ---------- */
.public-body { background: #f7f9fc; }
.public-nav {
  position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px); border-bottom: 1px solid rgba(227,233,242,.9);
}
.public-nav-inner { max-width: 1320px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.public-nav .brand img { height: 38px; width: auto; display: block; }
.public-nav-links { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.public-nav-links a { padding: .5rem .7rem; color: var(--ink-600); font-size: .82rem; font-weight: 650; border-radius: 9px; }
.public-nav-links a:hover, .public-nav-links a.active { background: var(--brand-050); color: var(--brand-700); }
.public-nav-login { border: 1px solid var(--line-strong); }
.hero {
  position: relative; overflow: hidden; background:
    radial-gradient(900px 500px at 75% -10%, rgba(23,108,241,.16), transparent 65%),
    radial-gradient(600px 400px at 10% 10%, rgba(76,141,248,.09), transparent 60%),
    #f7f9fc;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background-image: linear-gradient(rgba(15,37,71,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15,37,71,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
}
.hero-inner { position: relative; max-width: 1320px; margin: 0 auto; padding: 4rem 1.25rem 3.2rem; display: grid; grid-template-columns: 1.08fr .92fr; gap: 3rem; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .42rem; padding: .34rem .65rem;
  border-radius: 100px; background: #fff; border: 1px solid var(--line); color: var(--ink-600);
  font-size: .7rem; font-weight: 700; box-shadow: var(--shadow-xs); margin-bottom: 1.15rem;
}
.hero-badge .dot { width: 6px; height: 6px; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.35rem); line-height: .99; letter-spacing: -.055em; font-weight: 850; margin: 0 0 1.15rem; color: var(--ink-900); }
.hero h1 .accent { color: var(--brand-600); }
.hero p.lead { font-size: 1.07rem; line-height: 1.65; color: #51657c; max-width: 550px; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.hero-stats { display: flex; gap: 1.7rem; margin-top: 2rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.hero-stat strong { display: block; font-size: 1.5rem; letter-spacing: -.04em; color: var(--ink-900); line-height: 1.1; }
.hero-stat span { font-size: .72rem; color: var(--muted); }
.hero-visual { position: relative; }
.hero-map-card {
  border-radius: 26px; overflow: hidden; border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 35px 80px -20px rgba(15,37,71,.28), 0 0 0 8px rgba(255,255,255,.4);
  background: #fff; transform: rotate(.6deg);
}
.hero-map-card .map-preview { height: 360px; background: #e9f1fb; position: relative; overflow: hidden; }
.hero-map-card .map-preview::before {
  content: ""; position: absolute; inset: -20%;
  background-image: linear-gradient(rgba(23,108,241,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(23,108,241,.11) 1px, transparent 1px);
  background-size: 38px 38px; transform: rotate(-7deg);
}
.hero-map-card .map-preview::after {
  content: ""; position: absolute; width: 120%; height: 40%; left: -10%; top: 40%;
  border: 18px solid rgba(23,108,241,.08); border-radius: 50%; transform: rotate(-14deg);
}
.hero-floating-card {
  position: absolute; left: 1rem; bottom: 1.1rem; background: #fff; border-radius: 14px;
  padding: .7rem .8rem; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: .6rem; max-width: min(290px, calc(100% - 2rem)); animation: floatIn .7s .2s both;
}
.hero-source {
  position: absolute; z-index: 3; top: 1rem; right: 1rem; background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 10px; padding: .45rem .65rem; font-size: .64rem;
  color: var(--muted); box-shadow: var(--shadow-sm);
}
.hero-floating-card .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
.hero-floating-card strong { font-size: .8rem; display: block; }
.hero-floating-card span { font-size: .67rem; color: var(--muted); }
.map-dot-illustration { position: absolute; z-index: 2; width: 38px; height: 38px; border-radius: 50% 50% 50% 0; background: var(--brand-600); transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 6px 20px rgba(15,37,71,.25); display: grid; place-items: center; }
.map-dot-illustration i { transform: rotate(45deg); color: #fff; }
.map-dot-illustration.i-1 { top: 28%; left: 31%; }
.map-dot-illustration.i-2 { top: 55%; left: 63%; width: 30px; height: 30px; background: #0f9f5a; }
.map-dot-illustration.i-3 { top: 68%; left: 24%; width: 25px; height: 25px; background: #f59e0b; }
@keyframes floatIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.section-public { max-width: 1320px; margin: 0 auto; padding: 2.6rem 1.25rem; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.section-title-row h2 { font-size: 1.55rem; font-weight: 800; margin: 0 0 .2rem; letter-spacing: -.04em; }
.section-title-row p { color: var(--muted); margin: 0; font-size: .86rem; }
.municipio-chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
.municipio-chips::-webkit-scrollbar { display: none; }
.municipio-chip {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--ink-600);
  border-radius: 100px; padding: .45rem .8rem; font-size: .75rem; font-weight: 650; white-space: nowrap;
}
.municipio-chip:hover, .municipio-chip.active { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-050); }
.public-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.5rem; }
.public-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; box-shadow: var(--shadow-xs); }
.public-stat strong { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.04em; }
.public-stat span { font-size: .7rem; color: var(--muted); }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; height: 100%; }
.feature-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-050); color: var(--brand-600); margin-bottom: .9rem; }
.feature-card h3 { font-size: .95rem; font-weight: 750; margin-bottom: .35rem; }
.feature-card p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.6; }
.public-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 2rem; }
.public-footer-inner { max-width: 1320px; margin: 0 auto; padding: 1.7rem 1.25rem; display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.public-footer-brand { font-weight: 800; font-size: .85rem; color: var(--ink-800); }
.public-footer small { color: var(--muted); font-size: .7rem; display: block; margin-top: .35rem; line-height: 1.6; }
.public-footer-links { display: flex; gap: 1rem; font-size: .74rem; }

/* ---------- Detalle público ---------- */
.detail-hero { background: #fff; border-bottom: 1px solid var(--line); }
.detail-hero-inner { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.detail-code { font-family: var(--mono); color: var(--brand-700); font-weight: 800; font-size: .82rem; letter-spacing: .02em; }
.detail-title { font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 850; letter-spacing: -.045em; margin: .35rem 0; }
.gallery-main { border-radius: var(--radius-lg); overflow: hidden; background: #e8eef7; aspect-ratio: 16/10; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .45rem; overflow-x: auto; margin-top: .55rem; padding-bottom: .2rem; }
.gallery-thumb { width: 84px; height: 64px; flex-shrink: 0; border-radius: 9px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--bg-2); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--brand-500); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) 360px; gap: 1.25rem; align-items: start; }
.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.spec-item { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.spec-item:nth-child(odd) { padding-right: 1rem; }
.spec-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; margin-bottom: .2rem; }
.spec-value { font-size: .88rem; font-weight: 650; color: var(--ink-800); }
.measure-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .8rem 0; }
.measure-item { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .7rem; }
.measure-item strong { display: block; font-size: 1.15rem; letter-spacing: -.03em; }
.measure-item span { font-size: .63rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.sticky-side { position: sticky; top: 92px; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 650; color: var(--muted); margin-bottom: .8rem; }
.back-link:hover { color: var(--brand-600); }
.back-link [data-lucide] { width: 15px; height: 15px; }

/* ---------- Ficha PDF / impresión ---------- */
.print-page { background: #fff; max-width: 860px; margin: 0 auto; padding: 2.2rem; }
.print-header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink-900); padding-bottom: .8rem; margin-bottom: 1.2rem; }
.print-header img { height: 44px; }
.print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.5rem; font-size: .8rem; }
.print-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .32rem 0; gap: 1rem; }
.print-row span:first-child { color: var(--muted); }
.print-row strong { text-align: right; }
@media print {
  .no-print, .public-nav, .public-footer { display: none !important; }
  body { background: #fff; }
  .print-page { max-width: none; padding: 0; }
}

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; background: #f6f9fd; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }
.auth-visual {
  position: relative; overflow: hidden; background: linear-gradient(145deg, #062f70 0%, #084fd0 55%, #176cf1 100%);
  color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.075) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.075) 1px, transparent 1px);
  background-size: 58px 58px; mask-image: radial-gradient(circle at 60% 40%, #000, transparent 80%);
}
.auth-visual::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -170px; bottom: -160px;
  border: 70px solid rgba(255,255,255,.08); border-radius: 50%;
}
.auth-visual-inner { position: relative; z-index: 2; max-width: 500px; }
.auth-brand img { height: 50px; width: auto; filter: brightness(0) invert(1); }
.auth-kicker { display: inline-flex; align-items: center; gap: .45rem; margin-top: 4.5rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: rgba(255,255,255,.72); }
.auth-visual h1 { font-size: clamp(2.1rem, 3.9vw, 3.4rem); color: #fff; font-weight: 850; line-height: 1.03; letter-spacing: -.05em; margin: 1rem 0 1.1rem; max-width: 500px; }
.auth-visual p { color: rgba(255,255,255,.75); font-size: .94rem; line-height: 1.7; max-width: 430px; }
.auth-points { display: grid; gap: .65rem; margin-top: 2rem; }
.auth-point { display: flex; align-items: center; gap: .7rem; font-size: .82rem; color: rgba(255,255,255,.9); }
.auth-point-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.15); flex-shrink: 0; }
.auth-point-icon [data-lucide] { width: 15px; height: 15px; }
.auth-visual-foot { position: relative; z-index: 2; font-size: .7rem; color: rgba(255,255,255,.55); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; min-height: 100vh; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; margin-bottom: .35rem; }
.auth-card .subtitle { color: var(--muted); font-size: .88rem; margin-bottom: 1.6rem; }
.auth-card .form-control { min-height: 50px; }
.auth-card .btn-lg { width: 100%; }
.auth-card .auth-links { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; font-size: .78rem; }
.auth-footer { text-align: center; color: var(--muted-2); font-size: .7rem; margin-top: 2rem; }
.mobile-auth-brand { display: none; margin-bottom: 1.7rem; }
.mobile-auth-brand img { height: 42px; }
.demo-credentials { background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: .6rem .75rem; font-size: .72rem; color: var(--muted); margin-top: 1rem; }

/* ---------- Captura ---------- */
.capture-shell { max-width: 980px; margin: 0 auto; }
.capture-steps { display: flex; gap: .4rem; margin-bottom: 1rem; }
.capture-step {
  display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line);
  border-radius: 100px; padding: .4rem .6rem; font-size: .68rem; font-weight: 650; color: var(--muted);
  white-space: nowrap; flex-shrink: 0;
}
.capture-step b { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); font-size: .62rem; }
.capture-step.is-active { border-color: var(--brand-300, #9dc2ff); background: var(--brand-050); color: var(--brand-700); }
.capture-step.is-active b { background: var(--brand-600); color: #fff; }
.capture-card { margin-bottom: 1rem; }
.capture-card .card-head { padding: 1rem 1.2rem; }
.capture-section-head { display: flex; align-items: flex-start; gap: .7rem; }
.capture-index { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-050); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.capture-section-head h2 { font-size: .95rem; font-weight: 780; margin: 0; }
.capture-section-head p { font-size: .75rem; color: var(--muted); margin: .15rem 0 0; }
.gps-panel {
  background: linear-gradient(140deg, #f5faff, #edf5ff); border: 1px solid #dceaff;
  border-radius: 14px; padding: .9rem;
}
.gps-coords { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .7rem; }
.gps-coord { background: #fff; border: 1px solid #dce8f7; border-radius: 10px; padding: .55rem .65rem; }
.gps-coord span { display: block; font-size: .6rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.gps-coord strong { font-family: var(--mono); font-size: .92rem; color: var(--ink-800); }
.gps-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; color: var(--muted); }
.gps-status.is-ok { color: var(--success); }
.gps-status.is-error { color: var(--danger); }
.gps-status.is-loading { color: var(--brand-600); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.capture-map { height: 205px; border-radius: 12px; overflow: hidden; margin-top: .65rem; border: 1px solid #dce8f7; z-index: 0; }
.photo-dropzone {
  border: 1.5px dashed #c8d6e8; border-radius: 15px; background: #fbfdff; padding: 1.1rem;
  text-align: center; transition: border-color .15s, background .15s;
}
.photo-dropzone.dragover { border-color: var(--brand-500); background: var(--brand-050); }
.photo-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.photo-actions .btn { min-height: 46px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin-top: .8rem; }
.photo-tile { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: var(--bg-2); aspect-ratio: 4/3; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.is-main { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(23,108,241,.12); }
.photo-tile-actions { position: absolute; inset: auto 0 0; background: linear-gradient(transparent, rgba(6,20,38,.78)); padding: .3rem; display: flex; justify-content: space-between; align-items: center; gap: .25rem; }
.photo-tile-actions button { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 6px; font-size: .6rem; padding: .2rem .35rem; display: inline-flex; align-items: center; gap: .2rem; }
.photo-tile-actions button [data-lucide] { width: 12px; height: 12px; }
.photo-badge { position: absolute; top: .35rem; left: .35rem; background: var(--brand-600); color: #fff; border-radius: 100px; font-size: .55rem; font-weight: 800; padding: .18rem .4rem; letter-spacing: .04em; }
.photo-tile.is-uploading::after {
  content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.65);
  background-image: radial-gradient(circle, var(--brand-500) 2px, transparent 2px); background-size: 12px 12px;
  animation: pulseFade 1s infinite alternate;
}
@keyframes pulseFade { from { opacity: .35; } to { opacity: .8; } }
.camera-note { font-size: .68rem; color: var(--muted); margin-top: .55rem; }
.area-preview {
  background: linear-gradient(145deg, var(--brand-050), #f7fbff); border: 1px solid #dceaff;
  border-radius: 12px; padding: .7rem .9rem; display: flex; align-items: center; justify-content: space-between;
}
.area-preview strong { font-size: 1.3rem; color: var(--brand-700); letter-spacing: -.03em; }
.area-preview span { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.duplicate-card { display: flex; gap: .65rem; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; align-items: center; }
.duplicate-card img { width: 58px; height: 48px; object-fit: cover; border-radius: 7px; }
.duplicate-card strong { font-family: var(--mono); font-size: .72rem; color: var(--brand-700); }
.duplicate-card small { display: block; color: var(--muted); font-size: .67rem; }
.capture-savebar { position: sticky; bottom: 0; z-index: 1010; background: rgba(255,255,255,.93); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: .7rem 1rem; margin: 1rem -1.6rem -2.5rem; }
.capture-savebar-inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.capture-savebar .hint { font-size: .68rem; color: var(--muted); }
.offline-banner { display: none; align-items: center; gap: .5rem; background: var(--warning-bg); border: 1px solid #fde5b0; color: #78350f; border-radius: 10px; padding: .55rem .8rem; font-size: .75rem; margin-bottom: .8rem; }
.offline-banner.show { display: flex; }
.sync-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--bg-2); border-radius: 100px; padding: .28rem .55rem; font-size: .67rem; color: var(--ink-600); font-weight: 650; }
.sync-chip.is-pending { background: var(--warning-bg); color: var(--warning); }
.sync-chip.is-synced { background: var(--success-bg); color: var(--success); }
.sync-chip.is-error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Dashboard ---------- */
.dashboard-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; }
.chart-wrap { position: relative; min-height: 270px; }
.chart-wrap canvas { max-width: 100%; }
.mini-map { height: 285px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.recent-row { display: flex; align-items: center; gap: .7rem; padding: .62rem 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.recent-row img { width: 40px; height: 34px; border-radius: 7px; object-fit: cover; }
.recent-row-main { min-width: 0; flex: 1; }
.recent-row-code { font-family: var(--mono); font-size: .68rem; color: var(--brand-700); font-weight: 700; }
.recent-row-title { font-size: .78rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row-meta { font-size: .65rem; color: var(--muted); }
.progress-thin { height: 6px; border-radius: 100px; background: var(--bg-2); overflow: hidden; }
.progress-thin span { display: block; height: 100%; border-radius: 100px; background: var(--brand-500); }

/* ---------- Timeline auditoría ---------- */
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: .35rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.36rem; top: .25rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand-100); }
.timeline-time { font-size: .67rem; color: var(--muted); }
.timeline-title { font-size: .82rem; font-weight: 700; margin: .12rem 0; }
.timeline-desc { font-size: .74rem; color: var(--muted); }
details.json-details summary { cursor: pointer; font-size: .72rem; color: var(--brand-600); font-weight: 650; }
details.json-details pre { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; font-size: .68rem; margin-top: .35rem; max-height: 240px; overflow: auto; }

/* ---------- Toasts ---------- */
#toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .4rem; max-width: 360px; }
.toast-app { background: #0f2547; color: #fff; border-radius: 10px; padding: .65rem .8rem; font-size: .78rem; box-shadow: var(--shadow-lg); display: flex; gap: .5rem; align-items: flex-start; animation: toastIn .2s ease; }
.toast-app.is-error { background: #991b1b; }
.toast-app.is-success { background: #14532d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Offline ---------- */
.offline-page { min-height: 100vh; display: grid; place-items: center; text-align: center; background: var(--bg); padding: 1rem; }
.offline-page .offline-icon { width: 80px; height: 80px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto 1.2rem; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); color: var(--brand-600); }
.offline-page .offline-icon [data-lucide] { width: 36px; height: 36px; }
.offline-page h1 { font-size: 1.55rem; font-weight: 800; }
.offline-page p { color: var(--muted); font-size: .88rem; max-width: 420px; margin: 0 auto 1.2rem; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-050); color: var(--brand-600); display: grid; place-items: center; margin: 0 auto 1rem; }
.empty-icon [data-lucide] { width: 26px; height: 26px; }
.empty-state h1, .empty-state h2 { font-size: 1.15rem; font-weight: 750; margin-bottom: .35rem; }
.empty-state p { color: var(--muted); font-size: .82rem; max-width: 450px; margin: 0 auto 1rem; }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line); padding: 1.1rem 1.3rem; }
.modal-title { font-size: 1rem; font-weight: 750; }
.modal-body { padding: 1.3rem; }
.modal-footer { border-top: 1px solid var(--line); padding: .85rem 1.3rem; }
.lightbox-modal .modal-content { background: transparent; box-shadow: none; }
.lightbox-modal .modal-body { padding: 0; text-align: center; }
.lightbox-modal img { max-height: 82vh; border-radius: 14px; box-shadow: var(--shadow-lg); }
.lightbox-close { position: absolute; top: -2.4rem; right: 0; color: #fff; background: transparent; border: 0; }

/* ---------- Móvil ---------- */
.mobile-bottom-nav { display: none; }
@media (max-width: 1199.98px) {
  .app-content { padding: 1.3rem 1.2rem 2rem; }
  .public-map-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .hero-inner { gap: 2rem; }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .app-topbar { padding: 0 1rem; }
  .app-content { padding: 1.1rem 1rem 6rem; }
  .public-map-layout { grid-template-columns: 1fr; }
  .public-list-panel { max-height: 430px; }
  .map-shell.map-public { height: 480px; }
  .hero-inner { grid-template-columns: 1fr; padding: 2.8rem 1.25rem 2.5rem; }
  .hero-visual { max-width: 560px; width: 100%; margin: 0 auto; }
  .hero h1 { max-width: 650px; }
  .hero-map-card .map-preview { height: 300px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 2rem 1.2rem; }
  .mobile-auth-brand { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .capture-savebar { margin: 1rem -1rem -6rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); }
  .has-mobile-nav .capture-savebar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1035;
    background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: .32rem .4rem calc(.32rem + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    font-size: .59rem; font-weight: 650; color: var(--muted); padding: .3rem 0; border-radius: 9px;
  }
  .mobile-bottom-nav a.active { color: var(--brand-600); }
  .mobile-bottom-nav a [data-lucide] { width: 20px; height: 20px; }
  body.has-mobile-nav .app-content { padding-bottom: 5.8rem; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(6,20,38,.4); z-index: 1039; display: none; }
  .sidebar-backdrop.show { display: block; }
}
@media (max-width: 767.98px) {
  .app-topbar { height: 64px; }
  .topbar-title h1 { font-size: 1rem; }
  .topbar-title .eyebrow { display: none; }
  .app-content { padding: .9rem .85rem 6rem; }
  .page-header { margin-bottom: 1rem; }
  .page-header h1 { font-size: 1.35rem; }
  .page-header p { font-size: .8rem; }
  .stat-value { font-size: 1.55rem; }
  .stat-card { padding: .95rem 1rem; }
  .stat-label { margin-top: .55rem; }
  .card-app > .card-head, .card-app > .card-body-app { padding: 1rem; }
  .filter-bar { padding: .7rem; }
  .table-app { min-width: 780px; }
  .table-responsive-app { border: 1px solid var(--line); background: #fff; }
  .public-nav-inner { padding: .55rem .85rem; }
  .public-nav .brand img { height: 33px; }
  .public-nav-links a:not(.public-nav-login):not(.nav-mapa) { display: none; }
  .public-nav-login { font-size: .75rem; padding: .4rem .55rem; }
  .hero-inner { padding: 2.3rem .9rem 2rem; gap: 2rem; }
  .hero h1 { font-size: 2.55rem; }
  .hero p.lead { font-size: .92rem; }
  .hero-stats { gap: 1.2rem; flex-wrap: wrap; }
  .hero-stat strong { font-size: 1.25rem; }
  .hero-floating-card { left: .7rem; bottom: .7rem; }
  .hero-map-card .map-preview { height: 245px; }
  .section-public { padding: 1.8rem .9rem; }
  .section-title-row h2 { font-size: 1.25rem; }
  .public-stats-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .public-stat { padding: .8rem .9rem; }
  .public-stat strong { font-size: 1.35rem; }
  .map-shell.map-public { height: 430px; }
  .map-overlay-top { flex-wrap: wrap; top: .55rem; left: .55rem; right: .55rem; }
  .map-toolbar { width: 100%; justify-content: space-between; }
  .map-legend { display: none; }
  .detail-hero-inner { padding: 1rem .9rem; }
  .spec-list { grid-template-columns: 1fr; }
  .spec-item:nth-child(odd) { padding-right: 0; }
  .measure-box { gap: .35rem; }
  .measure-item { padding: .55rem; }
  .measure-item strong { font-size: 1rem; }
  .capture-steps { overflow-x: auto; padding-bottom: .2rem; }
  .capture-step { font-size: .62rem; }
  .capture-step span { display: none; }
  .capture-step b { display: grid; }
  .capture-section-head p { display: none; }
  .gps-coords { grid-template-columns: 1fr 1fr; gap: .35rem; }
  .gps-coord strong { font-size: .8rem; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-actions { flex-direction: column; }
  .photo-actions .btn { width: 100%; }
  .capture-savebar-inner { gap: .4rem; }
  .capture-savebar .hint { display: none; }
  .capture-savebar .btn { flex: 1; font-size: .8rem; }
  .modal-dialog { margin: .6rem; }
  .modal-body { padding: 1rem; }
  .auth-panel { padding: 1.4rem .9rem; }
  .auth-card h2 { font-size: 1.45rem; }
  .gallery-main { aspect-ratio: 4/3; }
  .detail-title { font-size: 1.7rem; }
  #toast-stack { left: .7rem; right: .7rem; bottom: 5rem; max-width: none; }
}
@media (max-width: 420px) {
  .stat-value { font-size: 1.4rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 1rem; }
  .public-stats-grid { grid-template-columns: 1fr 1fr; }
  .gps-coords { grid-template-columns: 1fr 1fr; }
  .gps-coord { padding: .45rem .5rem; }
  .gps-coord strong { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
