/* ── Vault Yovi v1.2 ─────────────────────────────────────────────────────
   Estética: Apple / iOS — Minimalista, limpio, aireado.
   Light mode por defecto · Dark mode con toggle.
   Tipografía: SF Pro via system-ui + JetBrains Mono para contraseñas.
   ────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

/* ══ TOKENS DE COLOR ════════════════════════════════════════════════════════ */

/* Light Mode (por defecto) */
.by-app {
    --by-bg:          #F5F5F7;
    --by-surface:     #FFFFFF;
    --by-surface-2:   #F5F5F7;
    --by-surface-3:   #E8E8ED;
    --by-border:      rgba(0,0,0,.08);
    --by-border-mid:  rgba(0,0,0,.12);
    --by-accent:      #FF2D78;
    --by-accent-hov:  #FF0066;
    --by-accent-soft: rgba(255,45,120,.10);
    --by-green:       #34C759;
    --by-green-soft:  rgba(52,199,89,.12);
    --by-red:         #FF3B30;
    --by-red-soft:    rgba(255,59,48,.10);
    --by-orange:      #FF9500;
    --by-orange-soft: rgba(255,149,0,.12);
    --by-text:        #1D1D1F;
    --by-text-2:      #3C3C43;
    --by-text-muted:  #6E6E73;
    --by-text-dim:    #AEAEB2;
    --by-shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --by-shadow:      0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.06);
    --by-shadow-lg:   0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
    --by-radius:      16px;
    --by-radius-sm:   10px;
    --by-radius-xs:   7px;
    --by-font:        -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --by-font-mono:   'JetBrains Mono', 'SF Mono', 'Courier New', monospace;
    --by-max-w:       760px;
    --by-transition:  0.18s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* Dark Mode */
.by-app.by-dark {
    --by-bg:          #000000;
    --by-surface:     #1C1C1E;
    --by-surface-2:   #2C2C2E;
    --by-surface-3:   #3A3A3C;
    --by-border:      rgba(255,255,255,.10);
    --by-border-mid:  rgba(255,255,255,.15);
    --by-accent:      #FF375F;
    --by-accent-hov:  #FF6B8A;
    --by-accent-soft: rgba(255,55,95,.15);
    --by-green:       #30D158;
    --by-green-soft:  rgba(48,209,88,.15);
    --by-red:         #FF453A;
    --by-red-soft:    rgba(255,69,58,.15);
    --by-orange:      #FF9F0A;
    --by-orange-soft: rgba(255,159,10,.15);
    --by-text:        #FFFFFF;
    --by-text-2:      #EBEBF5;
    --by-text-muted:  #AEAEB2;
    --by-text-dim:    #636366;
    --by-shadow-sm:   0 1px 3px rgba(0,0,0,.3);
    --by-shadow:      0 4px 16px rgba(0,0,0,.4);
    --by-shadow-lg:   0 12px 40px rgba(0,0,0,.5);
}

/* ══ BASE ════════════════════════════════════════════════════════════════════ */

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

.by-app {
    font-family: var(--by-font);
    background: var(--by-bg);
    color: var(--by-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ══ SCREENS ════════════════════════════════════════════════════════════════ */

.by-screen { display: none; }
.by-screen--active {
    display: block;
    animation: fvFadeUp 0.32s cubic-bezier(0.25,0.46,0.45,0.94) both;
}
@keyframes fvFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══ LOCK CARD (pantallas de acceso) ════════════════════════════════════════ */

.by-lock-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 100vh;
    justify-content: center;
}

.by-lock-icon {
    width: 76px; height: 76px;
    background: var(--by-surface);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--by-shadow);
    color: var(--by-accent);
    margin-bottom: 0.25rem;
}
.by-lock-icon svg { width: 36px; height: 36px; }
.by-lock-icon--locked { color: var(--by-text-muted); }
.by-lock-icon--new    { color: var(--by-accent); }

.by-lock-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--by-text);
    text-align: center;
}
.by-lock-subtitle {
    font-size: 0.9rem;
    color: var(--by-text-muted);
    text-align: center;
    line-height: 1.5;
}

/* ══ STEP INDICATOR ════════════════════════════════════════════════════════ */

