/* =========================================================
   FAMILY FINANCE AI
   MOBILE-FIRST APPLICATION STYLES
   ========================================================= */


/* =========================================================
   ROOT VARIABLES
   ========================================================= */

:root {
    --app-primary: #0d6efd;
    --app-primary-dark: #0a58ca;
    --app-primary-soft: #eaf3ff;

    --app-brand: #0d6efd;
    --app-brand-dark: #0a58ca;

    --app-success: #198754;
    --app-danger: #dc3545;
    --app-warning: #ffc107;
    --app-info: #0dcaf0;

    --app-text: #212529;
    --app-text-muted: #6c757d;

    --app-background: #f5f7fb;
    --app-surface: #ffffff;
    --app-border: #e4e7ec;

    --app-navbar-height: 64px;

    --app-radius-sm: 8px;
    --app-radius-md: 12px;
    --app-radius-lg: 16px;

    --app-shadow-sm:
        0 2px 8px rgba(16, 24, 40, 0.06);

    --app-shadow-md:
        0 8px 24px rgba(16, 24, 40, 0.08);

    --app-transition:
        0.2s ease;
}


/* =========================================================
   GLOBAL
   ========================================================= */

html {
    min-height: 100%;
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;
    margin: 0;

    display: flex;
    flex-direction: column;

    background: var(--app-background);

    color: var(--app-text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


a {
    color: var(--app-primary);
    text-decoration: none;
}


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


button,
input,
select,
textarea {
    font: inherit;
}


img {
    max-width: 100%;
    height: auto;
}


::selection {
    background: var(--app-primary);
    color: #ffffff;
}


/* =========================================================
   MAIN
   ========================================================= */

.app-main {
    flex: 1;
    width: 100%;
    min-width: 0;
}


/* =========================================================
   NAVBAR
   ========================================================= */

.app-navbar {
    min-height: var(--app-navbar-height);

    background: var(--app-surface);

    border-bottom: 1px solid var(--app-border);

    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.04);

    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}


.app-navbar .container {
    min-height: 52px;
}


/* =========================================================
   BRAND
   ========================================================= */

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;

    color: var(--app-text) !important;

    font-size: 1rem;
    font-weight: 700;

    white-space: nowrap;
}


.app-brand:hover {
    color: var(--app-text) !important;
}


.app-brand-icon {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--app-primary);
    color: #ffffff;

    font-size: 1rem;

    box-shadow:
        0 4px 12px rgba(13, 110, 253, 0.2);
}


.app-brand-text {
    line-height: 1;
}


/* =========================================================
   MOBILE NAV TOGGLER
   ========================================================= */

.navbar-toggler {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--app-border);

    border-radius: var(--app-radius-sm);

    background: var(--app-surface);
}


.navbar-toggler:focus {
    box-shadow:
        0 0 0 3px rgba(13, 110, 253, 0.15);
}


/* =========================================================
   NAVIGATION LINKS
   ========================================================= */

.app-navbar .navbar-collapse {
    padding-top: 0.75rem;
}


.app-navbar .navbar-nav {
    gap: 0.25rem;
}


.app-nav-link {
    display: flex !important;
    align-items: center;

    gap: 0.5rem;

    width: 100%;

    padding: 0.7rem 0.85rem !important;

    border-radius: var(--app-radius-sm);

    color: var(--app-text-muted) !important;

    font-size: 0.95rem;
    font-weight: 500;

    transition:
        background-color var(--app-transition),
        color var(--app-transition);
}


.app-nav-link:hover {
    background: var(--app-background);

    color: var(--app-primary) !important;
}


.app-nav-link i {
    font-size: 1rem;
}


.app-register-item {
    margin-top: 0.25rem;
}


.app-nav-register {
    display: flex !important;
    justify-content: center;
    align-items: center;

    width: 100%;

    padding: 0.7rem 1rem !important;

    border-radius: var(--app-radius-sm);

    background: var(--app-primary);

    color: #ffffff !important;

    font-size: 0.95rem;
    font-weight: 600;

    transition:
        background-color var(--app-transition),
        transform var(--app-transition);
}


.app-nav-register:hover {
    background: var(--app-primary-dark);

    color: #ffffff !important;
}


.app-nav-logout form {
    margin: 0;
}


.app-logout-button {
    border: 0;
    background: transparent;

    cursor: pointer;

    text-align: left;
}


/* =========================================================
   PAGE CONTAINER
   ========================================================= */

