@import url('https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css');

/*
 * Sistema visual oficial del panel administrativo privado ZELIMUSI.
 * Archivo: /public_html/administrar/assets/css/admin.css
 */

:root {
    --color-white: #FFFFFF;
    --color-text: #111111;
    --color-muted: #6B6B6B;

    --color-beige: #F3E9DD;
    --color-beige-soft: #FFF8F3;
    --color-panel-bg: #FFF2EA;

    --color-coral: #FF4F5E;
    --color-coral-dark: #C92F3B;
    --color-coral-deep: #9F1F2C;
    --color-coral-soft: #FFE3DF;
    --color-coral-panel: #E63E4A;
    --color-coral-panel-mid: #C92F3B;
    --color-coral-panel-light: #FF796D;

    --color-border: rgba(17, 17, 17, .09);
    --color-border-coral: rgba(201, 47, 59, .35);

    --shadow-soft: 0 22px 64px rgba(17, 17, 17, .10);
    --shadow-card: 0 14px 36px rgba(17, 17, 17, .07);
    --shadow-coral: 0 14px 32px rgba(201, 47, 59, .30);

    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;

    --container-width: 1180px;
    --sidebar-width: 280px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    background:
    radial-gradient(circle at 12% 8%, rgba(255, 79, 94, .10), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 121, 109, .15), transparent 30%),
    linear-gradient(135deg, var(--color-beige-soft), var(--color-panel-bg));
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
    overflow-y: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    color: var(--color-text);
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Logo oficial blanco/transparente: sin caja blanca, con sombra para contraste */

.brand img,
.zl-logo,
.zl-logo img,
.login-card img,
.zl-logo-img,
.brand-logo-img {
    object-fit: contain;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.brand img,
.brand-logo-img {
    filter: drop-shadow(0 5px 14px rgba(0, 0, 0, .38));
}

.zl-logo,
.zl-logo img,
.zl-logo-img,
.login-card img {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .40));
}

/* Login */

.admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(201, 47, 59, .18), transparent 34%),
        linear-gradient(135deg, var(--color-beige-soft), var(--color-beige));
}

.login-card {
    width: min(100%, 460px);
    padding: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow-soft);
}

.login-card .brand,
.login-card .admin-brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 28px;
    text-align: center;
}

.login-card img {
    max-width: 170px;
    max-height: 96px;
}

.login-card h1,
.login-card h2 {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.1rem);
    line-height: 1.15;
}

.login-card p {
    margin: 8px 0 0;
    color: var(--color-muted);
}

/* Shell interno */

.admin-shell,
.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background:
        radial-gradient(circle at 80% 6%, rgba(255, 79, 94, .08), transparent 30%),
        linear-gradient(135deg, var(--color-beige-soft), var(--color-panel-bg));
    align-items: stretch;
}

.admin-sidebar,
.sidebar {
    position: sticky;
    top: 0;
    padding: 26px 20px;
    border-right: 1px solid rgba(159, 31, 44, .34);
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .14), transparent 28%),
        linear-gradient(180deg, #E63E4A 0%, #C92F3B 58%, #9F1F2C 100%);
    backdrop-filter: blur(16px);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    height: auto;
    max-height: none;
    align-self: stretch;
}

.admin-sidebar::before,
.sidebar::before {
    content: "🐾  🐾  🐾\A    🐾  🐾\A 🐾     🐾  🐾\A   🐾  🐾";
    white-space: pre;
    position: absolute;
    inset: 98px 12px auto auto;
    z-index: 0;
    color: rgba(255, 255, 255, .92);
    font-size: 2.35rem;
    line-height: 1.7;
    opacity: .08;
    transform: rotate(-10deg);
    pointer-events: none;
    user-select: none;
}

.admin-sidebar > *,
.sidebar > * {
    position: relative;
    z-index: 1;
}

.admin-main,
.main {
    min-height: 100vh;
}

.admin-topbar,
.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 248, 243, .90);
    backdrop-filter: blur(14px);
}

.admin-content {
    width: min(100%, var(--container-width));
    margin: 0 auto;
    padding: 32px;
    min-height: calc(100vh - 82px);
}

.admin-card,
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card {
    margin: 28px 32px;
}

.admin-card + .admin-card,
.card + .card {
    margin-top: 22px;
}

.admin-card-header,
.admin-card .hd,
.hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 248, 243, .62));
}

