/* ============================================================================
 *  Yalibis Drive — assets/css/style.css
 *  Hoja maestra. Identidad visual heredada de Destrezas (assets/css/style.css:
 *  tokens, sidebar 264px, topbar, tarjetas, botones, Select2) adaptada a
 *  Yalibis: contraste AA verificado, objetivos táctiles >= 44px, mobile-first
 *  y sin scroll horizontal global. Prefijo dz-* conservado en componentes
 *  heredados; componentes nuevos usan yd-*.
 * ============================================================================ */

/* ---- Tipografía local: Plus Jakarta Sans (OFL) -------------------------- */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF; }

/* ---- Tokens (claro por defecto) ------------------------------------------ */
:root,
[data-theme="light"] {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --text: #1F2937;
  --text2: #5B6472;           /* 5.9:1 sobre blanco (AA) */
  --border: #E1E5EB;
  --hover: #EEF1F6;
  --sidebar: #16213E;
  --sb-text: #C3CCDD;
  --sb-hover: #22315A;
  --topbar: #FFFFFF;
  --shadow: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);

  --teal: #0DCAA8;            /* relleno */
  --teal-2: #00B894;
  --teal-text: #00705E;       /* texto/icono sobre claro: 5.9:1 */
  --teal-soft: rgba(13,202,168,.14);
  --on-teal: #0C1A33;         /* texto sobre relleno turquesa: 8:1 */
  --navy: #16213E;
  --navy-2: #1B2A4A;
  --focus: #0A6FD6;

  --success: #047857; --success-bg: rgba(16,185,129,.14);
  --warning: #92400E; --warning-bg: rgba(245,158,11,.18);
  --danger:  #B91C1C; --danger-bg: rgba(239,68,68,.12);
  --info:    #0369A1; --info-bg: rgba(14,165,233,.14);
  --muted:   #5B6B8C;
  --danger-fill: #DC2626;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #16213E;
  --surface-2: #1B2749;
  --text: #F1F5F9;
  --text2: #A7B3C6;
  --border: #2A3856;
  --hover: #1F2D4D;
  --sidebar: #0E1830;
  --sb-text: #C3CCDD;
  --sb-hover: #1E2A45;
  --topbar: #16213E;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  --teal-text: #2DE0C0;
  --teal-soft: rgba(13,202,168,.18);
  --focus: #7CC0FF;
  --success: #34D399; --success-bg: rgba(52,211,153,.16);
  --warning: #FBBF24; --warning-bg: rgba(251,191,36,.16);
  --danger:  #F87171; --danger-bg: rgba(248,113,113,.16);
  --info:    #38BDF8; --info-bg: rgba(56,189,248,.16);
  --danger-fill: #DC2626;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--border);
  --bs-body-font-family: inherit;
  overflow-wrap: break-word;
}
a { color: var(--teal-text); }
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.yd-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; }
.yd-skip:focus { left: 8px; }
.visually-hidden-yd { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.yd-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- Layout maestro ------------------------------------------------------ */
.dz-app { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.dz-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dz-content {
  flex: 1; min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto;
  padding: 16px 12px calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.dz-content:focus { outline: none; }

/* Sidebar */
.dz-sidebar {
  width: 264px; flex: 0 0 264px; height: 100vh; height: 100dvh; position: sticky; top: 0;
  background: var(--sidebar); display: flex; flex-direction: column; overflow: hidden; z-index: 60;
}
.dz-sb-brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px 12px 20px; }
.dz-sb-logo { width: 42px; height: 42px; flex: 0 0 42px; }
.dz-sb-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.yd-top-brand img, .yd-auth-marca img { object-fit: contain; }
.dz-sb-brandtext { min-width: 0; line-height: 1.15; }
.dz-sb-name { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.3px; overflow-wrap: anywhere; }
.dz-sb-tag { color: #5EEAD4; font-weight: 700; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }
.dz-sb-close { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 18px; }
.dz-nav { flex: 1; overflow-y: auto; padding: 4px 12px 24px; overscroll-behavior: contain; }
.dz-nav-sec { padding: 16px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: #8FA0C0; text-transform: uppercase; }
.dz-nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--sb-text);
  border-left: 3px solid transparent; transition: background .16s ease, color .16s ease;
}
.dz-nav-link i { width: 20px; text-align: center; font-size: 17px; }
.dz-nav-link:hover { background: var(--sb-hover); color: #fff; }
.dz-nav-link.active { color: #fff; font-weight: 700; background: rgba(13,202,168,.18); border-left-color: var(--teal); padding-left: 9px; }
.dz-nav-link.active i { color: var(--teal); }
.dz-nav-count, .dz-badge-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger-fill); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; display: inline-block;
}
.dz-nav-count { margin-left: auto; }
.dz-backdrop { display: none; }

/* Topbar */
.dz-topbar {
  min-height: 60px; position: sticky; top: 0; z-index: 50; background: var(--topbar);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
}
.dz-burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); font-size: 20px; align-items: center; justify-content: center; }
.yd-top-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 15px; min-width: 0; }
.yd-top-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.yd-top-contexto { display: none; font-weight: 700; font-size: 15px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.yd-top-espacio { flex: 1; }
.dz-icon-btn {
  position: relative; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text);
  font-size: 18px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; flex: 0 0 auto;
}
.dz-icon-btn:hover { background: var(--border); }
.yd-lang { font-weight: 800; font-size: 13px; }
.dz-badge-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 4px; }
.yd-user { position: relative; }
.dz-user { display: flex; align-items: center; gap: 10px; cursor: pointer; background: transparent; border: 0; padding: 2px; border-radius: 12px; color: var(--text); min-height: 44px; }
.dz-avatar {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: var(--on-teal); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: 0 0 auto;
}
.dz-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yd-user-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.yd-user-nombre { font-weight: 700; font-size: 13.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yd-user-rol { font-size: 12px; color: var(--text2); }
.dz-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 230px; display: none; z-index: 70;
}
.dz-user-menu.open { display: block; }
.yd-user-menu-cab { padding: 10px 12px 8px; display: flex; flex-direction: column; line-height: 1.3; }
.yd-user-menu-cab small { color: var(--text2); }
.dz-user-menu a, .dz-user-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent;
  text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer;
}
.dz-user-menu a:hover, .dz-user-menu button:hover { background: var(--hover); }
.dz-user-menu .danger { color: var(--danger); }
.dz-user-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.yd-form-salir { margin: 0; }
.dz-hide-sm { display: initial; }