.app-message-container {
    padding-top: 1rem;
    padding-bottom: 0;
}


/* =========================================================
   ALERTS
   ========================================================= */

.app-alert {
    position: relative;

    border-radius: var(--app-radius-md);

    border-width: 1px;

    box-shadow: var(--app-shadow-sm);

    font-size: 0.9rem;

    padding: 0.85rem 3rem 0.85rem 0.9rem;
}


.app-alert-icon {
    flex: 0 0 auto;

    margin-top: 0.1rem;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-label {
    margin-bottom: 0.45rem;

    color: var(--app-text);

    font-size: 0.9rem;
    font-weight: 600;
}


.form-control,
.form-select {
    min-height: 46px;

    border-color: var(--app-border);

    border-radius: var(--app-radius-sm);

    background: #ffffff;

    color: var(--app-text);

    box-shadow: none;

    transition:
        border-color var(--app-transition),
        box-shadow var(--app-transition);
}


.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary);

    box-shadow:
        0 0 0 3px rgba(13, 110, 253, 0.12);
}


.form-control::placeholder {
    color: #98a2b3;
}


textarea.form-control {
    min-height: 110px;
}


.form-text {
    color: var(--app-text-muted);
    font-size: 0.82rem;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    min-height: 44px;

    border-radius: var(--app-radius-sm);

    font-weight: 600;

    transition:
        background-color var(--app-transition),
        border-color var(--app-transition),
        color var(--app-transition),
        transform var(--app-transition),
        box-shadow var(--app-transition);
}


.btn:active {
    transform: translateY(1px);
}


.btn-primary {
    box-shadow:
        0 4px 10px rgba(13, 110, 253, 0.16);
}


.btn-primary:hover {
    box-shadow:
        0 6px 14px rgba(13, 110, 253, 0.2);
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    border: 1px solid var(--app-border);

    border-radius: var(--app-radius-md);

    background: var(--app-surface);

    box-shadow: var(--app-shadow-sm);
}


.card-body {
    padding: 1.1rem;
}


.card-title {
    color: var(--app-text);
    font-weight: 700;
}


/* =========================================================
   TABLES
   ========================================================= */

.table {
    margin-bottom: 0;

    color: var(--app-text);
}


.table th {
    white-space: nowrap;

    color: var(--app-text-muted);

    font-size: 0.78rem;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.025em;
}


.table td {
    vertical-align: middle;
}


/* =========================================================
   FOOTER
   ========================================================= */

.app-footer {
    margin-top: 2rem;

    border-top: 1px solid var(--app-border);

    background: var(--app-surface);

    padding: 1.25rem 0;
}


.app-footer-content {
    display: flex;
    flex-direction: column;

    gap: 0.85rem;
}


.app-footer-brand {
    display: flex;
    align-items: center;

    gap: 0.45rem;

    color: var(--app-text);

    font-size: 0.9rem;
    font-weight: 700;
}


.app-footer-brand i {
    color: var(--app-primary);
}


.app-footer-description {
    margin: 0.3rem 0 0;

    color: var(--app-text-muted);

    font-size: 0.8rem;
}


.app-footer-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;

    color: var(--app-text-muted);

    font-size: 0.76rem;
}


.app-footer-divider {
    opacity: 0.6;
}


/* =========================================================
   UTILITY CLASSES
   ========================================================= */

.app-page-header {
    padding: 1.25rem 0;
}


.app-page-title {
    margin: 0;

    color: var(--app-text);

    font-size: 1.5rem;
    font-weight: 700;
}


.app-page-subtitle {
    margin: 0.35rem 0 0;

    color: var(--app-text-muted);

    font-size: 0.9rem;
}


.app-section {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}


.app-surface {
    background: var(--app-surface);

    border: 1px solid var(--app-border);

    border-radius: var(--app-radius-md);

    box-shadow: var(--app-shadow-sm);
}


.app-muted {
    color: var(--app-text-muted) !important;
}


