﻿/* --- VARIABLES DE DISEÑO --- */
:root {
    --bg-base: #F9F8F6;
    --primary: #6B705C;
    --primary-light: #A5A58D;
    --accent: #CB997E;
    --text-dark: #333333;
    --text-light: #666666;
    --sidebar-bg: #2D3027;
    --sidebar-hover: #3A3E33;
    --font-body: 'Montserrat', sans-serif;
    --font-headings: 'Lora', serif;
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Botón de acento reutilizable para acciones destacadas del admin (ej. "Vista previa en vivo",
   "Rellenar con contenido de ejemplo") — para no depender de las clases genéricas "btn/btn-outline"
   de Bootstrap, que en el panel de admin caen en su aspecto por defecto (gris, sin personalidad). */
.btn-admin-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 30px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(107, 112, 92, 0.3);
    transition: var(--transition);
}
.btn-admin-accent i { font-size: 1.15rem; }
.btn-admin-accent:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(107, 112, 92, 0.4);
    color: #fff;
}

/* --- ESTRUCTURA PRINCIPAL --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* === SIDEBAR (BARRA LATERAL) === */
.admin-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    flex-shrink: 0;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-main-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-right: 12px;
    transition: var(--transition);
}

.sidebar-logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    transition: var(--transition);
}

    .sidebar-logo-badge .sidebar-logo-full {
        display: block;
        height: 30px;
        width: auto;
    }

    .sidebar-logo-badge .sidebar-logo-mark {
        display: none;
        height: 34px;
        width: auto;
    }

.sidebar-title-container {
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s ease;
}

.sidebar-subtitle {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--accent);
}

.close-sidebar {
    display: none;
    margin-left: auto;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Esto era lo que ocultaba los tooltips */
}

    .sidebar-nav::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.1);
        border-radius: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

.nav-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin: 20px 20px 10px;
    font-weight: 600;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar-nav ul {
    list-style: none;
}

    .sidebar-nav ul li a {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        gap: 12px;
        font-size: 0.95rem;
        color: #c0c0c0;
        transition: all 0.2s ease;
        border-left: 3px solid transparent;
        position: relative;
        white-space: nowrap;
    }

        .sidebar-nav ul li a i {
            font-size: 1.3rem;
            flex-shrink: 0;
        }

        .sidebar-nav ul li a:hover, .sidebar-nav ul li a.active {
            background-color: var(--sidebar-hover);
            color: white;
            border-left-color: var(--accent);
        }

.nav-text {
    transition: opacity 0.2s ease;
}


/* =========================================
   ESTADO COLAPSADO DE LA SIDEBAR (DESKTOP)
   ========================================= */
.admin-sidebar.collapsed {
    width: 80px;
}

    /* SOLUCIÓN AL TOOLTIP: Permitimos que el contenido salga fuera del contenedor al colapsar */
    .admin-sidebar.collapsed .sidebar-nav {
        overflow: visible;
    }

    .admin-sidebar.collapsed .sidebar-title-container,
    .admin-sidebar.collapsed .nav-heading,
    .admin-sidebar.collapsed .nav-text {
        opacity: 0;
        visibility: hidden;
        width: 0;
    }

    .admin-sidebar.collapsed .sidebar-header {
        justify-content: center;
        padding: 0;
    }

    .admin-sidebar.collapsed .sidebar-main-icon {
        margin-right: 0;
        font-size: 2.2rem;
    }

    .admin-sidebar.collapsed .sidebar-logo-badge {
        margin-right: 0;
    }

        .admin-sidebar.collapsed .sidebar-logo-badge .sidebar-logo-full {
            display: none;
        }

        .admin-sidebar.collapsed .sidebar-logo-badge .sidebar-logo-mark {
            display: block;
        }

    .admin-sidebar.collapsed ul li a {
        justify-content: center;
        padding: 15px 0;
    }

        /* Tooltips CSS puros */
        .admin-sidebar.collapsed ul li a::after {
            content: attr(data-title);
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            background-color: #1a1b15;
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: all 0.2s ease;
            z-index: 9999; /* Z-index altísimo para que pase por encima de todo */
            margin-left: 15px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }

        .admin-sidebar.collapsed ul li a::before {
            content: '';
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            border-width: 5px;
            border-style: solid;
            border-color: transparent #1a1b15 transparent transparent;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            margin-left: 5px;
            z-index: 9999;
        }

        /* Efecto hover del tooltip */
        .admin-sidebar.collapsed ul li a:hover::after {
            opacity: 1;
            visibility: visible;
            margin-left: 5px;
        }

        .admin-sidebar.collapsed ul li a:hover::before {
            opacity: 1;
            visibility: visible;
            margin-left: -5px;
        }


