/* ==========================================================================
   AROMA PERFUMES - ESTILOS PANEL DE ADMINISTRACIÓN
   ========================================================================== */

:root {
    --bg-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --primary-color: #B88E5F;
    --primary-hover: #9E7951;
    --border-color: #DEE2E6;
    --danger-color: #DC3545;
    
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* --- BOTONES --- */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    color: var(--text-primary);
    background-color: #fff;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e6ea;
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.w-100 { width: 100%; }

/* --- LOGIN SCREEN --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    padding: 1rem;
}

.auth-card {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-img {
    display: block;
    margin: 0 auto 1rem;
    mix-blend-mode: multiply;
}

.auth-header h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-header p { color: var(--text-secondary); }

.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.col-6 { flex: 0 0 calc(50% - 0.5rem); }

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

input, select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    outline: 0;
}

small { display: block; margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.75rem; }

.error-msg {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
    gap: 0.75rem;
}

.sidebar-logo-img {
    border-radius: 4px;
    mix-blend-mode: multiply;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout:hover { color: var(--danger-color); }

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.topbar h1 { font-size: 1.25rem; font-weight: 600; }

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* --- TABLA --- */
.table-card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table td { vertical-align: middle; }

.table-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.text-center { text-align: center; }

/* --- MODAL FORMULARIO --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1050;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background-color: var(--surface-color);
    width: 100%; max-width: 600px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; border-bottom: 1px solid var(--border-color);
}

.modal-header h2 { font-size: 1.25rem; font-weight: 600; }

.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); }

.modal form { padding: 1.5rem; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 1rem;
    margin-top: 2rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* --- BARRA DE BÚSQUEDA --- */
.catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.search-bar {
    position: relative;
    flex-grow: 1;
    max-width: 420px;
}

.search-bar svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-bar input {
    padding-left: 2.5rem;
    background-color: var(--surface-color);
}

.results-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* --- BADGE CATEGORÍA --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background-color: #f0ebe4;
    color: var(--primary-color);
}

/* --- APARIENCIA --- */
.apariencia-card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    max-width: 680px;
}

.apariencia-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.apariencia-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-preview-wrap {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-preview-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .dashboard-wrapper {
        flex-direction: column !important;
    }
    .sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .sidebar-header {
        justify-content: center;
    }
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }
    .sidebar-nav a {
        margin-top: 0 !important;
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
    .topbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }
    .topbar > div {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .topbar button {
        width: 100%;
    }
    .main-content {
        min-width: 0;
    }
    .content-body {
        padding: 1rem;
        width: 100%;
        max-width: 100vw;
    }
    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .data-table {
        min-width: 800px;
    }
    .modal {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-bar {
        max-width: 100%;
    }
}
