:root {
    --fp-bg: #f6f8fb;
    --fp-surface: #ffffff;
    --fp-surface-muted: #eef3f1;
    --fp-text: #17211d;
    --fp-muted: #68756f;
    --fp-line: #d9e2dd;
    --fp-primary: #0f766e;
    --fp-primary-dark: #115e59;
    --fp-accent: #d97706;
    --fp-success: #15803d;
    --fp-danger: #b42318;
    --fp-shadow: 0 12px 28px rgba(23, 33, 29, 0.08);
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    color: var(--fp-text);
    font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(246, 248, 251, 0) 320px),
        var(--fp-bg);
}

a {
    color: var(--fp-primary);
}

a:hover {
    color: var(--fp-primary-dark);
}

.app-shell {
    flex: 1;
    width: min(1440px, calc(100% - 32px));
    margin: 88px auto 32px;
}

.app-shell,
.table,
.card,
.app-panel {
    overflow-wrap: anywhere;
}

.navbar.app-navbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--fp-line);
    backdrop-filter: blur(16px);
}

.navbar.app-navbar .navbar-toggler {
    border-color: var(--fp-line);
}

.navbar.app-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2823, 33, 29, 0.82%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar.app-navbar .navbar-brand,
.navbar.app-navbar .nav-link {
    color: var(--fp-text);
}

.navbar.app-navbar .nav-link:hover,
.navbar.app-navbar .nav-link:focus {
    color: var(--fp-primary);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--fp-primary), var(--fp-accent));
    font-weight: 800;
}

.page-band {
    padding: 28px 0;
    border-bottom: 1px solid var(--fp-line);
}

.page-kicker {
    color: var(--fp-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: var(--fp-text);
    font-weight: 800;
}

.page-subtitle {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--fp-muted);
    font-size: 1.02rem;
}

.metric-card,
.app-card,
.card {
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    background: var(--fp-surface);
    box-shadow: 0 8px 18px rgba(23, 33, 29, 0.05);
}

.metric-card {
    height: 100%;
    padding: 20px;
}

.metric-label {
    margin-bottom: 8px;
    color: var(--fp-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.metric-value {
    margin: 0;
    color: var(--fp-text);
    font-size: 1.65rem;
    font-weight: 800;
}

.metric-income {
    border-top: 4px solid var(--fp-success);
}

.metric-expense {
    border-top: 4px solid var(--fp-danger);
}

.metric-net {
    border-top: 4px solid var(--fp-primary);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.app-panel {
    padding: 24px;
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    background: var(--fp-surface);
    box-shadow: 0 8px 18px rgba(23, 33, 29, 0.05);
}

.summary-strip {
    padding: 16px 0 0;
    border-top: 1px solid var(--fp-line);
}

.form-label,
label {
    color: var(--fp-text);
    font-weight: 700;
}

.form-control,
.form-select,
select.form-control {
    min-height: 42px;
    border-color: var(--fp-line);
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.14);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--fp-primary);
    background: var(--fp-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--fp-primary-dark);
    background: var(--fp-primary-dark);
}

.btn-outline-secondary {
    border-color: var(--fp-line);
    color: var(--fp-text);
}

.btn-secondary {
    border-color: #6b7280;
    background: #6b7280;
}

.btn-danger {
    border-color: var(--fp-danger);
    background: var(--fp-danger);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 8px;
    line-height: 1;
    vertical-align: middle;
}

.trash-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: currentColor;
    pointer-events: none;
}

.btn-danger.icon-btn {
    color: #ffffff;
}

.btn-outline-danger.icon-btn {
    color: var(--fp-danger);
}

.btn-outline-danger.icon-btn:hover,
.btn-outline-danger.icon-btn:focus {
    color: #ffffff;
}

.btn-success {
    border-color: var(--fp-success);
    background: var(--fp-success);
}