.app-hidden {
    display: none !important;
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.app-empty-state {
    padding: 2rem 1rem;

    text-align: center;

    color: var(--app-text-muted);
}


.app-empty-state-icon {
    width: 52px;
    height: 52px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 0.75rem;

    border-radius: 50%;

    background: var(--app-primary-soft);

    color: var(--app-primary);

    font-size: 1.25rem;
}


/* =========================================================
   LOADING STATE
   ========================================================= */

.app-loading {
    position: relative;

    pointer-events: none;

    opacity: 0.7;
}


.app-spinner {
    width: 1rem;
    height: 1rem;

    display: inline-block;

    border: 2px solid currentColor;

    border-right-color: transparent;

    border-radius: 50%;

    animation: app-spin 0.7s linear infinite;
}


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


/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 576px) {

    .app-brand {
        font-size: 1.05rem;
    }

    .app-card-body {
        padding: 1.25rem;
    }

    .app-page-header {
        padding: 1.5rem 0;
    }

    .app-page-title {
        font-size: 1.7rem;
    }

    .app-footer {
        padding: 1.5rem 0;
    }
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 992px) {

    .app-navbar {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .app-navbar .navbar-collapse {
        padding-top: 0;
    }

    .app-navbar .navbar-nav {
        gap: 0.35rem;
    }

    .app-nav-link {
        width: auto;

        padding: 0.55rem 0.75rem !important;
    }

    .app-nav-register {
        width: auto;

        padding: 0.55rem 1rem !important;
    }

    .app-register-item {
        margin-top: 0;
        margin-left: 0.2rem;
    }

    .app-page-header {
        padding: 2rem 0;
    }

    .app-page-title {
        font-size: 2rem;
    }

    .app-footer-content {
        flex-direction: row;

        align-items: center;

        justify-content: space-between;
    }
}


/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1200px) {

    .app-page-title {
        font-size: 2.15rem;
    }

    .card-body {
        padding: 1.35rem;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}


/* =========================================================
   FAMILY DETAIL PAGE
   ========================================================= */

.family-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--app-text-muted);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 12px;
}

.family-back-link:hover {
    color: var(--app-brand);
    text-decoration: none;
}

/* ---- HERO ---- */

.family-hero {
    background: linear-gradient(135deg,
        var(--app-brand, #1c3d63) 0%,
        var(--app-brand-dark, #16304e) 100%);
    color: #ffffff;
    border-radius: var(--app-radius-lg);
    padding: 20px;
    box-shadow: 0 6px 20px rgba(28, 61, 99, 0.18);
}

.family-hero-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.family-hero-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
}

.family-hero-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    align-self: flex-start;
    backdrop-filter: blur(6px);
}

.family-hero-code code {
    color: #ffffff;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 700;
    background: transparent;
    padding: 0;
    font-size: 13px;
}

.family-hero-code button {
    border: 0;
    background: transparent;
    color: #ffffff;
    opacity: 0.8;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
}

.family-hero-code button:hover {
    opacity: 1;
}

/* ---- SECTION TITLE ---- */

.family-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--app-text);
}

/* ---- QUICK LINKS GRID ---- */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 576px) {
    .quick-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
}

.quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    text-decoration: none;
    color: var(--app-text);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-height: 78px;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.quick-tile i {
    font-size: 22px;
    color: var(--app-brand, #1c3d63);
}

.quick-tile span {
    line-height: 1.15;
}

.quick-tile:hover {
    border-color: var(--app-brand, #1c3d63);
    color: var(--app-text);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(28, 61, 99, 0.08);
}

.quick-tile:active {
    transform: translateY(1px);
}

.quick-tile-highlight {
    border-color: var(--app-brand, #1c3d63);
    background: var(--app-primary-soft, #e8eef5);
}

/* ---- MONEY HERO ---- */

.money-hero {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
}

.money-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-text-muted);
    margin-bottom: 4px;
}

.money-hero-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--app-text);
    line-height: 1.15;
}

.money-hero-meta {
    font-size: 12px;
    color: var(--app-text-muted);
    margin-top: 4px;
}

/* ---- STAT TILES ---- */

.stat-tile {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 12px 14px;
    height: 100%;
}

.stat-tile-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
    margin-bottom: 4px;
}

.stat-tile-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

/* ---- INFO CARDS ---- */

.info-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

.info-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--app-border);
}

.info-card-head h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--app-text);
}

.info-card-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--app-brand, #1c3d63);
    text-decoration: none;
}

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

/* ---- INFO LIST ---- */

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--app-border);
    min-height: 52px;
}

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

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

