html {
    font-size: 16px;
}

body {
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #085080;
    z-index: 1000;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
    outline: 3px solid #085080;
}

main:focus {
    outline: none;
}

/* Foco visible y consistente */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #085080;
    outline-offset: 2px;
}

.categories-table th {
    width: 33.333%;
}

.counters dd {
    margin-bottom: 0.25rem;
}

progress {
    height: 1.5rem;
    accent-color: #085080;
}

dialog {
    border: 2px solid #085080;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 32rem;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.email-preview {
    width: 100%;
    min-height: 40rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    background: #f4f4f4;
}

.text-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Editor del envío desde Excel */
#body {
    min-height: 24rem;
    resize: vertical;
    line-height: 1.4;
}

.placeholder-list .btn {
    font-family: var(--bs-font-monospace);
}

/* Menú contextual de edición (context-menu.js) */
.ctx-menu {
    position: fixed;
    z-index: 2000;
    min-width: 15rem;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    color: #212529;
    border: 1px solid #6c757d;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
}

.ctx-menu[hidden] {
    display: none;
}

.ctx-menu [role="menuitem"] {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.35rem 0.9rem;
    cursor: default;
    white-space: nowrap;
    outline: none;
}

.ctx-menu [role="menuitem"]:focus,
.ctx-menu [role="menuitem"][aria-expanded="true"] {
    background: #085080;
    color: #fff;
}

.ctx-menu [role="menuitem"]:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.ctx-menu [role="menuitem"][aria-disabled="true"] {
    color: #6c757d;
}

.ctx-menu [role="menuitem"][aria-disabled="true"]:focus {
    background: #e9ecef;
    color: #495057;
}

.ctx-shortcut,
.ctx-arrow {
    margin-left: auto;
    opacity: 0.85;
}

.ctx-key {
    font-family: var(--bs-font-monospace);
}

.ctx-hint {
    opacity: 0.85;
    font-size: 0.875em;
}

.ctx-separator {
    height: 0;
    margin: 0.25rem 0;
    border-top: 1px solid #dee2e6;
}

.ctx-has-sub {
    position: relative;
}

.ctx-submenu {
    position: absolute;
    left: 100%;
    top: -0.3rem;
    max-height: 60vh;
    overflow-y: auto;
}

.ctx-submenu.ctx-flip {
    left: auto;
    right: 100%;
}

@media (forced-colors: active) {
    .ctx-menu {
        border: 1px solid CanvasText;
    }

    .ctx-menu [role="menuitem"]:focus,
    .ctx-menu [role="menuitem"][aria-expanded="true"] {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }

    .ctx-menu [role="menuitem"][aria-disabled="true"] {
        color: GrayText;
    }
}

/* Estado de las sesiones: el texto dice el estado; el color solo acompaña (contraste AA sobre su fondo). */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 0.375rem;
    border: 1px solid currentColor;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}

.status-draft { color: #41464b; background: #f1f3f5; }
.status-sending { color: #0a4a7a; background: #e3f0fb; }
.status-paused { color: #664d03; background: #fff6d6; }
.status-cancelled { color: #58151c; background: #f8e1e3; }
.status-completed { color: #0a3622; background: #dff3e8; }
.status-failed { color: #58151c; background: #f8d7da; }

.image-thumb {
    max-width: 96px;
    max-height: 64px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background: #fff;
}

.breadcrumb a {
    color: #085080;
}

#status-message:focus {
    outline: none;
}
