/**
 * Panel /gestion — UI minimalista oscura.
 */

.gestion-body {
    margin: 0;
    min-height: 100vh;
    background: #0a0a0a;
    color: #f0f0f0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

.gestion-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: #111;
}

.gestion-top__brand a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    margin-right: 0.5rem;
}

.gestion-top__site {
    color: #9a9a9a;
    font-size: 0.85rem;
}

.gestion-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.gestion-nav__link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.gestion-nav__link:hover,
.gestion-nav__link.is-active {
    color: #fff;
}

.gestion-user-menu {
    position: relative;
    display: inline-block;
}

.gestion-user-menu__summary {
    list-style: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 600;
    user-select: none;
}

.gestion-user-menu__summary::-webkit-details-marker {
    display: none;
}

.gestion-user-menu__summary::after {
    content: " ▾";
    font-size: 0.75em;
    opacity: 0.7;
}

.gestion-user-menu__summary:hover,
.gestion-user-menu.is-active .gestion-user-menu__summary,
.gestion-user-menu[open] .gestion-user-menu__summary {
    color: #fff;
}

.gestion-user-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    min-width: 10rem;
    padding: 0.35rem;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.gestion-user-menu__item {
    display: block;
    padding: 0.5rem 0.7rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0.35rem;
}

.gestion-user-menu__item:hover,
.gestion-user-menu__item.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.gestion-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.gestion-back {
    margin: 0 0 1rem;
}

.gestion-back__link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.gestion-back__link:hover {
    color: #fff;
}

.gestion-title {
    margin: 0 0 0.5rem;
    font-size: 1.55rem;
}

.gestion-muted {
    color: #9a9a9a;
    margin: 0 0 1.25rem;
}

.gestion-hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 2rem 0 1.5rem;
}

.gestion-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gestion-card {
    width: min(100%, 22rem);
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.gestion-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.gestion-label[hidden] {
    display: none !important;
}

.gestion-input,
.gestion-label select,
.gestion-label textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.45rem;
    background: #0d0d0d;
    color: #fff;
    padding: 0.55rem 0.65rem;
    font: inherit;
}

.gestion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    color: #fff;
    border-radius: 0.45rem;
    padding: 0.5rem 0.95rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.gestion-btn--primary {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.gestion-btn--sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    min-height: 2rem;
}

.gestion-btn--danger {
    border-color: rgba(255, 110, 110, 0.55);
    background: rgba(180, 40, 40, 0.35);
    color: #ffd0d0;
}

.gestion-btn--danger:hover {
    background: rgba(200, 50, 50, 0.55);
    border-color: rgba(255, 140, 140, 0.8);
    color: #fff;
}

.gestion-btn--edit {
    border-color: rgba(120, 190, 255, 0.5);
    background: rgba(40, 110, 180, 0.35);
    color: #d4ecff;
}

.gestion-btn--edit:hover {
    background: rgba(50, 130, 210, 0.55);
    border-color: rgba(150, 210, 255, 0.8);
    color: #fff;
}

.gestion-flash {
    padding: 0.65rem 0.85rem;
    border-radius: 0.45rem;
    margin: 0 0 1rem;
}

.gestion-flash--ok {
    background: rgba(69, 201, 138, 0.15);
    border: 1px solid rgba(69, 201, 138, 0.4);
}

.gestion-flash--error {
    background: rgba(220, 60, 60, 0.15);
    border: 1px solid rgba(220, 60, 60, 0.4);
}

.gestion-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.85rem;
}

.gestion-stats a {
    display: block;
    padding: 1.1rem;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
    color: #fff;
    text-decoration: none;
}

.gestion-stats strong {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.gestion-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.gestion-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gestion-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
}

.gestion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.gestion-table th,
.gestion-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.gestion-table th {
    background: #151515;
    color: #bdbdbd;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gestion-table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.gestion-table__actions a,
.gestion-table__actions .gestion-link-danger,
.gestion-table__actions button.gestion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    min-height: 2.1rem;
    box-sizing: border-box;
}

.gestion-table__actions a {
    border: 1px solid rgba(120, 190, 255, 0.5);
    background: rgba(40, 110, 180, 0.4);
    color: #e8f5ff;
}

.gestion-table__actions a:hover {
    background: rgba(50, 130, 210, 0.6);
    border-color: rgba(150, 210, 255, 0.85);
    color: #fff;
}

.gestion-table__actions .gestion-btn:not(.gestion-link-danger) {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    min-width: 2.1rem;
}

.gestion-table__actions .gestion-btn:not(.gestion-link-danger):hover {
    background: rgba(255, 255, 255, 0.16);
}

.gestion-table__actions form {
    margin: 0;
    display: inline;
}

.gestion-table__actions .gestion-link-danger {
    border: 1px solid rgba(255, 110, 110, 0.55);
    background: rgba(180, 40, 40, 0.4);
    color: #ffe0e0;
    text-decoration: none;
}

.gestion-table__actions .gestion-link-danger:hover {
    background: rgba(200, 50, 50, 0.6);
    border-color: rgba(255, 140, 140, 0.85);
    color: #fff;
}

.gestion-link-danger {
    appearance: none;
    border: 0;
    background: none;
    color: #ff8f8f;
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.gestion-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
}

.gestion-label--full {
    grid-column: 1 / -1;
}

.gestion-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 0 1rem;
    font-weight: 600;
}

.gestion-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin-top: 0.35rem;
}

.gestion-check-list .gestion-check {
    margin: 0;
    font-weight: 500;
}

.gestion-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.gestion-upload-warn {
    color: #ffb4b4 !important;
    font-weight: 600;
}

.gestion-manual__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.gestion-manual__section {
    margin: 0 0 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gestion-manual__section:last-child {
    border-bottom: 0;
}

.gestion-manual__section h2 {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
}

.gestion-manual__section h3 {
    margin: 1rem 0 0.45rem;
    font-size: 1.02rem;
}

.gestion-manual__section p,
.gestion-manual__section li {
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.55;
}

.gestion-manual__section ul,
.gestion-manual__section ol {
    margin: 0.4rem 0 0.75rem;
    padding-left: 1.25rem;
}

.gestion-manual__tip {
    margin: 0.75rem 0 0;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(255, 255, 255, 0.35);
    border-radius: 0 0.4rem 0.4rem 0;
}

.print-only {
    display: none;
}

@media (max-width: 720px) {
    .gestion-form__grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .gestion-top,
    .gestion-back,
    .gestion-flash,
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
        margin-bottom: 1.25rem;
    }

    .gestion-body {
        background: #fff;
        color: #111;
    }

    .gestion-main {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .gestion-manual__section {
        border-bottom: 1px solid #ccc;
        break-inside: avoid;
    }

    .gestion-manual__section p,
    .gestion-manual__section li,
    .gestion-manual__section h2,
    .gestion-manual__section h3 {
        color: #111;
    }

    .gestion-manual__tip {
        background: #f3f3f3;
        border-left-color: #666;
    }
}
