/* ==========================================================================
   Greentimes — UI v4.0
   Minimal, Apple-inspired. One accent (brand green), neutral surfaces,
   system typography, hairline structure instead of shadows.

   Tokens
   canvas  #F5F5F7   surface #FFFFFF   ink #1D1D1F   ink-2 #515154   ink-3 #6E6E73
   brand   #1B7F36 (AA with white text)  warn #A85D00  danger #C41E16  info #0A64B4
   ========================================================================== */

:root {
    --canvas: #F5F5F7;
    --surface: #FFFFFF;
    --ink: #1D1D1F;
    --ink-2: #515154;
    --ink-3: #6E6E73;
    --ink-4: #86868B;
    --line: rgba(0, 0, 0, .08);
    --line-strong: rgba(0, 0, 0, .14);
    --fill: #F2F2F4;
    --fill-hover: #E9E9ED;

    --brand: #1B7F36;
    --brand-hover: #15692C;
    --brand-tint: rgba(27, 127, 54, .10);
    --brand-ring: rgba(27, 127, 54, .28);

    --ok: #1B7F36;   --ok-tint: #E8F5EB;
    --warn: #A85D00; --warn-tint: #FFF3DD;
    --danger: #C41E16; --danger-tint: #FDECEA;
    --info: #0A64B4; --info-tint: #E8F2FD;

    --r-control: 10px;
    --r-panel: 16px;
    --r-pill: 999px;

    --sidebar-w: 236px;
    --ease: cubic-bezier(.25, .1, .25, 1);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Legacy aliases so older pages keep rendering correctly */
    --bg: var(--canvas); --text: var(--ink); --text-muted: var(--ink-3); --hairline: var(--line);
    --green: var(--brand); --green-tint: var(--brand-tint); --orange: var(--warn); --orange-tint: var(--warn-tint);
    --red: var(--danger); --red-tint: var(--danger-tint); --gray-tint: var(--fill);
}

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

html, body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.47;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 3px; }
small, .small { font-size: .84em; }
::selection { background: var(--brand-tint); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.num, .money, td.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Shell */
.gt-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1045;
    display: flex; flex-direction: column;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border-right: 1px solid var(--line);
}
.gt-sidebar-head { height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.gt-brand { display: flex; align-items: center; gap: 10px; color: var(--ink) !important; text-decoration: none !important; min-width: 0; }
.gt-brand-mark {
    width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .95rem; flex: 0 0 32px;
}
.gt-brand strong { display: block; font-size: .95rem; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.gt-brand small { display: block; color: var(--ink-3); font-size: .72rem; margin-top: 1px; }
.gt-sidebar-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 10px 12px; overscroll-behavior: contain; }
.gt-sidebar-body::-webkit-scrollbar { width: 6px; }
.gt-sidebar-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

.gt-quick-action {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 9px 12px; margin: 4px 0 14px; border-radius: var(--r-control);
    background: var(--brand); color: #fff !important; font-weight: 600; font-size: .86rem;
    text-decoration: none !important; transition: background .15s var(--ease);
}
.gt-quick-action:hover { background: var(--brand-hover); }
.gt-quick-plus { font-size: 1.1rem; line-height: 1; font-weight: 500; }

.gt-nav-section { margin-bottom: 14px; }
.gt-nav-label { padding: 0 10px 5px; color: var(--ink-3); font-size: .74rem; font-weight: 600; letter-spacing: 0; }
.gt-nav-link, .gt-account-link {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 7px 10px; margin: 1px 0;
    border-radius: 9px; color: var(--ink-2) !important; text-decoration: none !important;
    font-size: .88rem; font-weight: 500; transition: background .12s var(--ease), color .12s var(--ease);
    background: none; border: 0; text-align: left;
}
.gt-nav-link:hover, .gt-account-link:hover { background: rgba(0, 0, 0, .05); color: var(--ink) !important; }
.gt-nav-link.active { background: var(--brand-tint); color: var(--brand-hover) !important; font-weight: 600; }
.gt-nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; }
.gt-nav-icon svg { width: 18px; height: 18px; }
.gt-nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-nav-badge { min-width: 20px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: .68rem; text-align: center; font-weight: 600; }
.gt-chevron { opacity: .5; }