/* Navegación inferior móvil + hoja "Más" */
.yd-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: none;
  background: var(--topbar); border-top: 1px solid var(--border);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.yd-bottomnav a, .yd-bottomnav button {
  flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: transparent; color: var(--text2); text-decoration: none; font-size: 11.5px; font-weight: 700; border-radius: 12px; cursor: pointer;
}
.yd-bottomnav i { font-size: 21px; line-height: 1; }
.yd-bottomnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yd-bottomnav .active { color: var(--teal-text); }
.yd-bottomnav .active i { background: var(--teal-soft); border-radius: 12px; padding: 3px 14px; margin: -3px 0; }
.yd-mas-backdrop { position: fixed; inset: 0; background: rgba(8,12,24,.5); z-index: 90; }
.yd-mas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); max-height: 85dvh; overflow-y: auto;
}
.yd-mas-cab { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; font-size: 17px; }
.yd-mas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.yd-mas-grid a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; min-height: 84px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 13px; text-align: center;
}
.yd-mas-grid a i { font-size: 22px; color: var(--teal-text); }
.yd-mas-grid a.active { border-color: var(--teal); }
.yd-mas-grid .dz-nav-count { position: absolute; top: 6px; right: 6px; margin: 0; }
.yd-mas-salir { margin-top: 14px; display: flex; }
.yd-mas-salir .dz-btn { width: 100%; justify-content: center; }