.by-step-indicator {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; font-weight: 500;
    margin: 0.1rem 0 0.4rem;
}
.by-step { display: flex; align-items: center; gap: 0.3rem; color: var(--by-text-dim); }
.by-step--active { color: var(--by-accent); }
.by-step--done   { color: var(--by-green); }
.by-step__num {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.by-step-arrow { color: var(--by-text-dim); }

/* ══ SETUP INFO BOXES ═══════════════════════════════════════════════════════ */

.by-two-locks {
    width: 100%;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-sm);
    padding: 0.85rem 1rem;
    display: flex; flex-direction: column; gap: 0.6rem;
    box-shadow: var(--by-shadow-sm);
}
.by-two-locks__item {
    display: flex; align-items: center; gap: 0.65rem;
    font-size: 0.85rem; color: var(--by-text-muted);
}
.by-two-locks__item small { font-size: 0.75rem; color: var(--by-text-dim); }
.by-two-locks__num {
    width: 22px; height: 22px;
    background: var(--by-accent);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 800; flex-shrink: 0;
}

.by-setup-section {
    width: 100%;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-sm);
    padding: 1rem;
    display: flex; flex-direction: column; gap: 0.75rem;
    box-shadow: var(--by-shadow-sm);
}
.by-setup-section__label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem; font-weight: 700;
    color: var(--by-text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.by-badge-num {
    width: 20px; height: 20px;
    background: var(--by-accent);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 800;
}

/* ══ HEADER ════════════════════════════════════════════════════════════════ */

.by-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--by-border);
    max-width: var(--by-max-w);
    margin: 0 auto;
    width: 100%;
    transition: background 0.3s ease;
}
.by-dark .by-header {
    background: rgba(28,28,30,.85);
}
.by-header__logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1rem; font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--by-text);
}
.by-header__logo svg { width: 18px; height: 18px; color: var(--by-accent); }
.by-header__actions { display: flex; gap: 0.35rem; align-items: center; }

/* ══ TOOLBAR ════════════════════════════════════════════════════════════════ */

.by-toolbar {
    max-width: var(--by-max-w);
    margin: 0 auto;
    padding: 0.75rem 1rem 0.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.by-search-wrap { position: relative; }
.by-search-icon {
    position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; color: var(--by-text-dim); pointer-events: none;
}
#by-search {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.3rem;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: 12px;
    color: var(--by-text);
    font-size: 0.9rem;
    font-family: var(--by-font);
    outline: none;
    box-shadow: var(--by-shadow-sm);
    transition: border-color var(--by-transition), box-shadow var(--by-transition);
}
#by-search:focus {
    border-color: var(--by-accent);
    box-shadow: 0 0 0 3px var(--by-accent-soft);
}
.by-filters {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}

/* ══ TOPBAR ════════════════════════════════════════════════════════════════ */

.by-topbar {
    max-width: var(--by-max-w);
    margin: 0 auto;
    padding: 0.35rem 1rem 0.5rem;
    display: flex; align-items: center; justify-content: space-between;
}
.by-count { font-size: 0.8rem; color: var(--by-text-muted); font-weight: 500; }

/* ══ ENTRIES LIST ═══════════════════════════════════════════════════════════ */

.by-entries {
    max-width: var(--by-max-w);
    margin: 0 auto;
    padding: 0 0.75rem 5rem;
    display: flex; flex-direction: column; gap: 0.4rem;
}

/* Loading */
.by-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.75rem; padding: 3rem;
    color: var(--by-text-muted); font-size: 0.875rem;
}
.by-spinner {
    width: 26px; height: 26px;
    border: 2.5px solid var(--by-border-mid);
    border-top-color: var(--by-accent);
    border-radius: 50%;
    animation: fvSpin 0.65s linear infinite;
}
.by-spinner--sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; }
@keyframes fvSpin { to { transform: rotate(360deg); } }

/* Empty */
.by-empty {
    text-align: center; padding: 3rem 1rem;
    color: var(--by-text-muted);
}
.by-empty svg { width: 44px; height: 44px; opacity: 0.25; margin-bottom: 0.75rem; }
.by-empty p { font-size: 0.875rem; line-height: 1.6; }

/* Grupo label */
.by-group-label {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--by-text-dim);
    padding: 0.85rem 0.25rem 0.2rem;
}