.gt-sidebar-foot { padding: 8px 10px 12px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.gt-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 600; flex: 0 0 28px; }
.gt-user-meta { min-width: 0; flex: 1; }
.gt-user-meta strong, .gt-user-meta small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-user-meta strong { font-size: .82rem; font-weight: 600; color: var(--ink); }
.gt-user-meta small { color: var(--ink-3); font-size: .72rem; }
.gt-account-link.active { background: var(--brand-tint); }
.gt-logout-link { color: var(--ink-3) !important; }

.gt-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.gt-content-wrap { max-width: 1280px; margin: 0 auto; padding: 32px 36px 24px; }

.gt-mobile-topbar {
    height: 56px; position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
    background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}
.gt-mobile-brand { color: var(--ink) !important; text-decoration: none !important; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.gt-mobile-brand .gt-brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: .8rem; flex-basis: 28px; }
.gt-menu-toggle { border: 0; background: transparent; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.gt-menu-toggle span { width: 18px; height: 2px; border-radius: 2px; background: var(--ink); display: block; }
.gt-mobile-notification { color: var(--ink-2) !important; padding: 8px; display: inline-flex; }
.gt-sidebar-close { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--ink-3); }

@media (max-width: 991.98px) {
    .gt-sidebar { width: 288px; transform: translateX(-100%); transition: transform .24s var(--ease); background: rgba(255, 255, 255, .96); }
    .gt-sidebar.show { transform: translateX(0); box-shadow: 18px 0 48px rgba(0, 0, 0, .16); }
    .gt-main { margin-left: 0; }
    .gt-content-wrap { padding: 20px 16px 16px; }
    body.gt-menu-open { overflow: hidden; }
    .gt-sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(0, 0, 0, .3); }
    .gt-sidebar { z-index: 1050; }
}