/* ---- Responsive del layout ------------------------------------------------ */
@media (min-width: 576px) { .dz-content { padding-left: 16px; padding-right: 16px; } .yd-top-contexto { display: block; } }
@media (min-width: 768px) { .dz-content { padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); gap: 20px; } }
@media (max-width: 1023.98px) {
  .dz-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); visibility: hidden;
    transition: transform .26s ease, visibility 0s linear .26s; box-shadow: var(--shadow-lg); max-width: 86vw;
  }
  .dz-sidebar.open { transform: none; visibility: visible; transition: transform .26s ease; }
  .dz-sb-close { display: inline-flex; align-items: center; justify-content: center; }
  .dz-burger { display: inline-flex; }
  .dz-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(8,12,24,.5); z-index: 55; }
  .yd-top-brand span { display: none; }
}
@media (max-width: 767.98px) {
  .dz-burger { display: none; }
  .yd-bottomnav { display: flex; }
  .dz-hide-sm { display: none !important; }
  .yd-top-brand span { display: inline; }
  .yd-top-contexto { display: none; }
  .dz-user-menu { right: 0; max-width: calc(100vw - 24px); }
}
@media (min-width: 768px) { .yd-mas, .yd-mas-backdrop { display: none !important; } }
@media (max-width: 360px) { .dz-topbar { gap: 4px; padding-left: 8px; padding-right: 8px; } .yd-top-brand span { max-width: 24vw; } }