.table-responsive {
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    background: var(--fp-surface);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 1px solid var(--fp-line);
    color: var(--fp-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.transaction-amount {
    font-weight: 800;
}

.transaction-amount-negative {
    color: #8f1d1d;
}

.transaction-amount-positive {
    color: #11612f;
}

.report-page h1,
.report-page h2,
.report-page h3 {
    overflow-wrap: anywhere;
}

.report-form {
    max-width: 960px;
}

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

.clickable-row,
.clickable-card {
    cursor: pointer;
}

.clickable-row:hover {
    background: rgba(15, 118, 110, 0.06);
}

.clickable-card:hover {
    border-color: var(--fp-primary);
}

.mobile-transaction-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    margin-bottom: 6px;
    padding: 8px 10px;
    border: 1px solid #b9c8c1;
    border-radius: 8px;
    background: var(--fp-surface);
    box-shadow: 0 1px 2px rgba(23, 33, 29, 0.06);
}

.mobile-transaction-main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.mobile-transaction-copy {
    min-width: 0;
}

.mobile-transaction-title {
    overflow: hidden;
    color: var(--fp-text);
    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-transaction-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow: hidden;
    color: var(--fp-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.mobile-transaction-meta span {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
}

.mobile-transaction-amount {
    flex: 0 0 auto;
    color: var(--fp-text);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.mobile-transaction-actions {
    flex: 0 0 auto;
}

.mobile-transaction-actions .btn {
    padding: 4px 7px;
    font-size: 0.72rem;
    line-height: 1.2;
}

.footer {
    margin-top: auto;
    padding: 18px;
    color: var(--fp-muted);
    text-align: center;
    border-top: 1px solid var(--fp-line);
    background: var(--fp-surface);
}

.quota-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    color: var(--fp-muted);
    background: var(--fp-surface-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

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

.news-topic-list span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    color: var(--fp-text);
    background: var(--fp-surface-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.news-update-list {
    display: grid;
    gap: 10px;
}

.news-update-item {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--fp-line);
    border-left: 4px solid var(--fp-primary);
    border-radius: 8px;
    background: var(--fp-surface-muted);
    color: var(--fp-text);
    text-decoration: none;
}

.news-update-item:hover,
.news-update-item:focus {
    border-color: rgba(15, 118, 110, 0.38);
    border-left-color: var(--fp-primary-dark);
    color: var(--fp-text);
    box-shadow: 0 8px 18px rgba(23, 33, 29, 0.05);
}

.news-update-date {
    color: var(--fp-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.news-update-copy h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.news-update-copy p {
    margin: 6px 0 0;
    color: var(--fp-muted);
}

.advisor-grid .card,
.coach-advisor-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.advisor-grid .card:hover,
.coach-advisor-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: var(--fp-shadow);
}

.decision-list {
    display: grid;
    gap: 12px;
}

.decision-list-full {
    gap: 16px;
}

.decision-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    background: var(--fp-surface-muted);
}

.decision-content {
    min-width: 0;
}

.decision-item-full .decision-content {
    flex: 1 1 auto;
}

.decision-meta {
    margin-bottom: 4px;
    color: var(--fp-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.decision-title {
    color: var(--fp-text);
    font-weight: 750;
}

.decision-item-full .decision-title {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.decision-body {
    color: var(--fp-text);
    white-space: pre-wrap;
}

.decision-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.decision-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.decision-tab {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--fp-line);
    border-radius: 8px;
    background: var(--fp-surface);
    color: var(--fp-text);
    font-weight: 700;
    text-decoration: none;
}

.decision-tab:hover,
.decision-tab.active {
    border-color: rgba(15, 118, 110, 0.45);
    background: rgba(15, 118, 110, 0.1);
    color: var(--fp-forest);
}

.coach-avatar,
.coach-avatar-img {
    width: 88px;
    height: 88px;
}

.coach-avatar {
    margin: 0 auto;
}

.coach-avatar-img {
    display: block;
}

@media (max-width: 576px) {
    .app-shell {
        width: min(100% - 20px, 1440px);
        margin-top: 76px;
    }

    .page-band,
    .app-panel {
        padding: 18px;
    }

    .page-title {
        font-size: 1.65rem;
    }

    .metric-value {
        font-size: 1.35rem;
    }

    .decision-item {
        flex-direction: column;
    }

    .decision-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .decision-actions form,
    .decision-actions button {
        width: 100%;
    }

    .table th,
    .table td {
        font-size: 0.78rem;
        padding: 0.45rem;
    }

    .news-update-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .report-page {
        padding-right: 0;
        padding-left: 0;
    }

    .report-page h1 {
        font-size: 1.75rem;
    }

    .report-page h2 {
        font-size: 1.35rem;
    }

    .report-page h3 {
        font-size: 1.12rem;
    }

    .report-table,
    .report-table thead,
    .report-table tbody,
    .report-table tfoot,
    .report-table tr,
    .report-table th,
    .report-table td {
        display: block;
        width: 100%;
    }

    .report-table thead {
        display: none;
    }

    .report-table tr {
        border-bottom: 1px solid var(--fp-line);
    }

    .report-table tr:last-child {
        border-bottom: 0;
    }

    .report-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        border-width: 0 0 1px;
        text-align: right;
    }

    .report-table td:last-child {
        border-bottom: 0;
    }

    .report-table td::before {
        content: attr(data-label);
        flex: 0 0 44%;
        color: var(--fp-muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    .report-table .text-end {
        text-align: right !important;
    }
}

.coach-hero {
    position: relative;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.coach-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coach-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

.coach-hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
    padding: 48px 24px;
    text-align: center;
    color: #ffffff;
}

.coach-hero-kicker {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    opacity: 0.92;
}

.coach-hero-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 14px;
}

.coach-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0 auto;
    max-width: 640px;
    opacity: 0.96;
}

@media (max-width: 768px) {
    .coach-hero {
        min-height: 320px;
    }

    .coach-hero-content {
        padding: 32px 18px;
    }

    .coach-hero-subtitle {
        font-size: 0.98rem;
    }
}