/* ══ CARD ════════════════════════════════════════════════════════════════════ */

.by-card {
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius);
    padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.55rem;
    box-shadow: var(--by-shadow-sm);
    transition: box-shadow var(--by-transition), transform var(--by-transition);
    animation: fvSlideIn 0.22s ease both;
    cursor: default;
}
.by-card:hover {
    box-shadow: var(--by-shadow);
    transform: translateY(-1px);
}
@keyframes fvSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.by-card__top {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
}
.by-card__info { flex: 1; min-width: 0; }
.by-card__service {
    font-size: 0.95rem; font-weight: 600;
    color: var(--by-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
.by-card__user {
    font-size: 0.8rem; color: var(--by-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.by-card__badges { display: flex; gap: 0.3rem; flex-shrink: 0; }

.by-badge {
    font-size: 0.68rem; font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 30px;
    background: var(--by-accent-soft);
    color: var(--by-accent);
    white-space: nowrap;
}

.by-card__pass {
    display: flex; align-items: center; gap: 0.5rem;
}
.by-card__pass-text {
    font-family: var(--by-font-mono);
    font-size: 0.875rem;
    color: var(--by-text);
    letter-spacing: 0.05em;
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.by-card__age {
    display: flex; align-items: center; gap: 0.25rem;
    font-size: 0.7rem; font-weight: 500;
    color: var(--by-text-dim);
    white-space: nowrap;
}
.by-card__age svg { width: 11px; height: 11px; }
.by-card__age--old      { color: var(--by-orange); }
.by-card__age--very-old { color: var(--by-red); }

.by-card__notes {
    font-size: 0.78rem;
    color: var(--by-text-muted);
    background: var(--by-surface-2);
    border-radius: var(--by-radius-xs);
    padding: 0.4rem 0.6rem;
    line-height: 1.5;
}

.by-card__actions {
    display: flex; gap: 0.3rem; flex-wrap: wrap;
    padding-top: 0.4rem;
    border-top: 1px solid var(--by-border);
}

/* ══ BOTONES ════════════════════════════════════════════════════════════════ */

.by-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--by-radius-sm);
    font-size: 0.875rem; font-weight: 600;
    font-family: var(--by-font);
    cursor: pointer; border: none; outline: none;
    transition: all var(--by-transition);
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.by-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.by-btn--primary {
    background: var(--by-accent);
    color: white;
    box-shadow: 0 1px 3px rgba(255,45,120,.25);
}
.by-btn--primary:hover {
    background: var(--by-accent-hov);
    box-shadow: 0 4px 12px rgba(255,45,120,.3);
    transform: translateY(-1px);
}
.by-btn--primary:active { transform: translateY(0); box-shadow: none; }

.by-btn--accent {
    background: var(--by-accent);
    color: white;
    box-shadow: 0 1px 3px rgba(255,45,120,.25);
}
.by-btn--accent:hover {
    background: var(--by-accent-hov);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,45,120,.3);
}

.by-btn--ghost {
    background: var(--by-surface-2);
    border: 1px solid var(--by-border-mid);
    color: var(--by-text-muted);
}
.by-btn--ghost:hover { color: var(--by-text); border-color: var(--by-text-dim); }

.by-btn--warning {
    background: var(--by-orange-soft);
    border: 1px solid var(--by-orange);
    color: var(--by-orange);
}
.by-btn--warning:hover { background: rgba(255,149,0,.2); }

.by-btn--danger {
    background: var(--by-red-soft);
    border: 1px solid var(--by-red);
    color: var(--by-red);
}
.by-btn--danger:hover { background: rgba(255,59,48,.2); }

.by-btn--full { width: 100%; }
.by-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* Botones pequeños de acción en tarjetas */
.by-btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    border-radius: var(--by-radius-xs);
    display: inline-flex; align-items: center; gap: 0.3rem;
    cursor: pointer; font-family: var(--by-font); font-weight: 500;
    border: 1px solid var(--by-border-mid);
    background: var(--by-surface-2);
    color: var(--by-text-muted);
    transition: all var(--by-transition);
}
.by-btn-sm svg { width: 12px; height: 12px; }
.by-btn-sm:hover          { border-color: var(--by-accent); color: var(--by-accent); background: var(--by-accent-soft); }
.by-btn-sm--show:hover    { border-color: var(--by-accent); color: var(--by-accent); background: var(--by-accent-soft); }
.by-btn-sm--edit:hover    { border-color: var(--by-orange); color: var(--by-orange); background: var(--by-orange-soft); }
.by-btn-sm--delete:hover  { border-color: var(--by-red); color: var(--by-red); background: var(--by-red-soft); }
.by-btn-sm:disabled       { opacity: 0.5; cursor: not-allowed; }

/* Icon buttons */
.by-btn-icon {
    width: 34px; height: 34px;
    background: var(--by-surface-2);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-xs);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--by-text-muted);
    transition: all var(--by-transition);
    flex-shrink: 0;
}
.by-btn-icon svg { width: 14px; height: 14px; }
.by-btn-icon:hover            { color: var(--by-accent); border-color: var(--by-accent); background: var(--by-accent-soft); }
.by-btn-icon--danger:hover    { color: var(--by-red); border-color: var(--by-red); background: var(--by-red-soft); }

