:root {
    --bg-page: #f5f5f3;
    --bg-sidebar: #1a1a2e;
    --bg-card: #ffffff;
    --bg-input: #f9f9f7;
    --bg-hover: #f0efed;
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b6b;
    --text-muted: #999999;
    --text-white: #ffffff;
    --text-sidebar: #c4c4c8;
    --text-sidebar-active: #ffffff;
    --border: #e5e5e3;
    --border-light: #f0f0ee;
    --accent: #534AB7;
    --accent-light: #EEEDFE;
    --accent-dark: #3C3489;
    --green: #1D9E75;
    --green-light: #E1F5EE;
    --green-dark: #04342C;
    --red: #D85A30;
    --red-light: #FAECE7;
    --red-dark: #4A1B0C;
    --amber: #EF9F27;
    --amber-light: #FAEEDA;
    --amber-dark: #412402;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --warning-dark: #78350F;
    --purple-debt: #7B1E3B;
    --purple-debt-light: #FCE8F1;
    --teal-cicilan: #0F6E56;
    --teal-cicilan-light: #E1F5EE;
    --blue: #378ADD;
    --blue-light: #E6F1FB;
    --blue-dark: #042C53;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --sidebar-width: 240px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.15s ease;
}

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

.nav-item.active {
    background: var(--accent);
    color: var(--text-white);
}