/* -------------------------------------------------------------- Page head */
.gt-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.gt-page-title { font-size: 1.9rem; line-height: 1.12; letter-spacing: -.03em; font-weight: 650; margin: 0; }
.gt-page-subtitle { color: var(--ink-3); font-size: .92rem; margin-top: 6px; }
.gt-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gt-eyebrow { display: block; font-size: .82rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); margin-bottom: 4px; }
.gt-page-head .gt-eyebrow, .gt-loan-hero .gt-eyebrow { display: none; } /* titles carry their own context */
.gt-back { display: inline-flex; align-items: center; gap: 4px; font-size: .86rem; color: var(--ink-3); margin-bottom: 10px; }
.gt-back:hover { color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------ Panels etc. */
.gt-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.gt-panel + .gt-panel { margin-top: 16px; }
/* Panels used as a plain padded card (no head/body/table children) */
.gt-panel:not(:has(> .gt-panel-head, > .gt-panel-body, > .gt-table-wrap, > .table-responsive, > table, > .gt-list, > .gt-empty, > .gt-panel-footer)) { padding: 20px; }
.gt-panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gt-panel-title { font-weight: 600; letter-spacing: -.015em; margin: 0; font-size: 1rem; }
.gt-panel-subtitle { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.gt-panel-body { padding: 20px; }
.gt-panel-link { font-size: .86rem; font-weight: 500; }

.gt-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.gt-section-heading h2, .gt-section-heading h3 { font-size: 1.1rem; margin: 0; font-weight: 600; letter-spacing: -.02em; }
.gt-section-heading span { font-size: .84rem; color: var(--ink-3); }

/* One connected strip of figures — Apple-style summary row */
.gt-metrics { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; margin-bottom: 16px; }
.gt-metric { padding: 20px 22px; border-left: 1px solid var(--line); min-width: 0; display: block; color: inherit !important; text-decoration: none !important; transition: background .12s var(--ease); }
.gt-metric:first-child { border-left: 0; }
a.gt-metric:hover { background: #FAFAFB; }
.gt-metric-label { font-size: .82rem; color: var(--ink-3); font-weight: 500; }
.gt-metric-value { font-size: 1.65rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-metric-value small { font-size: .55em; font-weight: 500; color: var(--ink-3); margin-right: 3px; letter-spacing: 0; }
.gt-metric-meta { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.gt-metric-meta.success { color: var(--ok); } .gt-metric-meta.warning { color: var(--warn); } .gt-metric-meta.danger { color: var(--danger); }
.gt-metric-value.danger { color: var(--danger); }

/* Existing stat tiles (kept; calmer) */
.gt-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.gt-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; }
.gt-stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gt-stat-label { font-size: .82rem; color: var(--ink-3); font-weight: 500; }
.gt-stat-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--fill); color: var(--ink-2); }
.gt-stat-icon svg { width: 16px; height: 16px; }
.gt-stat-value { font-size: 1.55rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.gt-stat-meta { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.gt-stat-meta.success { color: var(--ok); } .gt-stat-meta.warning { color: var(--warn); } .gt-stat-meta.danger { color: var(--danger); }
.gt-mini-stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.gt-mini-label { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.gt-mini-value { font-size: 1.2rem; font-weight: 650; letter-spacing: -.025em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.gt-mini-meta { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }

/* Notice rows (replace the old boxed shortcuts) */
.gt-notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; font-size: .9rem; }
.gt-notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 8px; }
.gt-notice.danger .gt-notice-dot { background: var(--danger); }
.gt-notice-text { flex: 1; min-width: 0; color: var(--ink-2); }
.gt-notice-text strong { color: var(--ink); font-weight: 600; }
.gt-notice a { font-weight: 500; white-space: nowrap; }

/* --------------------------------------------------------------- Controls */
.gt-search-panel { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 12px; }
.gt-search-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 180px 140px auto; gap: 8px; align-items: center; }
.gt-input-wrap { position: relative; }
.gt-input-wrap .gt-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; display: flex; }
.gt-input-wrap .gt-input-icon svg { width: 16px; height: 16px; }
.gt-input-wrap input { padding-left: 36px !important; }

.gt-btn {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 7px;
    border-radius: var(--r-control) !important; padding: 8px 14px !important; font-size: .86rem !important; font-weight: 600 !important;
    line-height: 1.25 !important; border: 1px solid transparent; text-decoration: none !important; cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.gt-btn svg { width: 15px; height: 15px; }
.gt-btn:active { transform: scale(.98); }
.gt-btn-primary { background: var(--brand) !important; color: #fff !important; }
.gt-btn-primary:hover { background: var(--brand-hover) !important; }
.gt-btn-secondary { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line-strong) !important; }
.gt-btn-secondary:hover { background: var(--fill) !important; }
.gt-btn-ghost { background: var(--fill) !important; color: var(--ink) !important; }
.gt-btn-ghost:hover { background: var(--fill-hover) !important; }
.gt-btn-danger { background: var(--danger-tint) !important; color: var(--danger) !important; }
.gt-btn-danger:hover { background: #FAD9D6 !important; }
.gt-btn-success { background: var(--ok-tint) !important; color: var(--ok) !important; }
.gt-btn-sm { padding: 5px 10px !important; font-size: .8rem !important; }

.gt-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.gt-filter-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); text-decoration: none !important; font-size: .84rem; font-weight: 500; border: 1px solid transparent; transition: background .12s var(--ease); }
.gt-filter-pill:hover { background: var(--fill); color: var(--ink); }
.gt-filter-pill.active { background: var(--ink); color: #fff; }

/* Segmented control (period / format switchers) */
.gt-segment { display: inline-flex; padding: 3px; background: var(--fill); border-radius: 10px; gap: 2px; }
.gt-segment a, .gt-segment button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: .84rem; font-weight: 500; color: var(--ink-2); text-decoration: none !important; cursor: pointer; }
.gt-segment a.active, .gt-segment button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }

/* ----------------------------------------------------------------- Tables */
.gt-table-wrap { overflow: auto; }
.gt-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.gt-table.gt-table-compact { min-width: 0; }
.gt-table thead th { font-size: .78rem; color: var(--ink-3); font-weight: 600; padding: 11px 16px; background: #FAFAFB; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.gt-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.gt-table tbody tr:last-child td { border-bottom: 0; }
.gt-table tbody tr:hover { background: #FAFAFB; }
.gt-table .text-end, .gt-table th.text-end { text-align: right; font-variant-numeric: tabular-nums; }
.gt-table tfoot td { padding: 12px 16px; font-weight: 600; border-top: 1px solid var(--line-strong); background: #FAFAFB; }

.gt-person { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.gt-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--fill); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; flex: 0 0 32px; }
.gt-person-name { font-weight: 600; color: var(--ink); line-height: 1.25; }
.gt-person-meta { font-size: .78rem; color: var(--ink-3); margin-top: 1px; }
a.gt-person-name:hover { color: var(--brand); text-decoration: none; }

.gt-status { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 3px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.gt-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gt-status.success { background: var(--ok-tint); color: var(--ok); }
.gt-status.warning { background: var(--warn-tint); color: var(--warn); }
.gt-status.danger { background: var(--danger-tint); color: var(--danger); }
.gt-status.neutral { background: var(--fill); color: var(--ink-3); }
.gt-status.info { background: var(--info-tint); color: var(--info); }

.gt-account-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; background: var(--fill); color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.gt-account-pill.loan { background: var(--ok-tint); color: var(--ok); }
.gt-account-pill.savings { background: var(--warn-tint); color: var(--warn); }

.gt-empty { padding: 56px 20px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.gt-empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--ink-4); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.gt-empty-icon svg { width: 20px; height: 20px; }
.gt-empty strong { display: block; color: var(--ink); font-size: .98rem; font-weight: 600; margin-bottom: 4px; }

/* Rows used in dashboard lists */
.gt-list { list-style: none; margin: 0; padding: 0; }
.gt-list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); }
.gt-list-row:first-child { border-top: 0; }
.gt-list-main { min-width: 0; }
.gt-list-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--ink); }
a.gt-list-title:hover { color: var(--brand); text-decoration: none; }
.gt-list-sub { font-size: .8rem; color: var(--ink-3); }
.gt-list-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gt-list-amount small { display: block; font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.gt-list-amount.danger { color: var(--danger); } .gt-list-amount.success { color: var(--ok); }

/* ----------------------------------------------------------- Detail pages */
.gt-profile-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 16px; }
.gt-profile-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.gt-avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--fill); color: var(--ink-2); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 600; flex: 0 0 56px; }
.gt-profile-name { font-size: 1.3rem; font-weight: 650; letter-spacing: -.025em; }
.gt-profile-meta { font-size: .86rem; color: var(--ink-3); margin-top: 3px; }
.gt-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.gt-action-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; margin-bottom: 22px; }
.gt-stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gt-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gt-action-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none !important; color: var(--ink) !important; transition: background .12s var(--ease); }
.gt-action-card:hover { background: #FAFAFB; }
.gt-action-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--fill); display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: 0 0 34px; }
.gt-action-icon svg { width: 17px; height: 17px; }
.gt-action-card > span:last-child { min-width: 0; }
.gt-action-title { font-size: .9rem; font-weight: 600; }
.gt-action-desc { font-size: .78rem; color: var(--ink-3); margin-top: 1px; overflow-wrap: anywhere; display: block; }
.gt-action-title { display: block; }

