:root {
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #334155;

    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.brand p {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--accent);
    color: white;
    font-weight: 500;
}

.sidebar-footer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    margin-right: 4px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-dark);
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.date-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-panel);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* CARDS & GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.kpi-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kpi-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.kpi-card .value.positive {
    color: var(--success);
}

.kpi-card .value.negative {
    color: var(--danger);
}

.kpi-card .subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.kpi-card.highlight {
    background: linear-gradient(145deg, var(--bg-panel), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

/* CHARTS */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    min-height: 300px;
}

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* FORMS */
.form-card {
    max-width: 800px;
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

input,
select {
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

/* TABLE */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.data-table td {
    color: var(--text-primary);
}

/* OPERATION SELECTOR */
.operation-selector {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.operation-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.operation-selector select {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* AI SECTION */
.ai-container {
    display: flex;
    gap: 2rem;
}

.ai-textarea {
    width: 100%;
    height: 150px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: monospace;
}

.ai-preview-box {
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    min-height: 150px;
    border: 1px dashed var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-key-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.badge-op {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #334155;
    color: white;
}

/* KANBAN CASHFLOW */
.kanban-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    min-height: 400px;
}

.kanban-col {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    padding: 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.badge-requested {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-transit {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.kanban-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.kanban-card {
    background: var(--bg-dark);
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    position: relative;
    transition: transform 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.kanban-card .amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.kanban-card .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kanban-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.btn-move-next {
    background: var(--accent);
    color: white;
}
/* Drag & Drop Styles */
.drop-zone { border: 2px dashed #334155; border-radius: 8px; padding: 20px; text-align: center; color: #94a3b8; transition: all 0.3s; cursor: pointer; background: rgba(51, 65, 85, 0.1); }
.drop-zone:hover, .drop-zone.dragover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); color: #e2e8f0; }
.preview-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; margin: 4px; border: 1px solid #475569; }