.admin-card-body,
.admin-card .bd,
.bd {
    padding: 26px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.admin-grid > * {
    grid-column: span 4;
}

.admin-actions,
.actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

/* Botones */

.admin-btn,
.admin-btn-primary,
.admin-btn-secondary,
.btn,
.zl-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 24px;
    border-radius: 18px;
    border: 1px solid transparent;
    font-weight: 800;
    line-height: 1.12;
    white-space: nowrap;
    text-align: center;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.admin-btn-primary,
.admin-btn,
.btn,
.zl-btn {
    color: #FFFFFF;
    background: linear-gradient(135deg, #FF4F5E, #C92F3B);
    box-shadow: var(--shadow-coral);
}

.admin-btn-secondary,
.btn.ghost,
.admin-btn.ghost {
    color: #C92F3B;
    background: #FFFFFF;
    border-color: rgba(201, 47, 59, .35);
    box-shadow: 0 9px 22px rgba(201, 47, 59, .14);
}

.admin-btn:hover,
.admin-btn-primary:hover,
.admin-btn-secondary:hover,
.btn:hover,
.zl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(201, 47, 59, .25);
}

.btn.small,
.admin-btn.small {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 14px;
    font-size: .88rem;
}

/* Tablas */

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.admin-table {
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--color-muted);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--color-beige-soft);
}

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

.admin-table img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--color-coral-soft);
    box-shadow: 0 6px 16px rgba(17, 17, 17, .08);
}

/* Formularios */

.form-group,
.zl-field {
    margin-bottom: 18px;
}

.form-label,
.zl-label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: .92rem;
    font-weight: 700;
}

.form-control,
.zl-input {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus,
.zl-input:focus {
    border-color: rgba(201, 47, 59, .58);
    box-shadow: 0 0 0 4px rgba(255, 79, 94, .13);
}

textarea.form-control,
textarea.zl-input {
    min-height: 120px;
    resize: vertical;
}

/* Mensajes flash */

.flash,
.zl-alert {
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text);
    font-weight: 600;
}

.flash-success {
    border-color: rgba(44, 160, 90, .22);
    background: #ECFDF3;
    color: #166534;
}

.flash-error,
.zl-alert-error {
    border-color: rgba(201, 47, 59, .30);
    background: var(--color-coral-soft);
    color: #9F1F2C;
}

.flash-warning {
    border-color: rgba(202, 138, 4, .22);
    background: #FFF7E6;
    color: #8A5A00;
}

.flash-info {
    border-color: rgba(201, 47, 59, .16);
    background: #FFF1EE;
    color: var(--color-text);
}

/* Badges */

.badge,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-beige-soft);
    color: var(--color-text);
    font-size: .78rem;
    font-weight: 800;
}

.badge-active {
    border-color: rgba(44, 160, 90, .22);
    background: #ECFDF3;
    color: #166534;
}

.badge-inactive {
    border-color: rgba(107, 107, 107, .18);
    background: #F3F4F6;
    color: #4B5563;
}

/* Marca, navegación y sesión */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.brand-logo-link,
.brand a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.brand img,
.brand-logo-img {
    width: 82px;
    height: auto;
    max-height: 54px;
}

.brand-text strong,
.brand strong {
    display: block;
    font-size: .94rem;
    line-height: 1.12;
    letter-spacing: .02em;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .32);
}

.brand-text span,
.brand span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .84);
    font-size: .68rem;
    line-height: 1.18;
    white-space: normal;
}

.nav {
    display: grid;
    gap: 10px;
}

.nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .22);
    color: #FFFFFF;
    background: rgba(255, 255, 255, .13);
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
    transition:
        background var(--transition),
        color var(--transition),
        box-shadow var(--transition),
        transform var(--transition),
        border-color var(--transition);
}

.nav a.active,
.nav a:hover {
    color: #C92F3B;
    background: #FFFFFF;
    border-color: rgba(255, 255, 255, .85);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
    transform: translateX(2px);
}

.nav a.active .dot,
.nav a:hover .dot {
    opacity: 1;
    background: #C92F3B;
}

.dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: currentColor;
    opacity: .76;
}

.meta {
    margin-top: 30px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 22px;
    background: rgba(80, 12, 20, .20);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .20);
    backdrop-filter: blur(12px);
}

.meta span {
    display: block;
    color: rgba(255, 255, 255, .84);
    font-size: .78rem;
}

