:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --sidebar-width: 260px;
    --header-height: 60px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary-color: #1a252f;
    --secondary-color: #2c3e50;
    --accent-color: #5dade2;
    --text-color: #e0e0e0;
    --text-light: #aab7b8;
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sidebar-bg: #0d1117;
    --sidebar-hover: #161b22;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.1);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    border-radius: 8px;
    margin-bottom: 5px;
}

.nav-link i {
    font-size: 1.1rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 30px;
    transition: all 0.3s;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    color: var(--text-color);
    transition: transform 0.2s;
}

/* Product Images */
.product-img-container {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.product-img-container:hover {
    transform: scale(1.05);
}

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

/* Image Expansion Overlay */
.image-expansion-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.expanded-image-content {
    width: 300px;
    height: 300px;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.expanded-image-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.product-img-placeholder {
    font-size: 2rem;
    color: #ccc;
}

.img-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    border: 2px dashed var(--accent-color);
}

/* Responsividade para Imagens */
@media (max-width: 768px) {
    .product-img-container {
        width: 50px;
        height: 50px;
    }

    .product-img-placeholder {
        font-size: 1.2rem;
    }
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Premium Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: transparent;
}

.card.primary::before {
    background-color: var(--accent-color);
}

.card.success::before {
    background-color: var(--success-color);
}

.card.danger::before {
    background-color: var(--danger-color);
}

.card.warning::before {
    background-color: var(--warning-color);
}

.card-title {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-color);
}

/* Grid System */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.responsive-flex {
    display: flex;
    gap: 10px;
}

@media (max-width: 992px) {
    .responsive-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .responsive-flex>div {
        width: 100% !important;
    }
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
    /* Suave no iOS */
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
}

[data-theme="dark"] .form-control {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 550px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalAppear {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .mobile-menu-btn {
        display: block;
    }
}