/* ═══════════════════════════════════════════════════
   app.css — Nemobilier
   ═══════════════════════════════════════════════════ */

/* ─── VARIABLES ───────────────────────────────────── */
:root {
    --blue-dark:   #1a3a5c;
    --blue:        #1d5a9e;
    --blue-mid:    #2471c8;
    --blue-light:  #e8f1fc;
    --blue-accent: #3b90f5;

    --sidebar-w:  240px;
    --sidebar-collapsed-w: 64px;
    --header-h:   64px;

    --text:        #1e2a3b;
    --text-muted:  #6b7a90;
    --border:      #dce4ef;
    --bg:          #f4f7fb;
    --white:       #ffffff;
    --radius:      10px;
    --shadow:      0 2px 12px rgba(26, 58, 92, 0.09);

    --green:       #22c55e;
    --green-bg:    #dcfce7;
    --green-text:  #166534;
    --red:         #ef4444;
    --red-bg:      #fee2e2;
    --red-text:    #991b1b;
    --red-mid:     #b91c1c;
    --yellow:      #eab308;
    --yellow-bg:   #fef9c3;
    --yellow-text: #854d0e;
    --info-bg:     #dbeafe;
    --info-text:   #1e40af;
}

/* ─── RESET & BASE ────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ─── LAYOUT ──────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--blue-dark);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    transition: width 0.25s ease;
}

/* Collapsed */
.sidebar.is-collapsed {
    width: var(--sidebar-collapsed-w);
}

.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-fy-text,
.sidebar.is-collapsed .sidebar-brand-text,
.sidebar.is-collapsed .sidebar-user-info,
.sidebar.is-collapsed .sidebar-fy-change,
.sidebar.is-collapsed .nav-section-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.sidebar.is-collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.is-collapsed .sidebar-fy-badge {
    justify-content: center;
}

/* Brand */
.sidebar-brand {
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--blue-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    color: #fff;
}

.sidebar-brand-text {
    font-family: 'Sora', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: opacity 0.2s, width 0.2s;
}

/* Fiscal year badge */
.sidebar-fy {
    margin: 16px 12px 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    padding: 10px 14px;
    flex-shrink: 0;
}

.sidebar-fy-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-fy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.sidebar-fy-dot--inactive {
    background: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

.sidebar-fy-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s, width 0.2s;
}

.sidebar-fy-year {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.sidebar-fy-year--none {
    color: #f87171;
}

.sidebar-fy-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-fy-change {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--blue-accent);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s;
}

.sidebar-fy-change i {
    font-size: 10px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    padding: 14px 8px 6px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link--active {
    background: var(--blue-mid);
    color: #fff;
}

.nav-link--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Footer / user */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blue-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s, width 0.2s;
}

.sidebar-username {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

/* ─── HEADER ──────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
    transition: left 0.25s ease;
    box-shadow: 0 1px 4px rgba(26, 58, 92, 0.06);
}

.header.is-collapsed {
    left: var(--sidebar-collapsed-w);
}

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

.sidebar-toggle {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-toggle:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.header-page-title {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

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

.header-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ─── PAGE WRAPPER ────────────────────────────────── */
.page-wrapper {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    padding: 28px 40px;
    transition: margin-left 0.25s ease;
    width: calc(100% - var(--sidebar-w));
}

.page-wrapper.is-collapsed {
    margin-left: var(--sidebar-collapsed-w);
    width: calc(100% - var(--sidebar-collapsed-w));
}

/* ─── FLASH MESSAGES ──────────────────────────────── */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
}

.flash--success { background: var(--green-bg);  color: var(--green-text);  border-left: 3px solid var(--green); }
.flash--error   { background: var(--red-bg);    color: var(--red-text);    border-left: 3px solid var(--red); }
.flash--warning { background: var(--yellow-bg); color: var(--yellow-text); border-left: 3px solid var(--yellow); }
.flash--info    { background: var(--info-bg);   color: var(--info-text);   border-left: 3px solid var(--blue-accent); }

/* ─── BUTTONS ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
    text-decoration: none;
}

/* Sizes */
.btn--sm  { padding: 7px 14px;  font-size: 13px; }
.btn--md  { padding: 10px 18px; font-size: 14px; }
.btn--lg  { padding: 12px 22px; font-size: 15px; }

/* Variants */
.btn--primary { background: var(--blue);     color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }

.btn--secondary { background: var(--blue-light); color: var(--blue); }
.btn--secondary:hover { background: #d0e5f8; }

.btn--danger  { background: var(--red-bg); color: var(--red-mid); }
.btn--danger:hover  { background: #fecaca; }

.btn--ghost   { background: transparent; color: var(--text-muted); }
.btn--ghost:hover   { background: var(--blue-light); color: var(--blue); }

/* ─── CARDS ───────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.card__title {
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__title i {
    color: var(--blue);
}

/* ─── TABLES ──────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13.5px;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: #f9fbfd;
}

.table--empty td {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* ─── BADGES ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge--green  { background: var(--green-bg);  color: #15803d; }
.badge--blue   { background: var(--blue-light); color: var(--blue); }
.badge--red    { background: var(--red-bg);     color: var(--red-mid); }
.badge--yellow { background: var(--yellow-bg);  color: var(--yellow-text); }

/* ─── FORMS ───────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-control:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(59, 144, 245, 0.15);
}

.form-control::placeholder {
    color: #aab4c4;
}

/* ─── PAGE HEADER ─────────────────────────────────── */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 13px;
}

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

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
}

.stat-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
}

.stat-card__icon--blue   { background: var(--blue-light); color: var(--blue); }
.stat-card__icon--green  { background: var(--green-bg);   color: #16a34a; }
.stat-card__icon--red    { background: var(--red-bg);     color: var(--red-mid); }
.stat-card__icon--yellow { background: var(--yellow-bg);  color: var(--yellow-text); }

.stat-card__value {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w) !important;
        transition: transform 0.25s ease;
    }

    .sidebar.is-mobile-open {
        transform: translateX(0);
    }

    .header {
        left: 0 !important;
    }

    .page-wrapper {
        margin-left: 0 !important;
        padding: 20px 16px;
    }

    .header-meta {
        display: none;
    }

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

    .sidebar-overlay.is-active {
        display: block;
    }
}

/* ─── PROPERTY FORM ───────────────────────────────── */
.property-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.property-form .form-control {
    flex: 1;
    min-width: 160px;
}

.property-form .form-control:first-child {
    min-width: 240px;
    flex: 2;
}

.property-form .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ─── TABLE ACTIONS ───────────────────────────────── */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── CONFIRM MODAL ───────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 50, 0.45);
    backdrop-filter: blur(3px);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.is-active {
    display: flex;
    animation: modalFadeIn 0.15s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: var(--white);
    border-radius: 14px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(15, 30, 50, 0.2);
    text-align: center;
    animation: modalSlideUp 0.18s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--yellow-bg);
    color: var(--yellow-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
}