.meta strong {
    display: block;
    margin: 4px 0 14px;
    color: #FFFFFF;
    font-size: .94rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

.meta .admin-btn,
.meta .admin-btn-secondary,
.meta .btn,
.meta a[href*="logout"] {
    width: 100%;
    min-height: 42px;
    color: #C92F3B;
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, .80);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}

.h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.1;
}

.sub {
    margin: 6px 0 0;
    color: var(--color-muted);
}

.userbox {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 32px;
}

.kpi {
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.kpi span {
    display: block;
    color: var(--color-muted);
    font-size: .82rem;
    font-weight: 700;
}

.kpi strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
}

.kpi small {
    display: block;
    margin-top: 6px;
    color: var(--color-muted);
}

/* Login alterno usado por la reconstrucción */

.zl-admin {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(201, 47, 59, .16), transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(255, 121, 109, .15), transparent 30%),
        linear-gradient(135deg, var(--color-beige-soft), var(--color-beige));
}

.zl-center {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.zl-auth-card {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: var(--shadow-soft);
}

.zl-brand {
    position: relative;
    overflow: hidden;
    padding: 44px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, .14), transparent 34%),
        linear-gradient(135deg, #E63E4A 0%, #C92F3B 55%, #9F1F2C 100%);
}

.zl-brand::before {
    content: "🐾  🐾\A    🐾  🐾\A 🐾     🐾";
    white-space: pre;
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 0;
    color: rgba(255, 255, 255, .92);
    font-size: 2.2rem;
    line-height: 1.7;
    opacity: .08;
    transform: rotate(-12deg);
    pointer-events: none;
    user-select: none;
}

.zl-brand > * {
    position: relative;
    z-index: 1;
}

.zl-logo,
.zl-logo-img {
    width: 220px;
    max-width: 80%;
    max-height: 120px;
    margin: 0 0 28px;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border: 0 !important;
}

.zl-logo img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    background: transparent !important;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .40));
}

.zl-logo-text {
    display: block;
    margin: 0 0 18px;
    color: #FFFFFF;
    font-size: 1.15rem;
    letter-spacing: .12em;
    text-shadow: 0 3px 14px rgba(0, 0, 0, .30);
}

.zl-brand h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.45rem);
    line-height: 1.08;
    color: #FFFFFF;
    text-shadow: 0 3px 14px rgba(0, 0, 0, .28);
}

.zl-brand p {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .90);
}

.zl-form {
    padding: 44px;
}

.zl-pass-wrap {
    position: relative;
}

.zl-pass-wrap .zl-input {
    padding-right: 54px;
}

.zl-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    border-radius: 14px;
    background: var(--color-coral-soft);
    color: var(--color-coral-dark);
}

/* Responsive */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .admin-topbar,
    .topbar {
        padding: 22px 24px;
    }

    .admin-content,
    .card,
    .kpis {
        margin-left: 24px;
        margin-right: 24px;
    }

    .admin-grid > * {
        grid-column: span 6;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand img,
    .brand-logo-img {
        width: 76px;
        max-height: 50px;
    }
}

@media (max-width: 768px) {
    .admin-shell,
    .app {
        grid-template-columns: 1fr;
    }

    .admin-sidebar,
    .sidebar {
        position: relative;
        border-right: 0;
        border-bottom: 1px solid rgba(159, 31, 44, .34);
        background:
            radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .14), transparent 28%),
            linear-gradient(135deg, #E63E4A 0%, #C92F3B 58%, #9F1F2C 100%);
        min-height: auto;
        height: auto;
        align-self: auto;
    }

    .admin-sidebar::before,
    .sidebar::before {
        inset: 34px 10px auto auto;
        font-size: 1.7rem;
        opacity: .07;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav a {
        min-height: 50px;
    }

    .admin-topbar,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .userbox {
        justify-content: flex-start;
    }

    .admin-content,
    .card,
    .kpis {
        margin-left: 18px;
        margin-right: 18px;
    }

    .admin-grid > * {
        grid-column: span 12;
    }

    .admin-card-header,
    .admin-card .hd,
    .hd {
        flex-direction: column;
    }

    .zl-auth-card {
        grid-template-columns: 1fr;
    }

    .zl-brand,
    .zl-form {
        padding: 32px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 14px;
    }

    .admin-login-page,
    .zl-center {
        padding: 16px;
    }

    .login-card,
    .zl-auth-card {
        border-radius: 22px;
    }

    .login-card,
    .zl-brand,
    .zl-form {
        padding: 24px;
    }

    .admin-sidebar,
    .sidebar {
        padding: 18px 14px;
    }

    .brand {
        align-items: center;
        gap: 9px;
        padding: 0;
    }

    .brand img,
    .brand-logo-img {
        width: 68px;
        max-height: 46px;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .admin-topbar,
    .topbar {
        padding: 18px;
    }

    .admin-content,
    .card,
    .kpis {
        margin: 16px;
    }

    .admin-card-header,
    .admin-card-body,
    .admin-card .hd,
    .admin-card .bd,
    .hd,
    .bd {
        padding: 18px;
    }

    .admin-actions,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-btn,
    .admin-btn-primary,
    .admin-btn-secondary,
    .btn,
    .zl-btn {
        width: 100%;
        min-height: 48px;
        padding: 13px 18px;
    }

    .kpis {
        grid-template-columns: 1fr;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px;
    }

    .zl-logo,
    .zl-logo-img {
        width: 180px;
        max-height: 110px;
    }
}

/* ==================================================
   Sistema común de módulos internos
   ================================================== */

.bx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.08em;
}