/* Eye button */
.by-eye-btn {
    position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px;
    background: none; border: none; cursor: pointer;
    color: var(--by-text-dim);
    display: flex; align-items: center; justify-content: center;
    transition: color var(--by-transition);
}
.by-eye-btn svg { width: 15px; height: 15px; }
.by-eye-btn:hover { color: var(--by-text-muted); }

/* Toggle dark mode */
.by-btn-theme {
    width: 34px; height: 34px;
    background: var(--by-surface-2);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-xs);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--by-text-muted);
    transition: all var(--by-transition);
    flex-shrink: 0;
}
.by-btn-theme:hover { color: var(--by-accent); border-color: var(--by-accent); }
.by-btn-theme svg   { width: 15px; height: 15px; }
.by-icon-sun, .by-icon-moon { transition: opacity 0.2s; }
.by-app:not(.by-dark) .by-icon-moon { display: none; }
.by-app.by-dark      .by-icon-sun  { display: none; }

/* ══ INPUTS ═════════════════════════════════════════════════════════════════ */

.by-form-group { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.by-form-group label {
    font-size: 0.78rem; font-weight: 600;
    color: var(--by-text-muted);
    letter-spacing: 0.01em;
}
.by-form-row { display: flex; flex-direction: column; gap: 0.75rem; }
.by-form-row--2 { flex-direction: column; }
.by-input-wrap { position: relative; }

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
textarea,
.by-select {
    width: 100%;
    padding: 0.68rem 0.9rem;
    background: var(--by-surface);
    border: 1px solid var(--by-border-mid);
    border-radius: var(--by-radius-xs);
    color: var(--by-text);
    font-size: 0.9rem;
    font-family: var(--by-font);
    outline: none;
    transition: border-color var(--by-transition), box-shadow var(--by-transition);
    appearance: none;
    box-shadow: var(--by-shadow-sm);
}
.by-dark input[type="text"],
.by-dark input[type="password"],
.by-dark input[type="search"],
.by-dark textarea,
.by-dark .by-select { background: var(--by-surface-2); }

input:focus, textarea:focus, .by-select:focus {
    border-color: var(--by-accent);
    box-shadow: 0 0 0 3px var(--by-accent-soft);
}
input[type="password"].by-pass-field {
    font-family: var(--by-font-mono);
    letter-spacing: 0.08em;
    padding-right: 5.5rem;
}
.by-input-wrap input { padding-right: 2.5rem; }
.by-input-wrap:has(#by-btn-generate) input { padding-right: 5.5rem; }
textarea { resize: vertical; min-height: 72px; }

.by-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23AEAEB2' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.4rem;
    cursor: pointer;
}
.by-select option { background: var(--by-surface); color: var(--by-text); }

/* ══ STRENGTH METER ═════════════════════════════════════════════════════════ */

.by-strength {
    display: flex; align-items: center; gap: 0.6rem;
    margin-top: 0.3rem;
}
.by-strength__track {
    flex: 1; height: 4px;
    background: var(--by-surface-3);
    border-radius: 4px; overflow: hidden;
}
.by-strength__fill {
    height: 100%; width: 0;
    border-radius: 4px;
    transition: width 0.4s ease, background-color 0.4s ease;
}
#by-strength-label {
    font-size: 0.7rem; font-weight: 600;
    min-width: 60px; text-align: right;
    color: var(--by-text-dim);
}