.info-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-row-sub {
    font-size: 12px;
    color: var(--app-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-row-amount {
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- MEMBER AVATAR (small) ---- */

.member-avatar-sm {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--app-primary-soft, #e8eef5);
    color: var(--app-brand, #1c3d63);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ---- GOAL MINI ---- */

.goal-mini {
    padding: 12px 16px;
    border-bottom: 1px solid var(--app-border);
}

.goal-mini:last-child {
    border-bottom: none;
}

/* ---- FAMILY HEADER ACTIONS (mobile: icons only) ---- */

.family-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.family-actions .btn {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    margin: 0;
}

.family-actions .btn i {
    font-size: 14px;
}

@media (max-width: 575.98px) {
    .family-actions .btn span {
        display: none;
    }

    .family-actions .btn {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
        justify-content: center;
    }

    .family-actions .btn i {
        font-size: 16px;
    }
}
/* =========================================================
   FAMILY LIST PAGE
   ========================================================= */

.family-list-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--app-text);
    margin: 0 0 4px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .family-list-title {
        font-size: 28px;
    }
}

.family-list-subtitle {
    font-size: 14px;
    color: var(--app-text-muted);
    margin: 0;
}

/* ---- FAMILY LIST ---- */

.family-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.family-list-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    text-decoration: none;
    color: inherit;
    min-height: 80px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.family-list-card:hover {
    border-color: var(--app-brand, #1c3d63);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(28, 61, 99, 0.08);
}

.family-list-card:active {
    transform: translateY(1px);
}

.family-list-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        var(--app-brand, #1c3d63) 0%,
        var(--app-brand-dark, #16304e) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.family-list-body {
    flex: 1;
    min-width: 0;
}

.family-list-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--app-text);
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-list-meta {
    font-size: 13px;
    color: var(--app-text-muted);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-list-meta-sm {
    font-size: 12px;
    color: var(--app-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-list-chevron {
    color: var(--app-text-soft, #98a2b3);
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- ACTION CARDS (create / join) ---- */

.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    text-decoration: none;
    color: inherit;
    min-height: 72px;
    margin-bottom: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.action-card:hover {
    border-color: var(--app-brand, #1c3d63);
    background: var(--app-primary-soft, #e8eef5);
    color: inherit;
    text-decoration: none;
}

.action-card-dashed {
    border-style: dashed;
    border-width: 2px;
    border-color: var(--app-border);
}

.action-card-icon {
    font-size: 22px;
    color: var(--app-brand, #1c3d63);
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.action-card-body {
    flex: 1;
    min-width: 0;
}

.action-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--app-text);
    margin: 0 0 2px;
    line-height: 1.2;
}

.action-card-desc {
    font-size: 12px;
    color: var(--app-text-muted);
    margin: 0;
    line-height: 1.3;
}

.action-card-chevron {
    color: var(--app-text-soft, #98a2b3);
    font-size: 18px;
    flex-shrink: 0;
}

/* =========================================================
   REPORTS PAGE
   ========================================================= */

.report-section { margin-bottom: 24px; }

.report-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--app-text);
}

.report-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

.report-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    margin: 0;
}

.report-table thead th {
    background: #f8f9fb;
    border-bottom: 2px solid var(--app-border);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-text-muted);
    text-align: left;
    white-space: nowrap;
}

.report-table thead th.num { text-align: right; }

.report-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.report-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.report-table tbody tr:nth-child(even) { background: #fcfcfd; }
.report-table tbody tr:hover { background: #f5f7fb; }
.report-table tbody tr.clickable { cursor: pointer; }
.report-table tbody tr.clickable:hover { background: #eff4fb; }

.report-table tfoot td {
    padding: 12px;
    border-top: 2px solid var(--app-border);
    background: #f8f9fb;
    font-weight: 700;
}
.report-table tfoot td.num { text-align: right; }

.num-positive { color: var(--app-success); }
.num-negative { color: var(--app-danger); }
.num-muted    { color: var(--app-text-muted); }

@media (max-width: 575.98px) {
    .report-table { font-size: 12px; }
    .report-table thead th,
    .report-table tbody td,
    .report-table tfoot td { padding: 8px 10px; }
}

.export-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.export-bar .btn { min-height: 40px; font-size: 13px; }

.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 10px 12px;
}

.month-nav .month-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.month-nav .month-link {
    font-size: 12px;
    color: var(--app-text-muted);
    text-decoration: none;
}
.month-nav .month-link:hover { text-decoration: underline; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 14px;
}

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
    margin-bottom: 4px;
}

.kpi-value { font-size: 18px; font-weight: 700; line-height: 1.2; }
.kpi-value.pos { color: var(--app-success); }
.kpi-value.neg { color: var(--app-danger); }

.kpi-sub {
    font-size: 11px;
    color: var(--app-text-muted);
    margin-top: 4px;
}