.gt-loan-hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 24px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.gt-loan-id { font-size: .84rem; color: var(--ink-3); font-weight: 500; }
.gt-loan-title { font-size: 1.6rem; font-weight: 650; letter-spacing: -.03em; margin: .15rem 0 .35rem; }
.gt-loan-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-3); font-size: .9rem; }
.gt-loan-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.gt-money-hero { font-size: 2.1rem; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gt-progress { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.gt-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.gt-waterfall { display: grid; gap: 0; }
.gt-waterfall-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.gt-waterfall-row:last-child { border-bottom: 0; }
.gt-waterfall-row.total { font-weight: 650; font-size: 1.02rem; padding-top: 14px; }
.gt-loan-tabs { display: flex; gap: 2px; overflow: auto; padding: 3px; background: var(--fill); border-radius: 11px; }
.gt-loan-tabs a { white-space: nowrap; border-radius: 8px; padding: 7px 14px; color: var(--ink-2); text-decoration: none !important; font-weight: 500; font-size: .88rem; }
.gt-loan-tabs a.active, .gt-loan-tabs a:hover { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.gt-stepper { display: flex; gap: 0; margin-bottom: 24px; overflow: auto; }
.gt-step { display: flex; align-items: center; gap: 9px; min-width: 170px; color: var(--ink-4); font-weight: 500; font-size: .9rem; }
.gt-step::after { content: ""; height: 1px; background: var(--line-strong); flex: 1; margin: 0 12px; }
.gt-step:last-child::after { display: none; }
.gt-step-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.gt-step.active { color: var(--ink); font-weight: 600; }
.gt-step.active .gt-step-no { background: var(--ink); color: #fff; }
.gt-step.done .gt-step-no { background: var(--brand); color: #fff; }
.gt-wizard-panel { display: none; } .gt-wizard-panel.active { display: block; }
.gt-wizard-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.gt-preview-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #FAFAFB; }
.gt-summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; font-variant-numeric: tabular-nums; }
.gt-request-card { transition: background .15s var(--ease); }
.gt-request-card:hover { background: #FAFAFB; }

/* ------------------------------------------------------------ Charts (SVG) */
.gt-chart { width: 100%; height: auto; display: block; }
.gt-chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.gt-chart .grid { stroke: var(--line); stroke-width: 1; }
.gt-chart .bar-a { fill: var(--brand); } .gt-chart .bar-b { fill: #C7C7CC; }
.gt-chart .line-a { fill: none; stroke: var(--brand); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.gt-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--ink-3); flex-wrap: wrap; }
.gt-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.gt-stackbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--fill); gap: 2px; }
.gt-stackbar span { display: block; height: 100%; }

/* ----------------------------------------------------------- Report hub */
.gt-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gt-report-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); color: var(--ink) !important; text-decoration: none !important; transition: background .12s var(--ease), border-color .12s var(--ease); }
.gt-report-card:hover { background: #FAFAFB; border-color: var(--line-strong); }
.gt-report-card strong { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; }
.gt-report-card span { font-size: .84rem; color: var(--ink-3); }
.gt-report-card em { font-style: normal; font-size: .8rem; color: var(--brand); font-weight: 500; margin-top: 4px; }
.gt-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 16px; }
.gt-filter-bar label { display: block; font-size: .78rem; color: var(--ink-3); font-weight: 500; margin-bottom: 4px; }
.gt-filter-bar .form-control, .gt-filter-bar .form-select { min-width: 150px; }
.gt-export { display: inline-flex; gap: 6px; }

/* ===================================================== Bootstrap overrides */
/* These make every older page pick up the new look without touching its markup. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel) !important; box-shadow: none; }
.card-header { background: transparent !important; border-bottom: 1px solid var(--line) !important; font-weight: 600; letter-spacing: -.01em; padding: 14px 20px; }
.card-body { padding: 20px; }
.shadow-sm, .shadow { box-shadow: none !important; }
.border-0 { border: 1px solid var(--line) !important; }
.card-clickable, .stat-card-clickable { cursor: pointer; transition: background .12s var(--ease); }
.card-clickable:hover, .stat-card-clickable:hover { background: #FAFAFB; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); background: var(--fill); margin-bottom: .6rem; }
.stat-icon svg { width: 17px; height: 17px; }
.bg-icon-green, .bg-icon-orange, .bg-icon-red, .bg-icon-gray { background: var(--fill); }
.bg-icon-green { color: var(--ok); } .bg-icon-orange { color: var(--warn); } .bg-icon-red { color: var(--danger); }
.stat-label { font-size: .82rem; color: var(--ink-3); font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-view-link { display: block; margin-top: .4rem; font-size: .8rem; font-weight: 500; color: var(--ink-3) !important; text-decoration: none !important; }

.btn { border-radius: var(--r-control); font-weight: 600; font-size: .88rem; padding: .48rem 1rem; border: 1px solid transparent; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-success, .btn-primary { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.btn-success:hover, .btn-primary:hover { background: var(--brand-hover) !important; border-color: var(--brand-hover) !important; }
.btn-secondary { background: var(--fill) !important; border-color: transparent !important; color: var(--ink) !important; }
.btn-secondary:hover { background: var(--fill-hover) !important; }
.btn-outline-success, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .btn-outline-info, .btn-outline-warning { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line-strong) !important; }
.btn-outline-success:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-dark:hover { background: var(--fill) !important; color: var(--ink) !important; }
.btn-outline-success.active, .btn-outline-primary.active, .btn-outline-secondary.active, .btn-outline-dark.active { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }
.btn-outline-danger { background: var(--surface) !important; color: var(--danger) !important; border-color: rgba(196, 30, 22, .35) !important; }
.btn-outline-danger:hover { background: var(--danger-tint) !important; color: var(--danger) !important; }
.btn-danger { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-warning { background: var(--warn-tint) !important; border-color: transparent !important; color: var(--warn) !important; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-group .btn { border-radius: var(--r-control) !important; margin-right: 6px; }
.btn:disabled, .btn.disabled { opacity: .5; }

.badge { font-weight: 600; font-size: .76rem; padding: .32em .7em; border-radius: var(--r-pill); letter-spacing: 0; }
.badge.bg-primary, .badge.bg-info { background: var(--info-tint) !important; color: var(--info) !important; }
.badge.bg-success { background: var(--ok-tint) !important; color: var(--ok) !important; }
.badge.bg-danger { background: var(--danger-tint) !important; color: var(--danger) !important; }
.badge.bg-secondary, .badge.bg-light, .badge.bg-dark { background: var(--fill) !important; color: var(--ink-3) !important; }
.badge.bg-warning { background: var(--warn-tint) !important; color: var(--warn) !important; }

.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--ink); }
.table > :not(caption) > * > * { border-bottom-color: var(--line); }
.table thead th, .table-light th { background: #FAFAFB !important; color: var(--ink-3); font-size: .78rem; font-weight: 600; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .8rem 1rem; font-size: .9rem; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > *, .table tbody tr:hover { --bs-table-accent-bg: #FAFAFB; }
.table-light { background: transparent; --bs-table-bg: transparent; }
td.text-end, th.text-end { font-variant-numeric: tabular-nums; }

.form-control, .form-select { border-radius: var(--r-control); border: 1px solid var(--line-strong); padding: .5rem .8rem; font-size: .92rem; background-color: #fff; color: var(--ink); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); outline: 0; }
.form-control::placeholder { color: var(--ink-4); }
.form-label { font-weight: 500; font-size: .84rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-text { color: var(--ink-3); font-size: .8rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { background: var(--fill); border-color: var(--line-strong); color: var(--ink-3); }

.alert { border: 0; border-radius: 12px; font-size: .9rem; }
.alert-success { background: var(--ok-tint); color: #12612A; }
.alert-danger { background: var(--danger-tint); color: #9B1710; }
.alert-warning { background: var(--warn-tint); color: #7F4600; }
.alert-info, .alert-primary { background: var(--info-tint); color: #084C8A; }
.alert-light, .alert-secondary { background: var(--fill); color: var(--ink-2); }

.modal-content { border-radius: 18px; border: 0; box-shadow: 0 24px 64px rgba(0, 0, 0, .22); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-size: 1.05rem; font-weight: 600; }
.modal-backdrop.show { opacity: .3; }

.list-group-item { border-color: var(--line); background: transparent; }
.list-group { border-radius: var(--r-panel); }
.progress { height: 6px; background: var(--fill); border-radius: 99px; }
.progress-bar { background: var(--brand); }
.pagination { gap: 4px; }
.page-link { border: 0; border-radius: 8px !important; color: var(--ink-2); background: transparent; font-size: .86rem; padding: .4rem .75rem; }
.page-link:hover { background: var(--fill); color: var(--ink); }
.page-item.active .page-link { background: var(--ink); color: #fff; }
.page-item.disabled .page-link { color: var(--ink-4); background: transparent; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: .88rem; padding: .45rem .75rem; }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { border: 0; color: var(--ink-3); font-weight: 500; padding: .6rem 1rem; }
.nav-tabs .nav-link.active { color: var(--ink); border-bottom: 2px solid var(--brand); background: transparent; }

.text-success { color: var(--ok) !important; } .text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warn) !important; } .text-primary { color: var(--info) !important; }
.text-muted { color: var(--ink-3) !important; } .bg-white { background: var(--surface) !important; }
.bg-light { background: var(--fill) !important; } .bg-success { background: var(--ok-tint) !important; }
hr { border-color: var(--line); opacity: 1; }
footer { color: var(--ink-3) !important; }
.borrower-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); z-index: 20; padding: 6px; }
.borrower-dropdown-item { display: flex; justify-content: space-between; align-items: center; padding: .5rem .7rem; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.borrower-dropdown-item:hover, .borrower-dropdown-item.active { background: var(--brand-tint); }
.borrower-dropdown-empty { padding: .75rem; color: var(--ink-3); font-size: .85rem; text-align: center; }

/* ------------------------------------------- Sign-in and password pages */
body.bg-light { background: var(--canvas) !important; }
body.bg-light > .container { margin-top: 0 !important; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding-top: 24px; padding-bottom: 24px; }
body.bg-light > .container > .card { width: 100%; border-radius: 20px !important; box-shadow: 0 8px 40px rgba(0, 0, 0, .06); }
body.bg-light > .container > .card .card-body { padding: 2rem !important; }

/* ---------------------------------------------------- Portal navbar + footer */
.navbar { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); padding: .55rem 0; }
.navbar-brand { font-weight: 650; letter-spacing: -.02em; color: var(--ink) !important; }
.navbar-toggler { border: 0; }
.navbar-toggler:focus { box-shadow: 0 0 0 4px var(--brand-ring); }
.nav-btn-group { gap: 2px; }
.nav-btn { display: flex; align-items: center; gap: 8px; padding: .45rem .8rem !important; border-radius: 9px; color: var(--ink-2) !important; font-weight: 500; font-size: .9rem; text-decoration: none !important; }
.nav-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-btn:hover { background: rgba(0, 0, 0, .05); color: var(--ink) !important; }
.nav-btn.active { background: var(--brand-tint); color: var(--brand-hover) !important; font-weight: 600; }
.nav-btn-logout { color: var(--ink-3) !important; }
.gt-footer { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 28px 16px 32px; }

