/* CoinsTrack - Bluecoins-inspired theme */
:root {
    --bg-primary: #E8F4FD;
    --bg-card: #FFFFFF;
    --bg-header: #B3DDF2;
    --accent-blue: #2196F3;
    --accent-green: #4CAF50;
    --accent-red: #E91E63;
    --accent-pink: #FF4081;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-green: #2E7D32;
    --text-red: #C62828;
    --text-blue: #1565C0;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Desktop wider layout */
@media (min-width: 768px) {
    body { max-width: 900px; }
}

/* Header */
.header {
    background: var(--bg-header);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--text-primary);
}

.header-btn:hover { background: rgba(0,0,0,0.05); }

/* Tabs */
.tabs {
    display: flex;
    background: var(--bg-header);
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab:hover { color: var(--accent-blue); }

/* Tab Content */
.tab-content { display: none; padding: 12px; }
.tab-content.active { display: block; }

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

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

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

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

.card-action-btn {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chart container */
.chart-container {
    width: 100%;
    height: 200px;
    margin-bottom: 12px;
}

/* Summary table */
.summary-table {
    width: 100%;
    font-size: 13px;
}

.summary-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 8px;
}

.summary-table td {
    padding: 4px 8px;
    text-align: right;
}

.summary-table .label-col { text-align: left; }

.amount-positive { color: var(--text-green); font-weight: 500; }
.amount-negative { color: var(--text-red); font-weight: 500; }
.amount-blue { color: var(--text-blue); font-weight: 500; }

/* Accounts list */
.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.account-row:last-child { border-bottom: none; }

.account-name {
    font-size: 14px;
    font-weight: 500;
}

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

/* Transactions list */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.transaction-item:hover { background: #f9f9f9; margin: 0 -16px; padding: 12px 16px; }

.tx-left { flex: 1; }

.tx-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.tx-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.tx-amount {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.tx-category {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
}

.tx-category-edit {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed transparent;
    transition: background 0.15s, border-color 0.15s;
    display: inline-block;
}
.tx-category-edit:hover {
    background: #eef5ff;
    border-color: #b8d4ff;
}
.tx-cat-edit-icon { opacity: 0.4; font-size: 10px; margin-left: 2px; }
.tx-category-edit:hover .tx-cat-edit-icon { opacity: 1; }
.tx-category.tx-cat-editing { padding: 0; border: none; }
.tx-category.tx-cat-editing .ts-wrapper { min-width: 160px; text-align: left; }
.tx-cat-inline-wrap { display: inline-flex; gap: 4px; align-items: center; }
.tx-cat-inline-wrap .ts-wrapper { font-size: 12px; }
.tx-cat-inline-cancel {
    background: transparent; border: 1px solid #ddd; border-radius: 4px;
    padding: 2px 7px; cursor: pointer; line-height: 1; font-size: 14px; color: #888;
}
.tx-cat-inline-cancel:hover { background: #fee; border-color: #faa; color: #c00; }

/* Date separator */
.date-separator {
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: 70px;
    right: calc(50% - 220px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33,150,243,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: transform 0.2s;
}

.fab:hover { transform: scale(1.1); }

@media (min-width: 768px) {
    .fab { right: calc(50% - 430px); }
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: flex-end;
}

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

.modal {
    background: var(--bg-primary);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
    .modal {
        max-width: 600px;
        border-radius: 16px;
        margin-bottom: 40px;
        max-height: 80vh;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    background: var(--bg-header);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.modal-header h2 { font-size: 16px; }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.modal-body { padding: 16px; }

/* Form styles */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-blue);
}

.form-group textarea { resize: vertical; min-height: 60px; }

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

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

/* Type toggle */
.type-toggle {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.type-btn.active[data-type="Expense"] { background: var(--accent-red); color: white; }
.type-btn.active[data-type="Income"] { background: var(--accent-green); color: white; }
.type-btn.active[data-type="Transfer"] { background: var(--accent-blue); color: white; }

/* Amount input special styling */
.amount-input-wrap {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 16px;
}

.amount-sign {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
}

.amount-sign.expense { background: var(--accent-red); }
.amount-sign.income { background: var(--accent-green); }
.amount-sign.transfer { background: var(--accent-blue); }

.amount-input-wrap input {
    border: none;
    font-size: 22px;
    font-weight: 600;
    flex: 1;
    outline: none;
    min-width: 0;
}

.currency-badge {
    background: var(--accent-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-top: 8px;
}

.btn-submit.expense { background: var(--accent-red); }
.btn-submit.income { background: var(--accent-green); }
.btn-submit.transfer { background: var(--accent-blue); }

/* Import section */
.import-section {
    text-align: center;
    padding: 20px;
}

.import-section input[type="file"] {
    margin: 12px 0;
}

.import-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.import-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.import-progress {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: white;
    flex: 1;
    min-width: 100px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show { opacity: 1; }

/* Balance Sheet */
.bs-section { margin-bottom: 16px; }

.bs-title {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 2px solid var(--accent-blue);
    margin-bottom: 8px;
}

/* Daily summary bar chart placeholders */
.daily-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 150px;
    padding: 0 4px;
}

.daily-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.daily-bar-fill {
    width: 100%;
    max-width: 40px;
    background: var(--accent-red);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}

.daily-bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.daily-bar-value {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* Reports */
.report-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.preset-btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.preset-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

.preset-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.report-group-toggle {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.report-group-toggle .type-toggle {
    flex: 1;
}

.report-group-toggle .type-btn.active {
    background: var(--accent-blue);
    color: white;
}

.report-totals {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-total-box {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    background: var(--bg-primary);
}

.report-total-box .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.report-total-box .value {
    font-size: 16px;
    font-weight: 700;
}

.report-detail-table {
    width: 100%;
}

.report-detail-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-bottom: 2px solid var(--border);
}

.report-detail-table td {
    padding: 8px;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}

.report-detail-table tr:hover td { background: #fafafa; }

.report-detail-table .pct-bar-cell {
    width: 80px;
}

.pct-bar {
    height: 6px;
    border-radius: 3px;
    background: #f0f0f0;
    overflow: hidden;
}

.pct-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.pct-bar-fill.expense { background: var(--accent-red); }
.pct-bar-fill.income { background: var(--accent-green); }

/* Report transaction list */
.report-tx-table tr { cursor: pointer; }
.report-tx-table tr:hover td { background: #f0f7ff; }

.report-tx-row td {
    vertical-align: top;
    padding: 8px 6px;
}

.show-mobile-only { display: none; }

@media (max-width: 600px) {
    .hide-mobile { display: none !important; }
    .show-mobile-only { display: block; }
}

/* AI Insights */
.ai-controls { padding: 0; }

.ai-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 768px) {
    .ai-actions-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.ai-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: center;
}

.ai-action-btn:hover {
    border-color: var(--accent-blue);
    background: #E3F2FD;
}

.ai-action-btn:active {
    transform: scale(0.97);
}

.ai-action-icon {
    font-size: 24px;
    line-height: 1;
}

/* AI Content (rendered markdown) */
.ai-content {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary);
}

.ai-content h1 { font-size: 18px; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
.ai-content h2 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; color: var(--accent-blue); }
.ai-content h3 { font-size: 14px; font-weight: 600; margin: 12px 0 4px; color: var(--text-primary); }
.ai-content h4 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: var(--text-secondary); }

.ai-content p { margin: 6px 0; }

.ai-content ul, .ai-content ol {
    padding-left: 20px;
    margin: 6px 0;
}

.ai-content li {
    margin: 3px 0;
}

.ai-content strong { font-weight: 600; }

.ai-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.ai-table th {
    background: var(--bg-primary);
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border);
}

.ai-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f5f5f5;
}

.ai-table tr:hover td { background: #fafafa; }

.ai-code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 12px;
    line-height: 1.5;
}

.ai-inline-code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 250;
}

.ac-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

.ac-item:hover { background: #E3F2FD; }
.ac-item:last-child { border-bottom: none; }

.ac-name {
    font-size: 14px;
    font-weight: 500;
}

.ac-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Transaction tags */
.tx-tags {
    display: inline;
    margin-left: 6px;
}

.tx-tag {
    display: inline-block;
    background: #E3F2FD;
    color: var(--accent-blue);
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 3px;
    vertical-align: middle;
}

/* Drag and drop */
.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-header) !important;
}

.drag-handle:hover {
    color: var(--accent-blue) !important;
}

/* Tom Select overrides */
.ts-wrapper {
    font-size: 13px !important;
}

.ts-wrapper .ts-control {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    min-height: 36px !important;
    background: white !important;
}

.ts-wrapper .ts-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow) !important;
}

.ts-wrapper .ts-dropdown .option {
    padding: 8px 10px !important;
    font-size: 13px !important;
}

.ts-wrapper .ts-dropdown .active {
    background: var(--bg-header) !important;
    color: var(--text-primary) !important;
}

.ts-wrapper.multi .ts-control > .item {
    background: #E3F2FD !important;
    color: var(--accent-blue) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 2px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.ts-wrapper.multi .ts-control > .item .remove {
    border: none !important;
    color: var(--accent-blue) !important;
}

/* Login screen */
#loginScreen input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

#loginScreen .import-btn {
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

/* Settings account toggles */
#settingsAccountsList input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
}

/* Voice button active state */
#voiceBtn:disabled {
    background: var(--accent-red);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Settings items */
.settings-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.settings-item-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.settings-icon-btn:hover { background: var(--bg-secondary); }
.settings-icon-btn.danger { color: var(--accent-red); }
.settings-icon-btn.danger:hover { background: #fdeaea; }
.settings-inline-input {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-primary);
}

/* PWA install button */
.pwa-install-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    color: #fff !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(39,174,96,0.4) !important;
    animation: pwa-pulse 2s ease-in-out infinite;
}
@keyframes pwa-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(39,174,96,0.4); }
    50% { box-shadow: 0 2px 16px rgba(39,174,96,0.7); }
}