.modal__title {
    font-family: 'Sora', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.modal__message {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal__actions .btn {
    flex: 1;
    justify-content: center;
    max-width: 160px;
}

/* ─── MODAL VARIANTS ──────────────────────────────── */
.modal--lg {
    max-width: 600px;
    padding: 0;
}

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

.modal__header .modal__title {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.modal__close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.modal__close:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.modal__body {
    padding: 24px;
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ─── FORM GRID ───────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.required {
    color: var(--red);
}

/* ─── TEXTAREA ────────────────────────────────────── */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ─── FORM READONLY STATE ─────────────────────────── */
.form-control:disabled {
    background: var(--bg);
    color: var(--text);
    border-color: transparent;
    cursor: default;
}

#peFooterEdit {
    display: none;
    gap: 10px;
}

/* ─── TABS ────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn,
.investor-tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tab-btn:hover,
.investor-tab-btn:hover {
    color: var(--text);
    background: var(--blue-light);
}

.tab-btn--active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

.tab-total {
    background: var(--blue-light);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.tab-panel,
.investor-tab-panel {
    display: none;
}

.tab-panel--active,
.investor-tab-panel.tab-panel--active {
    display: block;
}

/* ─── INCOME TABLE ─────────────────────────────────── */
.income-table-header {
    display: grid;
    grid-template-columns: 160px 1fr 1fr 140px;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.income-row {
    display: grid;
    grid-template-columns: 160px 1fr 1fr 140px;
    gap: 10px;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.1s;
}

.income-row:last-of-type {
    border-bottom: none;
}

.income-row:hover {
    background: #f9fbfd;
}

.income-col-month {
    display: flex;
    align-items: center;
}

.income-month-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.income-col-amount {
    display: flex;
    align-items: center;
}

.income-col-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.income-row-total {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    min-width: 80px;
    text-align: right;
}

.income-input {
    width: 100%;
}

.income-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-muted);
}

.income-subtotal strong {
    color: var(--text);
    font-size: 15px;
}

.income-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.income-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.income-total span {
    font-size: 12px;
    color: var(--text-muted);
}

.income-total strong {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

@media (max-width: 768px) {
    .income-table-header,
    .income-row {
        grid-template-columns: 90px 1fr 1fr 80px;
    }
    .income-footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .tabs {
        overflow-x: auto;
    }
}

/* ─── EXPENSE FORM ────────────────────────────────── */
.expense-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.expense-form .form-control {
    flex: 1;
    min-width: 140px;
}

.expense-form .btn {
    flex-shrink: 0;
}

/* ─── SELECT ──────────────────────────────────────── */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7a90' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .income-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .income-footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* ─── DASHBOARD STAT CARDS ───────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(15,30,50,0.07);
}

.stat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card__icon--blue   { background: #e8f1fc; color: #1d5a9e; }
.stat-card__icon--green  { background: #dcfce7; color: #166534; }
.stat-card__icon--red    { background: #fee2e2; color: #991b1b; }
.stat-card__icon--yellow { background: #fef9c3; color: #854d0e; }

.stat-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card__value {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* ─── FISCAL RESULT ───────────────────────────────── */
.fiscal-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.fiscal-section__title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.fiscal-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid #f4f6f9;
}

.fiscal-line--total {
    border-top: 2px solid var(--border);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 600;
    font-size: 14px;
}

.fiscal-result-summary {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fiscal-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 5px 0;
}

.fiscal-result-row--main {
    font-size: 17px;
    font-weight: 700;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.text--green { color: #1a9e5c; }
.text--red   { color: #e03434; }

.tab-total--green {
    background: #dcfce7;
    color: #166534;
}

.tab-total--red {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .fiscal-result-grid {
        grid-template-columns: 1fr;
    }
    .fiscal-result-row--main {
        font-size: 15px;
    }
}

/* ─── FISCAL SUMMARY — 2033 FORMS ────────────────── */

.form-section-header {
    background: var(--bg-subtle);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin: -1px -1px 0;
    border-radius: 8px 8px 0 0;
}

.decl-table td small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.col-line   { width: 56px; }
.col-amount { width: 160px; text-align: right !important; }
.amount-cell { text-align: right; white-space: nowrap; }

.line-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.line-badge--calc  { background: rgba(37,99,235,.12);  border-color: rgba(37,99,235,.35); color: #2563eb; }
.line-badge--input { background: rgba(234,179,8,.15);  border-color: rgba(234,179,8,.5);  color: #a16207; }
.line-badge--green { background: rgba(22,163,74,.12);  border-color: rgba(22,163,74,.4);  color: #16a34a; }
.line-badge--red   { background: rgba(220,38,38,.12);  border-color: rgba(220,38,38,.4);  color: #dc2626; }

.row-na td        { opacity: .38; font-size: 13px; }
.row-na .amount-cell { font-style: italic; }

.row-calc   { background: rgba(37,99,235,.05); }
.row-input  { background: rgba(234,179,8,.06); }
.row-manual { background: rgba(220,38,38,.04); }
.row-manual .amount-cell { color: var(--text-muted); font-style: italic; font-size: 12px; }

.row-section-label td {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    padding: 8px 12px 4px !important;
    background: transparent;
    border-bottom: none;
}

.row-result     { background: var(--bg-subtle); }
.row-total      { background: var(--bg-subtle); }
.row-result-big { background: var(--bg-subtle); border-top: 2px solid var(--border); }
.row-result-big td { font-size: 15px; }

.amount-cell--calc   { border-left: 3px solid rgba(37,99,235,.4) !important; font-weight: 600; color: #1e40af; }
.amount-cell--input  { border-left: 3px solid rgba(234,179,8,.6) !important; font-weight: 600; color: #92400e; }
.amount-cell--result { font-weight: 700; font-size: 16px; }
.amount-cell--result.positive { color: var(--green); }
.amount-cell--result.negative { color: var(--red); }
/* ── LOAN SCHEDULE TABLE ─────────────────────────── */
details summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }

.loan-schedule-table {
    width: 100%;
    table-layout: fixed;
    font-size: 14px;
    border-collapse: collapse;
}
.loan-schedule-table thead tr {
    background: var(--bg-subtle, #f8fafc);
}
.loan-schedule-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border, #e5e7eb);
}
.loan-schedule-table th.col-num    { width: 52px; text-align: center; }
.loan-schedule-table th.col-date   { width: 110px; }
.loan-schedule-table th.col-amount { text-align: right; }
.loan-schedule-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    white-space: nowrap;
}
.loan-schedule-table td.col-num    { text-align: center; color: var(--text-muted); font-size: 12px; }
.loan-schedule-table td.col-date   { color: var(--text-muted); }
.loan-schedule-table td.col-amount { text-align: right; font-variant-numeric: tabular-nums; }
.loan-schedule-table td.col-highlight,
.loan-schedule-table th.col-highlight { font-weight: 700; color: var(--blue); }
.loan-schedule-table tbody tr:hover { background: var(--bg-subtle, #f8fafc); }
.loan-schedule-table tbody tr.row--highlight { background: rgba(59, 130, 246, 0.18); }
.loan-schedule-table tbody tr.row--highlight td.col-highlight { color: var(--blue); }

/* ── TOOLTIPS ────────────────────────────────────── */
.tooltip-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}
.tooltip-icon {
    font-size: 13px;
    color: var(--blue);
    cursor: help;
    opacity: 0.85;
    transition: opacity .15s;
    font-style: normal;
}
.tooltip-wrap:hover .tooltip-icon {
    opacity: 1;
}
.tooltip-box {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 280px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 13px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    z-index: 100;
    pointer-events: none;
    font-weight: 400;
}
.tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}
.tooltip-wrap:hover .tooltip-box { display: block; }

/* ── SIDEBAR GUIDE LINK ─────────────────────────── */
.sidebar-guide-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 0 8px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    border-top: 1px solid rgba(255,255,255,.07);
    padding-top: 12px;
    margin-top: 4px;
}
.sidebar-guide-link i { font-size: 14px; flex-shrink: 0; }
.sidebar-guide-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-guide-link--active { color: var(--blue-accent); }

/* ── GUIDE STYLES ───────────────────────────────── */
.guide-step-header { display:flex; gap:16px; align-items:flex-start; margin-bottom:20px; }
.guide-step-num {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.guide-step-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.guide-step-sub   { font-size: 13px; color: var(--text-muted); margin: 0; }
.guide-subtitle   {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    margin: 20px 0 12px;
}
.guide-block { border-radius: 8px; padding: 14px 16px; margin-bottom: 8px; }
.guide-block h3 { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.guide-block p  { font-size: 13px; line-height: 1.6; margin: 0; }
.guide-block--info    { background: rgba(37,99,235,.06); border: 1px solid rgba(37,99,235,.2); }
.guide-block--info h3 { color: #1d4ed8; }
.guide-block--warn    { background: rgba(234,179,8,.07); border: 1px solid rgba(234,179,8,.3); }
.guide-block--warn h3 { color: #92400e; }
.guide-block--neutral { background: var(--bg-subtle, #f8fafc); border: 1px solid var(--border); }
.guide-block--neutral h3 { color: var(--text); }
.guide-checklist { display: flex; flex-direction: column; gap: 14px; }
.guide-checklist-item { display: flex; gap: 12px; align-items: flex-start; }
.guide-checklist-item > i { margin-top: 2px; flex-shrink: 0; font-size: 15px; }
.guide-checklist-item strong { display: block; font-size: 13px; margin-bottom: 3px; }
.guide-checklist-item p { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.guide-compare { display: flex; gap: 16px; align-items: stretch; margin-top: 16px; }
.guide-compare-vs {
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: var(--text-muted); flex-shrink: 0;
}
.guide-compare-col { flex: 1; border-radius: 10px; padding: 16px; border: 2px solid transparent; }
.guide-compare-col--bad  { background: rgba(220,38,38,.05); border-color: rgba(220,38,38,.2); }
.guide-compare-col--good { background: rgba(22,163,74,.05);  border-color: rgba(22,163,74,.2); }
.guide-compare-label { font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.guide-compare-col--bad  .guide-compare-label { color: #b91c1c; }
.guide-compare-col--good .guide-compare-label { color: #15803d; }
.guide-compare-example { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.guide-compare-line   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.guide-compare-amount { font-size: 14px; font-weight: 600; }
.guide-compare-amount--sub  { color: var(--text-muted); font-size: 13px; }
.guide-compare-amount--bad  { color: #b91c1c; font-size: 15px; }
.guide-compare-amount--good { color: #15803d; font-size: 15px; }
.guide-compare-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0; }
@media (max-width: 640px) {
    .guide-compare { flex-direction: column; }
    .guide-compare-vs { padding: 4px 0; }
}

/* ── UNCLOSED PRIOR FY BANNER ───────────────────── */
.fy-unclosed-warning {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #78350f;
}
.fy-unclosed-warning__icon {
    font-size: 20px;
    color: #f59e0b;
    flex-shrink: 0;
    padding-top: 1px;
}
.fy-unclosed-warning__body {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.5;
}
.fy-unclosed-warning__body strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}
.fy-unclosed-warning__body p {
    margin: 0;
    color: #92400e;
}
.stat-card--warning {
    border: 1.5px solid #f59e0b;
}

/* ─── SUBSCRIPTION PAGES ──────────────────────────── */
.sub-result-page {
    max-width: 520px;
    margin: 80px auto;
    text-align: center;
    padding: 0 16px;
}

.sub-result-page__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
}

.sub-result-page__icon--success { background: var(--green, #16a34a); }
.sub-result-page__icon--cancel  { background: var(--red, #dc2626); }

.sub-result-page__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.sub-result-page__subtitle {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.sub-result-page__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sub-result-page__actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
}

.sub-result-page__note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.sub-result-page__note a {
    color: var(--blue);
}

.sub-unlock-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-unlock-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.sub-unlock-list li i {
    color: var(--green, #16a34a);
}

.sub-unlock-card {
    text-align: left;
    margin-bottom: 24px;
}

.sub-unlock-card__label {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ─── NAV SECTION PRO BADGE ──────────────────────── */
.nav-section-pro {
    margin-left: 6px;
    font-size: 9px;
    padding: 1px 5px;
    background: #f5c842;
    color: #7a5c00;
    border-radius: 99px;
    font-weight: 700;
    vertical-align: middle;
}

/* ─── SIDEBAR FY CLOSED ───────────────────────────── */
.sidebar-fy-closed {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin: 0 12px 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #fca5a5;
}

.sidebar-fy-closed i {
    flex-shrink: 0;
}

/* ─── SIDEBAR PREMIUM ICON ───────────────────────── */
.nav-section-pro {
    margin-left: 6px;
    font-size: 9px;
    padding: 1px 5px;
    background: #f5c842;
    color: #7a5c00;
    border-radius: 99px;
    font-weight: 700;
    vertical-align: middle;
}

/* ─── SIDEBAR ADMIN LINK ──────────────────────────── */
.sidebar-guide-link--admin {
    color: var(--red, #dc2626);
}

/* ─── NOTEPAD FAB ─────────────────────────────────── */
.notepad-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 290;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #f5c842;
    color: #3d2e00;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.notepad-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

/* ─── NOTEPAD PANEL ───────────────────────────────── */
.notepad-panel {
    position: fixed;
    bottom: 92px;
    right: 28px;
    z-index: 291;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #fefce8;
    border: 1px solid #e9c830;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.notepad-panel.is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.notepad-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e9c830;
    flex-shrink: 0;
}

.notepad-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a07800;
    font-size: 13px;
}

.notepad-panel__controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notepad-panel__status {
    font-size: 11px;
    color: #a07800;
}

.notepad-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #a07800;
    line-height: 1;
    padding: 2px 4px;
}

.notepad-panel__textarea {
    height: 260px;
    resize: none;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
    background: transparent;
    color: #3d2e00;
    font-family: inherit;
    overflow-y: auto;
}

.notepad-panel__footer {
    padding: 8px 16px;
    border-top: 1px solid #e9c830;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notepad-panel__date {
    font-size: 10px;
    color: #a07800;
}

.notepad-panel__clear {
    font-size: 11px;
    color: #a07800;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
}

/* ─── PREMIUM MODAL ───────────────────────────────── */
.premium-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.premium-modal-overlay.is-open {
    display: flex;
}

.premium-modal {
    background: var(--white);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(245, 200, 66, 0.3);
    position: relative;
}

.premium-modal__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5c842, #e09d10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
    color: #7a5c00;
}

.premium-modal__title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.premium-modal__desc {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.premium-modal__features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.premium-modal__features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
}

.premium-modal__features li i {
    color: #f5c842;
    width: 16px;
    flex-shrink: 0;
}

.premium-modal__cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.premium-modal__btn-monthly {
    width: 100%;
    justify-content: center;
}

.premium-modal__btn-annual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(245, 200, 66, 0.4);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.premium-modal__btn-annual:hover {
    background: rgba(245, 200, 66, 0.08);
}

.premium-modal__discount {
    font-size: 10px;
    padding: 2px 7px;
    background: #f5c842;
    color: #7a5c00;
    border-radius: 99px;
    font-weight: 700;
}

.premium-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.15s;
}

.premium-modal__close:hover {
    color: var(--text);
}

/* ─── ACCOUNT — PLAN CARDS ────────────────────────── */
.account-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 768px) {
    .account-plans { grid-template-columns: 1fr; }
}

.plan-card {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, box-shadow .2s;
}

.plan-card--annual {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.plan-card.is-selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.plan-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    background: var(--blue);
    color: #fff;
    border-radius: 99px;
    letter-spacing: .04em;
}

.plan-card__header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle, #f8f7f3);
}

.plan-card__name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.plan-card__price {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.plan-card__period {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.plan-card__features {
    list-style: none;
    padding: 16px 20px;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card__feature {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-card__feature--ok  { color: var(--text); }
.plan-card__feature--ok i { color: var(--green, #16a34a); font-size: 11px; }
.plan-card__feature--off  { color: var(--text-muted); }
.plan-card__feature--off i { color: var(--text-muted); font-size: 11px; }

.plan-card__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.plan-card__current {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 0;
}

/* ══════════════════════════════════════════════
   UTILITAIRES
   ══════════════════════════════════════════════ */

/* Couleurs texte */
.text-positive { color: var(--green-text); }
.text-negative { color: var(--red-text); }
.text-blue     { color: var(--blue); }
.text-red      { color: var(--red-text); }
.text-yellow   { color: var(--yellow-text); }
.text-muted    { color: var(--text-muted); }
.text-green    { color: var(--green-text); }

/* Typographie */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-bold     { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal   { font-weight: 400; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }

/* Affichage */
.d-none          { display: none; }
.overflow-x-auto { overflow-x: auto; }
.opacity-50      { opacity: 0.5; }

/* ══════════════════════════════════════════════
   COMPOSANTS COMMUNS
   ══════════════════════════════════════════════ */

/* État vide */
.empty-state       { text-align: center; padding: 40px; }
.empty-state__icon { font-size: 32px; color: var(--text-muted); margin-bottom: 12px; display: block; }

/* Pastilles de couleur */
.dot           { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot--blue     { background: var(--blue); }
.dot--red      { background: var(--red); }
.dot--yellow   { background: var(--yellow); }
.dot--positive { background: var(--green); }
.dot--negative { background: var(--red); }

/* Séparateur horizontal */
.separator { height: 1px; background: var(--border); }

/* Bordure latérale colorée (cashflow, alertes) */
.border-left-positive { border-left: 3px solid var(--green); }
.border-left-negative { border-left: 3px solid var(--red); }

/* ══════════════════════════════════════════════
   COMPOSANTS ADMIN
   ══════════════════════════════════════════════ */

/* Badge rôle admin */
.badge--admin { background: #dc2626; color: #fff; }

/* Ligne de log */
.log-line         { padding: 4px 8px; border-radius: 4px; margin-bottom: 1px; }
.log-line--error  { background: rgba(220,38,38,0.12); }
.log-line--normal { background: rgba(255,255,255,0.03); }

/* Barre de stats vide */
.stat-bar--empty { opacity: 0.2; }

/* Panneau de cohérence (dashboard) */
.coherence-panel             { border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.coherence-panel--warning    { border: 1px solid var(--yellow, #d97706); }
.coherence-panel--info       { border: 1px solid var(--blue); }
.coherence-panel__header     { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: none; background: transparent; cursor: pointer; }
.coherence-panel__label      { display: flex; align-items: center; gap: 8px; }
.coherence-panel__badge          { padding: 1px 8px; border-radius: 20px; }
.coherence-panel__badge--warning { background: rgba(217,119,6,0.15); color: inherit; }
.coherence-panel__badge--info    { background: rgba(59,130,246,0.12); color: inherit; }
.coherence-panel__chevron    { transition: transform .2s; transform: rotate(180deg); }
.coherence-panel__body--warning { border-top: 1px solid var(--yellow, #d97706); }
.coherence-panel__body--info    { border-top: 1px solid var(--blue); }
.coherence-panel__issue      { display: flex; gap: 10px; padding: 10px 16px; }
.coherence-panel__issue:not(:last-child) { border-bottom: 1px solid var(--border); }
.coherence-panel__issue--warning { background: var(--yellow-bg, #fef9ec); }
.coherence-panel__issue--info    { background: var(--surface); }
.coherence-panel__issue-icon--warning { color: var(--yellow, #d97706); margin-top: 2px; }
.coherence-panel__issue-icon--info    { color: var(--blue); margin-top: 2px; }
.coherence-panel__issue-text { font-size: 12px; line-height: 1.5; color: var(--text); }
.coherence-panel__issue-link--warning { color: var(--yellow-text, #92400e); }
.coherence-panel__issue-link--info    { color: var(--blue); }

/* ══════════════════════════════════════════════
   UTILITAIRES DISPLAY / LAYOUT
   ══════════════════════════════════════════════ */

/* Formulaire en colonne (flex) */
.form-col { display: flex; flex-direction: column; gap: 16px; padding: 0 4px 8px; }
.form-col--sm { display: flex; flex-direction: column; gap: 14px; }

/* Grilles de formulaires */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-2--sm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3--sm { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Rangée flex avec boutons alignés à droite */
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; }
.form-actions--sm { display: flex; gap: 10px; justify-content: flex-end; }

/* Carte avec largeur maximale (formulaire de création) */
.card--narrow { max-width: 640px; }

/* Carte avec marge supérieure */
.card--mt { margin-top: 24px; }

/* Carte avec marge inférieure */
.card--mb { margin-bottom: 24px; }

/* En-tête de carte avec espace entre les éléments */
.card__title--spread { justify-content: space-between; }

/* Groupe d'actions flex */
.btn-group { display: flex; gap: 8px; }

/* Formulaire inline (display:inline) */
.form-inline { display: inline; }

/* ══════════════════════════════════════════════
   COMPOSANTS PRÊT (.loan-*)
   ══════════════════════════════════════════════ */

/* Conteneur principal deux colonnes (paramètres + récapitulatif) */
.loan-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Grille du récapitulatif annuel (2 colonnes) */
.loan-recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 4px 0 8px;
}

/* Cellule qui s'étend sur toute la largeur */
.loan-recap-grid__full { grid-column: span 2; }

/* Libellé de métrique (petit texte muted) */
.loan-metric-label { font-size: 11px; color: var(--text-muted); }

/* Valeur principale d'une métrique */
.loan-metric-value { font-size: 20px; font-weight: 700; }

/* Valeur principale — variante taille 18px (vue index) */
.loan-metric-value--md { font-size: 18px; font-weight: 700; }

/* Valeur corrigée manuellement */
.loan-override-note { font-size: 11px; color: var(--yellow); margin-top: 2px; }

/* Zone récapitulatif sur la page index */
.loan-recap-box {
    background: var(--bg-subtle, #f8fafc);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

/* Titre section récapitulatif */
.loan-recap-box__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 12px;
}

/* Grille auto-responsive du récapitulatif index */
.loan-recap-box__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

/* Conteneur du corps d'une carte prêt (padding interne) */
.loan-body { padding: 0 20px 20px; }

/* Hint sous un champ (petite note informative) */
.loan-field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Liste des segments (historique du prêt) */
.loan-segment-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }

/* Un segment dans la liste */
.loan-segment { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.loan-segment:last-child { border-bottom: none; }

/* Icône ronde du type d'événement */
.loan-segment__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.loan-segment__icon--initial    { background: var(--blue-light); color: var(--blue); }
.loan-segment__icon--repayment  { background: var(--yellow-bg);  color: var(--yellow-text); }
.loan-segment__icon--other      { background: var(--green-bg);   color: var(--green-text); }

/* Partie textuelle d'un segment */
.loan-segment__body { flex: 1; }

/* Titre du segment */
.loan-segment__title { font-weight: 600; font-size: 13px; }

/* Sous-titre du segment */
.loan-segment__subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Note optionnelle dans le titre d'un segment */
.loan-segment__note { font-weight: 400; color: var(--text-muted); font-size: 12px; }

/* Bouton supprimer segment (rouge) */
.btn--danger-text { color: var(--red); }

/* Boîte du formulaire d'ajout de segment */
.loan-add-segment-box {
    background: var(--bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
}

/* Titre interne du formulaire d'ajout de segment */
.loan-add-segment-box__title { font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--text); }

/* Accordéon tableau d'amortissement — déclencheur */
.loan-schedule-summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    padding: 6px 0;
    user-select: none;
}

/* Wrapper du tableau d'amortissement dans l'accordéon */
.loan-schedule-wrapper { margin-top: 16px; }

/* Bloc vide (aucun prêt) */
.loan-empty-card { text-align: center; padding: 32px; }

/* Icône du bloc vide */
.loan-empty-card__icon { font-size: 28px; color: var(--text-muted); margin-bottom: 10px; display: block; }

/* Bouton du bloc vide */
.loan-empty-card__btn { margin-top: 12px; }

/* En-tête d'un prêt sur la page index */
.loan-header { display: flex; align-items: center; gap: 10px; }

/* Méta-données dans l'en-tête du prêt */
.loan-header__meta { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* Sous-titre d'un label (poids normal, couleur atténuée) */
.label-sub { font-weight: 400; color: var(--text-muted); }

/* ══════════════════════════════════════════════
   COMPOSANTS BIEN (.property-*)
   ══════════════════════════════════════════════ */

/* Badge avec marge en haut (gestion agence) */
.badge--mt { margin-top: 4px; }

/* Zone info gestion de frais d'agence (modal bien) */
.property-fee-info {
    padding: 10px 14px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 3px solid var(--blue);
    border-radius: 8px;
    background: var(--blue-light, #eff6ff);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Icône dans la zone info */
.property-fee-info__icon { color: var(--blue); margin-right: 6px; }

/* Texte lien dans la zone info */
.property-fee-info__link { color: var(--blue); font-size: 11px; }

/* Bloc vide (propriété non rattachée / limite atteinte) */
.property-upsell { text-align: center; padding: 32px 24px; }

/* Icône premium dorée */
.property-upsell__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5c842, #e09d10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
    color: #7a5c00;
}

/* Titre de l'upsell */
.property-upsell__title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }

/* Description de l'upsell */
.property-upsell__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* ══════════════════════════════════════════════
   COMPOSANTS GUIDE (.guide-*)
   ══════════════════════════════════════════════ */

/* Navigation rapide du guide */
.guide-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Label "Aller à :" dans la nav */
.guide-nav__label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 4px;
}

/* Icône colorée dans le titre de page */
.guide-page-icon { color: var(--blue); margin-right: 8px; }

/* Rangée de liens en bas de section */
.guide-link-row { margin-top: 16px; }

/* Grille des cases 2031 (badge + description) */
.guide-2031-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ligne d'une case 2031 */
.guide-2031-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    align-items: start;
}

/* Badge numéro de case */
.guide-2031-badge {
    background: var(--blue);
    color: #fff;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    margin-top: 2px;
}

/* Texte d'une case 2031 */
.guide-2031-desc { font-size: 13px; }

/* Rangée de liens officiels */
.guide-official-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* Icône dans une checklist */
.guide-checklist-icon--green { color: var(--green); }
.guide-checklist-icon--muted { color: var(--text-muted); }

/* Bulle ⓘ colorée dans le texte courant */
.guide-tooltip-ref { color: var(--blue); font-weight: 600; }

/* Marges supérieures génériques */
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

/* Marge inférieure générique */
.mb-14 { margin-bottom: 14px; }

/* Padding interne léger (haut/bas) */
.pad-y-sm { padding: 4px 0 8px; }

/* Curseur non-interactif (badge informatif) */
.cursor-default { cursor: default; }

/* ══════════════════════════════════════════════
   DASHBOARD — STYLES REFACTORISÉS
   ══════════════════════════════════════════════ */

/* Lien héritant la couleur du parent avec souligné */
.link-inherit-underline {
    color: inherit;
    text-decoration: underline;
    margin-top: 4px;
    display: inline-block;
}

/* Indicateur "indicatif" dans la stat-card déficit */
.stat-card__indicator {
    color: var(--yellow);
    font-size: 11px;
    margin-left: 4px;
}

/* Sous-ligne de détail dans stat-card (stock brut / imputé) */
.stat-card__sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Bloc d'avertissement LMP (recettes > 23 000 €) */
.lmp-warning {
    background: var(--yellow-bg, #fef9ec);
    border: 1px solid var(--yellow, #d97706);
    border-left: 4px solid var(--yellow, #d97706);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Icône du bloc LMP */
.lmp-warning__icon {
    color: var(--yellow, #d97706);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Titre du bloc LMP */
.lmp-warning__title {
    font-size: 13px;
    color: var(--yellow-text, #92400e);
}

/* Texte du bloc LMP */
.lmp-warning__text {
    font-size: 12px;
    color: var(--yellow-text, #92400e);
    margin: 4px 0 0;
}

/* Ligne de charge vide (aucune charge saisie) */
.fiscal-line--muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Sous-ligne indentée dans le récapitulatif fiscal (fs-13 muted) */
.fiscal-result-row__indent {
    padding-left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Valeur muted fs-13 dans le récapitulatif fiscal */
.fiscal-result-row__value-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Valeur en jaune fs-13 (amortissements reportables) */
.fiscal-result-row__value-yellow {
    color: var(--yellow-text);
    font-size: 13px;
}

/* Note d'information en bas du récapitulatif (déficit reportable) */
.fiscal-result-row__note {
    color: var(--text-muted);
    font-size: 12px;
}

/* Sous-titre adresse dans card__title (muted, fw-normal, fs-13) */
.card__title-address {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

/* Badge avec margin-left auto (alignement droite dans flex) */
.badge--push-right {
    margin-left: auto;
}

/* Barre de statistique avec hauteur dynamique via variable CSS */
.stat-bar {
    height: var(--bar-h);
}

/* ══════════════════════════════════════════════
   ACCOUNT — STYLES REFACTORISÉS
   ══════════════════════════════════════════════ */

/* Onglets sans marge basse */
.tabs--no-bottom-margin {
    margin-bottom: 0;
}

/* Carte avec marge haute réduite (espaceur entre cartes) */
.card--mt {
    margin-top: 8px;
}

/* Carte zone de danger (bordure rouge à gauche) */
.card--danger {
    border-left: 4px solid var(--red);
}

/* En-tête d'info compte (avatar + email) */
.account-info-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Avatar circulaire avec initiale */
.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Email de l'utilisateur */
.account-email {
    font-weight: 600;
    font-size: 14px;
}

/* Méthode de connexion (Google ou email/mdp) */
.account-email-method {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Icône Google dans la méthode de connexion */
.icon-google {
    color: #4285f4;
}

/* Titre de section dans une carte (h2 standard) */
.card__heading {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Titre de section avec marge basse réduite */
.card__heading--sm-mb {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Icône bleue dans un titre de carte */
.card__heading-icon--blue {
    color: var(--blue);
}

/* Titre de plan en h2 avec marge basse minimale */
.card__heading--plan {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Description de carte standard */
.card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Description de carte avec marge basse 12px */
.card__desc--mb12 {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Description de carte avec marge basse 16px */
.card__desc--mb16 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Description de plan avec marge basse 24px */
.card__desc--mb24 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Formulaire en colonne avec espacement réduit (formulaires de compte) */
.form-col--account {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Form-group sans marge (dans form-col) */
.form-group--tight {
    margin: 0;
}

/* Titre h2 rouge (zone de danger) */
.card__heading--danger {
    font-size: 15px;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 8px;
}

/* Bloc abonnement actif (Premium) */
.subscription-active {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--green-bg, #f0fdf4);
    border: 1px solid var(--green, #16a34a);
    margin-bottom: 20px;
}

/* Icône check dans le bloc Premium actif */
.subscription-active__icon {
    color: var(--green, #16a34a);
    font-size: 20px;
}

/* Nom du plan Premium */
.subscription-active__name {
    font-weight: 700;
    font-size: 14px;
}

/* Méta-info du plan (label, renouvellement) */
.subscription-active__meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Alerte paiement en attente (past_due) */
.past-due-alert {
    padding: 12px 16px;
    border-radius: 8px;
    background: #fef9ec;
    border: 1px solid #d97706;
    margin-bottom: 16px;
    font-size: 13px;
}

/* Icône de l'alerte paiement en attente */
.past-due-alert__icon {
    color: #d97706;
}

/* Label "Payer avec" dans les providers de plan */
.plan-providers-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

/* Liste des providers en colonne */
.plan-providers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Bouton pleine largeur centré (sélection de plan / provider) */
.btn--full-center {
    width: 100%;
    justify-content: center;
}

/* Note de prix mensuel dans la période du plan annuel */
.plan-period__note {
    font-size: 11px;
    color: var(--text-muted);
}

/* Modale taille réduite (460px) */
.modal--sm {
    max-width: 460px;
}

/* Zone de confirmation de mot de passe dans la modale */
.modal__confirm-field {
    margin: 16px 0;
    text-align: left;
}

/* Label du champ de confirmation */
.modal__confirm-label {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

/* Note Google (pas de mot de passe requis) */
.modal__confirm-note {
    font-size: 13px;
    color: var(--text-muted);
    margin: 12px 0;
}

/* Input pleine largeur dans la modale */
.modal__confirm-input {
    width: 100%;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════
   COMPOSANT — ALERTE / BANNIÈRE LÉGALE
   (fiscal_summary/index.html.twig)
   ══════════════════════════════════════════════ */

/* Bannière avertissement jaune */
.alert-warning {
    border-left: 4px solid var(--yellow);
    background: rgba(234, 179, 8, .06);
    margin-bottom: 8px;
}

.alert-warning__body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 4px 0;
}

.alert-warning__icon {
    color: var(--yellow);
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-warning__text {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

/* ══════════════════════════════════════════════
   COMPOSANT — LÉGENDE (synthèse fiscale)
   ══════════════════════════════════════════════ */

/* Conteneur de la légende */
.legend {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Un item de légende */
.legend__item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Pastille colorée générique */
.legend__swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Pastille — valeur calculée par l'application */
.legend__swatch--calc {
    background: rgba(37, 99, 235, .1);
    border: 2px solid rgba(37, 99, 235, .4);
}

/* Pastille — valeur saisie (à vérifier) */
.legend__swatch--input {
    background: rgba(234, 179, 8, .1);
    border: 2px solid rgba(234, 179, 8, .5);
}

/* Pastille — non applicable LMNP */
.legend__swatch--na {
    background: var(--bg-subtle, #f8f7f3);
    border: 1px solid var(--border);
    opacity: .5;
}

/* Pastille — à compléter manuellement */
.legend__swatch--manual {
    background: rgba(220, 38, 38, .08);
    border: 2px solid rgba(220, 38, 38, .3);
}

/* ══════════════════════════════════════════════
   COMPOSANT — LIEN GUIDE (synthèse fiscale)
   ══════════════════════════════════════════════ */

/* Wrapper aligné à droite du lien "Comment remplir ces cases ?" */
.guide-link-wrap {
    text-align: right;
    margin-bottom: 4px;
}

/* Le lien guide */
.guide-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ══════════════════════════════════════════════
   TABLEAU FISCAL — .fiscal-table
   (fiscal_summary/index.html.twig)
   ══════════════════════════════════════════════ */

/* Cellule libellé indentée (niveau 1) */
.fiscal-table td.td-indent {
    padding-left: 24px;
}

/* Ligne avec séparateur en tirets en haut */
.fiscal-table tr.row-dashed-top td {
    border-top: 2px dashed var(--border);
}

/* ══════════════════════════════════════════════
   COMPOSANT — ENCART FRAIS DE GESTION AGENCE
   (expense/index.html.twig)
   ══════════════════════════════════════════════ */

/* Encart principal frais de gestion */
.fee-check {
    margin-top: 16px;
    border: 1px solid var(--blue);
    border-left: 3px solid var(--blue);
    border-radius: 10px;
    overflow: hidden;
}

/* En-tête de l'encart */
.fee-check__header {
    background: var(--blue-light, #eff6ff);
    padding: 11px 16px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fee-check__header-icon { color: var(--blue); }

.fee-check__header-title {
    font-size: 13px;
    color: var(--blue);
}

.fee-check__header-rate {
    font-size: 12px;
    color: var(--blue);
    opacity: 0.7;
    margin-left: 4px;
}

/* Corps de l'encart */
.fee-check__body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}

/* Ligne label / valeur dans le corps */
.fee-check__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fee-check__label { color: var(--text-muted); }
.fee-check__value--blue { color: var(--blue); }

/* Badge de résultat d'écart */
.fee-check__result {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    padding: 8px 12px;
}

.fee-check__result--ok    { background: var(--green-bg); }
.fee-check__result--over  { background: #fff8ed; }
.fee-check__result--under { background: #fff0f0; }

.fee-check__result-text { font-size: 12px; font-weight: 600; }
.fee-check__result-text--ok    { color: var(--green-text); }
.fee-check__result-text--over  { color: var(--yellow-text); }
.fee-check__result-text--under { color: var(--red-text); }

/* Pied d'encart — info si aucun honoraire saisi */
.fee-check__footer-info {
    background: var(--info-bg);
    padding: 8px 16px;
    font-size: 11px;
    color: var(--info-text);
}

/* Encart "pas de taux configuré sur la fiche bien" */
.fee-check-hint {
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fee-check-hint__icon {
    color: var(--blue);
    font-size: 14px;
    flex-shrink: 0;
}

.fee-check-hint__text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ══════════════════════════════════════════════
   COMPOSANT — ALERTE NON DÉDUCTIBLE (expense)
   ══════════════════════════════════════════════ */

/* Avertissement catégorie non déductible — masqué par défaut */
.non-deductible-warning {
    display: none;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid var(--yellow, #d97706);
    border-left: 3px solid var(--yellow, #d97706);
    border-radius: 7px;
    background: var(--yellow-bg, #fef9ec);
    font-size: 12px;
    color: var(--yellow-text, #92400e);
    line-height: 1.5;
}

/* ══════════════════════════════════════════════
   UTILITAIRES DIVERS — refacto templates
   ══════════════════════════════════════════════ */

/* Libellé de bien actif (badge dynamique dans titre de card) */
.active-property-label {
    color: var(--blue);
    font-weight: 600;
}

/* Ligne de tableau avec opacité réduite (terrain non amortissable) */
.row-faded { opacity: 0.5; }

/* Ligne d'édition inline amortissement mobilier */
.row-edit-inline { background: rgba(37, 99, 235, .04); }

/* Cellule de la ligne d'édition inline */
.row-edit-inline__cell { padding: 12px 16px; }

/* Formulaire inline dans une cellule de tableau */
.form-inline-wrap { flex-wrap: wrap; gap: 8px; }

/* Champ texte étendu dans formulaire inline (édition mobilier) */
.form-control--flex2 { flex: 2; min-width: 160px; }

/* Champ texte large dans formulaire d'ajout mobilier */
.form-control--flex2-lg { flex: 2; min-width: 180px; }

/* Select avec largeur minimale (durée amortissement) */
.form-control--select-md { min-width: 140px; }

/* Input année exercice fiscal (largeur max restreinte) */
.input--year { max-width: 200px; }

/* Formulaire en ligne (display:inline pour les <form> dans cellules) */
.form--inline { display: inline; }

/* Bouton désactivé visuellement (état "Actif" non cliquable) */
.btn--disabled-look { cursor: default; opacity: .5; }

/* Actions alignées à droite dans le header d'une card */
.card__title-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Méta-info (base, date) dans le header d'une card amortissement */
.card__title-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Bloc "données manquantes" centré avec padding dans une card */
.card-placeholder {
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
}

/* Badge non déductible — espacement gauche */
.badge--offset-left { margin-left: 4px; }

/* Utilitaire flex-shrink:0 (empêche le rétrécissement d'un élément flex) */
.flex-shrink-0 { flex-shrink: 0; }

/* Icône étoile couleur or (plan tarifaire) */
.icon-star-gold { color: #f5c842; }

/* Variante danger de l'icône de modale (fond rouge) */
.modal__icon--danger {
    background: var(--red-bg);
    color: var(--red);
}

/* ══════════════════════════════════════════════
   UTILITAIRES ADMIN — suppression styles inline
   ══════════════════════════════════════════════ */

/* Couleur Google (auth) */
.text-google { color: #4285f4; }

/* Badge générique (rôles utilisateur) */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Barre de stat dynamique — hauteur via propriété CSS personnalisée */
.stat-bar { height: var(--bar-h); }

/* ══════════════════════════════════════════════
   LAYOUT ADMIN — flexbox communs
   ══════════════════════════════════════════════ */

/* Colonne flex avec espacement vertical */
.admin-flex-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Ligne flex centrée verticalement */
.admin-flex-row-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Formulaire inline (display:inline) */
.admin-form--inline { display: inline; }

/* ══════════════════════════════════════════════
   EN-TÊTE DE PAGE ADMIN (store_records, store_edit)
   ══════════════════════════════════════════════ */

.admin-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-page-header__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

/* ══════════════════════════════════════════════
   CELLULES DE TABLEAU ADMIN
   ══════════════════════════════════════════════ */

/* Cellule tronquée */
.admin-td--truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cellule sans retour à la ligne */
.admin-td--nowrap { white-space: nowrap; }

/* Cellule état vide */
.admin-td--empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* Colonne action à largeur fixe */
.admin-th--action { width: 100px; }

/* ══════════════════════════════════════════════
   GRILLE EXERCICES FISCAUX (dashboard)
   ══════════════════════════════════════════════ */

.admin-fy-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Carte stat compacte pour les années fiscales */
.admin-stat--fy {
    min-width: 80px;
    text-align: center;
}

/* ══════════════════════════════════════════════
   STATS REVENUE — grille 4 colonnes
   ══════════════════════════════════════════════ */

.admin-stats--4col { grid-template-columns: repeat(4, 1fr); }

/* ══════════════════════════════════════════════
   TABLEAU REVENUE — ligne total
   ══════════════════════════════════════════════ */

.revenue-table__total {
    font-weight: 700;
    border-top: 2px solid var(--border);
}

/* ══════════════════════════════════════════════
   BADGE "en cours" (revenue — mois courant)
   ══════════════════════════════════════════════ */

.plan-badge--en-cours {
    margin-left: 6px;
    font-size: 10px;
}

/* ══════════════════════════════════════════════
   CARTE ADMIN INFO (revenue — méthodologie)
   ══════════════════════════════════════════════ */

.admin-card--info { border-left: 3px solid var(--blue); }

.admin-methodology {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ══════════════════════════════════════════════
   EXPLORATEUR DE STORES (store_list)
   ══════════════════════════════════════════════ */

/* Icône dossier avec marge droite */
.admin-icon--mr { margin-right: 6px; }

/* Badge compteur d'enregistrements */
.admin-count-badge {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

/* ══════════════════════════════════════════════
   ÉDITEUR JSON (store_edit)
   ══════════════════════════════════════════════ */

.admin-json-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.admin-json-panel__notice {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Icône avertissement (jaune) */
.admin-icon--warning { color: var(--yellow, #d97706); }

/* Actions bas de formulaire */
.admin-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ══════════════════════════════════════════════
   LOGS (logs.html.twig)
   ══════════════════════════════════════════════ */

/* Onglets de sélection du fichier de log */
.admin-log-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* Conteneur principal des lignes de log */
.admin-log-container {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Message quand le fichier est vide */
.admin-log-empty {
    color: #64748b;
    font-size: 13px;
}

/* Style commun à chaque ligne de log */
.admin-log-line {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: #cbd5e1;
}

/* Couleur texte des lignes d'erreur */
.log-line--error.admin-log-line { color: #fca5a5; }

/* Note de bas de page du bloc logs */
.admin-log-footer {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Bouton pleine largeur centré (modale premium) */
.btn--full-center { width: 100%; justify-content: center; text-decoration: none; }

/* Note sous le CTA de la modale premium */
.premium-modal__note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; margin-bottom: 0; }

/* Piège autofill : visible par le navigateur, invisible pour l'utilisateur */
.autofill-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* Colonne sticky droite (ex : colonne Actions dans les tables admin) */
.admin-th--sticky,
.admin-td--sticky {
    position: sticky;
    right: 0;
    background: var(--white, #fff);
    z-index: 1;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
}

/* ══════════════════════════════════════════════
   MODALE D'INFORMATION
   ══════════════════════════════════════════════ */

.info-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-modal-overlay.d-none { display: none; }

.info-modal {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.info-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.info-modal__close:hover { background: var(--bg); }

.info-modal__icon {
    width: 52px;
    height: 52px;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
}

.info-modal__title {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.info-modal__content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-align: left;
}

.info-modal__cta { width: 100%; justify-content: center; }

/* ── Notice compte Google ──────────────────────────────────────────── */
.account-google-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.account-google-notice .fa-google {
    color: #4285F4;
    font-size: 15px;
    flex-shrink: 0;
}

/* ── Loan header — mois restants ───────────────────────────────────── */
.loan-header__remaining {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Barre sticky (Revenus + Charges) ──────────────────────────────── */
.income-save-sticky {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 240px);
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 200;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(100%);
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
}

.income-save-sticky--visible {
    transform: translateY(0);
    opacity: 1;
}

.income-save-sticky__total {
    font-size: 14px;
    color: var(--text-muted);
}

.income-save-sticky__total strong {
    color: var(--text);
    font-size: 16px;
    margin-left: 4px;
}


/* ══════════════════════════════════════════════════════════════════════
   Page Export PDF — Hub de sélection
   ══════════════════════════════════════════════════════════════════════ */

/* ── Upsell premium ──────────────────────────────────────────────────── */
.export-upsell {
    max-width: 480px;
    margin: 40px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.export-upsell__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
}

.export-upsell__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.export-upsell__desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.export-upsell__features {
    list-style: none;
    text-align: left;
    display: inline-block;
    margin-bottom: 24px;
}

.export-upsell__features li {
    font-size: 13px;
    color: var(--text);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-upsell__features li i {
    color: #16a34a;
    font-size: 14px;
    flex-shrink: 0;
}

.export-upsell__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 12px;
}

.export-upsell__note {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Onglets export ──────────────────────────────────────────────────── */
.export-tabs {
    display: flex;
    flex-direction: column;
}

.export-tabs__nav {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
}

.export-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.export-tab-btn:hover {
    color: var(--text);
    background: #f8fafc;
}

.export-tab-btn--active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.export-tab-panel {
    display: none;
    flex-direction: column;
}

.export-tab-panel--active {
    display: flex;
}

/* ── Barre de contrôles ──────────────────────────────────────────────── */
.export-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.export-controls__left {
    flex-shrink: 0;
}

.export-controls__left .form-control {
    min-width: 220px;
}

.export-controls__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
    background: #ede9fe;
    border-radius: 20px;
    padding: 5px 14px;
}

.export-controls__stats {
    display: flex;
    gap: 24px;
    flex: 1;
}

.export-controls__right {
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Statistiques ────────────────────────────────────────────────────── */
.export-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.export-stat__label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 500;
}

.export-stat__value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.export-stat__value--positive { color: #16a34a; }
.export-stat__value--negative { color: #dc2626; }

/* ── Lien de téléchargement désactivé ───────────────────────────────── */
.export-download-link--disabled {
    opacity: .45;
    pointer-events: none;
    cursor: not-allowed;
}

/* ── Conteneur PDF ───────────────────────────────────────────────────── */
.export-pdf-container {
    position: relative;
    margin-top: 16px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 700px;
}

.export-pdf-iframe {
    display: none;
    width: 100%;
    height: 700px;
    border: none;
}

.export-pdf-loading {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.export-pdf-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: export-spin .7s linear infinite;
}

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

.export-pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 700px;
    color: var(--text-muted);
}

.export-pdf-placeholder i {
    font-size: 40px;
    opacity: .3;
}

.export-pdf-placeholder p {
    font-size: 14px;
}

/* États du conteneur PDF */
.export-pdf-container.is-loading .export-pdf-loading    { display: flex; }
.export-pdf-container.is-loading .export-pdf-placeholder { display: none; }
.export-pdf-container.is-loaded  .export-pdf-iframe     { display: block; }
.export-pdf-container.is-loaded  .export-pdf-placeholder { display: none; }

/* ══════════════════════════════════════════════
   MOBILE — compléments responsive
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {

    .page-wrapper {
        width: 100% !important;
        padding: 16px 14px 80px;
    }

    .header {
        padding: 0 16px;
    }

    /* Tableaux scrollables */
    .card > .table,
    .card > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Formulaires multi-colonnes → 1 colonne */
    .form-grid,
    .form-grid-2,
    .form-grid-2--sm,
    .form-grid-3--sm {
        grid-template-columns: 1fr;
    }

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

    /* Grille prêt */
    .loan-edit-grid,
    .loan-recap-grid {
        grid-template-columns: 1fr;
    }

    .loan-recap-grid__full {
        grid-column: 1;
    }

    /* Barre sticky revenus */
    .income-save-sticky {
        left: 0 !important;
    }

    /* Modales full-screen */
    .modal--lg {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    /* Export controls */
    .export-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .export-controls__right {
        margin-left: 0;
        width: 100%;
    }

    .export-controls__right .btn {
        width: 100%;
        justify-content: center;
    }

    .export-controls__stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Page header */
    .page-header h1 {
        font-size: 18px;
    }
}