/* Explain: Styles for UI components like buttons, navigation, badges, and admin elements. - */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 0;
    color: var(--text-color);
    transition: color 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0.25rem;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.editorial-border {
    border: 1px solid var(--border-color);
}

.btn-primary-cedhf,
.btn-secondary-cedhf,
.btn-success-cedhf,
.btn-warning-cedhf {
    border-radius: 0.375rem;
    min-height: 3rem;
    padding-inline: 1.3rem;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary-cedhf {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(18, 60, 140, 0.18);
}

.btn-primary-cedhf:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(18, 60, 140, 0.23);
}

.btn-secondary-cedhf {
    background: #ffffff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary-cedhf:hover {
    background: var(--primary-soft);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.btn-success-cedhf {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #ffffff;
}

.btn-success-cedhf:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-warning-cedhf {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--charcoal-color);
}

.btn-warning-cedhf:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
}

.section-rule {
    border-top: 1px solid var(--border-color);
}

.dashboard-shell {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-shell {
        grid-template-columns: 17rem minmax(0, 1fr);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

.status-badge-blue {
    background: var(--primary-soft);
    color: var(--primary-color);
}

.status-badge-green {
    background: var(--secondary-soft);
    color: var(--secondary-color);
}

.status-badge-gold {
    background: var(--accent-soft);
    color: #7A5700;
}

.status-badge-red {
    background: #FEE4E2;
    color: var(--danger-color);
}

.payment-option.is-selected {
    border-color: var(--primary-color);
    background: var(--primary-soft);
    box-shadow: 0 18px 38px rgba(18, 60, 140, 0.12);
}

.payment-option.is-selected .status-badge {
    background: var(--primary-color);
    color: #ffffff;
}

.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.auth-gate-card {
    box-shadow: 0 28px 70px rgba(21, 25, 34, 0.14);
}

.auth-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 80rem;
    margin: 1.5rem auto 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    box-shadow: 0 12px 28px rgba(21, 25, 34, 0.06);
}

.auth-session-bar strong {
    color: var(--primary-color);
}

@media (max-width: 640px) {
    .auth-session-bar {
        align-items: flex-start;
        flex-direction: column;
        margin-inline: 1.25rem;
    }
}

.admin-sidebar {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.admin-sidebar::-webkit-scrollbar {
    width: 0.45rem;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: 999px;
}

.admin-sidebar a {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.admin-sidebar a:hover {
    transform: translateX(2px);
}

[data-admin-dashboard] .table th {
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

[data-admin-dashboard] .modal-box {
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .btn,
    .btn-primary-cedhf,
    .btn-secondary-cedhf,
    .btn-success-cedhf,
    .btn-warning-cedhf {
        min-height: 2.9rem;
        height: auto;
        white-space: normal;
        line-height: 1.25;
        text-align: center;
        touch-action: manipulation;
    }

    .btn-xs {
        min-height: 2.5rem;
        padding-inline: 0.85rem;
        font-size: 0.78rem;
    }

    .nav-link,
    .mobile-menu-link {
        min-height: 3rem;
    }

    .mobile-menu-link {
        display: flex;
        align-items: center;
    }

    .input,
    .select,
    .textarea,
    .file-input {
        min-height: 3rem;
        font-size: 16px;
    }

    .textarea {
        line-height: 1.45;
    }

    .modal {
        padding: 0.75rem;
    }

    .modal-box {
        width: min(100%, calc(100vw - 1.5rem));
        max-height: calc(100dvh - 1.5rem);
    }

    .modal-box section {
        scroll-margin-top: 1rem;
    }

    .table {
        width: 100%;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0 0.75rem;
        background: transparent;
    }

    .table thead {
        display: none;
    }

    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        border: 1px solid var(--border-color);
        border-radius: 0.375rem;
        background: var(--surface-color);
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(21, 25, 34, 0.05);
    }

    .table td {
        border-bottom: 1px solid var(--border-color);
        padding: 0.85rem 1rem;
        text-align: left;
        white-space: normal;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .table td[colspan]::before {
        content: '';
        display: none;
    }

    .overflow-x-auto {
        overflow-x: visible;
    }

    .admin-sidebar {
        max-height: none;
    }
}