/* Narciso — estilo heredado de la v1 (papel crema, verde bosque, dorado, serif Libre Caslon), pensado también
   para móvil en vertical: por debajo de 900 px el menú lateral se oculta y se abre con el botón de menú. */

:root {
  --paper: #f6f5f0;
  --white: #fffefa;
  --ink: #263e35;
  --forest: #254337;
  --text: #303b34;
  --muted: #85877c;
  --line: #e7e7de;
  --gold: #ae9668;
  --gold-deep: #a88c54;
  --soft: #efeee7;
  --sage: #e8ede3;
  --red: #a56d5a;
  --red-soft: #f4e6df;
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
strong { font-weight: 600; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.eyebrow { display: block; font-size: 10px; letter-spacing: 1.8px; font-weight: 500; color: #9d9a84; text-transform: uppercase; line-height: 1.6; }

/* ---------------------------------------------------------------- pantalla de carga */
.splash { position: fixed; inset: 0; z-index: 5000; background: #f6f4ec; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .5s ease, visibility .5s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-flower { width: 128px; height: 128px; animation: flower-spin 3s cubic-bezier(.45, .05, .35, 1) both; filter: drop-shadow(0 10px 18px #a08b4930); }
.splash-word { font-family: var(--serif); font-size: 36px; color: #345344; letter-spacing: 10px; padding-left: 10px; margin: 24px 0 12px; animation: word-in 1.6s ease-out both; }
.splash p { font-size: 10px; letter-spacing: 3px; color: #a79f80; animation: word-in 2s ease-out both; }
@keyframes flower-spin { 0% { opacity: 0; transform: scale(.7) rotate(-90deg); } 20% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(630deg); } }
@keyframes word-in { 0%, 25% { opacity: 0; transform: translateY(8px); } 70%, 100% { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- acceso */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--white); padding: 32px; border-radius: 16px; box-shadow: 0 1px 2px #263e350f, 0 4px 16px #263e350d; width: min(380px, 100%); display: grid; gap: 12px; text-align: center; }
.login-card h1 { font-family: Georgia, serif; font-weight: 500; font-size: 1.9rem; color: var(--text); }
.login-card label { display: grid; gap: 4px; text-align: left; font-size: .85rem; color: var(--muted); }
.login-card input { padding: 9px 10px; border: 1px solid #e4ddcf; border-radius: 8px; background: #fff; color: var(--text); font-size: 16px; }
.login-logo { width: 72px; margin: 0 auto; }
.login-button { background: #2f4a3e; color: #fff; border-radius: 8px; padding: 10px 12px; }
.login-error { color: var(--red); min-height: 1.2em; }

/* ---------------------------------------------------------------- menú lateral */
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; z-index: 70; border-right: 1px solid var(--line); background: #fbfaf6; display: flex; flex-direction: column; padding: 26px 16px 0; padding-top: max(26px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 5px 26px; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand span { font-family: var(--serif); font-size: 24px; letter-spacing: 3px; line-height: 1.1; }
.brand small { display: block; font-family: var(--sans); font-size: 8px; letter-spacing: 2px; margin-top: 6px; color: #8f958a; }
.workspace-chip { border: 1px solid var(--line); padding: 11px 10px; display: flex; gap: 10px; align-items: center; border-radius: 6px; margin: 0 4px 22px; }
.workspace-symbol { border: 1px solid #d9d7c6; border-radius: 4px; font-family: var(--serif); font-size: 18px; width: 29px; height: 32px; display: grid; place-items: center; }
.workspace-chip > div { flex: 1; font-size: 12px; font-weight: 600; }
.workspace-chip small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; font-weight: 400; }
.sidebar nav { overflow: auto; scrollbar-width: thin; padding-bottom: 10px; flex: 1; }
.nav-group { margin-bottom: 20px; }
.nav-caption { display: block; font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: #9b9e92; margin: 0 13px 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 13px; margin: 2px 0; border-radius: 5px; color: #6b756c; font-size: 13px; min-height: 40px; transition: background .2s, color .2s; }
.nav-item:hover { background: #f0f0e8; }
.nav-item.active { background: var(--ink); color: #f4f1e6; }
.nav-item.active svg { color: #d2bf91; }
.nav-item em { font-style: normal; font-size: 10px; background: #e6e6db; color: #73806f; border-radius: 3px; min-width: 20px; padding: 2px 5px; text-align: center; margin-left: auto; }
.nav-item.active em { background: #496052; color: #f0e8d7; }
.sidebar-bottom { border-top: 1px solid var(--line); padding-top: 12px; }
.demo-box { display: flex; flex-direction: column; gap: 8px; margin: 0 4px 12px; }
.destination-line { font-size: 8px; letter-spacing: 1px; color: #989d8d; text-align: center; margin: 4px 0 12px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.destination-line > span { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.profile { display: flex; align-items: center; gap: 10px; padding: 13px 3px; padding-bottom: max(13px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.profile > div { flex: 1; min-width: 0; }
.profile strong { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { font-size: 10px; display: block; color: var(--muted); margin-top: 3px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; background: #e9e8dc; color: #6d725e; border: 1px solid #deded0; border-radius: 50%; font-size: 11px; font-weight: 500; object-fit: cover; overflow: hidden; }
.avatar.large { width: 58px; height: 58px; font-size: 18px; background: #e5e8df; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- estructura principal */
.main-shell { margin-left: var(--sidebar); min-height: 100vh; overflow-x: clip; }
.overview-top > *, .bottom-grid > *, .map-layout > *, .stats-grid > *, .bag-grid > *, .people-grid > *, .route-grid > * { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 60; height: 66px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 36px; background: rgba(251, 250, 246, .88); backdrop-filter: blur(8px); gap: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #91968a; flex: 1; min-width: 0; }
.breadcrumb strong { font-weight: 500; color: #536052; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.mode-label { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #8f8369; white-space: nowrap; }
.mode-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.mode-label.real::before { background: #4b7a61; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 6px; color: #7e8678; }
.icon-button:hover { background: #e9e9df; }
.mobile-menu, .nav-shade { display: none; }
.main-content { max-width: 1680px; margin: 0 auto; padding: 24px 36px 40px; }

.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 6px 0 26px; }
.page-heading h1 { font-family: var(--serif); font-size: 42px; line-height: 1.15; margin: 7px 0; letter-spacing: -.4px; color: var(--ink); }
.page-heading p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

.button { border: 1px solid #dedfd4; border-radius: 5px; min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 500; background: #fbfaf6; transition: background .15s; white-space: nowrap; color: var(--text); }
.button:hover { background: #eeeee5; }
.button.dark { background: var(--ink); border-color: var(--ink); color: #f5f2e8; }
.button.dark:hover { background: #345345; }
.button.dark svg { color: #c9b88e; }
.button.gold { background: #f0e9d6; border-color: #e4d8b8; color: #7d6a3f; }
.button.danger { color: var(--red); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.text-button { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 500; color: #65755e; }
.text-button:hover { color: var(--ink); }

.badge { display: inline-flex; padding: 5px 8px; border-radius: 4px; font-size: 10px; font-weight: 500; white-space: nowrap; color: #7b806c; background: #edede3; line-height: 1; }
.badge.green { background: #e7eddf; color: #66805b; }
.badge.gold { background: #f0e9d6; color: #9c8757; }
.badge.red { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------- vista general */
.overview-top { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 20px; }
.collection-hero { position: relative; overflow: hidden; background: var(--forest); color: #f5f0df; min-height: 290px; border-radius: 8px; padding: 32px 34px 52px; }
.hero-copy { position: relative; z-index: 1; width: 62%; }
.hero-copy .eyebrow { color: #c0b28a; }
.hero-copy h2 { font-family: var(--serif); font-size: 40px; line-height: 1.12; margin: 16px 0 14px; }
.hero-copy p { font-size: 12px; color: #bcc8b7; line-height: 1.9; max-width: 300px; }
.hero-copy button { display: inline-flex; gap: 18px; align-items: center; color: #f5efdf; font-size: 12px; margin-top: 18px; padding: 0 0 5px; border-bottom: 1px solid #72816a; }
.hero-copy button svg { color: #c4b07b; }
.hero-flower { position: absolute; right: 10px; top: -6px; width: 300px; height: 300px; opacity: .8; transform: rotate(13deg); }
.hero-flower path, .hero-flower circle { stroke: #cbbd8d; }
.hero-foot { position: absolute; bottom: 16px; left: 34px; right: 26px; display: flex; justify-content: space-between; font-size: 8px; color: #9ba58d; letter-spacing: 1.4px; border-top: 1px solid #52634b; padding-top: 10px; gap: 10px; }
.route-highlight { border-radius: 8px; border: 1px solid var(--line); background: #fbfaf5; padding: 22px 22px 0; display: flex; flex-direction: column; }
.mini-label { display: flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: 1.5px; color: #8e927f; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #a4925e; }
.route-highlight-title { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 8px; }
.route-highlight h3 { font-family: var(--serif); font-size: 28px; color: var(--ink); }
.route-highlight > p { font-size: 11px; color: #94988a; margin-top: 6px; }
.route-stops { display: flex; flex-direction: column; margin: 14px 0 10px; }
.route-stops > div { display: flex; gap: 12px; align-items: center; font-size: 12px; min-height: 30px; }
.route-stops i { height: 7px; width: 7px; border: 1px solid #aa9b75; border-radius: 50%; position: relative; flex-shrink: 0; }
.route-stops > div:not(:last-child) i::after { content: ""; position: absolute; top: 9px; left: 2px; width: 1px; height: 19px; background: #d6d6c6; }
.route-stops small { margin-left: auto; color: #a0a18e; font-size: 9px; letter-spacing: 1px; }
.route-person { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: auto; text-align: left; padding: 12px 0; width: 100%; }
.route-person > span:nth-child(2) { flex: 1; }
.route-person strong { font-size: 12px; font-weight: 500; }
.route-person small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0 30px; }
.stat { background: var(--white); border: 1px solid var(--line); padding: 18px 20px 15px; border-radius: 6px; min-width: 0; }
.stat-label { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: #7d8678; }
.stat-label svg { color: #a39d81; }
.stat > strong { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.8px; margin: 14px 0 7px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat p { font-size: 10px; color: #9a9d8e; line-height: 1.6; }
.stat.accent { background: var(--sage); border-color: #d6dfcf; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading h2 { font-family: var(--serif); font-size: 28px; line-height: 1.2; margin-top: 5px; color: var(--ink); }

.bag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bag-card { padding: 0; text-align: left; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); transition: transform .2s, box-shadow .2s; min-width: 0; width: 100%; }
.bag-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px #263b3410; }
.bag-visual { position: relative; background: radial-gradient(ellipse at 50% 50%, #f7f3e9, #ecebe2); height: 220px; display: flex; align-items: center; justify-content: center; }
.bag-visual img { width: 100%; height: 100%; object-fit: cover; }
.bag-visual .placeholder { width: 90px; opacity: .35; }
.bag-top { position: absolute; inset: 14px 14px auto; display: flex; justify-content: space-between; align-items: center; gap: 5px; z-index: 1; }
.bag-top > span:first-child { font-size: 10px; letter-spacing: 1.1px; color: #fffdf6; background: #263e35b0; padding: 4px 7px; border-radius: 4px; }
.bag-destination { position: absolute; bottom: 12px; left: 14px; display: flex; gap: 5px; align-items: center; font-size: 10px; color: #fffdf6; background: #263e35b0; padding: 4px 7px; border-radius: 4px; }
.bag-info { padding: 18px; }
.bag-info h3 { font-family: var(--serif); font-size: 23px; line-height: 1.3; color: #384536; }
.bag-info > p { font-size: 11px; margin-top: 6px; color: #a0a090; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-numbers { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 16px; }
.bag-numbers > div { flex: 1; min-width: 0; }
.bag-numbers small { display: block; font-size: 10px; color: #a0a28f; margin-bottom: 5px; }
.bag-numbers strong { font-size: 13px; font-weight: 500; color: #59664f; }

.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; }
.panel > h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 14px; color: var(--ink); }
.movement { display: flex; align-items: center; text-align: left; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; }
.movement-icon { display: grid; place-items: center; background: #f0f0e6; color: #8d957c; border-radius: 5px; width: 38px; height: 38px; flex-shrink: 0; }
.movement > span:nth-child(2) { flex: 1; min-width: 0; }
.movement strong { display: block; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movement small { font-size: 10px; display: block; color: #999d8c; margin-top: 4px; }
.movement .num { font-size: 13px; font-weight: 500; }
.movement .in { color: #66805b; }
.destination-panel { display: flex; align-items: center; gap: 18px; background: #efeee5; }
.destination-panel img { width: 80px; flex-shrink: 0; opacity: .8; }
.destination-panel h2 { font-family: var(--serif); font-size: 27px; margin: 7px 0; color: var(--ink); }
.destination-panel p { font-size: 11px; color: #969981; line-height: 1.8; }
.page-footer { margin-top: 34px; padding: 20px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: #a1a18e; gap: 15px; font-size: 10px; letter-spacing: .5px; }
.page-footer img { width: 18px; vertical-align: -4px; margin-right: 8px; }

/* ---------------------------------------------------------------- listas, tablas, tarjetas */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 9px; color: #929886; flex: 1; min-width: 180px; }
.search-box input { background: none; border: 0; padding: 6px 0; outline: none; color: var(--text); font-size: 14px; width: 100%; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-select, .field input, .field select, .field textarea { background: #fffef9; border: 1px solid #dedfd2; border-radius: 5px; padding: 9px 11px; color: #536147; font-size: 14px; min-height: 40px; }
.results-count { font-size: 11px; color: #939b88; white-space: nowrap; }
.view-switch { display: flex; border: 1px solid #dedfd2; border-radius: 5px; padding: 2px; gap: 2px; }
.view-switch button { height: 32px; width: 34px; display: grid; place-items: center; color: #9a9f8d; border-radius: 4px; }
.view-switch .selected { background: #e4e7dc; color: #52674c; }

.table-wrap { overflow-x: auto; width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th { font-size: 10px; letter-spacing: .5px; color: #969c89; font-weight: 500; background: #f5f5ed; padding: 13px 16px; white-space: nowrap; text-transform: uppercase; }
td { padding: 14px 16px; border-top: 1px solid var(--line); color: #7c8674; font-size: 12px; line-height: 1.6; vertical-align: top; }
td strong { color: #45563e; font-weight: 500; }
tbody tr.clickable { cursor: pointer; }
tbody tr:hover { background: #fafbf5; }
td.num, th.num { text-align: right; }

.people-grid, .route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.person-card, .route-card { border: 1px solid var(--line); border-radius: 6px; padding: 22px; background: var(--white); text-align: left; width: 100%; }
.person-top, .route-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.person-card h3, .route-card h3 { font-family: var(--serif); font-size: 27px; color: var(--ink); }
.person-card > p, .route-card > p { font-size: 12px; color: #a0a38f; margin: 7px 0 18px; line-height: 1.6; }
.person-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 14px 0; gap: 12px 8px; }
.person-stats > span { font-size: 10px; color: #989f88; }
.person-stats strong { display: block; font-size: 17px; font-weight: 500; color: #53674a; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.person-card footer, .route-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 11px; color: #9b9f87; flex-wrap: wrap; }
.route-symbol { width: 44px; height: 44px; border: 1px solid #dbdece; display: grid; place-items: center; border-radius: 50%; color: #a79464; }
.route-dates { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #9b9e86; margin: 4px 0 14px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 6px; background: #f5f5ec; margin: 12px 0 16px; }
.metrics > span { text-align: center; font-size: 10px; color: #9a9f87; padding: 12px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics > span:nth-child(3n) { border-right: 0; }
.metrics strong { display: block; font-size: 16px; margin-bottom: 5px; font-weight: 500; color: #5c714d; font-variant-numeric: tabular-nums; }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metrics.four > span:nth-child(3n) { border-right: 1px solid var(--line); }
.metrics.four > span:nth-child(4n) { border-right: 0; }

.panel-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11px; font-weight: 500; color: #7b856e; }
.field input[type=number] { width: 110px; }
.info-line { display: flex; align-items: center; gap: 9px; padding: 12px 16px; background: #efeee3; border-radius: 5px; line-height: 1.7; font-size: 12px; color: #8c9178; margin: 0 0 20px; }
.empty { border: 1px dashed #dedfd2; border-radius: 8px; padding: 50px 24px; text-align: center; background: #fcfbf5; color: #a99565; }
.empty h3 { font-family: var(--serif); font-size: 28px; color: #657157; margin: 12px 0 8px; }

/* ---------------------------------------------------------------- mapa */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.map-panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: start; background: var(--white); }
.map-frame { height: 540px; position: relative; background: #e9eee8; }
.map-footer { padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 11px; color: #88947c; flex-wrap: wrap; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.map-list { display: flex; flex-direction: column; gap: 12px; max-height: 600px; overflow: auto; padding-right: 4px; }
.map-list-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; text-align: left; background: var(--white); width: 100%; }
.map-list-card > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-list-card h3 { font-family: var(--serif); font-size: 21px; margin: 8px 0; color: var(--ink); }
.map-list-card p { font-size: 11px; line-height: 1.7; color: #a0a18c; }
.map-list-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px #f0e9d6; }
.narciso-marker { background: #284b38; border: 2px solid #fffdf5; box-shadow: 0 3px 12px #203d3044; color: #e4d6a7; border-radius: 50%; display: grid !important; place-items: center; font-size: 13px; font-weight: 600; }
.narciso-marker.gold { background: #b2955c; color: #fffdf5; }
.leaflet-container { font-family: var(--sans); background: #e9eee8; }
/* Suaviza los colores del mapa para que encaje con la paleta de Narciso. */
.leaflet-tile-pane { filter: grayscale(.55) sepia(.18) brightness(1.04) contrast(.95); }
.leaflet-popup-content { font-size: 12px; line-height: 1.7; }
.leaflet-popup-content h3 { font-family: var(--serif); font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.leaflet-control-attribution { font-size: 9px !important; }

/* ---------------------------------------------------------------- ficha (modal) */
.modal-backdrop { position: fixed; inset: 0; background: #17291f88; backdrop-filter: blur(5px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fcfbf6; border: 1px solid #e4e3d7; border-radius: 10px; box-shadow: 0 30px 100px #14291f33; width: 820px; max-width: 100%; max-height: 92vh; overflow: auto; animation: modal-in .2s ease-out; }
.modal-head { padding: 22px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; background: #fcfbf6; }
.modal-head h2 { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin-top: 6px; color: var(--ink); overflow-wrap: anywhere; }
.detail-tabs { display: flex; gap: 22px; padding: 0 26px; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; }
.detail-tabs button { font-size: 12px; color: #969e86; padding: 14px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.detail-tabs button.active { color: #5f7750; border-color: #a18b5a; }
.detail-content { padding: 22px 26px; min-height: 240px; }
.detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0; }
.detail-fields > div { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.detail-fields dt { font-size: 10px; color: #a2a68e; margin-bottom: 5px; }
.detail-fields dd { margin: 0; font-size: 13px; color: #637151; overflow-wrap: anywhere; line-height: 1.6; }
.bag-detail-hero { display: flex; background: #f0eee4; border-radius: 6px; align-items: stretch; margin-bottom: 16px; overflow: hidden; }
.bag-detail-hero > div { width: 42%; min-height: 200px; background: radial-gradient(ellipse, #f7f3e9, #ecebe2); display: grid; place-items: center; overflow: hidden; }
.bag-detail-hero > div img { width: 100%; height: 100%; object-fit: cover; }
.bag-detail-hero > section { flex: 1; padding: 20px; }
.bag-detail-hero > section > strong { display: block; font-size: 30px; font-weight: 400; margin: 8px 0 12px; color: #506542; font-family: var(--serif); }
.bag-detail-hero p { font-size: 12px; color: #8e997c; display: flex; gap: 16px; justify-content: space-between; padding: 3px 0; }
.bag-detail-hero b { color: #78875e; font-weight: 500; }
.history-list article { display: flex; gap: 16px; padding: 0 0 22px; position: relative; }
.history-dot { margin-top: 5px; width: 9px; height: 9px; border: 1px solid #a0ac86; background: #f5f4eb; border-radius: 50%; position: relative; flex-shrink: 0; }
.history-dot.gold { border-color: var(--gold); background: #f0e9d6; }
.history-dot.dark { border-color: var(--ink); background: var(--ink); }
.history-list article:not(:last-child) .history-dot::after { content: ""; position: absolute; top: 12px; left: 3px; height: calc(100% + 10px); width: 1px; background: #e0e4d2; }
.history-list strong { font-size: 13px; font-weight: 500; color: #5d6f4d; }
.history-list p { font-size: 12px; color: #8f9a7c; margin-top: 4px; line-height: 1.6; }
.history-list time { font-size: 10px; display: block; margin-top: 4px; color: #acb598; letter-spacing: .3px; }
.note-form textarea { width: 100%; border: 1px solid #d9ddcb; background: #fffef8; padding: 12px; border-radius: 5px; resize: vertical; color: #62734e; min-height: 90px; font-size: 14px; }
.note-form > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.note-form > div > span { font-size: 10px; color: #a1a98b; }
.notes-list { margin-top: 20px; }
.notes-list > article { border-top: 1px solid var(--line); padding: 16px 0; }
.notes-list strong { font-size: 12px; color: #7a8a61; font-weight: 500; }
.notes-list time { font-size: 10px; color: #a4ab8e; margin-left: 8px; }
.notes-list p { margin-top: 8px; font-size: 13px; color: #6e7d58; white-space: pre-wrap; line-height: 1.7; }
.upload-zone { text-align: center; background: #f4f4e9; border: 1px dashed #d9ddc7; border-radius: 6px; padding: 22px; color: #8b9974; }
.upload-zone h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 12px; }
.upload-zone form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.file-card { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: #8b9a73; background: var(--white); }
.file-card img { height: 110px; width: 100%; object-fit: cover; background: #eeefe2; border-radius: 3px; }
.file-card .file-icon { height: 110px; display: grid; place-items: center; }
.file-card strong { font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.file-card small { font-size: 10px; color: #acb396; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 6000; background: #284a38; color: #f6f2df; padding: 14px 20px; border-radius: 8px; box-shadow: 0 8px 35px #243b3026; max-width: calc(100vw - 32px); font-size: 13px; }

@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- tamaños intermedios */
@media (max-width: 1200px) {
  .main-content { padding: 20px 24px 40px; }
  .topbar { padding: 0 24px; }
  .page-heading h1 { font-size: 36px; }
  .hero-copy h2 { font-size: 34px; }
  .hero-flower { right: -50px; }
  .stats-grid { gap: 12px; }
  .bag-grid { gap: 15px; }
}

@media (max-width: 1100px) {
  .overview-top { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-grid { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-list { max-height: none; }
}

/* ---------------------------------------------------------------- móvil: menú oculto */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: min(290px, 86vw); box-shadow: 0 0 40px #17291f30; }
  .nav-open .sidebar { transform: none; }
  .nav-open .nav-shade { display: block; position: fixed; inset: 0; background: #1b33254d; z-index: 65; }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 58px; padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .breadcrumb > span { display: none; }
  .breadcrumb strong { font-size: 14px; }
  .small-avatar { display: none; }
  .main-content { padding: 16px 16px 40px; }
  .page-heading { flex-direction: column; align-items: flex-start; margin-bottom: 20px; }
  .page-heading h1 { font-size: 32px; }
  .heading-actions { width: 100%; }
  .collection-hero { min-height: 0; padding: 26px 22px 56px; }
  .hero-copy { width: 100%; }
  .hero-copy h2 { font-size: 32px; }
  .hero-flower { width: 210px; height: 210px; right: -60px; top: -30px; opacity: .35; }
  .hero-foot { left: 22px; right: 22px; font-size: 7px; }
  .hero-foot span:nth-child(2) { display: none; }
  .bag-grid { grid-template-columns: 1fr; }
  .people-grid, .route-grid { grid-template-columns: 1fr; }
  .map-frame { height: 62vh; min-height: 360px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-height: none; height: 100%; width: 100%; border: 0; }
  .modal-head { padding: 16px 16px 14px; padding-top: max(16px, env(safe-area-inset-top)); }
  .modal-head h2 { font-size: 25px; }
  .detail-tabs { padding: 0 16px; gap: 18px; }
  .detail-content { padding: 18px 16px 40px; }
  .detail-fields { grid-template-columns: 1fr; }
  .bag-detail-hero { flex-direction: column; }
  .bag-detail-hero > div { width: 100%; height: 220px; }
  .metrics.four { grid-template-columns: repeat(2, 1fr); }
  .metrics.four > span:nth-child(odd) { border-right: 1px solid var(--line); }
  .metrics.four > span:nth-child(even) { border-right: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics > span:nth-child(3n) { border-right: 1px solid var(--line); }
  .metrics > span:nth-child(even) { border-right: 0; }
  .page-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat > strong { font-size: 22px; }
  .stat p { display: none; }
  .table-wrap table { font-size: 12px; }
  th, td { padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-flower { animation: none; }
  .splash-word, .splash p { animation: none; }
  .sidebar { transition: none; }
}
