/* ========================================================================
   JP EXPORTING - ADMIN PANEL STYLES (identidade do site novo)
   Versão: 2.0
   Cores Principais:
   - Primária: #1E3852 (Azul Escuro Marinho)
   - Secundária: #C9A24E (Amarelo Dourado Elegante)
   ======================================================================== */

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

:root {
    --primary-color: #1E3852;
    --primary-dark: #132B41;
    --primary-darker: #0E1D2E;
    --secondary-color: #C9A24E;
    --secondary-dark: #B08A3A;
    --accent-color: #E4C580;
    --success-color: #3E9C5C;
    --danger-color: #B3452F;
    --light-gray: #F3EEE4;
    --dark-gray: #5B6772;
    --text-color: #1B2530;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--text-color);
    background: var(--light-gray);
}

/* ========================================================================
   LOGIN CONTAINER
   ======================================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E3852, #2C4460);
    padding: 2rem;
}

.login-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-header i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-header p {
    color: var(--dark-gray);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #C9A24E 0%, #B08A3A 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 166, 35, 0.3);
}

.login-info {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.85rem;
}

/* ========================================================================
   ADMIN DASHBOARD
   ======================================================================== */

.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* ========================================================================
   SIDEBAR
   ======================================================================== */

.sidebar {
    width: 260px;
    background: var(--primary-color);
    color: var(--white);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    color: var(--white);
    font-weight: 800;
}

.sidebar-header span {
    color: var(--secondary-color);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(245, 166, 35, 0.1);
    padding-left: 2rem;
    color: var(--white);
}

.nav-item.active {
    background: var(--secondary-color);
    border-left: 4px solid var(--white);
    color: var(--white);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
}

.nav-item.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.logout:hover {
    background: var(--danger-color);
}

/* ========================================================================
   MAIN CONTENT
   ======================================================================== */

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    background: var(--light-gray);
}

.dashboard-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.header-info i {
    color: var(--secondary-color);
}

/* ========================================================================
   CONTENT SECTION
   ======================================================================== */

.content-section {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.section-header h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.section-header h2 i {
    color: var(--secondary-color);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    width: 300px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

/* ========================================================================
   PRODUCTS TABLE
   ======================================================================== */

.products-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.products-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 100%;
}

.products-table th {
    background: var(--light-gray);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.products-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
    word-wrap: break-word;
    overflow: hidden;
}

.product-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.brands-cell {
    max-width: 300px;
    min-width: 200px;
}

.brand-chip {
    display: inline-block;
    background: var(--light-gray);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 0.2rem;
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.edit-btn {
    background: var(--primary-color);
    color: var(--white);
}

.edit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(44, 62, 80, 0.2);
}

.delete-btn {
    background: var(--danger-color);
    color: var(--white);
}

.delete-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 166, 35, 0.2);
}

/* ========================================================================
   FORM CONTAINER
   ======================================================================== */

.form-container {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--dark-gray);
    font-size: 0.85rem;
}

/* ========================================================================
   BRAND INPUT GROUPS
   ======================================================================== */

#brandsContainer, #editBrandsContainer {
    margin-bottom: 1rem;
}

.brand-input-group {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.brand-input-group input {
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    outline: none;
}

.brand-input-group input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.remove-brand-btn {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-brand-btn:hover {
    background: var(--secondary-dark);
    transform: scale(1.05);
}

.add-brand-btn {
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.add-brand-btn:hover {
    background: #358a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

/* ========================================================================
   FORM ACTIONS
   ======================================================================== */

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn, .cancel-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn {
    background: linear-gradient(135deg, #C9A24E 0%, #B08A3A 100%);
    color: var(--white);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 166, 35, 0.3);
}

.cancel-btn {
    background: var(--dark-gray);
    color: var(--white);
}

.cancel-btn:hover {
    background: #5B6772;
    transform: translateY(-2px);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 968px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .brand-input-group {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-box input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s;
        z-index: 1000;
        width: 260px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .action-btns {
        flex-direction: column;
    }

    .products-table {
        font-size: 0.9rem;
    }

    .products-table th,
    .products-table td {
        padding: 0.5rem;
    }

    .login-box {
        padding: 2rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }
}

/* ========================================================================
   ANIMATIONS
   ======================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================================================
   SCROLLBAR
   ======================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-gray);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========================================================================
   UTILITIES
   ======================================================================== */

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

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

/* ---- identidade JP Exporting ---- */
h1, h2, h3 { font-family: 'Archivo', 'IBM Plex Sans', sans-serif; letter-spacing: -0.01em; }
.sidebar-header img { height: 30px; width: auto; margin-bottom: 8px; display: block; }
.sidebar-header h2 { font-size: 15px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-nav .nav-item.mail { border-top: 1px solid rgba(255,255,255,.08); margin-top: 6px; padding-top: 14px; }