/* Botones compactos con iconos */

.icon-btn,
.icon-btn-primary,
.icon-btn-secondary,
.icon-btn-danger,
.icon-btn-muted {
    min-width: 38px;
    min-height: 38px;
    max-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        opacity var(--transition);
}

.icon-btn i,
.icon-btn-primary i,
.icon-btn-secondary i,
.icon-btn-danger i,
.icon-btn-muted i {
    font-size: 1.12rem;
    line-height: 1;
}

.icon-btn:has(i:only-child),
.icon-btn-primary:has(i:only-child),
.icon-btn-secondary:has(i:only-child),
.icon-btn-danger:has(i:only-child),
.icon-btn-muted:has(i:only-child) {
    width: 38px;
    height: 38px;
    padding: 0;
}

.icon-btn,
.icon-btn-primary {
    color: #FFFFFF;
    background: linear-gradient(135deg, #FF4F5E, #C92F3B);
    border-color: rgba(201, 47, 59, .22);
    box-shadow: 0 8px 18px rgba(201, 47, 59, .22);
}

.icon-btn-secondary {
    color: #C92F3B;
    background: #FFFFFF;
    border-color: rgba(201, 47, 59, .35);
    box-shadow: 0 6px 16px rgba(201, 47, 59, .10);
}

.icon-btn-danger {
    color: #FFFFFF;
    background: linear-gradient(135deg, #D92D20, #A61B12);
    border-color: rgba(166, 27, 18, .28);
    box-shadow: 0 8px 18px rgba(166, 27, 18, .20);
}

.icon-btn-muted {
    color: #4B5563;
    background: #F9FAFB;
    border-color: rgba(107, 114, 128, .24);
    box-shadow: 0 5px 14px rgba(17, 17, 17, .06);
}

.icon-btn:hover,
.icon-btn-primary:hover,
.icon-btn-secondary:hover,
.icon-btn-danger:hover,
.icon-btn-muted:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(17, 17, 17, .14);
}

.icon-btn:disabled,
.icon-btn-primary:disabled,
.icon-btn-secondary:disabled,
.icon-btn-danger:disabled,
.icon-btn-muted:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}

/* Grupos de acciones */

.table-actions,
.module-actions,
.action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions {
    justify-content: flex-end;
    gap: 7px;
    min-width: max-content;
}

.cell-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Botón principal de módulo */

.module-primary-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 16px;
    border: 1px solid rgba(201, 47, 59, .20);
    color: #FFFFFF;
    background: linear-gradient(135deg, #FF4F5E, #C92F3B);
    box-shadow: 0 10px 22px rgba(201, 47, 59, .22);
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.module-primary-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(201, 47, 59, .25);
}

.module-primary-action i {
    font-size: 1.12rem;
}

/* Tablas administrativas compactas */

.admin-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 47, 59, .34) rgba(255, 248, 243, .70);
}

.admin-table {
    font-size: .92rem;
}

.admin-table th,
.admin-table td {
    padding: 11px 14px;
}

.admin-table th {
    font-size: .76rem;
    line-height: 1.2;
}

.admin-table td {
    line-height: 1.35;
}

