@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    --bg-primary: rgb(var(--rgb-bg));
    --bg-secondary: rgb(var(--rgb-surface));
    --bg-tertiary: rgb(var(--rgb-border));
    --bg-card: rgb(var(--rgb-surface));
    --bg-card-solid: rgb(var(--rgb-surface));
    --bg-hover: rgba(var(--rgb-text) / 0.05);
    --text-primary: rgb(var(--rgb-text));
    --text-secondary: rgb(var(--rgb-text));
    --text-muted: rgb(var(--rgb-muted));
    --accent: rgb(var(--rgb-primary));
    --accent-light: rgb(var(--rgb-primary-light));
    --accent-glow: rgba(var(--rgb-primary) / 0.25);
    --success: #10B981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #F43F5E;
    --danger-glow: rgba(244, 63, 94, 0.2);
    --warning: #F59E0B;
    --info: #3B82F6;
    --border: rgb(var(--rgb-border));
    --border-light: rgba(var(--rgb-border) / 0.5);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    /* Tailwind handles body styling now */
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px
}

.app {
    display: flex;
    height: 100vh
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    transform: translateX(-100%)
}

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

@media(min-width:768px) {
    .sidebar {
        position: static;
        transform: none
    }
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px var(--accent-glow);
    flex-shrink: 0
}

.sidebar-brand h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.5px
}

.sidebar-brand p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500
}

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

.nav-section {
    margin-bottom: 20px
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 12px
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left
}

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

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow)
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border)
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.4)
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden
}

.user-info .name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.user-info .role {
    font-size: 11px;
    color: var(--text-muted)
}

.btn-logout {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition)
}

.btn-logout:hover {
    background: var(--danger-glow)
}

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

.sidebar-overlay.show {
    display: block
}

/* MAIN */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0
}

.header {
    height: 60px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20
}

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

.btn-menu {
    display: flex;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px
}

.btn-menu:hover {
    background: var(--bg-hover)
}

@media(min-width:768px) {
    .btn-menu {
        display: none
    }
}

.page-title {
    font-size: 18px;
    font-weight: 700
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px
}

.sync-indicator {
    font-size: 11px;
    color: var(--text-muted);
    display: none;
    align-items: center;
    gap: 4px
}

.sync-indicator.show {
    display: flex
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-glow)
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow)
}

.btn-primary svg {
    width: 16px;
    height: 16px
}

/* CONTENT */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px
}

.view {
    display: none;
    animation: fadeIn .3s ease
}

.view.active {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

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

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition)
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px)
}

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

.stat-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px
}

.stat-value.income {
    color: var(--success)
}

.stat-value.expense {
    color: var(--danger)
}

.stat-value.balance {
    color: var(--info)
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center
}

.stat-icon svg {
    width: 22px;
    height: 22px
}

.stat-icon.income-icon {
    background: var(--success-glow);
    color: var(--success)
}

.stat-icon.expense-icon {
    background: var(--danger-glow);
    color: var(--danger)
}

.stat-icon.balance-icon {
    background: rgba(59, 130, 246, .15);
    color: var(--info)
}

.stat-icon.count-icon {
    background: rgba(139, 92, 246, .15);
    color: #8B5CF6
}

/* PANELS */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden
}

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

.panel-title {
    font-size: 15px;
    font-weight: 700
}

.panel-body {
    padding: 20px
}

/* CHARTS */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%
}

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

/* NEW DASHBOARD LAYOUT STYLES */
.dashboard-section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-light));
    border-radius: 4px;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--info);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

@media(max-width:1024px) {
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
    .charts-grid.dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.chart-full {
    grid-column: 1/-1
}

/* TRANSACTIONS UI REFACTOR */
.tx-filters-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.filter-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

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

.btn-reset-filter {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* TX LIST CARDS */
.tx-date-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 4px;
}

.tx-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.tx-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tx-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

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

.tx-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.tx-amount {
    font-size: 14px;
    font-weight: 800;
}

.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }

.tx-actions {
    display: flex;
    gap: 4px;
}

.tx-actions .btn-icon {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 6px;
}

/* Responsive: Desktop Table vs Mobile Cards */
.tx-desktop-view {
    display: none !important;
}

.tx-mobile-view {
    display: block !important;
}

@media(min-width:768px) {
    .tx-desktop-view {
        display: block !important;
    }
    .tx-mobile-view {
        display: none !important;
    }
}

/* OLD TABLE STYLES (Kept for other tables) */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted)
}

.search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition)
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow)
}

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

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition)
}

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