/* === ÁREA PRINCIPAL === */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- HEADER SUPERIOR (STICKY) --- */
.admin-header {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

    .toggle-sidebar:hover {
        color: var(--primary);
    }

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-light);
}

    .breadcrumb strong {
        color: var(--text-dark);
        font-weight: 600;
    }

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-view-site-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(107, 112, 92, 0.08);
    color: var(--primary, #6B705C);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

    .header-view-site-btn i {
        font-size: 1.1rem;
    }

    .header-view-site-btn:hover {
        background: var(--primary, #6B705C);
        color: #fff;
    }

@media (max-width: 480px) {
    .header-view-site-text {
        display: none;
    }
}

/* DROPDOWN USUARIO HEADER */
.admin-user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px;
}

.avatar {
    width: 35px;
    height: 35px;
    background-color: var(--primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.username {
    font-weight: 500;
    font-size: 0.95rem;
}

.dropdown-menu {
    position: absolute;
    top: 130%;
    right: 0;
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-radius: var(--radius);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

    .dropdown-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-menu a, .logout-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        font-size: 0.95rem;
        color: var(--text-dark);
        text-decoration: none;
        cursor: pointer;
        background: transparent;
        border: none;
        width: 100%;
        text-align: left;
    }

        .dropdown-menu a:hover {
            background-color: var(--bg-base);
            color: var(--primary);
        }

    .dropdown-menu hr {
        border: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        margin: 5px 0;
    }

.logout-btn {
    color: #d9534f !important;
    font-weight: 600;
}

    .logout-btn:hover {
        background-color: #fdf0ef !important;
        color: #c9302c !important;
    }

/* --- CONTENIDO PRINCIPAL --- */
.admin-content {
    padding: 30px;
    flex: 1;
}

/* Utilidades para las páginas hijas */
.card-panel {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.03);
}

.page-title {
    font-family: var(--font-headings);
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 25px;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 260px;
    }

        .admin-sidebar.active {
            transform: translateX(0);
        }

    .close-sidebar {
        display: block;
    }

    .admin-sidebar.collapsed ul li a::after, .admin-sidebar.collapsed ul li a::before {
        display: none;
    }

    .admin-header {
        padding: 0 20px;
    }

    .admin-content {
        padding: 20px;
    }

    .breadcrumb {
        display: none;
    }
}
/* =========================================================
   ESTILOS PANEL DE ADMINISTRACIÓN (TABLAS Y CRUD)
   ========================================================= */

/* Tarjetas base del Admin */
.admin-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

/* Cabecera superior de la tabla */
.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Tabla de datos elegante */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

    .admin-table th {
        text-align: left;
        padding: 15px;
        background-color: #f8f9fa;
        color: var(--text-light);
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-bottom: 2px solid rgba(0,0,0,0.05);
    }

    .admin-table td {
        padding: 15px;
        vertical-align: middle;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        color: var(--text-dark);
        font-size: 0.95rem;
    }

    .admin-table tr:hover {
        background-color: #fafafa;
    }

/* Etiquetas (Badges) para Cliente/Empleado */
.admin-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-right: 5px;
}

.badge-cliente {
    background-color: #e3f2fd;
    color: #0275d8;
}

.badge-empleado {
    background-color: #fdf0ef;
    color: #d9534f;
}

.badge-none {
    background-color: #f0f0f0;
    color: #999;
}

/* Botones de acción en la tabla */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    transition: color 0.3s;
    margin-right: 10px;
}

    .action-btn.edit:hover {
        color: var(--primary);
    }

    .action-btn.delete:hover {
        color: #d9534f;
    }

/* Buscador */
.admin-search-box {
    display: flex;
    gap: 10px;
}

    .admin-search-box input {
        width: 300px;
    }

