/* ============================================================
   ADMIN - ESTILOS GERAIS
   ============================================================ */

.page-admin {
    background-color: #f5f5f5;
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

#login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
}

.login-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.logo-admin {
    text-align: center;
    margin-bottom: 30px;
}

.logo-admin img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.logo-admin h1 {
    font-size: 24px;
    color: #8B0000;
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-admin {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-admin-large {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8B0000;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.form-actions button {
    flex: 1;
}

.input-admin {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-admin {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Open Sans', sans-serif;
}

.btn-primary {
    background-color: #8B0000;
    color: white;
}

.btn-primary:hover {
    background-color: #6B0000;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.3);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

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

.btn-danger {
    background-color: #dc143c;
    color: white;
}

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

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-edit {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #007bff;
    color: white;
}

.btn-edit:hover {
    background-color: #0056b3;
}

.btn-delete {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #dc3545;
    color: white;
}

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

.btn-toggle {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #6c757d;
    color: white;
}

.btn-toggle.active {
    background-color: #28a745;
}

/* ============================================================
   NAVBAR
   ============================================================ */

.admin-navbar {
    background-color: white;
    border-bottom: 1px solid #ddd;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #8B0000;
    margin: 0;
}

.user-info {
    margin-right: 20px;
    font-size: 13px;
    color: #666;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ============================================================
   LAYOUT DASHBOARD
   ============================================================ */

.admin-container {
    display: flex;
    height: calc(100vh - 60px);
    background-color: #f5f5f5;
}

.admin-sidebar {
    width: 200px;
    background-color: white;
    border-right: 1px solid #ddd;
    padding: 20px 0;
    overflow-y: auto;
}

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #f0f0f0;
    color: #8B0000;
}

.menu-item.active {
    background-color: #f9f9f9;
    color: #8B0000;
    border-left-color: #8B0000;
    font-weight: 600;
}

.menu-item i {
    width: 18px;
    text-align: center;
}

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

.admin-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

/* ============================================================
   PRODUTOS TABLE
   ============================================================ */

.products-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.products-filters input,
.products-filters select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.table-admin {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-admin thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #ddd;
}

.table-admin th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-admin td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.table-admin tbody tr:hover {
    background-color: #f9f9f9;
}

.table-admin tbody tr:last-child td {
    border-bottom: none;
}

.product-img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background-color: #d4edda;
    color: #155724;
}

.badge-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.loading-row {
    text-align: center;
    color: #999;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.modal-content p {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    min-width: 100px;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background-color: #dc3545;
}

.toast.warning {
    background-color: #ffc107;
    color: #333;
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.login-footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

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

@media (max-width: 768px) {
    .admin-sidebar {
        width: 150px;
    }

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

    .section-header {
        flex-direction: column;
        gap: 15px;
    }

    .section-header h3 {
        margin-bottom: 10px;
    }

    .table-admin {
        font-size: 12px;
    }

    .table-admin th,
    .table-admin td {
        padding: 8px 10px;
    }

    .table-actions {
        flex-direction: column;
    }

    .products-filters {
        flex-direction: column;
    }

    .login-box {
        padding: 25px;
    }
}

@media (max-width: 600px) {
    .admin-container {
        flex-direction: column;
        height: auto;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 10px 0;
        display: flex;
        overflow-x: auto;
    }

    .menu {
        display: flex;
        gap: 0;
    }

    .menu-item {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .menu-item.active {
        border-left: none;
        border-bottom-color: #8B0000;
    }

    .admin-main {
        padding: 15px;
    }

    .btn-admin {
        padding: 8px 12px;
        font-size: 12px;
    }

    .table-admin th,
    .table-admin td {
        padding: 6px 8px;
        font-size: 11px;
    }
}
