/* ═══════════════════════════════════════════════
   PORTAL CONCESIONES CYL — Design System
   Paleta: verde deep #2a3a1f / acento #A7CA6E
   Fuente: Montserrat · Desktop-first
═══════════════════════════════════════════════ */

:root {
  /* Radios */
  --radius:      14px;
  --radius-sm:   10px;
  --radius-lg:   22px;
  --radius-pill: 999px;
  --radius-btn:  16px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(20,30,10,.04);
  --shadow-md: 0 4px 18px rgba(20,30,10,.06);

  /* Paleta principal */
  --green-deep:     #2a3a1f;
  --green-darker:   #1f2c17;
  --green-darkest:  #16200f;
  --green-accent:   #A7CA6E;
  --green-accent-hv:#97BA5E;
  --green-text:     #6b8a3a;
  --green-text-str: #4a6328;

  --ink:       #353E2D;
  --green:     #2a3a1f;
  --green-hv:  #1f2c17;
  --green-lt:  #3a7032;
  --leaf:      #A7CA6E;
  --leaf-soft: #d4e8c8;
  --leaf-mist: #eef5e8;

  --bg:        #fbfaf5;
  --bg-soft:   #f1efe6;
  --surface:   #ffffff;
  --surf-alt:  #f5f3ed;
  --surf-dark: #2a3a1f;

  --border:    #E4DDD3;
  --bdr-str:   #d4cec4;
  --line:      #E4DDD3;
  --line-soft: #ebe8db;

  --muted:     #7a8170;
  --mut-str:   #4a5240;
  --text:      #353E2D;
  --ink-soft:  #4a5240;
  --ink-muted: #7a8170;
  --ink-faint: #a8ad9e;

  --warn:      #a66a10;
  --warn-bg:   #fdf3e0;
  --danger:    #9b2c2c;
  --dng-bg:    #fce8e8;
  --info:      #2a5f77;
  --info-bg:   #e3eef4;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: 'Montserrat', sans-serif; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Flash alerts ── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; border: none;
}
.alert-success { background: var(--leaf-mist); color: var(--green-text-str); border-left: 3px solid var(--green-text); }
.alert-danger   { background: var(--dng-bg);   color: var(--danger); border-left: 3px solid var(--danger); }
.rectificacion-banner { margin-bottom: 16px; }
.alert-warn {
  background: var(--warn-bg);
  color: var(--mut-str);
  border-left: 3px solid var(--warn);
}
.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border-left: 3px solid var(--info);
}
.alert[hidden] { display: none !important; }

/* ── Institutional top strip ── */
.p-strip {
  background: #21271c;
  color: rgba(255,255,255,.65);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 7px 48px;
  display: flex; justify-content: space-between;
}

/* ── Header ── */
.p-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 48px;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: sticky; top: 0; z-index: 100;
  transition: border-color .2s, background .2s;
}
.p-header.scrolled {
  background: rgba(251,250,245,.92);
  backdrop-filter: saturate(140%) blur(8px);
}

.p-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.p-brand:hover .p-brand-mark { box-shadow: 0 2px 12px rgba(42,58,31,.45); }
.p-brand:hover .p-brand-name { color: var(--green-text); }
.p-brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green-deep) 0%, #3a5828 100%);
  display: grid; place-items: center; flex-shrink: 0; color: #fff;
  box-shadow: 0 2px 8px rgba(42,58,31,.3);
}
.p-brand-name {
  font-size: 19px; color: var(--green-text-str);
  letter-spacing: -0.01em; line-height: 1; font-weight: 800;
}
.p-brand-sub {
  font-size: 10.5px; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-top: 3px; font-weight: 500;
}

.p-nav { display: flex; align-items: center; gap: 2px; }
.p-nav a, .p-nav span {
  padding: 9px 16px; font-size: 14px; font-weight: 500;
  color: #153829; border-radius: var(--radius-pill);
  transition: text-decoration-color .15s;
  display: inline-block; white-space: nowrap;
}
.p-nav a:hover, .p-nav a.active, .p-nav span.active {
  text-decoration: underline;
  text-decoration-color: #153829;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.p-nav a.active, .p-nav span.active { font-weight: 600; }

.p-header-right { display: flex; align-items: center; gap: 12px; }

/* Bell */
.p-bell { position: relative; color: var(--ink-muted); line-height: 0; cursor: pointer; }
.p-bell-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-accent); border: 2px solid var(--bg);
}

/* Chip / user menu */
.p-user-menu { position: relative; }
.p-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font-size: 13px; color: var(--ink-muted);
  background: var(--surf-alt);
}
button.p-chip.p-chip-trigger {
  margin: 0; font: inherit;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  background: var(--surf-alt);
  transition: background .12s, border-color .12s, color .12s;
}
button.p-chip.p-chip-trigger:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: #c9d7af;
}
.p-chip-trigger svg:last-child {
  flex-shrink: 0;
  transition: transform .15s ease;
}
.p-chip-trigger[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }

.p-user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(42,58,31,.08), 0 2px 8px rgba(0,0,0,.06);
  z-index: 200;
}
.p-user-dropdown[hidden] { display: none; }
.p-user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  transition: background .12s;
}
.p-user-dropdown-item:hover { background: var(--leaf-mist); color: var(--green-text); }
.p-user-dropdown-item svg { flex-shrink: 0; }

.p-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-deep) 0%, #3a5828 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}

/* ── Main content ── */
.p-main { padding: 32px 48px 72px; }

/* ── Breadcrumb ── */
.p-bread {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-muted);
  margin-bottom: 20px; font-weight: 500;
}
.p-bread strong { color: var(--ink); font-weight: 600; }

/* ── Banner ── */
.p-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--ink);
  margin-bottom: 0;
}
.p-banner-time { margin-left: auto; font-size: 12px; color: var(--ink-muted); white-space: nowrap; }