.admin-table tbody tr {
    transition: background var(--transition);
}

.admin-table tbody tr:hover {
    background: rgba(255, 248, 243, .70);
}

.cell-muted {
    color: var(--color-muted);
    font-size: .86rem;
}

.cell-strong {
    color: var(--color-text);
    font-weight: 800;
}

.cell-nowrap {
    white-space: nowrap;
}

.table-thumb {
    width: 46px;
    height: 46px;
    display: inline-block;
    overflow: hidden;
    border-radius: 13px;
    object-fit: cover;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .84), transparent 32%),
        linear-gradient(135deg, #FFF0EC, #FFE3DF);
    border: 1px solid rgba(201, 47, 59, .12);
    box-shadow: 0 5px 14px rgba(17, 17, 17, .07);
}

/* Badges y estados */

.status-badge,
.status-active,
.status-inactive,
.status-stock,
.status-warning,
.status-muted {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-badge {
    color: #4B5563;
    background: #F9FAFB;
    border-color: rgba(107, 114, 128, .18);
}

.status-active,
.status-stock {
    color: #166534;
    background: #ECFDF3;
    border-color: rgba(22, 101, 52, .18);
}

.status-inactive,
.status-muted {
    color: #4B5563;
    background: #F3F4F6;
    border-color: rgba(75, 85, 99, .18);
}

.status-warning {
    color: #8A5A00;
    background: #FFF7E6;
    border-color: rgba(202, 138, 4, .22);
}

/* Cabeceras internas de módulo */

.module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.module-title {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    font-weight: 800;
    line-height: 1.12;
}

.module-description {
    max-width: 680px;
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: .93rem;
    line-height: 1.45;
}

.module-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

/* Cards compactas */

.module-card-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.module-card {
    grid-column: span 4;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 26px rgba(17, 17, 17, .06);
}

.module-card-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.module-card-description {
    margin: 7px 0 0;
    color: var(--color-muted);
    font-size: .88rem;
    line-height: 1.45;
}

.module-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

/* Formularios reutilizables */

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.form-grid > .form-group,
.form-grid > .zl-field {
    grid-column: span 6;
    margin-bottom: 0;
}

.form-grid > .form-group.full,
.form-grid > .zl-field.full,
.form-grid > .form-section {
    grid-column: 1 / -1;
}

.form-help {
    margin-top: 6px;
    color: var(--color-muted);
    font-size: .78rem;
    line-height: 1.35;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
}

.form-section {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 248, 243, .62);
}

/* Responsive para sistema común */

@media (max-width: 1024px) {
    .module-card {
        grid-column: span 6;
    }

    .module-header {
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .module-header {
        flex-direction: column;
    }

    .module-toolbar,
    .module-actions {
        justify-content: flex-start;
    }

    .form-grid > .form-group,
    .form-grid > .zl-field {
        grid-column: 1 / -1;
    }

    .module-card {
        grid-column: 1 / -1;
    }

    .table-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .module-primary-action,
    .form-actions .admin-btn,
    .form-actions .admin-btn-primary,
    .form-actions .admin-btn-secondary,
    .form-actions .btn,
    .form-actions .zl-btn {
        width: 100%;
    }

    .icon-btn,
    .icon-btn-primary,
    .icon-btn-secondary,
    .icon-btn-danger,
    .icon-btn-muted {
        min-height: 38px;
    }

    .module-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .table-thumb {
        width: 44px;
        height: 44px;
    }
}


/* Corrección global: sidebar continuo en páginas con contenido largo */
html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    overflow-y: auto;
}

.admin-shell,
.app {
    min-height: 100vh;
    display: grid;
    align-items: stretch;
}

.admin-sidebar,
.sidebar {
    min-height: 100vh;
    height: auto;
    max-height: none;
    align-self: stretch;
}

.admin-main,
.main {
    min-height: 100vh;
}

.admin-content {
    min-height: calc(100vh - 82px);
}

@media (max-width: 768px) {
    .admin-shell,
    .app {
        min-height: 100vh;
        display: block;
        align-items: stretch;
    }

    .admin-sidebar,
    .sidebar {
        position: relative;
        top: auto;
        min-height: auto;
        height: auto;
        max-height: none;
        align-self: auto;
    }

    .admin-main,
    .main {
        min-height: 100vh;
    }

    .admin-content {
        min-height: auto;
    }
}