/* ══ GENERADOR ══════════════════════════════════════════════════════════════ */

.by-generator {
    background: var(--by-surface-2);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-sm);
    padding: 0.9rem 1rem;
    margin-top: 0.25rem;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.by-gen-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.76rem; font-weight: 700;
    color: var(--by-text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.by-gen-close {
    background: none; border: none; cursor: pointer;
    color: var(--by-text-muted); font-size: 1.3rem; line-height: 1;
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
}
.by-gen-close:hover { background: var(--by-border); color: var(--by-text); }
.by-gen-preview {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius-xs);
    padding: 0.6rem 0.85rem;
}
.by-gen-preview code {
    font-family: var(--by-font-mono);
    font-size: 0.85rem;
    color: var(--by-accent);
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.by-gen-options { display: flex; flex-direction: column; gap: 0.55rem; }
.by-gen-length  { display: flex; flex-direction: column; gap: 0.3rem; }
.by-gen-length label { font-size: 0.8rem; color: var(--by-text-muted); }
input[type="range"] {
    width: 100%; accent-color: var(--by-accent);
    cursor: pointer; height: 4px;
}
.by-gen-checks {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
}
.by-check {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.82rem; color: var(--by-text-muted); cursor: pointer;
}
.by-check input[type="checkbox"] { accent-color: var(--by-accent); cursor: pointer; }

/* ══ MODALES ════════════════════════════════════════════════════════════════ */

.by-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: flex-end;
}
.by-modal[hidden] { display: none; }
.by-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.by-modal__panel {
    position: relative;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-bottom: none;
    border-radius: var(--by-radius) var(--by-radius) 0 0;
    width: 100%;
    max-width: var(--by-max-w);
    margin: 0 auto;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--by-shadow-lg);
    animation: fvSlideUp 0.3s cubic-bezier(0.32,0.72,0,1) both;
}
@keyframes fvSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.by-modal__header {
    position: sticky; top: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem 0.85rem;
    background: var(--by-surface);
    border-bottom: 1px solid var(--by-border);
    z-index: 1;
}
.by-modal__title {
    font-size: 1.05rem; font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--by-text);
}
.by-modal__close {
    width: 30px; height: 30px;
    background: var(--by-surface-2); border: none; cursor: pointer;
    color: var(--by-text-muted);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all var(--by-transition);
}
.by-modal__close:hover { background: var(--by-surface-3); color: var(--by-text); }
.by-modal__close svg { width: 14px; height: 14px; }
.by-modal__body {
    padding: 1rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.85rem;
}
.by-modal__footer {
    position: sticky; bottom: 0;
    display: flex; gap: 0.5rem; justify-content: flex-end;
    padding: 0.85rem 1.25rem;
    background: var(--by-surface);
    border-top: 1px solid var(--by-border);
}

/* ══ ALERTAS ════════════════════════════════════════════════════════════════ */

.by-alert {
    padding: 0.65rem 0.9rem;
    border-radius: var(--by-radius-xs);
    font-size: 0.83rem; line-height: 1.4;
}
.by-alert--error   { background: var(--by-red-soft);    border: 1px solid rgba(255,59,48,.2);  color: var(--by-red); }
.by-alert--success { background: var(--by-green-soft);  border: 1px solid rgba(52,199,89,.2);  color: var(--by-green); }
.by-alert--info    { background: var(--by-accent-soft); border: 1px solid rgba(255,45,120,.2); color: var(--by-accent); }
.by-notice         { padding: 1rem; border-radius: var(--by-radius-xs); }
.by-notice--error  { background: var(--by-red-soft); color: var(--by-red); border: 1px solid rgba(255,59,48,.2); }

/* ══ TOAST ══════════════════════════════════════════════════════════════════ */

.by-toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: var(--by-text);
    color: var(--by-surface);
    padding: 0.65rem 1.25rem;
    border-radius: 30px;
    font-size: 0.85rem; font-weight: 500;
    box-shadow: var(--by-shadow-lg);
    z-index: 2000;
    white-space: nowrap;
    animation: fvToastIn 0.25s ease both;
}
.by-toast--success { background: var(--by-green); color: white; }
.by-toast--error   { background: var(--by-red);   color: white; }
@keyframes fvToastIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ══ SETTINGS MODAL ═════════════════════════════════════════════════════════ */