/* ---- Encabezado de página, tarjetas y utilidades --------------------------- */
.yd-page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.yd-page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.yd-page-head p { margin: 4px 0 0; color: var(--text2); font-size: 14px; }
.yd-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.yd-acciones-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
@media (min-width: 768px) { .yd-acciones-grid { display: flex; flex-wrap: wrap; } }
@media (min-width: 768px) { .yd-page-head h1 { font-size: 28px; } }
.dz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 768px) { .dz-card { padding: 20px; } }
.yd-card-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.yd-subtle { color: var(--text2); font-size: 14px; }
.yd-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .yd-grid.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .yd-grid.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .yd-grid.dos-1024 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.yd-stack { display: flex; flex-direction: column; gap: 12px; }
.yd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.yd-vacio { text-align: center; padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.yd-vacio > i { font-size: 40px; color: var(--teal-text); }
.yd-vacio h1, .yd-vacio h2, .yd-vacio h3 { font-size: 18px; font-weight: 800; }
.yd-vacio p { margin: 0; color: var(--text2); max-width: 46ch; }

/* ---- Botones --------------------------------------------------------------- */
.dz-btn, .dz-btn-primary, .dz-btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 11px;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid var(--border); transition: filter .15s, background .15s; text-align: center; line-height: 1.2;
}
.dz-btn { background: var(--surface); color: var(--text); }
.dz-btn:hover { background: var(--hover); color: var(--text); }
.dz-btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: var(--on-teal); border-color: transparent; box-shadow: 0 6px 14px rgba(13,202,168,.28); }
.dz-btn-primary:hover { filter: brightness(1.04); color: var(--on-teal); }
.dz-btn-danger { background: var(--danger-fill); color: #fff; border-color: transparent; }
.dz-btn-danger:hover { filter: brightness(1.08); color: #fff; }
.dz-btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.dz-btn-sm { min-height: 44px; padding: 6px 12px; font-size: 14px; }
.dz-btn:disabled, .dz-btn-primary:disabled, .dz-btn-danger:disabled, [aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.dz-btn-block { width: 100%; }
.yd-btn-cargando::after { content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: yd-rot .7s linear infinite; }
@keyframes yd-rot { to { transform: rotate(360deg); } }

/* ---- Formularios ------------------------------------------------------------ */
.yd-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.yd-field > label, .yd-label { font-size: 14px; font-weight: 700; color: var(--text); }
.yd-req::after { content: ' *'; color: var(--danger); }
.yd-input, .yd-field input[type=text], .yd-field input[type=tel], .yd-field input[type=email], .yd-field input[type=password],
.yd-field input[type=date], .yd-field input[type=time], .yd-field input[type=number], .yd-field input[type=search],
.yd-field select, .yd-field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 11px; appearance: none; -webkit-appearance: none; min-width: 0;
}
.yd-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='%236B7280'%3E%3Cpath d='M1.5 5.5l6.5 6.5 6.5-6.5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.yd-field textarea { min-height: 96px; resize: vertical; }
.yd-field input:focus, .yd-field select:focus, .yd-field textarea:focus { border-color: var(--focus); outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.yd-field .yd-ayuda { font-size: 13px; color: var(--text2); }
.yd-field .yd-error { font-size: 13.5px; font-weight: 600; color: var(--danger); display: none; }
.yd-field.tiene-error .yd-error { display: block; }
.yd-field.tiene-error input, .yd-field.tiene-error select, .yd-field.tiene-error textarea { border-color: var(--danger); }
.yd-prefijo { display: flex; align-items: stretch; }
.yd-prefijo > span { display: inline-flex; align-items: center; padding: 0 12px; background: var(--hover); border: 1.5px solid var(--border); border-right: 0; border-radius: 11px 0 0 11px; font-weight: 800; color: var(--text2); }
.yd-prefijo > input { border-radius: 0 11px 11px 0 !important; }
.yd-form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .yd-form-grid.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .yd-form-grid.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.yd-form-grid .ancho-total { grid-column: 1 / -1; }
.yd-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.yd-check input { width: 22px; height: 22px; accent-color: var(--teal-text); flex: 0 0 auto; }
.yd-segmentado { display: flex; gap: 4px; padding: 4px; background: var(--hover); border: 1px solid var(--border); border-radius: 12px; }
.yd-segmentado label { flex: 1; min-width: 0; margin: 0; }
.yd-segmentado input { position: absolute; opacity: 0; pointer-events: none; }
.yd-segmentado span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 10px; border-radius: 9px;
  font-weight: 700; font-size: 14.5px; color: var(--text2); cursor: pointer;
}
.yd-segmentado input:checked + span { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: var(--on-teal); }
.yd-segmentado input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* Barra de acciones fija al pie del formulario largo (no tapa por teclado) */
.yd-form-pie {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px;
}
/* En móvil el pie del formulario queda anclado encima de la navegación inferior:
   Guardar/Siguiente siempre alcanzables aunque el teclado o el contenido sean largos. */
@media (max-width: 767.98px) {
  .yd-form-pie {
    position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 30;
    background: var(--surface); padding: 10px 0; margin-bottom: -4px; box-shadow: 0 -8px 12px -10px rgba(16,24,40,.25);
  }
  .yd-form-pie > * { flex: 1 1 140px; }
}

/* ---- Badges, avatares, KPI ---------------------------------------------------- */
.dz-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 9px; line-height: 1.3; white-space: nowrap; }
.dz-badge.success { background: var(--success-bg); color: var(--success); }
.dz-badge.warning { background: var(--warning-bg); color: var(--warning); }
.dz-badge.danger { background: var(--danger-bg); color: var(--danger); }
.dz-badge.info { background: var(--info-bg); color: var(--info); }
.dz-badge.secondary { background: var(--hover); color: var(--text2); }
.yd-avatar { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: var(--on-teal); font-weight: 800; font-size: 16px; }
.yd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.yd-avatar.grande { width: 72px; height: 72px; border-radius: 20px; font-size: 24px; }
.yd-kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .yd-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 359.98px) { .yd-kpis { grid-template-columns: minmax(0, 1fr); } }
.yd-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.yd-kpi .k-label { font-size: 13px; color: var(--text2); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.yd-kpi .k-valor { font-size: 22px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.yd-kpi .k-nota { font-size: 12.5px; color: var(--text2); }
.yd-kpi.k-deuda .k-valor { color: var(--danger); }
.yd-kpi.k-credito .k-valor { color: var(--success); }
.yd-kpi a.k-link { margin-top: 4px; font-size: 13px; font-weight: 700; }

/* ---- Listados: tarjetas en móvil, tabla en escritorio ------------------------- */
.yd-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.yd-barra .yd-buscar { flex: 1 1 220px; position: relative; min-width: 0; }
.yd-barra .yd-buscar i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text2); pointer-events: none; }
.yd-barra .yd-buscar input { padding-left: 40px; }
.yd-filtros { display: none; gap: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.yd-filtros.abierto { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.yd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.yd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-text); font-weight: 700; font-size: 13px; }
.yd-chip button { border: 0; background: transparent; color: inherit; padding: 4px; min-width: 28px; min-height: 28px; cursor: pointer; }
.yd-lista { display: flex; flex-direction: column; gap: 10px; }
.yd-item {
  display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; align-items: flex-start; min-width: 0;
}
.yd-item-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.yd-item-titulo { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.yd-item-meta { font-size: 13.5px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.yd-item-meta b { color: var(--text); font-weight: 700; }
.yd-item-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.yd-saldo-deuda { color: var(--danger); font-weight: 800; }
.yd-saldo-credito { color: var(--success); font-weight: 800; }
.yd-tabla-wrap { display: none; }
.yd-tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.yd-tabla th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.yd-tabla td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.yd-tabla tr:hover td { background: var(--hover); }
.yd-tabla td.nw, .yd-tabla th.nw { white-space: nowrap; overflow-wrap: normal; }
.yd-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yd-tabla-scroll { overflow-x: auto; position: relative; } /* position: contiene elementos absolutos (visually-hidden) */
@media (min-width: 768px) { .yd-tabla-wrap { display: block; } .yd-lista.solo-movil { display: none; } }
.yd-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; }
.yd-pager .info { font-size: 13.5px; color: var(--text2); font-weight: 600; }
.yd-pager .botones { display: flex; gap: 6px; flex-wrap: wrap; }
.yd-pager button { min-width: 44px; min-height: 44px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; font-weight: 700; cursor: pointer; }
.yd-pager button[disabled] { opacity: .45; cursor: not-allowed; }
.yd-pager button.on { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: var(--on-teal); border-color: transparent; }
.yd-skeleton { border-radius: 12px; min-height: 76px; background: linear-gradient(90deg, var(--hover) 25%, var(--border) 37%, var(--hover) 63%); background-size: 400% 100%; animation: yd-sk 1.3s ease infinite; }
@keyframes yd-sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.yd-alerta { border-radius: 12px; padding: 12px 14px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.yd-alerta.info { background: var(--info-bg); color: var(--info); }
.yd-alerta.warning { background: var(--warning-bg); color: var(--warning); }
.yd-alerta.danger { background: var(--danger-bg); color: var(--danger); }
.yd-alerta.success { background: var(--success-bg); color: var(--success); }
.yd-alerta i { margin-top: 2px; }

/* ---- Pestañas (expediente) ------------------------------------------------------ */
.yd-tabs-wrap { position: relative; }
.yd-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.yd-tabs button { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.yd-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .yd-tabs button[aria-selected="true"] { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }
.yd-tabpanel { display: none; }
.yd-tabpanel.activo { display: block; }

/* ---- Cronología ------------------------------------------------------------------- */
.yd-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.yd-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.yd-timeline .ic { flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-text); display: inline-flex; align-items: center; justify-content: center; }
.yd-timeline .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yd-timeline .tx small { color: var(--text2); }

/* ---- Horario semanal ------------------------------------------------------------------ */
.yd-semana { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .yd-semana { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .yd-semana { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.yd-dia { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.yd-dia h4 { font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yd-dia .tramo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: end; }
.yd-dia .tramo .titulo { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--text2); }
.yd-dia .tramo .yd-check { font-size: 13px; min-height: 44px; }

/* ---- Pasos (formulario por secciones) --------------------------------------------------- */
.yd-pasos { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; counter-reset: paso; }
.yd-pasos button {
  flex: 1 0 auto; min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.yd-pasos button::before { counter-increment: paso; content: counter(paso); width: 24px; height: 24px; border-radius: 50%; background: var(--hover); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; }
.yd-pasos button[aria-current="step"] { border-color: var(--teal); color: var(--text); }
.yd-pasos button[aria-current="step"]::before { background: var(--teal); color: var(--on-teal); }
.yd-paso { display: none; }
.yd-paso.activo { display: block; }

/* ---- Mapa --------------------------------------------------------------------------------- */
.yd-mapa-caja { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.yd-mapa { width: 100%; height: 320px; background: var(--hover); z-index: 0; }
@media (min-width: 1024px) { .yd-mapa { height: 460px; } }
.yd-mapa.completa { position: fixed; inset: 0; z-index: 2000; height: 100dvh; border-radius: 0; }
.yd-mapa-aviso { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 500; }
.yd-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.yd-pin span { transform: rotate(45deg); color: #fff; font-weight: 800; font-size: 13px; }
.yd-pin.a { background: #0369A1; }
.yd-pin.b { background: #B45309; }
.leaflet-container { font-family: inherit; }
.leaflet-bar a, .leaflet-control-zoom a { min-width: 44px; min-height: 44px; line-height: 44px !important; font-size: 20px; }
.leaflet-control-attribution { font-size: 11px; }
.yd-resultados-geo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.yd-resultados-geo button { width: 100%; text-align: left; min-height: 48px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.yd-resultados-geo button:hover { border-color: var(--teal); }

/* ---- Pago: vista previa del reparto ----------------------------------------------------------- */
.yd-reparto { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); }
.yd-reparto .fila { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.yd-reparto .fila.total { font-weight: 800; border-top: 1px solid var(--border); padding-top: 6px; }

/* ---- Select2 (tema + tamaños táctiles) ------------------------------------------------------------ */
.select2-container { width: 100% !important; font-family: inherit; font-size: 16px; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background: var(--surface) !important; border: 1.5px solid var(--border) !important; border-radius: 11px !important; min-height: 48px !important; color: var(--text) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text) !important; line-height: 45px !important; padding-left: 12px !important; padding-right: 32px !important; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--text2) !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px !important; right: 8px !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--focus) !important; }
.select2-dropdown { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important; border-radius: 11px !important; overflow: hidden; z-index: 2100; box-shadow: var(--shadow-lg); }
.select2-search--dropdown { padding: 8px !important; }
.select2-search--dropdown .select2-search__field { background: var(--bg) !important; color: var(--text) !important; border: 1.5px solid var(--border) !important; border-radius: 9px !important; min-height: 44px; padding: 8px 10px !important; font-size: 16px !important; }
.select2-results__option { padding: 12px !important; min-height: 44px; color: var(--text) !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--teal) !important; color: var(--on-teal) !important; }
.select2-container--default .select2-results__option--selected, .select2-container--default .select2-results__option[aria-selected=true] { background: var(--hover) !important; }
.select2-results__message { color: var(--text2) !important; }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--text2); margin-right: 6px; font-size: 20px; }

/* ---- Modales Bootstrap con tokens Yalibis ----------------------------------------------------------- */
.modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--text); --bs-modal-border-color: var(--border); --bs-modal-header-border-color: var(--border); --bs-modal-footer-border-color: var(--border); --bs-modal-border-radius: 16px; }
.modal-content { background: var(--surface); color: var(--text); }
.modal-footer { flex-wrap: wrap; gap: 8px; }
.modal-footer > * { margin: 0 !important; }
.modal-title { font-weight: 800; font-size: 18px; }
@media (max-width: 575.98px) {
  .modal-dialog { margin: 0; min-height: 100dvh; max-width: none; }
  .modal-content { min-height: 100dvh; border-radius: 0; border: 0; }
  .modal-body { overflow-y: auto; }
}
.btn-close { width: 44px; height: 44px; background-size: 14px; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* SweetAlert2 / Toastify */
.swal2-popup { border-radius: 18px !important; font-family: inherit !important; background: var(--surface) !important; color: var(--text) !important; width: min(92vw, 440px) !important; }
.swal2-title { color: var(--text) !important; font-size: 20px !important; }
.swal2-html-container { color: var(--text) !important; }
.swal2-styled { min-height: 44px !important; }
.swal2-input, .swal2-textarea { font-size: 16px !important; background: var(--surface) !important; color: var(--text) !important; border: 1.5px solid var(--border) !important; }
.toastify { border-radius: 12px !important; font-family: inherit !important; font-weight: 600 !important; box-shadow: var(--shadow-lg) !important; max-width: min(92vw, 420px); }

/* ---- Autenticación ----------------------------------------------------------------------------------- */
.yd-publica { background: linear-gradient(160deg, #16213E 0%, #0E1830 100%); min-height: 100dvh; }
[data-theme="light"] .yd-publica { background: linear-gradient(160deg, #16213E 0%, #1B2A4A 55%, #0F766E 130%); }
.yd-auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.yd-auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }
.yd-auth-marca { display: flex; align-items: center; gap: 12px; }
.yd-auth-marca img { width: 48px; height: 48px; }
.yd-auth-marca strong { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.yd-auth-prefs { display: flex; justify-content: flex-end; gap: 8px; }
.yd-pw { position: relative; }
.yd-pw input { padding-right: 52px !important; }
.yd-pw button { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text2); font-size: 18px; cursor: pointer; border-radius: 10px; }

/* ---- Utilidades de estado ------------------------------------------------------------------------------ */
.text-danger-yd { color: var(--danger); }
.text-success-yd { color: var(--success); }
.mt-0-yd { margin-top: 0; }
.yd-sin-scroll-x { overflow-x: clip; }
