﻿/* ========= ADMIN THEME TOKENS ========= */
:root {
    --admin-bg: #f3f4f6;
    --admin-card-bg: #f8fafc;
    --admin-border: #e5e7eb;
    --admin-border-soft: #eaeaea;
    --admin-text: #111827;
    --admin-text-muted: #6b7280;
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-success: #16a34a;
    --admin-danger: #dc2626;
}


/* ========= ADMIN BUTTONS ========= */

/* base admin button */
.admin-theme .btn-admin {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

/* primary (blue) */
.admin-theme .btn-admin-primary {
    background: var(--admin-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

    .admin-theme .btn-admin-primary:hover {
        background: var(--admin-primary-dark);
        transform: translateY(-1px);
    }

/* success (green) */
.admin-theme .btn-admin-success {
    background: var(--admin-success);
    color: #fff;
}

/* danger (red) */
.admin-theme .btn-admin-danger {
    background: var(--admin-danger);
    color: #fff;
}

/* subtle / ghost */
.admin-theme .btn-admin-ghost {
    background: transparent;
    color: var(--admin-primary);
}


/* ========= ADMIN FILTERS ========= */
.admin-theme .filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 10px;
}

    .admin-theme .filters-row .filter-field {
        flex: 1 1 220px;
        display: flex;
        flex-direction: column;
    }
    
    .admin-theme .filters-row label {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--admin-text-muted);
    }

    .admin-theme .filters-row .form-control {
        border-radius: 8px;
        border: 1px solid #d1d5db;
        font-size: 0.9rem;
        padding: 6px 10px;
        height: 38px;
        box-shadow: none;

    }

/* ========= ADMIN TABLES ========= */
.admin-theme .table-admin-container {
    background: var(--admin-card-bg);
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    overflow: auto;
    max-height: 70vh;
    margin-top: 1.5rem;
}

.admin-theme .table-admin {
    border-collapse: collapse;
    width: 100%;
}

    /* header */
    .admin-theme .table-admin thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #f6f8fa;
        color: #333;
        font-weight: 600;
        padding: 14px 16px;
        border-bottom: 1px solid #e7e7e7;
        text-transform: uppercase;
        font-size: 0.85rem;
    }

    /* body */
    .admin-theme .table-admin tbody td {
        padding: 14px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
        vertical-align: middle;
    }

        /* vertical separators between columns only */
        .admin-theme .table-admin thead th:not(:last-child),
        .admin-theme .table-admin tbody td:not(:last-child) {
            border-right: 1px solid var(--admin-border-soft);
        }



/* ========= ADMIN BADGES ========= */
.admin-theme .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.admin-theme .badge-success {
    background: var(--admin-success);
}

.admin-theme .badge-danger {
    background: var(--admin-danger);
}

.admin-theme .badge-warning {
    background: #facc15;
    color: #000;
}

.admin-theme .badge-secondary {
    background: #6b7280;
}

/* ========= ADMIN CARDS PAGINA ========= */

.admin-theme .admin-card {
    background: var(--admin-card-bg);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 16px 20px 18px;
    min-height: 100vh;
    -ms-flex-direction: inherit;
    -webkit-flex-direction: inherit;
    flex-direction: inherit;
}

.admin-theme .admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

    .admin-theme .admin-card-header h4 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--admin-text);
    }

.admin-theme .admin-card-body {
    margin-top: 4px;
}

.admin-theme .empty-state {
    padding: 16px;
    text-align: center;
    color: var(--admin-text-muted);
    font-size: 0.95rem;
}

/* ========= ADMIN CARDS BLANCO ========= */

.admin-theme .white-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 16px 20px 18px;
    background: white
}

    .admin-theme .white-card > h4 {
        margin-bottom: 12px;
        font-weight: 600;
    }





/* ========= ADMIN BUTTON EXTRAS ========= */

.admin-theme .btn-admin-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.admin-theme .btn-admin-primary:hover {
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.45);
}

.admin-theme .btn-admin-danger:hover {
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.45);
}

.admin-theme .btn-admin-ghost:hover {
    background: #eff6ff;
}

/* let buttons not look broken if inside Bootstrap .btn by mistake */
.admin-theme .btn-admin.btn {
    /* remove any bootstrap .btn interference */
    border: none;
}


/* ========= ADMIN TABLE REFINEMENTS ========= */

/* remove last row bottom border */
.admin-theme .table-admin tbody tr:last-child td {
    border-bottom: none;
}

/* hover row */
.admin-theme .table-admin tbody tr:hover {
    background: #f9fbff;
}

/* first column numeric alignment (optional) */
.admin-theme .table-admin tbody td:first-child {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/**************************************************************
 *   GENERIC ADMIN MODAL SYSTEM
 **************************************************************/

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.admin-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 1300px !important;
    width: 90% !important; /* or 100% on mobile */
    max-height: 95vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #888;
    margin: 0; /* important: no auto margins */
}

@keyframes adminModalPop {
    0% {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Header */
.admin-modal-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e0e5ea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
}

.admin-modal-close {
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #475569;
    transition: 0.15s ease;
}

    .admin-modal-close:hover {
        color: #1e293b;
    }

/* Body */
.admin-modal-body {
    padding: 15px 20px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Footer */
.admin-modal-footer {
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/**************************************************************
 * BUTTONS FOR MODAL FOOTERS
 **************************************************************/

.admin-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.18s;
}

.admin-btn-primary {
    background: #2563eb;
    color: white;
}

    .admin-btn-primary:hover {
        background: #1d4ed8;
    }

.admin-btn-danger {
    background: #dc2626;
    color: white;
}

    .admin-btn-danger:hover {
        background: #b91c1c;
    }

.admin-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

    .admin-btn-secondary:hover {
        background: #d1d5db;
    }



/* ========= RESUMEN VENTAS – KPIs ========= */

.admin-theme .resumen-kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-theme .resumen-kpi-card {
    flex: 1 1 220px;
    border-radius: 10px;
    border: 1px solid var(--admin-border-soft);
    background: #f9fafb;
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.admin-theme .resumen-kpi-label {
    color: var(--admin-text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.admin-theme .resumen-kpi-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--admin-text);
}

.admin-theme .resumen-kpi-card-total {
    border-color: rgba(22, 163, 74, 0.35);
    background: #ecfdf3;
}

    .admin-theme .resumen-kpi-card-total .resumen-kpi-value {
        color: var(--admin-success);
    }