/* Project theme bridge for legacy pages that still carry inline CSS. */

:root {
    --primary: var(--app-primary);
    --primary-color: var(--app-primary);
    --primary-dark: var(--app-primary-dark);
    --primary-light: color-mix(in srgb, var(--app-primary) 12%, white);
    --primary-bg-light: color-mix(in srgb, var(--app-primary) 8%, white);
    --secondary-color: var(--app-accent);
    --bg: var(--app-bg);
    --light: var(--app-bg);
    --dark: var(--app-text);
    --border: var(--app-border);
    --muted: var(--app-muted);
}

body {
    background-color: var(--app-bg, #f8fafc);
    color: var(--app-text, #1e293b);
    font-family: var(--app-font-family, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--app-font-size, 14px);
}

.btn-primary,
.btn-journal,
.btn-success:not(.btn-outline-success) {
    background: var(--app-gradient-primary, linear-gradient(135deg, var(--app-primary, #315c64), var(--app-primary-dark, #1e3a40)));
    border-color: var(--app-primary, #315c64);
    color: #fff;
}

.btn-primary:hover,
.btn-journal:hover,
.btn-success:not(.btn-outline-success):hover {
    background-color: var(--app-primary-dark, #1e3a40);
    border-color: var(--app-primary-dark, #1e3a40);
    color: #fff;
}

.form-control:focus,
.form-select:focus,
.search-input:focus {
    border-color: var(--app-primary, #315c64);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary, #315c64) 14%, transparent);
}

.card,
.form-card,
.table-container,
.filter-bar,
.summary-card {
    border-color: var(--app-border, #e2e8f0);
}

.header-journal,
.header-purchase,
.header-receipt,
.header-payment,
.app-header,
.topbar {
    background: var(--app-gradient-primary, linear-gradient(135deg, var(--app-primary, #315c64), var(--app-primary-dark, #1e3a40)));
}

.brand i,
.text-primary,
.accounts-table-title {
    color: var(--app-primary, #315c64);
}

.header .brand i,
.app-header .brand i,
.topbar .brand i,
.header-page-title {
    color: #fff;
}

.bg-purple,
.bg-primary,
.filter-btn.active {
    background-color: var(--app-primary, #315c64) !important;
}

.filter-btn:hover {
    border-color: var(--app-primary, #315c64);
    color: var(--app-primary, #315c64);
}

.form-card,
.summary-card,
.card,
.table-container {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border, #d8e1e7);
    box-shadow: 0 4px 14px rgba(23, 32, 51, 0.06);
}

.form-card h1,
.form-card h2,
.form-card h3,
.form-card h4,
.form-card h5,
.form-card h6,
.card-title,
.section-title,
.tree-category-header,
.summary-value,
.summary-card .sc-val,
.summary-card .summary-value,
.summary-card .val {
    color: var(--app-primary, #315c64) !important;
}

.summary-card .sc-icon,
.summary-card .summary-icon,
.summary-card .icon,
.stat-icon {
    background: color-mix(in srgb, var(--app-primary, #315c64) 10%, white) !important;
    color: var(--app-primary, #315c64) !important;
}

.modal-header,
.modal-header-drag {
    background: var(--app-gradient-primary, linear-gradient(135deg, var(--app-primary, #315c64), var(--app-primary-dark, #1e3a40))) !important;
    color: #fff !important;
}

.badge.text-bg-light,
.count-pill,
.quick-btn.active {
    background: color-mix(in srgb, var(--app-primary, #315c64) 9%, white) !important;
    border-color: color-mix(in srgb, var(--app-primary, #315c64) 24%, white) !important;
    color: var(--app-primary-dark, #1e3a40) !important;
}

.text-purple,
[style*="color:#7c3aed"],
[style*="color: #7c3aed"],
[style*="color:#2d6a4f"],
[style*="color: #2d6a4f"],
[style*="color:#1b4332"],
[style*="color: #1b4332"],
[style*="color:#315c64"],
[style*="color: #315c64"],
[style*="color:#1e3a40"],
[style*="color: #1e3a40"] {
    color: var(--app-primary, #315c64) !important;
}

[style*="color:#f59e0b"],
[style*="color: #f59e0b"],
[style*="color:#d4a843"],
[style*="color: #d4a843"],
[style*="color:#b8860b"],
[style*="color: #b8860b"] {
    color: var(--app-accent, #c08a2c) !important;
}

[style*="background:#7c3aed"],
[style*="background: #7c3aed"],
[style*="background:#2d6a4f"],
[style*="background: #2d6a4f"],
[style*="background:#1b4332"],
[style*="background: #1b4332"],
[style*="background:#315c64"],
[style*="background: #315c64"],
[style*="background:#1e3a40"],
[style*="background: #1e3a40"],
[style*="background:#f59e0b"],
[style*="background: #f59e0b"] {
    background: var(--app-gradient-primary, linear-gradient(135deg, var(--app-primary, #315c64), var(--app-primary-dark, #1e3a40))) !important;
}

.hosted-window-controls {
    align-items: center;
    display: flex;
    gap: 4px;
    position: fixed;
    right: 10px;
    top: 8px;
    z-index: 10050;
}

.hosted-window-controls button {
    align-items: center;
    background: color-mix(in srgb, var(--app-primary-dark) 88%, black);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 17px;
    height: 28px;
    justify-content: center;
    line-height: 1;
    width: 30px;
}

.hosted-window-controls button:hover {
    background: var(--app-primary);
}

@media print {
    .hosted-window-controls { display: none !important; }
}