/* ----------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
    .gt-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gt-metric:nth-child(odd) { border-left: 0; }
    .gt-metric:nth-child(n+3) { border-top: 1px solid var(--line); }
    .gt-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .gt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gt-search-grid { grid-template-columns: 1fr 1fr; }
    .gt-profile-hero { align-items: flex-start; flex-direction: column; }
    .gt-profile-actions { justify-content: flex-start; }
    .gt-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gt-action-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .gt-stat-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .gt-page-title { font-size: 1.55rem; }
    .gt-page-actions { width: 100%; } .gt-page-actions .gt-btn { flex: 1; }
    .gt-stat-grid { gap: 8px; } .gt-stat { padding: 14px; min-height: 100px; } .gt-stat-value { font-size: 1.25rem; }
    .gt-search-grid { grid-template-columns: 1fr; } .gt-search-grid .gt-btn { width: 100%; }
    .gt-metric { padding: 16px; } .gt-metric-value { font-size: 1.3rem; }
    .gt-report-grid { grid-template-columns: 1fr; }
    .gt-action-grid, .gt-action-grid-4 { grid-template-columns: minmax(0, 1fr) !important; }
    .gt-loan-hero { display: block; padding: 18px; } .gt-loan-actions { justify-content: flex-start; margin-top: 14px; }
    .gt-money-hero { font-size: 1.7rem; }
    .gt-filter-bar > div { flex: 1 1 100%; } .gt-filter-bar .form-control, .gt-filter-bar .form-select { width: 100%; }
    .gt-list-row { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ----------------------------------------------------------------- Print */
@media print {
    .gt-sidebar, .gt-mobile-topbar, .gt-page-actions, .gt-filter-bar, .gt-export, footer, .alert-dismissible .btn-close { display: none !important; }
    .gt-main { margin-left: 0; }
    .gt-content-wrap { max-width: none; padding: 0; }
    html, body { background: #fff; font-size: 11pt; }
    .gt-panel, .gt-metrics, .card { border-color: #ccc; break-inside: avoid; }
}