.btn-secondary svg {
    width: 14px;
    height: 14px
}

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

.data-table thead {
    background: rgba(15, 23, 42, .5)
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap
}

.data-table th.sortable {
    cursor: pointer;
    transition: color 0.2s
}

.data-table th.sortable:hover {
    color: var(--text-primary)
}

.data-table th.text-right {
    text-align: right
}

.data-table th.text-center {
    text-align: center
}

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

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

.data-table .text-right {
    text-align: right
}

.data-table .text-center {
    text-align: center
}

.amount-positive {
    color: var(--success);
    font-weight: 700
}

.amount-negative {
    color: var(--danger);
    font-weight: 700
}

.store-name {
    font-weight: 600;
    color: var(--text-primary)
}

.store-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(99, 102, 241, .12);
    color: var(--accent-light)
}

.badge.member {
    background: var(--accent-glow);
    color: var(--accent-light)
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted)
}

.pagination-btns {
    display: flex;
    gap: 6px
}

.btn-page {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition)
}

.btn-page:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

.btn-page:disabled {
    opacity: .3;
    cursor: not-allowed
}

.btn-icon {
    display: inline-flex;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition)
}

.btn-icon:hover {
    background: var(--bg-hover)
}

.btn-icon.edit:hover {
    color: var(--info)
}

.btn-icon.delete:hover {
    color: var(--danger)
}

.btn-icon svg {
    width: 15px;
    height: 15px
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted)
}

/* CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px
}

.entity-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition)
}

.entity-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow)
}

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

.entity-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0
}

.entity-name {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    margin-left: 12px
}

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

.entity-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid var(--border-light)
}

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

.entity-stat-value {
    font-size: 13px;
    font-weight: 600
}

/* BUDGET */
.budget-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px
}

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

.budget-category {
    font-size: 14px;
    font-weight: 700
}

.budget-amounts {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px
}

.budget-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden
}

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

.budget-bar-fill.safe {
    background: linear-gradient(90deg, var(--success), #34D399)
}

.budget-bar-fill.warn {
    background: linear-gradient(90deg, var(--warning), #FBBF24)
}

.budget-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger), #FB7185)
}

.budget-bar-fill.info {
    background: linear-gradient(90deg, var(--info), #60A5FA)
}

/* TABS & FILTERS */
.period-tabs {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px
}

.period-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition)
}

.period-btn:hover {
    color: var(--text-primary)
}

.period-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow)
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.modal-overlay.show {
    display: flex
}

.modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .4);
    animation: modalIn .3s ease
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(10px)
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card-solid);
    z-index: 1
}

.modal-title {
    font-size: 18px;
    font-weight: 700
}

.btn-close {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition)
}

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

.modal-body {
    padding: 24px
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

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

.form-group.full {
    grid-column: 1/-1
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow)
}

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

.form-select {
    cursor: pointer
}

.type-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border)
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition)
}

.type-btn.active.expense {
    background: var(--danger);
    color: #fff
}

.type-btn.active.income {
    background: var(--success);
    color: #fff
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border)
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition)
}

.btn-cancel:hover {
    background: var(--bg-hover)
}

.btn-save {
    padding: 10px 24px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-glow)
}

.btn-save:hover {
    transform: translateY(-1px)
}

/* SETTINGS */
.settings-section {
    margin-bottom: 28px
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light)
}

.setting-label {
    font-size: 13px;
    font-weight: 500
}

.setting-value {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace
}

.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--success);
    overflow-x: auto;
    white-space: pre;
    margin-top: 8px
}

.collab-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px
}

.collab-info {
    display: flex;
    align-items: center;
    gap: 10px
}

.collab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%
}

.collab-dot.active {
    background: var(--success)
}

.collab-dot.inactive {
    background: var(--text-muted)
}

/* FAB */
.fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 8px 32px var(--accent-glow);
    transition: var(--transition);
    align-items: center;
    justify-content: center
}

.fab:hover {
    transform: translateY(-2px) scale(1.05)
}

@media(max-width:640px) {
    .fab {
        display: flex
    }

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

    .stat-card {
        padding: 14px
    }

    .stat-value {
        font-size: 18px
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .chart-container {
        height: 220px
    }

    .charts-grid {
        grid-template-columns: 1fr
    }

    .card-grid {
        grid-template-columns: 1fr
    }

    .content {
        padding: 14px
    }

    .toolbar {
        padding: 12px
    }

    .btn-primary span {
        display: none
    }
}

.spin {
    animation: spin 1s linear infinite
}

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