/* Offline indicator */
body.offline::after {
    content: 'Offline';
    position: fixed;
    top: 0; left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: #fff;
    padding: 4px 16px;
    border-radius: 0 0 8px 8px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10000;
}

/* Dashboard reports grid */
.dash-reports-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
}
.dash-reports-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.dash-reports-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.dash-report-card {
    padding: 8px !important;
    margin-bottom: 0 !important;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.dash-report-card .card-header {
    padding: 0 0 6px;
    margin: 0;
}
.dash-report-card .card-title {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Report body: stack totals above chart */
.dash-report-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-report-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
}
.dash-report-totals .report-total-box {
    min-width: 0;
    padding: 4px 2px;
}
.dash-report-totals .report-total-box .value {
    font-size: 12px;
}
.dash-report-totals .report-total-box .label {
    font-size: 9px;
}
.dash-report-chart {
    height: 140px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* In multi-col, make charts smaller */
.dash-reports-grid.cols-2 .dash-report-chart,
.dash-reports-grid.cols-3 .dash-report-chart { height: 120px; }
.dash-reports-grid.cols-3 .dash-report-totals .report-total-box .value { font-size: 11px; }
.dash-reports-grid.cols-3 .card-title { font-size: 11px; }

/* Column picker */
.dash-grid-cols-picker { display: flex; gap: 4px; }
.dash-grid-cols-picker .preset-btn.small {
    padding: 2px 8px;
    font-size: 11px;
    min-width: 24px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .dash-reports-grid { gap: 6px; }
    .dash-reports-grid.cols-3 { grid-template-columns: 1fr 1fr; }
    .dash-report-card { padding: 6px !important; }
    .dash-report-card .card-title { font-size: 11px; }
    .dash-report-totals .report-total-box { padding: 3px 1px; }
    .dash-report-totals .report-total-box .value { font-size: 11px; }
    .dash-report-totals .report-total-box .label { font-size: 8px; }
    .dash-report-chart { height: 100px; }
    .dash-report-card .card-header button { font-size: 12px; padding: 2px; }
    .dash-report-card .drag-handle { font-size: 12px !important; }
}
@media (max-width: 380px) {
    .dash-reports-grid.cols-2,
    .dash-reports-grid.cols-3 { grid-template-columns: 1fr; }
}

/* Draggable header cue */
.dash-report-card .card-header {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.dash-report-card .card-header:active { cursor: grabbing; }

/* Tap-to-zoom body cue */
.dash-report-body { cursor: zoom-in; }

/* Zoom overlay */
.dash-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: zoomFadeIn .15s ease-out;
}
@keyframes zoomFadeIn { from { opacity: 0; } to { opacity: 1; } }

.dash-zoom-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.dash-zoom-card .card-header { margin-bottom: 8px; }
.dash-zoom-card .card-title { font-size: 16px !important; }
.dash-zoom-card .report-total-box .value { font-size: 18px !important; }
.dash-zoom-card .report-total-box .label { font-size: 11px !important; }
.dash-zoom-card .report-total-box { padding: 8px 6px !important; }
.dash-zoom-card .dash-report-chart { height: 220px !important; }

.dash-zoom-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}
.dash-zoom-close:hover { background: var(--bg-secondary); }