/* Interruptor (Toggle Switch) para formularios */
.custom-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

    .custom-switch input[type="checkbox"] {
        width: 40px;
        height: 20px;
        appearance: none;
        background: #ddd;
        border-radius: 20px;
        position: relative;
        outline: none;
        cursor: pointer;
        transition: 0.3s;
    }

        .custom-switch input[type="checkbox"]::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            transition: 0.3s;
        }

        .custom-switch input[type="checkbox"]:checked {
            background: var(--primary);
        }

            .custom-switch input[type="checkbox"]:checked::after {
                left: 22px;
            }
/* =========================================================
   23. ESTILOS DEL PANEL DE ADMINISTRACIÓN (CRUD & MODAL) - CORREGIDO
   ========================================================= */

/* Inputs y Validaciones Admin */
.admin-card .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: 0.3s;
    box-sizing: border-box; /* IMPORTANTE: Para que el padding no rompa el ancho */
}

    .admin-card .form-control:focus {
        border-color: var(--primary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(107, 112, 92, 0.1);
    }

    .admin-card .form-control[readonly] {
        background-color: #f5f5f5;
        color: #777;
        cursor: not-allowed;
    }

/* Clases de validación */
.req-star {
    color: #d9534f;
    margin-left: 4px;
    font-weight: bold;
}

.is-invalid {
    border-color: #d9534f !important;
    background-color: #fffafa !important;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.1) !important;
}

.invalid-feedback {
    display: none;
    color: #d9534f;
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

.is-invalid + .invalid-feedback {
    display: block;
}

/* Grid para el formulario (Asegura alineación) */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start; /* Alinea los elementos arriba */
}

/* Banners de error */
.form-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

    .form-alert.error {
        background-color: #fdf0ef;
        color: #d9534f;
        border: 1px solid rgba(217, 83, 79, 0.2);
    }

    .form-alert.success {
        background-color: #f4fcf6;
        color: var(--primary);
        border: 1px solid rgba(107, 112, 92, 0.2);
    }

/* Barra inferior adhesiva (Sticky Footer) */
.admin-sticky-footer {
    position: sticky;
    bottom: -1px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: center;
    z-index: 100;
}

/* Modal Personalizado de Confirmación */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

    .custom-modal-overlay.active {
        display: flex;
        opacity: 1;
    }

.custom-modal-content {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.custom-modal-overlay.active .custom-modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 4rem;
    color: #d9534f;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-family: var(--font-headings);
}

.modal-text {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Badges y Switches */
.admin-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-right: 5px;
}

.badge-cliente {
    background-color: #e3f2fd;
    color: #0275d8;
}

.badge-empleado {
    background-color: #fdf0ef;
    color: #d9534f;
}

.badge-none {
    background-color: #f0f0f0;
    color: #999;
}

.custom-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

    .custom-switch input[type="checkbox"] {
        width: 40px;
        height: 20px;
        appearance: none;
        background: #ddd;
        border-radius: 20px;
        position: relative;
        outline: none;
        cursor: pointer;
        transition: 0.3s;
    }

        .custom-switch input[type="checkbox"]::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            transition: 0.3s;
        }

        .custom-switch input[type="checkbox"]:checked {
            background: var(--primary);
        }

            .custom-switch input[type="checkbox"]:checked::after {
                left: 22px;
            }