/* ── Page heading ── */
.p-heading-row {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 24px;
  margin: 15px 0px;
}
.p-eyebrow {
  font-size: 12px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-muted);
  font-weight: 600; margin-bottom: 8px;
}
.p-h1 {
  font-size: 30px; color: var(--ink);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 0; font-weight: 400;
}
.p-h1-desc {
  color: var(--ink-soft); font-size: 14px;
  margin-top: 4px; margin-bottom: 0; max-width: 620px; line-height: 1.65;
}
.p-btn-secondary {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--bdr-str); border-radius: var(--radius-pill);
  color: var(--mut-str); font-size: 13.5px; cursor: pointer;
  white-space: nowrap; transition: background .1s;
}
.p-btn-secondary:hover { background: var(--surf-alt); }

/* ── Step label ── */
.p-section { margin-top: 36px; }
.p-section.first { margin-top: 28px; }
.p-step { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.s2-back-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 0 0 14px;
}
.s2-back-top .p-btn-secondary { flex-shrink: 0; }
.p-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--ink-soft);
  color: var(--ink-soft);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.p-step-hint {
  font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-muted); font-weight: 600;
}
.p-step-title {
  font-size: 20px; color: var(--ink-soft); font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.1; margin-top: 2px;
}

/* ── Tipo selector ── */
.tipo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tipo-card {
  padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: #fff; cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: var(--shadow-sm);
}
.tipo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md); border-color: #d8d4c4;
}
.tipo-card.sel {
  border-color: var(--green-text);
  box-shadow: 0 0 0 3px rgba(107,138,58,.15), var(--shadow-md);
}
.tipo-card-top {
  display: flex; justify-content: flex-end; margin-bottom: 14px;
}
.tipo-name-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tipo-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: #E3ECD6; display: grid; place-items: center;
  color: var(--green-text-str); transition: background .12s, color .12s;
  flex-shrink: 0;
}
.tipo-card.sel .tipo-icon { background: #E3ECD6; color: var(--green-text-str); }
.tipo-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--bdr-str); background: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  transition: border-color .12s, background .12s;
}
.tipo-card.sel .tipo-radio { border-color: var(--green-text); background: var(--green-text); }
.tipo-radio-inner { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: none; }
.tipo-card.sel .tipo-radio-inner { display: block; }
.tipo-name { font-size: 19px; color: var(--ink); font-weight: 600; letter-spacing: -0.015em; }
.tipo-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 14px; }
.tipo-anualidad-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.tipo-card[data-tipok="concesion_notificacion"].sel .tipo-anualidad-panel {
  display: flex;
}
.tipo-anualidad-label {
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.tipo-anualidad-select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.tipo-anualidad-info {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  background: var(--surf-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.tipo-anualidad-info[hidden] { display: none; }
.tipo-anualidad-info--warn {
  background: #f6f0d8;
  border-color: #e0c878;
  color: #6b4f12;
}
.tipo-anualidad-info-plazo {
  display: block;
  margin-top: 4px;
}
.tipo-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.tipo-detail { font-size: 11.5px; color: var(--ink-muted); font-weight: 500; }
.tipo-continue { margin-top: 18px; }

.tipo-card.tipo-card--disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 500; white-space: nowrap; color: #5b5e58;
}
.badge-dot { width: 6px; height: 6px; border-radius: 3px; flex-shrink: 0; }
.badge.nodot { padding-left: 12px; }
.badge.neutral { background: #e6e6e6; color: #5b5e58; }
.badge.neutral .badge-dot { background: #8e8e8e; }
.badge.success { background: #e1f2e3; color: #5b5e58; }
.badge.success .badge-dot { background: #43b549; }
.badge.warn    { background: #f6daaf; color: #5b5e58; }
.badge.warn .badge-dot { background: #d27f00; }
.badge.danger  { background: var(--dng-bg); color: #5b5e58; }
.badge.danger .badge-dot { background: var(--danger); }
.badge.info    { background: #dfedf1; color: #5b5e58; }
.badge.info .badge-dot { background: #15a3cc; }
.badge.leaf    { background: var(--green-accent); color: var(--green-darkest); }
.badge.leaf .badge-dot { background: var(--green-darkest); }

/* ── Button system ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; font-size: 13.5px; font-weight: 500;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  cursor: pointer; font-family: 'Montserrat', sans-serif;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn-primary, .btn.btn-primary {
  padding: 11px 22px; background: var(--green-accent); border: none;
  border-radius: var(--radius-btn); color: var(--green-darkest); font-size: 13.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Montserrat', sans-serif; transition: background .15s;
}
.btn-primary:hover, .btn.btn-primary:hover { background: var(--green-accent-hv); }
.btn-primary:disabled, .btn.btn-primary:disabled {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.btn-primary:disabled:hover, .btn.btn-primary:disabled:hover { background: var(--green-accent); }

.btn-ghost, .btn.btn-ghost {
  padding: 10px 20px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-btn); color: var(--ink-soft); font-size: 13.5px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Montserrat', sans-serif; font-weight: 500; transition: background .12s;
}
.btn-ghost:hover, .btn.btn-ghost:hover { background: var(--surf-alt); }

/* ── Unified chip ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px; font-size: 11px;
  font-family: 'Montserrat', sans-serif; border: 1px solid;
}
.chip.ok      { background: #e6efd3; border-color: #b8d4a8; color: #275e29; }
.chip.pending { background: #fff; border-color: #d1d1d1; color: #5f5e54; }
.chip.neutral { background: var(--surf-alt); border-color: var(--border); color: #79807a; }

/* ── Unified card ── */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0px 2px 4px 0px rgba(201,192,180,0.25);
}
.card-pad    { padding: 24px; }
.card-pad-lg { padding: 28px 32px; }

/* ── Unified input ── */
.input {
  width: 100%; padding: 11px 14px; border: 1px solid #E6E6E6;
  background: #fff; border-radius: var(--radius-btn); font-size: 13.5px;
  font-family: 'Montserrat', sans-serif; color: var(--ink); outline: none;
  box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--green-text); box-shadow: 0 0 0 3px rgba(107,138,58,.14); }
.input.input-sm { padding: 7px 12px; font-size: 12.5px; }
.input-label { display: block; font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.input-hint  { font-size: 12px; color: var(--ink-muted); margin-top: 6px; }
.field       { margin-bottom: 16px; }

/* ══════════════════════════════════════════════
   STEP 2 — s2-* components
══════════════════════════════════════════════ */

.s2-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-top: 16px; }
.s2-grid > * { min-width: 0; }
.s2-sidebar { display: flex; flex-direction: column; gap: 12px; align-self: start; position: sticky; top: 88px; }
.s2-blocks { display: flex; flex-direction: column; gap: 12px; }

.s2-block { background: #fff; border: 1px solid #e4ddd3; border-radius: 12px; overflow: hidden; box-shadow: 0px 2px 4px 0px rgba(201,192,180,0.25); }
.s2-block-hd { display: flex; align-items: center; gap: 14px; padding: 18px 26px; cursor: pointer; background: #ffffff; border-bottom: 1px solid transparent; user-select: none; }
.s2-block-bd { padding: 20px 26px; border-top: 1px solid #e7e6df; display: none; background: #F5F2ED; }
.s2-block-bd.open { display: flex; flex-direction: column; gap: 20px; }
.s2-block-hd.expanded { border-bottom-color: #e7e6df; }
.s2-block-icon { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; flex-shrink: 0; }
.s2-icon-green   { background: #E3ECD6; color: #6B8A3A; }
.s2-icon-neutral { background: #E3ECD6; color: #6B8A3A; }
.s2-block-meta { flex: 1; min-width: 0; }
.s2-block-hd .badge { margin-left: auto; flex-shrink: 0; }
.s2-block-hd .badge.neutral { background: #fff; border: 1px solid #e7e6df; }
.s2-block-title { font-size: 18px; font-weight: 400; color: #29321E; line-height: 1.2; }
.s2-block-sub   { font-size: 12.5px; color: #6f6f6f; margin-top: 4px; }
.s2-tag-req     { font-size: 12.5px; color: #b92121; font-weight: 400; margin-left: 6px; }
.s2-tag-opt     { font-size: 12.5px; color: #6f6f6f; font-weight: 400; margin-left: 6px; }
/* Rectificación: ocultar «Obligatorio»; campos obligatorios solo en capas ya cargadas del envío anterior */
#portal.portal-rectificacion .s2-tag-req { display: none; }
.file-replace-hint {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #c7c4b5;
  font-size: 13px;
  font-weight: 500;
  color: #484e46;
  line-height: 1.45;
}
.file-replace-hint span {
  color: var(--green-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dropzone.shape-multi-dz--ok .file-replace-hint,
.dropzone.dropzone--ok .file-replace-hint {
  border-top-color: #b8d4a8;
  color: #3e423a;
}
.s2-block-bd:has(.shape-multi-wrap[data-baseline-locked="1"]) > .s2-fields { display: none; }
.s2-chev        { color: #79807a; transition: transform .15s; flex-shrink: 0; }
.s2-chev.open   { transform: rotate(180deg); }
/* Block headers: last direct child SVG = chevron; rotates on expand */
.s2-block-hd > svg { color: #79807a; transition: transform .15s; flex-shrink: 0; transform: rotate(0deg); }
.s2-block-hd.expanded > svg { transform: rotate(180deg); }

.s2-upload-card { background: #fff; border: 1px solid #e7e6df; border-radius: 12px; padding: 17px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0px 2px 2px rgba(201,192,180,0.25); width: 100%; }
.s2-upload-card-top { border-bottom: 1px solid #e9eae8; padding-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.s2-files-ok    { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #29321e; font-weight: 500; }
.s2-filechips   { display: flex; flex-wrap: wrap; gap: 8px; }
.s2-filechip    { font-size: 11px; padding: 4px 7px; border-radius: 999px; font-family: 'Montserrat', sans-serif; border: 1px solid; display: inline-flex; align-items: center; gap: 6px; }
.s2-filechip.ok { background: #e6efd3; border-color: #b8d4a8; color: #275e29; }
.s2-filechip.pending { background: #f5f2ed; border-color: var(--border); color: #79807a; }

.s2-validation  { background: #fff; border-radius: 10px; padding: 12px 14px; }
.s2-val-title   { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: #545750; margin-bottom: 8px; }
.s2-val-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.s2-val-item    { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #6f6f6f; }

.s2-preview       { margin-top: 14px; min-width: 0; max-width: 100%; }
.s2-preview-title { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: #3e423a; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.s2-preview-count { font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; font-family: 'Montserrat', sans-serif; flex-shrink: 0; }
.s2-table-wrap    { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; border: 1px solid #E7E6DF; border-radius: 12px; box-shadow: 0px 2px 4px 0px rgba(201,192,180,0.25); background: #fff; }
.s2-table         { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 11px; font-family: 'Montserrat', sans-serif; }
.s2-table th      { padding: 7.5px 12px 8.25px; text-align: left; background: #fff; border-bottom: 1px solid #E7E6DF; font-weight: 600; font-size: 11px; color: #6f6f6f; white-space: nowrap; }
.s2-table td      { padding: 7px 12px; color: #6f6f6f; font-size: 11px; border-bottom: 1px solid #E7E6DF; white-space: nowrap; }
.s2-table tbody tr:last-child td { border-bottom: none; }

.s2-fields        { position: relative; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surf-alt); }
.s2-fields::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surf-alt);
  border: 1px solid var(--border);
}
.s2-fields-title  { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: #3e423a; margin-bottom: 12px; }
.s2-tags          { display: flex; flex-wrap: wrap; gap: 8px; }
.s2-tag           { padding: 4px 7px; height: 24px; background: #fff; border: 1px solid #e4ddd3; border-radius: 999px; font-size: 9px; color: #5f5e54; font-family: 'Montserrat', sans-serif; font-weight: 600; display: inline-flex; align-items: center; box-shadow: 0px 2px 2px rgba(201,192,180,0.25); }

.s2-file-row    { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border: 1px solid #E7E6DF; border-radius: 8px; }
.s2-file-icon   { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.s2-file-icon.ok{ background: #d6ead8; color: #275226; }
.s2-file-info   { flex: 1; min-width: 0; }
.s2-file-name   { font-size: 12.5px; font-weight: 600; color: #2c342a; }
.s2-file-meta   { font-size: 11px; color: #6f6f6f; margin-top: 2px; font-family: 'Montserrat', sans-serif; }
.s2-file-del    { background: none; border: none; cursor: pointer; color: #6f6f6f; font-size: 14px; padding: 4px; }

.s2-dropzone    { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 2px dashed #E7E6DF; border-radius: 8px; background: #fff; font-size: 12.5px; color: #484e46; cursor: pointer; }
.s2-dropzone:hover { border-color: #2e6b35; background: #f5f9f2; }
.s2-dropzone u  { color: #2e6b35; cursor: pointer; }
.s2-dl-link     { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: #6f6f6f; }
.s2-dl-link a   { color: #2e6b35; font-weight: 600; }

.s2-block-bd.opt { gap: 16px; padding: 20px 26px 26px; }
.s2-opt-card    { background: #fbfaf6; border: 1.5px dashed #c7c4b5; border-radius: 12px; padding: 17px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0px 2px 2px rgba(201,192,180,0.25); width: 100%; box-sizing: border-box; cursor: pointer; transition: border-color .15s, background .15s; }
.s2-opt-card:hover { border-color: #6b8a3a; background: #f5f8ed; }
.s2-opt-card.is-drag { border-color: #2e6b35; background: #eef5e2; }
.s2-upload-row  { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #484e46; font-weight: 500; }
.s2-upload-row u { color: #275e29; text-decoration: underline; font-weight: 500; font-style: normal; }
.s2-filechips-indent { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 24px; }
.s2-opt-card .s2-filechip.pending { background: #fff; border-color: #d1d1d1; color: #5f5e54; }
.s2-dl-pill     { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e4ddd3; border-radius: var(--radius-btn); padding: 9px 15px; font-size: 12.5px; color: #16200f; font-weight: 500; cursor: pointer; font-family: 'Montserrat', sans-serif; text-decoration: none; align-self: flex-start; }
.s2-dl-pill:hover { background: #faf9f6; }
.s2-dl-hint     { font-size: 11.5px; color: #8b8a7e; line-height: 1.5; }

.s2-action-bar  { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 16px 0 4px; }
.s2-action-right{ display: flex; align-items: center; gap: 10px; }
.s2-btn-back    { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-btn); font-size: 12.5px; color: #484e46; cursor: pointer; font-family: Montserrat, sans-serif; font-weight: 500; }
.s2-btn-back:hover { background: #faf9f6; }

.s2-card        { background: #fff; border: 1px solid #e7e6df; border-radius: 14px; overflow: hidden; box-shadow: 0px 1px 1.5px rgba(20,30,10,0.05); }
.s2-card-body   { padding: 16px 20px; }
.s2-card-label  { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: #5F6854; margin-bottom: 12px; display: block; }
.s2-data-row    { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #e7e6df; }
.s2-data-icon   { width: 28px; height: 28px; border-radius: 10px; background: #f3f6ea; display: grid; place-items: center; flex-shrink: 0; }
.s2-data-k      { font-size: 11px; color: #8b8a7e; margin-bottom: 1px; }
.s2-data-v      { font-size: 13px; color: #29321e; font-weight: 500; }

/* Ciclo de concesión */
.s2-ciclo-section { padding: 0 20px 12px; border-top: 1px solid #e7e6df; }
.s2-ciclo-lbl   { margin-top: 16px; }
.s2-ciclo-hint  { font-size: 12px; color: #8b8a7e; margin-bottom: 10px; line-height: 1.5; }
.s2-anu-list    { display: flex; flex-direction: column; }
.s2-anu-item    { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid #e7e6df; }
.s2-anu-left    { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 36px; flex-shrink: 0; }
.s2-anu-num     { width: 22px; height: 22px; border-radius: 10px; background: #275e29; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.s2-anu-num.active { background: #f3f6ea; color: #275e29; }
.s2-anu-num.muted  { background: #f3f6ea; color: #8b8a7e; }
.s2-anu-year    { font-size: 10px; font-weight: 700; color: #5f5e54; letter-spacing: 0.3px; }
.s2-anu-body    { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.s2-anu-pill    { display: block; width: 100%; padding: 2.5px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; font-family: 'Montserrat', sans-serif; box-sizing: border-box; }
.s2-anu-pill.approved  { background: #e6efd3; color: #275e29; }
.s2-anu-pill.current   { background: #fbf1de; color: #a66a10; }
.s2-anu-pill.waiting   { background: #f6f5ef; color: #5f5e54; }
.s2-anu-pill.disabled  { background: transparent; color: #b8b7ad; }
.s2-anu-num.disabled   { background: #f3f6ea; color: #c8c7be; }
.s2-anu-item--disabled { opacity: 0.6; }
.s2-anu-item--disabled .s2-anu-year { color: #b8b7ad; }
.s2-anu-note    { font-size: 11.5px; color: #8b8a7e; }
.s2-anu-range   { font-size: 11px; color: #8b8a7e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-anu-empty   { font-size: 12px; color: #8b8a7e; padding: 8px 0 4px; text-align: center; line-height: 1.5; }

/* Card foot */
.s2-card-foot   { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #f3f6ea; border-top: 1px solid #e7e6df; }
.s2-card-foot-label { font-size: 12px; color: #5f5e54; }
.s2-card-foot a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #275e29; }
.s2-card-foot a:hover { color: #1f4820; }

/* Aviso del técnico CYL (sidebar) */
.s2-aviso-tecnico {
  background: #2b341f;
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: 0 2px 6px rgba(20, 30, 10, 0.12);
}
.s2-aviso-tecnico-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #c5d0a4;
}
.s2-aviso-tecnico-hd svg { flex-shrink: 0; }
.s2-aviso-tecnico-body {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.95);
}
.s2-aviso-tecnico-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(197, 208, 164, 0.22);
  font-size: 10.5px;
  font-weight: 500;
  color: #a8b48a;
  letter-spacing: 0.2px;
}
.s2-aviso-tecnico-ft span:last-child { text-align: right; }

/* Info banners (mod / notif) */
.s2-info-banner { display: flex; align-items: flex-start; gap: 10px; background: #f6f5ef; border: 1px solid #dddbd0; border-radius: 10px; padding: 13px 16px; font-size: 12.5px; color: #353e2d; line-height: 1.55; margin-bottom: 16px; }
.s2-info-banner svg { flex-shrink: 0; margin-top: 2px; color: #6b8a3a; }
.s2-info-banner-note { display: block; margin-top: 4px; font-size: 11.5px; color: #6f6e64; }

/* Submit secure note */
.submit-secure { font-size: 12.5px; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }

/* ══════════════════════════════════════════════
   DROPZONE & FILE UPLOAD (funcional - no tocar)
══════════════════════════════════════════════ */

.portal-upload-fieldset {
  border: none; margin: 0; padding: 0; min-width: 0;
}
.portal-upload-fieldset[disabled] > * { opacity: 0.88; }
.portal-upload-fieldset[disabled] .dropzone,
.portal-upload-fieldset[disabled] .shape-multi-dz { pointer-events: none; cursor: not-allowed; }

.rule-info {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--info-bg); border-left: 3px solid var(--info);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--info);
}

.dropzone {
  padding: 18px; border: 1.5px dashed var(--bdr-str); border-radius: var(--radius-sm);
  background: repeating-linear-gradient(
    135deg, var(--surf-alt) 0, var(--surf-alt) 8px, var(--surface) 8px, var(--surface) 16px
  );
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; position: relative; transition: border-color .15s;
}
.dropzone:hover { border-color: var(--green-text); }
.portal-drag-files-outside::before {
  content: 'Suelte los archivos dentro de un recuadro de carga';
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(155, 44, 44, 0.94);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(20, 30, 10, 0.2);
  pointer-events: none;
}
.portal-drag-files-outside::after {
  content: '';
  position: fixed;
  inset: 12px;
  border: 2px dashed rgba(155, 44, 44, 0.75);
  border-radius: 14px;
  box-shadow: inset 0 0 0 9999px rgba(252, 232, 232, 0.24);
  pointer-events: none;
  z-index: 999;
}
/* Recuadros de carga resaltados durante todo el arrastre de ficheros */
body.portal-drag-files .portal-upload-fieldset:not([disabled]) .dropzone {
  position: relative;
  z-index: 1001;
  border-color: var(--green-text);
  border-style: solid;
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(107, 138, 58, 0.28);
}
body.portal-drag-files .portal-upload-fieldset:not([disabled]) .dropzone:not(.shape-multi-dz) {
  background: var(--leaf-mist);
}
body.portal-drag-files .portal-upload-fieldset:not([disabled]) .dropzone.shape-multi-dz {
  background: #f5f8ed;
}
.dropzone--drop-miss {
  animation: portalDropMiss .26s ease-in-out;
}
@keyframes portalDropMiss {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.dropzone-body { flex: 1; min-width: 0; }
.dropzone-remove {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e8c4c4;
  border-radius: 999px;
  background: #fff;
  color: #9b2c2c;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.dropzone-remove:hover {
  background: #fce8e8;
  border-color: #d99;
  box-shadow: 0 1px 4px rgba(155, 44, 44, 0.12);
}
.dropzone-remove:focus-visible {
  outline: 2px solid #9b2c2c;
  outline-offset: 2px;
}
.dropzone-remove[hidden] { display: none !important; }
.dropzone:has(.dropzone-remove:not([hidden])) { padding-right: 12px; }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}
.dropzone:has(.dropzone-remove:not([hidden])) input[type=file] {
  right: 44px;
}
.dropzone-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--leaf-mist); display: grid; place-items: center;
  border: 1px solid var(--leaf); flex-shrink: 0; color: var(--green-text);
}
.dropzone-label { font-size: 13.5px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.dropzone-label span { color: var(--green-text); text-decoration: underline; text-underline-offset: 3px; }
.dropzone-hint { font-size: 11px; color: var(--muted); font-family: 'SF Mono', Menlo, monospace; }
.dropzone.compact { padding: 18px 16px; }
.dropzone--ok { border: 1.5px solid var(--green-text); background: var(--leaf-mist); }
.dropzone--ok .dropzone-icon { background: var(--green-text); border-color: var(--green-text); color: #fff; }
.dropzone--ok .dropzone-label { color: var(--green-text); font-weight: 600; }
.dropzone--ok .dropzone-hint { color: var(--mut-str); }
/* shape-multi-dz uses a simple icon (no box) — override ok state accordingly */
.dropzone.shape-multi-dz.dropzone--ok { border: 1.5px solid var(--green-text); background: var(--leaf-mist); }
.dropzone.shape-multi-dz.dropzone--ok .dropzone-icon { background: none; border: none; color: var(--green-text); }
.dropzone.shape-multi-dz.dropzone--ok .dropzone-label { color: var(--green-text); font-weight: 600; }
.dropzone.shape-multi-dz.dropzone--ok .dropzone-hint { color: var(--mut-str); }

/* Shape-multi dropzone: match s2-opt-card aesthetic (dashed, no stripes) */
.dropzone.shape-multi-dz {
  background: #fbfaf6;
  border: 1.5px dashed #c7c4b5;
  border-radius: 12px;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
.dropzone.shape-multi-dz:hover { border-color: #6b8a3a; background: #f5f8ed; }
/* Icon: simple SVG, no box */
.dropzone.shape-multi-dz .dropzone-icon {
  width: auto; height: auto; background: none; border: none;
  border-radius: 0; flex-shrink: 0; margin-top: 1px; color: #484e46;
}
.dropzone.shape-multi-dz .dropzone-body { flex: 1; min-width: 0; }
.dropzone.shape-multi-dz .dropzone-label { font-size: 13px; font-weight: 500; margin-bottom: 0; }
/* Chips: pill capsules */
.dropzone.shape-multi-dz .shape-slot-row { margin-top: 10px; padding-left: 0; }
.dropzone.shape-multi-dz .shape-slot {
  border-radius: 999px; padding: 3px 8px;
  font-size: 11px; gap: 5px;
}
.shape-multi-dz .shape-slot-row { margin-top: 6px; }
.shape-multi-dz--ok { border: 1.5px solid var(--green-text); background: var(--leaf-mist); }
.shape-multi-dz--ok .dropzone-icon { color: var(--green-text); }
.shape-multi-dz--ok .dropzone-label { color: var(--green-text); font-weight: 600; }
.shape-multi-dz--ok .dropzone-hint { color: var(--mut-str); font-style: normal; }
.shape-multi-dz--loading { border: 1.5px dashed var(--info); background: var(--info-bg); }
.shape-multi-dz--loading .dropzone-icon { color: var(--info); }
.shape-multi-dz--loading .dropzone-label { color: var(--info); }
.shape-multi-dz--err { border: 1.5px solid var(--danger); background: var(--dng-bg); }
.shape-multi-dz--err .dropzone-icon { color: var(--danger); }
.shape-multi-dz--err .dropzone-label { color: var(--danger); font-weight: 600; }
.shape-multi-dz--err .dropzone-hint { color: var(--danger); opacity: .75; }

.dl-link {
  margin-top: 10px; display: flex; gap: 14px;
  font-size: 12px; color: var(--mut-str); align-items: center;
}
.dl-link a { color: var(--green-text); font-weight: 500; display: flex; align-items: center; gap: 4px; }

/* ── File chip ── */
.fchip {
  display: grid;
  grid-template-columns: 38px 1fr 120px auto;
  align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.fchip-slim { grid-template-columns: 34px 1fr auto; }
.fchip-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.fchip-slim .fchip-icon { width: 30px; height: 30px; }
.fchip-icon.ok  { background: var(--leaf-mist); color: var(--green-text); }
.fchip-icon.validating { background: var(--warn-bg); color: var(--warn); }
.fchip-icon.err { background: var(--dng-bg); color: var(--danger); }
.fchip-name { font-size: 13px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip-size { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-family: 'SF Mono', Menlo, monospace; }

/* ── Validation checklist ── */
.vcl { margin-top: 14px; padding: 12px 14px; background: var(--leaf-mist); border-radius: var(--radius-sm); }
.vcl-title { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--green-text); font-weight: 700; margin-bottom: 8px; }
.vcl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.vcl-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); }

/* ── Required fields callout ── */
.fcl { margin-top: 14px; padding: 12px 14px; background: var(--surf-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fcl-title { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--mut-str); font-weight: 700; margin-bottom: 8px; }
.ftags { display: flex; flex-wrap: wrap; gap: 6px; }
.ftag {
  padding: 3px 9px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 11px; color: var(--mut-str); font-family: 'SF Mono', Menlo, monospace;
}

/* ── Sub-layers (Actuaciones) ── */
.sublayer { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: -1px; }
.sublayer:last-child  { border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-bottom: 0; }
.sl-row {
  padding: 12px 14px;
  display: grid; grid-template-columns: 32px 1fr 120px auto;
  align-items: center; gap: 14px; cursor: pointer; user-select: none;
  background: var(--surf-alt); border-radius: var(--radius-sm);
}
.sl-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.sl-icon.has   { background: var(--leaf-mist); color: var(--green-text); }
.sl-icon.empty { background: var(--surface); color: var(--muted); border: 1px dashed var(--bdr-str); }
.sl-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.sl-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sl-chev { transition: transform .15s; color: var(--muted); line-height: 0; }
.sl-row[aria-expanded=true] .sl-chev { transform: rotate(180deg); }
.sl-body { padding: 14px; border-top: 1px solid var(--border); display: none; border-radius: var(--radius-sm); min-width: 0; max-width: 100%; }
.sl-body.open { display: block; }
.act-hint {
  margin-top: 14px; padding: 10px 14px;
  background: var(--leaf-mist); border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink);
}

/* ── Shape multi-wrap ── */
.shape-multi-wrap { margin-bottom: 0; min-width: 0; max-width: 100%; }
.shape-slot-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.shape-slot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 4px; border-radius: 6px; font-size: 11.5px;
  border: 1px solid var(--border); max-width: 100%;
}
.shape-slot-mark { font-weight: 800; width: 1em; flex-shrink: 0; text-align: center; }
.shape-slot--missing { background: #fff; border-color: #d1d1d1; color: #5f5e54; }
.shape-slot--ok { background: #e6efd3; border-color: #b8d4a8; color: #275e29; }
.shape-slot--warn { background: var(--warn-bg); border-color: #e6d4a8; color: var(--warn); }
.shape-slot-ext { font-weight: 600; }
.shape-slot-name { font-size: 10.5px; color: var(--mut-str); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.shape-parts-note { margin: 5px 0px 0px 5px; font-size: 11.5px; color: var(--muted); font-style: italic; line-height: 1.5; }
.shape-parts-note code { font-size: 11.5px; background: var(--surf-alt); padding: 1px 5px; border-radius: 2px; }

/* ── Shape live validation ── */
.shape-live-validacion { margin-top: 14px; min-width: 0; max-width: 100%; }
.shape-live-check { padding: 12px 14px; background: var(--leaf-mist); border-radius: var(--radius-sm); }
.shape-live-check--sent .s2-filechips { margin-top: 4px; }
.shape-live-check-title { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--green-text); margin-bottom: 8px; }
.shape-live-status { padding: 12px 14px; font-size: 12.5px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.shape-live-status--wait { background: var(--surf-alt); color: var(--mut-str); }
.shape-live-status--warn { background: var(--warn-bg); color: #8a5a12; border-left: 3px solid var(--warn); }
.shape-live-status--err  { background: var(--dng-bg); color: var(--danger); border-color: #e0b4b4; }

/* ── Shape preview table ── */
.shape-prev-wrap { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; min-width: 0; max-width: 100%; }
.shape-prev-hd { padding: 8px 14px; background: var(--surf-alt); border-bottom: 1px solid var(--border); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.shape-prev-count { color: var(--mut-str); text-transform: none; letter-spacing: 0; font-weight: 500; }
.shape-prev-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; font-size: 11.5px; }
.shape-prev-table { width: max-content; min-width: 100%; border-collapse: collapse; }
.shape-prev-table th { padding: 8px 12px; text-align: left; color: var(--ink); border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; background: var(--surface); }
.shape-prev-table td { padding: 7px 12px; color: var(--text); border-bottom: 1px solid var(--border); white-space: nowrap; }
.shape-prev-table tbody tr:last-child td { border-bottom: none; }
.shape-prev-tr-alt td { background: var(--surf-alt); }

/* ── Block template bar (styled as s2-dl-row) ── */
.block-template-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 0; }
.sublayer .block-template-bar { margin-top: 14px; margin-bottom: 0; }
.btn-shp-template {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  border: 1px solid #e4ddd3; border-radius: var(--radius-btn);
  background: #fff; color: #16200f;
  font-size: 12.5px; font-weight: 500; text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.12s ease; flex: 0 0 auto;
}
.btn-shp-template:hover { background: #faf9f6; }
.block-template-meta { font-size: 11.5px; color: #8b8a7e; line-height: 1.5; flex: 1 1 220px; }

/* ── Comprobación panel ── */
.comprobacion-panel {
  margin-bottom: 22px; padding: 16px 18px;
  background: var(--leaf-mist); border: 1px solid var(--border);
  border-radius: var(--radius-sm); border-left: 3px solid var(--green-text);
}
.comprobacion-panel-hd { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.comprobacion-panel-title { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--green-text); }
.comprobacion-panel-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.comprobacion-bloque { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.comprobacion-bloque:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.comprobacion-bloque-hd { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.comprobacion-bloque-res { font-size: 12px; color: var(--muted); font-family: 'SF Mono', Menlo, monospace; margin-bottom: 10px; word-break: break-all; }
.comprobacion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
@media (max-width: 720px) { .comprobacion-grid { grid-template-columns: 1fr; } }
.comprobacion-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink); line-height: 1.35; }
.comprobacion-item svg { flex-shrink: 0; margin-top: 1px; }

/* ── Select (portal) ── */
.p-input-select {
  width: 380px; flex-shrink: 0;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--info); border-radius: var(--radius-sm);
  background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232a5f77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  -webkit-appearance: none; appearance: none;
  font-family: 'Montserrat', sans-serif; font-size: 13px; color: var(--ink); cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.p-input-select:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(42,95,119,.12); }
.p-input-select:disabled { opacity: 0.5; cursor: not-allowed; background-color: var(--surf-alt); }

/* ── Portal map ── */
.portal-map-card[hidden] { display: none !important; }
.map-coords--muted { color: var(--muted); font-weight: 400; font-size: 11px; }
.portal-map-overlays-wrap { padding: 0 14px 10px; font-size: 11px; }
.portal-map-overlays-title { display: block; font-weight: 600; color: var(--mut-str); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.portal-map-overlays { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 20px; }
.portal-map-overlay-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.portal-map-frame { padding: 14px; }
.portal-map-frame #portal-leaflet-map { z-index: 1; }
.portal-leaflet-map { height: 260px; width: 100%; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--surf-alt); }
.portal-leaflet-map .leaflet-container { font-family: inherit; }
.map-hd { display: inline-grid; justify-content: space-between; align-items: center; padding: 14px 14px 10px; width: 100%; }
.map-coords { font-size: 11px; color: var(--muted); }

/* ── Tech card ── */
.tech-card { background: var(--green-deep); color: #dddccc; border-radius: var(--radius); padding: 20px 22px; }
.tech-card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tech-card-label { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--green-accent); font-weight: 600; }
.tech-card-msg { margin: 0; font-size: 13px; line-height: 1.55; color: #e8e7dc; }
.tech-card-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid #3d4631; display: flex; justify-content: space-between; font-size: 11.5px; color: #a9a89b; }

/* ══════════════════════════════════════════════
   HISTORIAL
══════════════════════════════════════════════ */

.hist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 14px; }
.hist-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.hist-head-left { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); font-weight: 500; }
.hist-filter {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--mut-str);
  cursor: pointer; background: var(--surface);
  transition: background .15s, color .15s, border-color .15s;
}
.hist-filter:hover { background: var(--surf-alt); color: var(--ink); }
.hist-filter.active { background: var(--leaf-mist); color: var(--green-text); border-color: #c9d7af; }
.hist-filters {
  padding: 18px 24px 20px; border-bottom: 1px solid var(--border);
  background: var(--surf-alt);
}
.hist-filters[hidden] { display: none; }
.hist-filters-inner {
  display: grid; grid-template-columns: 1fr 1fr auto;
  align-items: end; gap: 14px 18px;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(26, 26, 20, .06);
}
.hist-filter-field { display: flex; flex-direction: column; min-width: 0; }
.hist-filter-field label { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--mut-str); font-weight: 600; margin-bottom: 6px; }
.hist-filter-field select {
  width: 100%; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 13px; padding: 0 12px;
  font-family: 'Montserrat', sans-serif; cursor: pointer;
}
.hist-filter-field select:focus { outline: none; border-color: var(--green-text); box-shadow: 0 0 0 3px rgba(107,138,58,.12); }
.hist-filter-reset {
  height: 36px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surf-alt); color: var(--mut-str);
  font-size: 12.5px; font-weight: 500; font-family: 'Montserrat', sans-serif;
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
  align-self: end;
}
.hist-filter-reset:hover { background: var(--leaf-mist); color: var(--green-text); border-color: #c9d7af; }
@media (max-width: 760px) {
  .hist-filters-inner { grid-template-columns: 1fr; width: 100%; }
  .hist-filter-reset { width: 100%; }
}

.hist-body { display: grid; grid-template-columns: 1fr minmax(300px, 360px); }
.hist-col { overflow: hidden; }
.hist-th { display: grid; grid-template-columns: 56px 1fr 120px 140px; padding: 10px 24px; font-size: 11px; color: var(--muted); letter-spacing: 0.5px; border-bottom: 1px solid var(--border); text-transform: uppercase; }
.hist-row {
  display: grid; grid-template-columns: 56px 1fr 120px 140px;
  padding: 13px 24px; font-size: 13px;
  align-items: center; border-bottom: 1px solid var(--border);
  background: var(--surface); border-left: 3px solid transparent;
  cursor: pointer; transition: background .1s;
}
.hist-row:last-child { border-bottom: none; }
.hist-row.sel { background: var(--leaf-mist); border-left-color: var(--green-text); padding-left: 21px; }
.hist-row:hover:not(.sel) { background: var(--surf-alt); }
.hist-id   { font-family: 'SF Mono', Menlo, monospace; color: var(--mut-str); }
.hist-tipo { }
.hist-tipo.bold { font-weight: 500; color: var(--ink); }
.hist-th span:nth-child(4),
.hist-date { padding-left: 20px; }
.hist-date { color: var(--muted); }
.hist-empty { padding: 40px 24px; font-size: 13px; color: var(--muted); text-align: center; }

.hist-pager {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surf-alt);
}
.hist-pager-info { font-size: 12px; color: var(--mut-str); }
.hist-pager-controls { display: flex; align-items: center; gap: 6px; }
.hist-pg-btn {
  min-width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--mut-str); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.hist-pg-btn:hover:not(:disabled) { background: var(--leaf-mist); color: var(--green-text); border-color: #c9d7af; }
.hist-pg-btn.active { background: var(--green-text); color: #fff; border-color: var(--green-text); }
.hist-pg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hist-pager-size { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.hist-pager-size select { height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 8px; font-family: 'Montserrat', sans-serif; }

/* ── Detail aside ── */
.det { border-left: 1px solid var(--border); background: var(--surf-alt); padding: 20px 22px; }
.det-hd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.det-num { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.det-title { font-size: 16px; color: var(--ink); font-weight: 500; }
.det-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.det-grid[hidden] { display: none; }
.det-cell { background: var(--surface); padding: 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.det-cell-k { font-size: 10px; color: var(--muted); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 4px; }
.det-cell-v { font-size: 13px; color: var(--ink); font-weight: 500; }
.det-cell-v.danger { color: var(--danger); }
.det-obsoleta { background: var(--warn-bg); border: 1px solid var(--warn); color: var(--warn); font-size: 12.5px; font-weight: 500; padding: 11px 12px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.det-tl-label { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.tl { padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-line { position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--border); }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green-text); margin-top: 4px; z-index: 1; flex-shrink: 0; }
.tl-dot.success { background: var(--green-text); }
.tl-dot.warn    { background: var(--warn); }
.tl-dot.danger  { background: var(--danger); }
.tl-dot.neutral { background: var(--muted); }
.tl-dot.info    { background: var(--info); }
.tl-dot.alert   { background: var(--danger); }
.tl-event { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.tl-time  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.det-denial { margin-top: 16px; padding: 14px; background: var(--dng-bg); border-radius: var(--radius-sm); font-size: 12px; color: var(--danger); line-height: 1.45; }
.det-empty { font-size: 13px; color: var(--muted); padding: 20px 0; }
.det-title-tipo { font-size: 14px; line-height: 1.35; font-weight: 500; }
.det-arch-section { margin-bottom: 18px; }
.det-arch-hint { font-size: 11.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.4; }
.det-arch-body { min-width: 0; }
.det-arch-empty { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }
.det-arch-wrap { display: flex; flex-direction: column; gap: 0; }
.det-arch-wrap--muted { opacity: 0.68; }
.det-arch-slots { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.det-arch-slot {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); font-size: 11.5px;
}
.det-arch-slot-name { font-weight: 600; color: var(--ink); line-height: 1.25; flex: 1; min-width: 0; }
.det-arch-slot-estado { font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.det-arch-slot--nuevo { border-color: #b8d9be; background: #f4faf5; }
.det-arch-slot--nuevo .det-arch-slot-estado { color: #0d5c18; }
.det-arch-slot--vacio { border-color: #e0e0e0; background: #fafafa; }
.det-arch-slot--vacio .det-arch-slot-estado { color: #555; }

/* ── Footer ── */
.p-footer {
  border-top: 1px solid var(--line); padding: 28px 48px 20px;
  display: flex; flex-direction: column; gap: 20px;
  font-size: 12px; color: var(--ink-muted); background: var(--surf-alt); font-weight: 500;
}
.p-footer-logos {
  display: flex; align-items: center; justify-content: center; gap: 32px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.p-footer-logo-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; white-space: nowrap; }
.p-footer-divider { width: 1px; height: 36px; background: var(--line); display: inline-block; }
.p-footer-logo-strip { height: 44px; width: auto; display: block; }
.p-footer-logo-cesefor { height: 44px; width: auto; display: block; opacity: .9; }
@media (max-width: 900px) {
  .p-footer-logos { gap: 18px; }
  .p-footer-divider { display: none; }
  .p-footer-logo-strip { height: 32px; }
  .p-footer-logo-cesefor { height: 28px; }
}
.p-footer-base { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.p-footer-base a { color: var(--ink-muted); text-decoration: none; transition: color .15s; }
.p-footer-base a:hover { color: var(--green-text-str); }

/* ══════════════════════════════════════════════
   JS-CONTROLLED VISIBILITY POR TIPO
══════════════════════════════════════════════ */

[data-tipo="concesion_notificacion"] .block-explotacion { display: none; }
[data-tipo="concesion_notificacion"] .block-plan-template { display: none; }
.block-plan .block-template-bar { margin-bottom: 0; }
.rule-mod { display: none; }
[data-tipo="concesion_mod"] .rule-mod { display: flex; }
.capsule-ciclo { display: none; }
[data-tipo="concesion_notificacion"] .capsule-ciclo { display: block; }

/* ══════════════════════════════════════════════
   SHARED FORM & LOGIN COMPONENTS
   (usados en portal login y panel técnico)
══════════════════════════════════════════════ */

/* ── Form fields ── */
.t-field { margin-bottom: 14px; }
.t-label { display: block; font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 7px; }
.t-hint  { font-size: 11.5px; color: var(--ink-muted); margin-top: 6px; line-height: 1.5; }

/* ── Password toggle ── */
.u-pwd-wrap { position: relative; }
.u-pwd-wrap .input { padding-right: 42px; }
.u-pwd-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-muted); border-radius: 6px;
  transition: background .12s, color .12s;
}
.u-pwd-toggle:hover { background: rgba(0,0,0,.04); color: var(--ink); }

/* ── Login screen cards ── */
.t-login-outer { flex: 1; display: grid; place-items: center; padding: 60px 20px; }
.t-login-card  { width: 100%; max-width: 440px; }
.t-login-icon  {
  width: 52px; height: 52px; border-radius: 50%;
  background: #E3ECD6; color: var(--green-text-str);
  display: grid; place-items: center; margin-bottom: 20px;
}
.t-login-title { font-size: 28px; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; margin: 0 0 8px; }
.t-login-sub   { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; line-height: 1.6; }
