/* ==========================================================================
   ANYELIS ADMINCP - ESTILOS DEL PANEL DE ADMINISTRACIÓN
   ========================================================================== */

:root {
    --admin-sidebar-bg: #1e1b2e;
    --admin-sidebar-hover: #2d2845;
    --admin-sidebar-active: #ec4899;
    --admin-primary: #ec4899;
    --admin-primary-dark: #be185d;
    --admin-bg: #f8fafc;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #1e293b;
    --admin-text-muted: #64748b;
    --admin-radius: 14px;
    --admin-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.admin-body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
    display: flex;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Playfair Display', serif;
}

.sidebar-title span {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    padding: 20px 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: var(--admin-sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

.sidebar-link .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ec4899;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info h5 {
    font-size: 13px;
    color: #fff;
}

.user-info p {
    font-size: 11px;
    color: #94a3b8;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
}

/* ==========================================================================
   CONTENIDO PRINCIPAL ADMIN
   ========================================================================== */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Poppins', sans-serif;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
    transition: all 0.2s;
}

.btn-admin-action:hover {
    background: var(--admin-primary-dark);
    transform: translateY(-1px);
}

.admin-body-content {
    padding: 30px;
    flex-grow: 1;
}

/* ==========================================================================
   TARJETAS DASHBOARD
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 24px;
    box-shadow: var(--admin-shadow);
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.pink {
    background: #fdf2f8;
    color: #ec4899;
}

.stat-icon.purple {
    background: #faf5ff;
    color: #a855f7;
}

.stat-icon.amber {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-icon.emerald {
    background: #ecfdf5;
    color: #10b981;
}

.stat-details h3 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 4px;
    font-family: 'Poppins', sans-serif;
}

.stat-details p {
    font-size: 13px;
    color: var(--admin-text-muted);
}

/* ==========================================================================
   TABLAS Y CONTENEDORES ADMIN
   ========================================================================== */
.admin-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 24px;
    box-shadow: var(--admin-shadow);
    margin-bottom: 30px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.admin-card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Poppins', sans-serif;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: #fcfcfd;
}

.table-product-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: #fdf2f8;
    border: 2px solid #fce7f3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
    display: block;
}

.table-product-thumb:hover {
    transform: scale(1.08);
    border-color: #f472b6;
    box-shadow: 0 6px 14px rgba(236, 72, 153, 0.2);
}

/* Tooltip Flotante de Imagen Grande */
.admin-image-tooltip {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    border: 2px solid #fbcfe8;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92) translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
    width: 260px;
    max-width: 90vw;
    backdrop-filter: blur(8px);
}

.admin-image-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.admin-image-tooltip .tooltip-img-container {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-image-tooltip .tooltip-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-image-tooltip .tooltip-img-info {
    padding: 8px 4px 2px 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.admin-image-tooltip .tooltip-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-image-tooltip .tooltip-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #be185d;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 600;
}

.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.status-featured {
    background: #fef3c7;
    color: #b45309;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.btn-icon.edit:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.btn-icon.delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ==========================================================================
   FORMULARIOS ADMIN
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.form-control {
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.image-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--admin-radius);
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.image-dropzone:hover, .image-dropzone.dragover {
    border-color: var(--admin-primary);
    background: #fdf2f8;
}

.dropzone-icon {
    font-size: 36px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.existing-img-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid #e2e8f0;
}

.existing-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-badge-main {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--admin-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-del-img {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.colors-selector-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.color-check-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 50px;
    font-size: 13px;
    cursor: pointer;
}

.color-check-item input[type="checkbox"] {
    cursor: pointer;
}

.color-dot-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ==========================================================================
   ALERTAS ADMIN
   ========================================================================== */
.admin-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.admin-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   LOGIN SCREEN ADMIN
   ========================================================================== */
.admin-login-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b2e 0%, #311b92 50%, #4a044e 100%);
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.login-logo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #fff;
    font-size: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: #4a044e;
    margin-bottom: 6px;
}

.login-card p.subtitle {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
}

.btn-login-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

/* ==========================================================================
   ADMINCP RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    body.admin-body {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        min-height: auto;
    }
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 6px;
    }
    .sidebar-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    .sidebar-footer {
        display: none;
    }
    .admin-main {
        width: 100%;
    }
    .admin-body-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }
    .admin-topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.col-span-2 {
        grid-column: span 1;
    }
}
