:root {
    --primary: #00c853;
    --primary-dark: #00a443;
    --secondary: #2196F3;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: #334155;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
}

/* Layout Principal */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #0b1120;
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(0, 200, 83, 0.1);
    color: var(--primary);
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    max-width: 1200px;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

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

/* Componentes */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.header-main {
    margin-bottom: 32px;
}

.header-main h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Importação */
.import-section {
    margin-bottom: 32px;
}

.import-section h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

#bookmarklet-link {
    display: inline-block;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: move;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

#bookmarklet-link:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.import-section p {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
}

    border-top: 1px solid var(--border);
    margin: 40px 0;
    opacity: 0.5;
}

/* Tabelas e Listas */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--border);
}

.h-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.h-product { font-weight: 600; }
.h-price { color: var(--primary); font-weight: 700; }
.h-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Botões e Inputs */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: auto;
    min-width: 200px;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary:hover { 
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #334155;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

textarea, input[type="text"] {
    background: #0b1120;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: white;
    width: 100%;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.2s;
    font-size: 1rem;
}

textarea:focus, input[type="text"]:focus {
    border-color: var(--secondary);
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card-bg);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
}

.toast.show { display: block; animation: slideIn 0.3s ease-out; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