.by-settings-section {
    font-size: 1rem; font-weight: 700;
    color: var(--by-text); letter-spacing: -0.01em;
    padding-top: 0.5rem;
    border-top: 1px solid var(--by-border);
}
.by-settings-section:first-child { border-top: none; padding-top: 0; }
.by-settings-note {
    font-size: 0.82rem; color: var(--by-text-muted);
    background: var(--by-orange-soft);
    border: 1px solid rgba(255,149,0,.2);
    border-radius: var(--by-radius-xs);
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}

/* ══ CATS / PROJS MANAGER ═══════════════════════════════════════════════════ */

.by-tag-manager { display: flex; flex-direction: column; gap: 0.5rem; }
.by-tag-list    { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.by-tag {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: var(--by-accent-soft);
    color: var(--by-accent);
    border-radius: 30px;
    font-size: 0.8rem; font-weight: 500;
    border: 1px solid rgba(255,45,120,.15);
    transition: all var(--by-transition);
}
.by-tag__del {
    background: none; border: none; cursor: pointer;
    color: var(--by-accent); font-size: 1rem; line-height: 1;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity var(--by-transition);
}
.by-tag__del:hover { opacity: 1; background: rgba(255,59,48,.15); color: var(--by-red); }
.by-tag-add {
    display: flex; gap: 0.4rem;
}
.by-tag-add input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.by-tag-add .by-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
}

/* ══ CSV EXPORT BUTTON ══════════════════════════════════════════════════════ */

.by-btn--csv {
    background: var(--by-green-soft);
    border: 1px solid var(--by-green);
    color: var(--by-green);
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
}
.by-btn--csv:hover { background: rgba(52,199,89,.2); }

/* ══ SCROLLBAR ══════════════════════════════════════════════════════════════ */

.by-app ::-webkit-scrollbar        { width: 5px; }
.by-app ::-webkit-scrollbar-track  { background: transparent; }
.by-app ::-webkit-scrollbar-thumb  { background: var(--by-border-mid); border-radius: 3px; }

/* ══ FOCUS VISIBLE ══════════════════════════════════════════════════════════ */

.by-app button:focus-visible { outline: 2px solid var(--by-accent); outline-offset: 2px; }

/* ══ MEDIA QUERIES ══════════════════════════════════════════════════════════ */

@media (min-width: 540px) {
    .by-toolbar     { flex-direction: row; align-items: center; }
    .by-search-wrap { flex: 1; }
    .by-filters     { flex: 1; grid-template-columns: 1fr 1fr; }
    .by-form-row--2 { flex-direction: row; }
    .by-modal       { align-items: center; }
    .by-modal__panel {
        border-bottom: 1px solid var(--by-border);
        border-radius: var(--by-radius);
        max-height: 88vh;
        width: calc(100% - 2rem);
        margin: 1rem auto;
    }
}
@media (min-width: 760px) {
    .by-card__actions { flex-wrap: nowrap; }
}

/* ── Setup box (pantalla de configuración/lock) ──────────────────────────── */
.by-setup-box {
    width: 100%;
    display: flex; flex-direction: column; gap: 0.85rem;
    background: var(--by-surface);
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius);
    padding: 1.25rem;
    box-shadow: var(--by-shadow);
}

/* ── Indicador de fecha mejorado (Opción C: relativo + fecha exacta) ────── */
.by-card__age {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 1px;
    font-size: 0.72rem;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}
.by-card__age-relative {
    font-weight: 600;
    color: var(--by-text-muted);
    display: flex; align-items: center; gap: 0.25rem;
}
.by-card__age-relative svg { width: 11px; height: 11px; flex-shrink: 0; }
.by-card__age-date {
    font-size: 0.68rem;
    color: var(--by-text-dim);
}
/* Colores por antigüedad */
.by-card__age--ok   .by-card__age-relative { color: var(--by-text-muted); }
.by-card__age--warn .by-card__age-relative { color: var(--by-orange); }
.by-card__age--old  .by-card__age-relative { color: var(--by-red); }