/* Enlaces de ordenación en las cabeceras de tabla */
.sort-link {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

    .sort-link:hover {
        color: var(--primary);
    }

    .sort-link i {
        font-size: 0.85rem;
    }
/* =========================================================
   24. MEJORAS UI ADMIN (BANNERS, STICKY, SORTING)
   ========================================================= */

/* Banner de Error Superior (Persistente) */
.form-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

    .form-alert.error {
        background-color: #fdf0ef;
        color: #d9534f;
        border: 1px solid rgba(217, 83, 79, 0.2);
    }

    .form-alert.success {
        background-color: #f4fcf6;
        color: var(--primary);
        border: 1px solid rgba(107, 112, 92, 0.2);
    }

/* Barra inferior adhesiva (Sticky Footer) para botones de guardado */
.admin-sticky-footer {
    position: sticky;
    bottom: -1px; /* Para asegurar que toque el fondo */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: center; /* Centrado como pediste */
    z-index: 100;
}

/* Enlaces de ordenación en las cabeceras de tabla */
.sort-link {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

    .sort-link:hover {
        color: var(--primary);
    }

    .sort-link i {
        font-size: 0.85rem;
    }
/* =========================================================
   ESTILOS PANEL DE ADMINISTRACIÓN (PEDIDOS / VENTAS)
   ========================================================= */

/* Contenedores y Layout */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-card-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-card-panel-highlight {
    border-left: 4px solid var(--accent, #CB997E);
}

/* Filtros */
.admin-filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.admin-filter-group {
    flex: 1;
}

.admin-filter-label {
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
    color: #444;
}

/* Tablas (GridView y Repeater) */
.admin-grid {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-grid-header th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #ddd;
}

.admin-grid-row td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-grid-empty {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Elementos visuales (Badges, Botones, Textos) */
.badge-estado {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #eee;
    display: inline-block;
}

.btn-admin-dark {
    padding: 10px 20px;
    background: #333;
    color: white;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

    .btn-admin-dark:hover {
        background: #111;
        color: white;
    }

.btn-admin-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary, #6B705C);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

    .btn-admin-primary:hover {
        background: var(--primary-light, #8a8f78);
        color: white;
    }

.btn-detalle-sm {
    background: var(--primary, #6B705C);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.3s;
    display: inline-block;
}

    .btn-detalle-sm:hover {
        background: var(--accent, #CB997E);
        color: white;
    }

/* Alertas de Mensajes */
.admin-alert {
    display: block;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.admin-alert-success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.admin-alert-error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Grid para el Detalle del Pedido */
.admin-detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.admin-section-title {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.2rem;
    color: #333;
}

.admin-data-row {
    margin-bottom: 8px;
}

    .admin-data-row strong {
        color: #444;
    }

.admin-total-price {
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    color: var(--primary, #6B705C);
}
/* Estilos elegantes para inputs y selects del Admin */
.admin-form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .admin-form-control:focus {
        border-color: var(--primary, #6B705C);
        outline: 0;
        box-shadow: 0 0 0 3px rgba(107, 112, 92, 0.15);
    }

/* Colores para los Estados de los Pedidos */
.badge-base {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.5px;
}

.badge-pendiente {
    background-color: #fff3cd;
    color: #8a6d3b;
    border: 1px solid #faebcc;
}

.badge-pagado {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

.badge-procesando {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-completado {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.badge-cancelado {
    background-color: #f5f5f5;
    color: #666666;
    border: 1px solid #e3e3e3;
}

.badge-error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}
/* Cabecera del pedido (Meta datos) */
.admin-order-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.95rem;
    margin-top: 5px;
}

    .admin-order-meta span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: #f8f9fa;
        padding: 4px 12px;
        border-radius: 20px;
        border: 1px solid #eee;
    }

/* Grid de 3 columnas para la ficha del cliente */
.admin-client-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 15px;
}

.admin-client-col h4 {
    font-size: 1rem;
    color: var(--primary, #6B705C);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.admin-product-link {
    color: var(--primary, #6B705C);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

    .admin-product-link:hover {
        color: var(--accent, #CB997E);
        text-decoration: underline;
    }

/* Paginación compartida de los listados administrativos */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    color: var(--text-light, #687078);
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    font-size: 0.88rem;
}

.admin-pagination:first-child {
    border-radius: 8px 8px 0 0;
}

.admin-pagination-size-label,
.admin-pagination-navigation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-pagination-size {
    width: auto;
    min-width: 82px;
    padding: 6px 30px 6px 10px;
}

.admin-pagination-button {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
}

.admin-pagination-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

table.js-admin-paginacion + .admin-pagination {
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

@media (max-width: 640px) {
    .admin-pagination {
        justify-content: center;
        text-align: center;
    }

    .admin-pagination-summary {
        flex-basis: 100%;
    }
}

@media (max-width: 900px) {
    .admin-client-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   MODAL DEL RECORTADOR DE IMAGEN COMPARTIDO (ImageCropTool.js)
   ================================================================ */
.crop-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20, 20, 20, 0.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

    .crop-modal-overlay.active {
        display: flex;
    }

.crop-modal {
    background: #fff;
    border-radius: 10px;
    width: min(700px, 92vw);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid #eee;
}

    .crop-modal-header h3 {
        margin: 0;
        font-size: 1.1rem;
    }

.crop-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

.crop-modal-body {
    background: #2b2b2b;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .crop-modal-body img {
        display: block;
        max-width: 100%;
    }

.crop-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 16px 22px;
}

.crop-modal-hint {
    font-size: 0.85rem;
    color: #888;
}