.nav-icon {
    font-size: 11px;
    font-family: monospace;
    opacity: 0.7;
    width: 16px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-add {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-add:hover {
    background: var(--accent-dark);
}

/* ===== MENU TOGGLE (mobile) ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    width: 40px;
    height: 40px;
    background: var(--bg-sidebar);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    cursor: pointer;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.overlay.active {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* ===== PAGES ===== */
.page {
    display: none;
    animation: fadeIn 0.2s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-balance .stat-value { color: var(--accent); }
.stat-income .stat-value { color: var(--green); }
.stat-expense .stat-value { color: var(--red); }
.stat-net .stat-value { color: var(--text-primary); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* ===== TRANSACTION LIST ===== */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    transition: background 0.1s;
}

.transaction-item:hover {
    background: var(--bg-hover);
}

.trans-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.trans-icon.income {
    background: var(--green-light);
    color: var(--green-dark);
}

.trans-icon.expense {
    background: var(--red-light);
    color: var(--red-dark);
}

.trans-info {
    flex: 1;
    min-width: 0;
}

.trans-desc {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trans-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.trans-amount {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.trans-amount.income { color: var(--green); }
.trans-amount.expense { color: var(--red); }

/* ===== ACCOUNT BALANCE LIST ===== */
.account-balance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
}

.account-balance-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bank-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-white);
}

.account-balance-name {
    font-size: 13px;
    font-weight: 600;
}

.account-balance-num {
    font-size: 11px;
    color: var(--text-muted);
}

.account-balance-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== CATEGORY BARS ===== */
.category-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-bar-name {
    font-size: 13px;
    font-weight: 500;
}

.cat-bar-amount {
    font-size: 13px;
    font-weight: 600;
}

.cat-bar-track {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== TABLES ===== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

.amount-col {
    text-align: right;
}

.amount-income {
    color: var(--green);
    font-weight: 600;
}

.amount-expense {
    color: var(--red);
    font-weight: 600;
}

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

.badge-income {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-expense {
    background: var(--red-light);
    color: var(--red-dark);
}

.badge-category {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-paid {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-unpaid {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-overdue {
    background: var(--red-light);
    color: var(--red-dark);
}

.badge-debt {
    background: var(--purple-debt-light);
    color: var(--purple-debt);
}

.badge-piutang {
    background: var(--teal-cicilan-light);
    color: var(--teal-cicilan);
}

/* ===== DEBTS PAGE ===== */
.stat-debt .stat-value { color: var(--purple-debt); }
.stat-cicilan .stat-value { color: var(--warning); }
.stat-piutang .stat-value { color: var(--teal-cicilan); }
.stat-paid .stat-value { color: var(--green); }

.debts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.debt-card {
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--purple-debt);
}

.debt-card.type-piutang {
    border-left-color: var(--teal-cicilan);
}

.debt-card.status-paid {
    opacity: 0.65;
    border-left-color: var(--green);
}

.debt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.debt-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.debt-card-name {
    font-size: 15px;
    font-weight: 600;
}

.debt-card-person {
    font-size: 12px;
    color: var(--text-muted);
}

.debt-card-actions {
    display: flex;
    gap: 6px;
}

.debt-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.debt-stat-item {
    display: flex;
    flex-direction: column;
}

.debt-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.debt-stat-value {
    font-size: 15px;
    font-weight: 600;
}

.debt-stat-value.remaining {
    color: var(--purple-debt);
}

.debt-stat-value.paid {
    color: var(--green);
}

.debt-card-progress {
    margin-bottom: 12px;
}

.debt-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.debt-progress-track {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.debt-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.debt-progress-fill.debt {
    background: var(--purple-debt);
}

.debt-progress-fill.piutang {
    background: var(--teal-cicilan);
}

.debt-installments-list {
    margin-top: 12px;
}

.debt-installments-toggle {
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.debt-installments-toggle:hover {
    text-decoration: underline;
}

.debt-installments-table {
    margin-top: 8px;
    display: none;
}

.debt-installments-table.show {
    display: block;
}

.debt-installments-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.debt-installments-table th {
    text-align: left;
    padding: 6px 10px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.debt-installments-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light);
}

.debt-installments-table tr.paid {
    opacity: 0.5;
}

.debt-installments-table tr.overdue td {
    color: var(--red);
}

.payment-info {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.payment-info strong {
    color: var(--text-primary);
}

.modal-lg {
    max-width: 600px;
}

.btn-pay {
    padding: 6px 12px;
    background: var(--green);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-pay:hover {
    background: var(--green-dark);
}

.btn-pay:disabled {
    background: var(--border);
    cursor: not-allowed;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    margin-right: 4px;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: var(--red-light);
    color: var(--red);
    border-color: var(--red);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 32px 16px;
}

/* ===== ACCOUNTS GRID ===== */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.account-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.account-card-bank {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-card-name {
    font-size: 16px;
    font-weight: 600;
}

.account-card-num {
    font-size: 12px;
    color: var(--text-muted);
}

.account-card-balance {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.account-card-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.account-card-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.account-card-stat {
    flex: 1;
}

.account-card-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.account-card-stat-value {
    font-size: 14px;
    font-weight: 600;
}

.account-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ===== CATEGORIES ===== */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.category-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

/* ===== CHART ===== */
.chart-container {
    min-height: 200px;
    position: relative;
}

.chart-bar-group {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.chart-month-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chart-bars {
    display: flex;
    gap: 2px;
    height: 160px;
    align-items: flex-end;
    width: 100%;
    justify-content: center;
}

.chart-bar {
    width: 12px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.chart-bar-income {
    background: var(--green);
}

.chart-bar-expense {
    background: var(--red);
}

.chart-month-label {
    font-size: 10px;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* ===== SPREADSHEET PAGE ===== */
.spreadsheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.export-options,
.import-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.export-note,
.import-guide {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
}

.export-note ul,
.import-guide ul {
    margin-top: 8px;
    padding-left: 16px;
}

.export-note li,
.import-guide li {
    margin-top: 4px;
}

.file-upload-area {
    position: relative;
}

.file-upload-label {
    display: block;
    padding: 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.file-upload-label:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

#importFile {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.import-result {
    font-size: 13px;
    margin-top: 12px;
}

.import-result.success {
    color: var(--green);
    padding: 10px;
    background: var(--green-light);
    border-radius: var(--radius-md);
}

.import-result.error {
    color: var(--red);
    padding: 10px;
    background: var(--red-light);
    border-radius: var(--radius-md);
}

.spreadsheet-preview {
    font-family: "Courier New", monospace;
    font-size: 12px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.select-month,
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

.select-month:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-option {
    flex: 1;
    position: relative;
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-option span {
    display: block;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-option input[type="radio"]:checked + span {
    background: var(--accent);
    color: var(--text-white);
    border-color: var(--accent);
}

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

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: var(--text-white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.2s ease;
    pointer-events: none;
}

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

.toast.success {
    background: var(--green);
}

.toast.error {
    background: var(--red);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 56px 16px 16px;
    }

    .dashboard-grid,
    .categories-grid,
    .spreadsheet-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

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

    .data-table thead th,
    .data-table tbody td {
        padding: 8px 10px;
    }

    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
