:root {
    --wildata-navy: #0D2137;
    --wildata-accent: #1D9E75;
    --wildata-amber: #C9971C;
}

/* ── NAVBAR: brand logo ──────────────────────────────────────────────────── */
.navbar-logo {
    height: 30px;
    width: auto;
    border-radius: 4px;
}

.navbar-username {
    max-width: 180px;
    display: inline-block;
}

/* ── GLOBAL: remove Bootstrap container max-width cap ────────────────────── */
/* Bootstrap's .container applies max-width (1140px at xl, 1320px at xxl).
   With a 260px fixed sidebar this creates dead space on wide screens. */
.container.flex-grow-1 {
    max-width: none;
}

@media (min-width: 1400px) {
    .container.flex-grow-1 {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── SIDEBAR SHELL ───────────────────────────────────────────────────────── */
.sidebar-wildata {
    width: 260px;
    min-width: 260px;
    background-color: var(--wildata-navy);
}

@media (min-width: 768px) {
    .sidebar-wildata {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: hidden;
    }
}

.sidebar-wildata .nav {
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: nowrap;   /* .nav (Bootstrap) defaults to wrap — with flex-direction:
                            column that spills overflow into a second column instead
                            of scrolling vertically once content exceeds the sidebar's
                            fixed height (e.g. Contabilidad expanded) */
    min-height: 0;   /* critical: lets flex child shrink below content height */
}

/* ── SIDEBAR LINKS (base) ────────────────────────────────────────────────── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
    font-size: 1rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar-link.active {
    background-color: rgba(29, 158, 117, 0.15);
    border-left-color: var(--wildata-accent);
    color: #ffffff;
    font-weight: 600;
}

/* ── CONTABILIDAD GROUP TRIGGER ──────────────────────────────────────────── */
.sidebar-group-trigger {
    cursor: pointer;
    user-select: none;
}

.sidebar-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar-group-trigger[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(-180deg);
}

.sidebar-group-trigger[aria-expanded="true"]:not(.active) {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.04);
}

/* ── CONTABILIDAD SUBMENU ────────────────────────────────────────────────── */
.sidebar-submenu {
    background-color: rgba(0, 0, 0, 0.18);
}

.sidebar-submenu .sidebar-link {
    padding-left: 2.5rem;
    font-size: 0.875rem;
    border-left-width: 2px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-submenu .sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-submenu .sidebar-link.active {
    color: #ffffff;
    font-weight: 600;
    background-color: rgba(29, 158, 117, 0.12);
    border-left-color: var(--wildata-accent);
}

/* ── SIDEBAR USER FOOTER ─────────────────────────────────────────────────── */
.sidebar-user-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.85);   /* baseline: covers any Bootstrap cascade */
}

.sidebar-user-avatar {
    font-size: 1.75rem;
    color: rgba(255, 255, 255, 0.75);
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-logout-btn {
    color: #ffffff;
    border: 1px solid var(--wildata-accent);
    background: transparent;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-logout-btn:hover {
    background-color: var(--wildata-accent);
    color: #ffffff;
    border-color: var(--wildata-accent);
}

/* ── MISC ────────────────────────────────────────────────────────────────── */
.sidebar-link-disabled {
    color: rgba(255, 255, 255, 0.35);
    cursor: default;
}

.sidebar-badge {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.45rem;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar-wildata {
        width: 100%;
        min-width: 0;
    }
}

/* ── CATÁLOGO: HEADER ────────────────────────────────────────────────────── */
.catalog-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ── CATÁLOGO: PILLS DE CATEGORÍA ────────────────────────────────────────── */
.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-pill:hover {
    background-color: #e9ecef;
    color: #212529;
}

.category-pill.active {
    background-color: var(--wildata-amber);
    color: #ffffff;
    border-color: var(--wildata-amber);
}

/* ── CATÁLOGO: TARJETA DE SERVICIO ───────────────────────────────────────── */
.service-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.service-card-nombre {
    font-weight: 700;
    color: var(--wildata-navy);
}

.service-card-precio {
    font-weight: 700;
    color: var(--wildata-accent);
    white-space: nowrap;
}

.service-card-badge {
    display: inline-block;
    background-color: rgba(29, 158, 117, 0.12);
    color: var(--wildata-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.service-card-badge-inactivo {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.service-card-actions .btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.375rem;
}

/* ── MODALES DE FORMULARIO (patrón compartido: Nuevo Cliente y los que
   sigan después) ─────────────────────────────────────────────────────── */
.modal-form-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.3rem;
}

.btn-brand {
    background-color: var(--wildata-accent);
    border-color: var(--wildata-accent);
    color: #ffffff;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: #17845f;
    border-color: #17845f;
    color: #ffffff;
}

/* ── AUTH PAGES (login / bloqueo de axes) ────────────────────────────────── */
body.auth-page {
    background-color: #F4F6F8;
    min-height: 100vh;
}

body.auth-page .container .alert {
    max-width: 380px;
    margin: 0 auto 1rem;
    border-radius: 0.5rem;
}

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

.auth-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 3.5rem 3rem;
    width: 100%;
    max-width: 520px;
}

.auth-logo-frame {
    width: 120px;
    height: 120px;
    background-color: var(--wildata-navy);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-logo {
    display: block;
    max-height: 72px;
    max-width: 72px;
    margin: 0;
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--wildata-navy);
    margin-bottom: 0.35rem;
}

.auth-slogan {
    text-align: center;
    font-size: 0.85rem;
    color: var(--wildata-accent);
    margin-bottom: 1.5rem;
}

.auth-icon {
    display: block;
    text-align: center;
    font-size: 2rem;
    color: var(--wildata-amber);
    margin-bottom: 1rem;
}

.auth-input-group {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}

.auth-input {
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
}

.auth-input-has-toggle {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #adb5bd;
    padding: 0.35rem;
    line-height: 1;
}

.auth-password-toggle:hover {
    color: var(--wildata-navy);
}

.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 1.5rem;
    margin-bottom: 0;
}
