:root {
      --canvas-0: #e7eff7;
      --canvas-1: #d5e1ed;
      --canvas-2: #c6d3e0;
      --surface-a: rgba(250, 253, 255, 0.92);
      --surface-b: rgba(230, 238, 247, 0.84);
      --surface-c: rgba(214, 226, 237, 0.76);
      --text-main: #17283b;
      --text-soft: #40566d;
      --text-muted: #6d8195;
      --line: rgba(96, 121, 145, 0.18);
      --primary: #2f67a8;
      --primary-soft: #dbe9f8;
      --success: #3f8c69;
      --warning: #c58a2b;
      --danger: #b54f60;
      --violet: #7359aa;
      --radius-xs: 8px;
      --radius-sm: 11px;
      --radius-md: 15px;
      --radius-lg: 19px;
      --radius-xl: 24px;
      --shadow-light: rgba(255, 255, 255, 0.84);
      --shadow-dark: rgba(104, 126, 149, 0.38);
      --shadow-contact: rgba(66, 87, 109, 0.24);
      --shadow-raised: 8px 10px 22px var(--shadow-dark), 2px 3px 5px var(--shadow-contact), -7px -7px 18px var(--shadow-light);
      --shadow-raised-sm: 4px 5px 11px rgba(104, 126, 149, 0.30), 1px 2px 3px rgba(66, 87, 109, 0.20), -4px -4px 10px rgba(255, 255, 255, 0.78);
      --shadow-inset: inset 3px 3px 7px rgba(105, 126, 148, 0.27), inset -3px -3px 7px rgba(255, 255, 255, 0.72);
      --shadow-pressed: inset 4px 4px 9px rgba(96, 117, 139, 0.30), inset -4px -4px 9px rgba(255, 255, 255, 0.68);
      --sidebar-width: 258px;
      --topbar-height: 74px;
      --content-max: 1680px;
      --gap: 18px;
      --ease: cubic-bezier(.2, .8, .2, 1);
      --speed: 180ms;
    }

    * { box-sizing: border-box; }
    html { min-height: 100%; background: var(--canvas-1); }
    body {
      min-height: 100vh;
      margin: 0;
      color: var(--text-main);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
      background:
        radial-gradient(circle at 14% 2%, rgba(255,255,255,.72), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.34), transparent 22%),
        linear-gradient(145deg, var(--canvas-0) 0%, var(--canvas-1) 45%, var(--canvas-2) 100%);
      overflow-x: hidden;
    }
    button, input, select, textarea { font: inherit; color: inherit; }
    button { border: 0; }
    a { color: inherit; text-decoration: none; }
    [hidden] { display: none !important; }

    .glass-surface {
      background: linear-gradient(145deg, var(--surface-a), var(--surface-b));
      border: 1px solid rgba(255,255,255,.72);
      border-right-color: rgba(111,134,157,.22);
      border-bottom-color: rgba(87,110,133,.25);
      backdrop-filter: blur(14px) saturate(118%);
      -webkit-backdrop-filter: blur(14px) saturate(118%);
    }
    .neo-raised-sm { box-shadow: inset 0 1px 0 rgba(255,255,255,.80), var(--shadow-raised-sm); }
    .embossed-text { text-shadow: -1px -1px 0 rgba(255,255,255,.90), 1px 2px 2px rgba(75,95,116,.20); }
    .pressable {
      cursor: pointer;
      transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease);
    }
    .pressable:hover { transform: translateY(-2px); }
    .pressable:active, .pressable.is-pressed { transform: translateY(1px); box-shadow: var(--shadow-pressed); }
    .pressable:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(47,103,168,.30);
      outline-offset: 3px;
    }
    .muted { color: var(--text-muted); }
    .eyebrow { margin: 0 0 6px; color: var(--text-muted); font-size: .77rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

    .app-shell {
      min-height: 100vh;
      display: grid;
      grid-template-columns: var(--sidebar-width) minmax(0,1fr);
      grid-template-rows: var(--topbar-height) minmax(0,1fr);
    }
    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 40;
      width: var(--sidebar-width);
      padding: 18px 14px;
      background: linear-gradient(170deg, rgba(238,246,253,.86), rgba(205,219,233,.80));
      border-right: 1px solid rgba(255,255,255,.72);
      box-shadow: 8px 0 18px rgba(80,103,127,.21), inset -1px 0 0 rgba(91,115,139,.16);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      overflow-y: auto;
    }
    .brand { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 18px; border-radius: var(--radius-md); }
    .brand-mark, .icon-tile {
      position: relative;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: #fff;
      background: linear-gradient(145deg,#4f89cc,#24558f);
      box-shadow: 4px 5px 10px rgba(63,84,108,.32), -3px -3px 7px rgba(255,255,255,.72), inset 0 1px 1px rgba(255,255,255,.42);
    }
    .brand-mark { width: 44px; height: 44px; border-radius: 14px; font-weight: 900; font-size: 1.15rem; }
    .brand strong { display: block; font-size: 1.02rem; }
    .brand small { color: var(--text-muted); }
    .brand-slogan { color: var(--danger) !important; font-weight: 900 !important; letter-spacing: .045em; }
    .nav { display: grid; gap: 8px; }
    .nav-item {
      min-height: 46px;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 12px;
      color: var(--text-soft);
      font-weight: 720;
      text-shadow: 0 1px 0 rgba(255,255,255,.82);
      transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
    }
    .nav-item:hover { transform: translateX(3px); background: rgba(255,255,255,.34); box-shadow: var(--shadow-raised-sm); }
    .nav-item.active {
      color: #173c67;
      background: linear-gradient(145deg, rgba(231,242,253,.90), rgba(192,211,230,.82));
      box-shadow: inset 1px 1px 0 rgba(255,255,255,.84), 4px 5px 10px rgba(97,119,142,.31), -4px -4px 10px rgba(255,255,255,.78);
    }
    .nav-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color:#fff; background: rgba(255,255,255,.34); box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 2px 3px 6px rgba(89,110,132,.20); }
    .nav-icon.dashboard { background:linear-gradient(145deg,#4f89cc,#24558f); }
    .nav-icon.loans { background:linear-gradient(145deg,#65ad8a,#347b5b); }
    .nav-icon.pending { background:linear-gradient(145deg,#e1ad55,#a56b1b); }
    .nav-icon.history { background:linear-gradient(145deg,#9a82cb,#624594); }
    .nav-icon.interest { background:linear-gradient(145deg,#d97a88,#a93f53); }
    .nav-icon.settings { background:linear-gradient(145deg,#7e99b6,#405f80); }
    .nav-count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--danger); font-size: .75rem; font-weight: 900; }
    .account-card { margin-top: 22px; padding: 13px; border-radius: 14px; }
    .account-row { display: flex; align-items: center; gap: 10px; }
    .account-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 900; background: linear-gradient(145deg,#7e99b6,#405f80); box-shadow: var(--shadow-raised-sm); }
    .account-card strong { display: block; font-size: .9rem; }
    .account-avatar { border-radius:50%; font-size:1.05rem; }
    .account-card small { display: block; margin-top: 2px; color: var(--text-muted); font-size: .74rem; word-break: break-all; }
    .account-footer { display:grid; grid-template-columns:1fr; gap:8px; margin-top:11px; }
    .account-footer button { width:100%; min-height:34px; padding:7px 10px; font-size:.76rem; }

    .login-shell { min-height:100vh; display:grid; place-items:center; padding:22px; }
    .login-card { width:min(440px,100%); padding:26px; border-radius:24px; background:linear-gradient(145deg,rgba(250,253,255,.96),rgba(220,231,241,.92)); border:1px solid rgba(255,255,255,.82); box-shadow:12px 16px 34px rgba(58,79,101,.34),-8px -8px 20px rgba(255,255,255,.70); }
    .login-brand { display:flex; align-items:center; gap:14px; margin-bottom:20px; }
    .login-brand .brand-mark { width:54px; height:54px; border-radius:17px; }
    .login-brand h1 { margin:0; font-size:1.5rem; }
    .login-brand p { margin:5px 0 0; color:var(--text-muted); font-size:.84rem; }
    .login-role { display:flex; align-items:center; gap:9px; margin-bottom:16px; padding:11px 12px; border-radius:12px; background:rgba(206,219,232,.42); box-shadow:var(--shadow-inset); font-weight:850; }
    .login-note { margin:14px 0 0; color:var(--text-muted); font-size:.76rem; line-height:1.5; text-align:center; }

    .topbar {
      position: fixed;
      top: 0;
      right: 0;
      left: var(--sidebar-width);
      z-index: 30;
      height: var(--topbar-height);
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 12px 20px;
      background: linear-gradient(180deg, rgba(246,251,255,.86), rgba(218,230,241,.74));
      border-bottom: 1px solid rgba(112,135,158,.18);
      box-shadow: 0 9px 18px rgba(84,106,129,.24), inset 0 -1px 0 rgba(90,112,135,.16), inset 0 1px 0 rgba(255,255,255,.82);
      backdrop-filter: blur(18px) saturate(120%);
      -webkit-backdrop-filter: blur(18px) saturate(120%);
    }
    .icon-button {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: linear-gradient(145deg, rgba(250,253,255,.82), rgba(215,227,239,.78));
      box-shadow: var(--shadow-raised-sm);
      cursor: pointer;
    }
    .search-box { width: min(620px,56vw); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: rgba(206,219,232,.48); box-shadow: var(--shadow-inset); }
    .search-box input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; }
    .top-actions { display: flex; align-items: center; gap: 10px; }
    .role-chip { min-height: 40px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-radius: 12px; background: linear-gradient(145deg,rgba(250,253,255,.84),rgba(215,227,239,.78)); box-shadow: var(--shadow-raised-sm); font-size: .82rem; font-weight: 850; }
    .role-chip.profile-role { padding:4px 11px 4px 5px; }
    .profile-avatar { width:32px; height:32px; flex:0 0 32px; border-radius:50%; object-fit:cover; object-position:center 24%; border:2px solid rgba(255,255,255,.92); box-shadow:2px 3px 7px rgba(67,88,111,.28),-2px -2px 6px rgba(255,255,255,.82); background:#dce8f2; }
    .top-logout { min-height:42px; padding:8px 13px; white-space:nowrap; }
    .role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(63,140,105,.14); }

    .content { grid-column: 2; grid-row: 2; width: min(100%,var(--content-max)); margin: 0 auto; padding: 24px; }
    .page { display: none; }
    .page.active { display: block; }
    .page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
    .page-head h1 { margin: 0; font-size: clamp(1.65rem,2vw,2.25rem); line-height: 1.08; }
    .page-head p { margin: 8px 0 0; color: var(--text-muted); }
    .head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

    .soft-button, .primary-button, .danger-button, .success-button {
      min-height: 40px;
      padding: 9px 14px;
      border-radius: 11px;
      font-weight: 850;
      box-shadow: var(--shadow-raised-sm);
      cursor: pointer;
    }
    .soft-button { color: #204d7b; background: linear-gradient(145deg,rgba(247,252,255,.88),rgba(205,220,234,.80)); border: 1px solid rgba(255,255,255,.66); }
    .primary-button { color: #fff; background: linear-gradient(145deg,#4d87c9,#24558f); }
    .success-button { color: #fff; background: linear-gradient(145deg,#65ad8a,#347b5b); }
    .danger-button { color: #fff; background: linear-gradient(145deg,#d97a88,#a93f53); }
    button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

    .stats-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: var(--gap); margin-bottom: var(--gap); }
    .card {
      min-width: 0;
      padding: 18px;
      border-radius: var(--radius-lg);
      background: linear-gradient(145deg,var(--surface-a),var(--surface-b));
      border: 1px solid rgba(255,255,255,.72);
      border-right-color: rgba(107,130,153,.21);
      border-bottom-color: rgba(85,107,130,.27);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.90), inset 1px 0 0 rgba(255,255,255,.52), var(--shadow-raised);
      backdrop-filter: blur(13px) saturate(115%);
      -webkit-backdrop-filter: blur(13px) saturate(115%);
    }
    .stat-card { position: relative; min-height: 142px; overflow: hidden; }
    .stat-card::after { content: ""; position: absolute; right: -28px; bottom: -44px; width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.24); box-shadow: var(--shadow-inset); pointer-events: none; }
    .stat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .icon-tile { width: 42px; height: 42px; border-radius: 12px; font-weight: 900; }
    .icon-tile.success { background: linear-gradient(145deg,#65ad8a,#347b5b); }
    .icon-tile.warning { background: linear-gradient(145deg,#e1ad55,#a56b1b); }
    .icon-tile.danger { background: linear-gradient(145deg,#d97a88,#a93f53); }
    .icon-tile.violet { background: linear-gradient(145deg,#9a82cb,#624594); }
    .stat-label { margin-top: 14px; color: var(--text-soft); font-size: .84rem; font-weight: 760; }
    .stat-value { margin-top: 6px; font-size: clamp(1.55rem,2.1vw,2.25rem); font-weight: 900; line-height: 1.08; text-shadow: -1px -1px 0 rgba(255,255,255,.94), 1px 2px 2px rgba(67,87,108,.22); word-break: break-word; }
    .stat-trend { margin-top: 8px; color: var(--success); font-size: .82rem; font-weight: 800; }
    .badge { padding: 6px 9px; border-radius: 999px; font-size: .74rem; font-weight: 850; color: #264c74; background: rgba(219,233,248,.78); box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 2px 3px 6px rgba(91,112,134,.18); white-space: nowrap; }
    .badge.success { color: #28684c; background: rgba(207,239,222,.82); }
    .badge.warning { color: #85580e; background: rgba(248,228,185,.88); }
    .badge.danger { color: #8a3041; background: rgba(247,210,216,.88); }
    .badge.muted { color: #5d6b79; background: rgba(221,227,233,.82); }

    .notice { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; margin-bottom: var(--gap); padding: 14px 16px; border-radius: 15px; background: linear-gradient(145deg,rgba(255,248,220,.90),rgba(235,218,175,.75)); border: 1px solid rgba(255,255,255,.72); border-bottom-color: rgba(149,115,50,.26); box-shadow: 7px 9px 18px rgba(121,111,86,.25), 2px 3px 5px rgba(101,86,57,.18), -6px -6px 15px rgba(255,255,255,.72); }
    .notice.success-notice { background: linear-gradient(145deg,rgba(226,250,237,.90),rgba(190,225,207,.76)); }
    .dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(290px,.75fr); gap: var(--gap); align-items: start; }
    .main-stack, .side-stack { display: grid; gap: var(--gap); }
    .card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
    .card-head h2, .card-head h3 { margin: 0; font-size: 1rem; text-shadow: 0 1px 0 rgba(255,255,255,.92), 0 2px 2px rgba(72,92,114,.16); }
    .quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
    .quick-tile { min-height: 128px; display: grid; place-items: center; gap: 8px; padding: 16px; text-align: center; border-radius: 16px; background: linear-gradient(145deg,rgba(249,253,255,.78),rgba(214,226,238,.72)); border: 1px solid rgba(255,255,255,.66); box-shadow: var(--shadow-raised-sm); }
    .quick-tile .icon-tile { width: 50px; height: 50px; border-radius: 15px; }

    .list { display: grid; gap: 11px; }
    .loan-card, .payment-card {
      padding: 14px;
      border-radius: 15px;
      background: linear-gradient(145deg,rgba(249,252,255,.76),rgba(222,232,242,.70));
      border: 1px solid rgba(255,255,255,.62);
      border-right-color: rgba(105,127,149,.16);
      border-bottom-color: rgba(92,113,135,.20);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 3px 4px 8px rgba(103,124,146,.22), -3px -3px 7px rgba(255,255,255,.66);
    }
    .loan-top, .payment-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
    .loan-title, .payment-title { font-weight: 860; line-height: 1.35; }
    .loan-meta, .payment-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 5px; color: var(--text-muted); font-size: .79rem; }
    .loan-amount { margin-top: 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
    .money-cell { padding: 10px; border-radius: 11px; background: rgba(206,219,232,.42); box-shadow: var(--shadow-inset); }
    .money-cell span { display: block; color: var(--text-muted); font-size: .72rem; font-weight: 760; }
    .money-cell strong { display: block; margin-top: 4px; font-size: .98rem; }
    .progress { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(133,153,173,.20); box-shadow: inset 2px 2px 5px rgba(89,110,132,.28), inset -2px -2px 5px rgba(255,255,255,.74); }
    .progress > span { display: block; width: var(--value,0%); height: 100%; border-radius: inherit; background: linear-gradient(180deg,rgba(255,255,255,.44),transparent 42%), linear-gradient(90deg,#2c69ad,#68a8e8); box-shadow: 0 1px 2px rgba(35,74,116,.34), inset 0 1px 1px rgba(255,255,255,.48); }
    .loan-progress { margin-top: 12px; }
    .progress-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--text-muted); font-size: .75rem; font-weight: 750; }
    .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
    .row-actions button { min-height: 35px; padding: 7px 10px; font-size: .78rem; }
    .loan-icon-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
    .loan-icon-button { width:36px; height:36px; padding:0 !important; display:grid; place-items:center; border-radius:11px; font-size:1rem !important; font-weight:900; box-shadow:var(--shadow-raised-sm); }
    .loan-icon-button.edit { color:var(--primary); background:rgba(219,233,248,.82); }
    .loan-icon-button.delete { color:var(--danger); background:rgba(247,210,216,.76); }
    .activity-amount { font-weight:900; font-size:.98rem; }
    .activity-amount.loan { color:var(--primary); }
    .activity-amount.payment { color:var(--danger); }
    .delete-request-card { border-left:4px solid rgba(181,79,96,.72); }
    .payment-main { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: start; }
    .payment-amount { min-width: 120px; padding: 10px 12px; border-radius: 12px; text-align: center; color: #fff; background: linear-gradient(145deg,#4f89cc,#24558f); box-shadow: var(--shadow-raised-sm); font-size: .95rem; font-weight: 900; }
    .payment-note { margin-top: 8px; color: var(--text-soft); font-size: .84rem; }
    .reason-box { margin-top: 8px; padding: 9px 10px; border-left: 4px solid var(--danger); border-radius: 8px; background: rgba(247,210,216,.55); color: #7f3442; font-size: .8rem; }

    .filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 14px; }
    .filter-button { min-height: 36px; padding: 7px 12px; border-radius: 10px; color: var(--text-soft); font-size: .8rem; font-weight: 820; background: linear-gradient(145deg,rgba(247,252,255,.78),rgba(205,220,234,.72)); box-shadow: var(--shadow-raised-sm); cursor: pointer; }
    .filter-button.active { color: #fff; background: linear-gradient(145deg,#4f89cc,#24558f); }
    .empty-state { padding: 32px 18px; text-align: center; border-radius: 15px; background: rgba(255,255,255,.34); box-shadow: var(--shadow-inset); }
    .empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg,#8da7c1,#55718e); box-shadow: var(--shadow-raised-sm); font-size: 1.45rem; }
    .empty-state strong { display: block; }
    .empty-state p { margin: 7px 0 0; color: var(--text-muted); font-size: .85rem; }

    .scrim { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(39,57,76,.28); backdrop-filter: blur(3px); }
    body.sidebar-open .scrim { display: block; }
    .mobile-menu { display: none; }

    .modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(39,57,76,.36); backdrop-filter: blur(5px); }
    .modal-backdrop.open { display: flex; }
    .modal { width: min(560px,100%); max-height: calc(100vh - 36px); overflow: auto; padding: 20px; border-radius: 20px; background: linear-gradient(145deg,rgba(250,253,255,.96),rgba(220,231,241,.94)); border: 1px solid rgba(255,255,255,.82); box-shadow: 12px 16px 34px rgba(58,79,101,.38), -7px -7px 18px rgba(255,255,255,.50); }
    .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
    .modal-head h2 { margin: 0; font-size: 1.25rem; }
    .modal-head p { margin: 5px 0 0; color: var(--text-muted); font-size: .83rem; }
    .form-grid { display: grid; gap: 14px; }
    .field { display: grid; gap: 7px; }
    .field label { color: var(--text-soft); font-size: .82rem; font-weight: 820; }
    .field input, .field select, .field textarea { width: 100%; border: 1px solid rgba(255,255,255,.68); outline: 0; border-radius: 12px; background: rgba(206,219,232,.48); box-shadow: var(--shadow-inset); padding: 11px 12px; }
    .field input, .field select { min-height: 45px; }
    .field textarea { min-height: 96px; resize: vertical; }
    .field-hint { color: var(--text-muted); font-size: .75rem; }
    .file-drop { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:11px; min-height:72px; padding:12px; border:1px dashed rgba(47,103,168,.42); border-radius:13px; background:rgba(245,250,255,.54); box-shadow:var(--shadow-inset); cursor:pointer; }
    .file-drop:hover { border-color:var(--primary); }
    .file-drop-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(145deg,#4f89cc,#24558f); box-shadow:var(--shadow-raised-sm); font-size:1.15rem; }
    .file-drop strong { display:block; font-size:.84rem; }
    .file-drop span { display:block; margin-top:3px; color:var(--text-muted); font-size:.73rem; line-height:1.4; }
    .file-drop input { position:absolute; width:1px !important; height:1px !important; opacity:0; pointer-events:none; }
    .evidence-preview { display:none; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:11px; padding:10px; border-radius:12px; background:rgba(255,255,255,.44); box-shadow:var(--shadow-inset); }
    .evidence-preview.show { display:grid; }
    .evidence-preview img { width:72px; height:62px; object-fit:cover; border-radius:10px; box-shadow:var(--shadow-raised-sm); }
    .evidence-preview strong { display:block; font-size:.8rem; word-break:break-word; }
    .evidence-preview span { display:block; margin-top:4px; color:var(--text-muted); font-size:.72rem; }
    .evidence-image-wrap { margin-top:12px; padding:10px; border-radius:14px; background:rgba(206,219,232,.42); box-shadow:var(--shadow-inset); }
    .evidence-image { display:block; width:100%; max-height:65vh; object-fit:contain; border-radius:11px; background:#fff; }
    .pending-alert-list { display:grid; gap:10px; margin-top:12px; }
    .pending-alert-row { padding:12px; border-radius:13px; background:linear-gradient(145deg,rgba(249,252,255,.76),rgba(222,232,242,.70)); box-shadow:var(--shadow-raised-sm); }
    .pending-alert-row > div:first-child { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
    .pending-alert-row p { margin:6px 0 0; color:var(--text-muted); font-size:.78rem; line-height:1.45; }
    .payment-mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .payment-mode-option { position:relative; display:block; cursor:pointer; }
    .payment-mode-option input { position:absolute; opacity:0; pointer-events:none; }
    .payment-mode-content { min-height:82px; display:grid; align-content:center; gap:4px; padding:12px; border-radius:13px; background:linear-gradient(145deg,rgba(247,252,255,.82),rgba(205,220,234,.74)); border:1px solid rgba(255,255,255,.66); box-shadow:var(--shadow-raised-sm); transition:transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease); }
    .payment-mode-content strong { font-size:.9rem; }
    .payment-mode-content span { color:var(--text-muted); font-size:.75rem; line-height:1.4; }
    .payment-mode-option input:checked + .payment-mode-content { color:#fff; background:linear-gradient(145deg,#4f89cc,#24558f); box-shadow:var(--shadow-pressed); }
    .payment-mode-option input:checked + .payment-mode-content span { color:rgba(255,255,255,.82); }
    .payment-preview { padding:12px; border-radius:12px; background:rgba(206,219,232,.42); box-shadow:var(--shadow-inset); color:var(--text-soft); font-size:.82rem; line-height:1.55; }
    .payment-preview strong { color:var(--text-main); }
    .bulk-loan-list { display:grid; gap:8px; max-height:260px; overflow:auto; padding:4px; }
    .bulk-loan-option { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px; border-radius:11px; background:rgba(255,255,255,.42); box-shadow:var(--shadow-inset); cursor:pointer; }
    .bulk-loan-option input { width:20px; height:20px; accent-color:var(--primary); }
    .bulk-loan-option small { display:block; margin-top:3px; color:var(--text-muted); }
    .allocation-list { display:grid; gap:7px; margin-top:10px; }
    .allocation-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:8px 10px; border-radius:9px; background:rgba(255,255,255,.42); font-size:.79rem; }
    .allocation-row span { color:var(--text-muted); }
    .allocation-row strong { text-align:right; }
    .surplus-line { margin-top:8px; padding:8px 10px; border-radius:10px; color:#28684c; background:rgba(207,239,222,.72); font-size:.78rem; font-weight:800; }
    .modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
    .confirm-box { padding: 15px; border-radius: 14px; background: rgba(206,219,232,.42); box-shadow: var(--shadow-inset); }
    .confirm-box strong { display: block; font-size: 1.1rem; }
    .confirm-box p { margin: 7px 0 0; color: var(--text-soft); line-height: 1.55; }

    .toast { position: fixed; right: 22px; bottom: 22px; z-index: 130; max-width: min(420px,calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; color: var(--text-main); background: linear-gradient(145deg,rgba(251,254,255,.96),rgba(215,228,240,.92)); border: 1px solid rgba(255,255,255,.72); box-shadow: var(--shadow-raised); transform: translateY(22px); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.error { border-left: 5px solid var(--danger); }
    .toast.success { border-left: 5px solid var(--success); }

    .loading-overlay { position: fixed; inset: 0; z-index: 150; display: none; place-items: center; background: rgba(215,225,235,.60); backdrop-filter: blur(4px); }
    .loading-overlay.show { display: grid; }
    .loader-card { min-width: 230px; padding: 20px; text-align: center; border-radius: 18px; background: linear-gradient(145deg,rgba(250,253,255,.94),rgba(220,231,241,.90)); box-shadow: var(--shadow-raised); }
    .spinner { width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 50%; border: 5px solid rgba(47,103,168,.18); border-top-color: var(--primary); animation: spin .8s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    .fatal { max-width: 720px; margin: 8vh auto; padding: 24px; }
    .fatal h1 { margin: 0 0 10px; }
    .fatal p { color: var(--text-soft); line-height: 1.65; }


    .notification-button { position:relative; }
    .notification-count { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 5px; display:grid; place-items:center; border-radius:999px; color:#fff; background:var(--danger); font-size:.66rem; font-weight:900; box-shadow:0 3px 8px rgba(161,55,55,.35); }
    .notification-count[hidden] { display:none; }
    .credit-toggle { display:flex; align-items:flex-start; gap:11px; padding:13px 14px; border-radius:14px; background:rgba(211,225,238,.50); box-shadow:var(--shadow-inset); cursor:pointer; }
    .credit-toggle input { width:19px; height:19px; margin-top:2px; accent-color:var(--success); flex:0 0 auto; }
    .credit-toggle strong { display:block; margin-bottom:4px; }
    .credit-toggle span span { display:block; color:var(--text-muted); font-size:.78rem; line-height:1.45; }
    .credit-summary { display:grid; gap:7px; padding:12px 13px; border-radius:13px; background:rgba(225,239,231,.66); border:1px solid rgba(255,255,255,.72); }
    .credit-summary-row { display:flex; justify-content:space-between; gap:12px; font-size:.82rem; }
    .credit-summary-row strong { color:var(--success); }
    .notification-list { display:grid; gap:10px; }
    .notification-item { padding:13px 14px; border-radius:14px; background:rgba(221,233,244,.62); box-shadow:var(--shadow-inset); }
    .notification-item.unread { border-left:4px solid var(--primary); }
    .notification-item-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
    .notification-item p { margin:6px 0 0; color:var(--text-soft); line-height:1.5; font-size:.82rem; }
    .notification-time { color:var(--text-muted); font-size:.72rem; white-space:nowrap; }

    .chart-card { overflow:hidden; }
    .chart-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .chart-toolbar select { min-height:36px; padding:7px 32px 7px 11px; border:1px solid rgba(255,255,255,.68); border-radius:10px; background:rgba(206,219,232,.48); box-shadow:var(--shadow-inset); font-weight:760; }
    .chart-wrap { position:relative; width:100%; height:280px; padding:8px 2px 0; }
    .chart-wrap canvas { display:block; width:100%; height:100%; }
    .chart-legend { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:8px; color:var(--text-muted); font-size:.76rem; font-weight:760; }
    .legend-item { display:flex; align-items:center; gap:7px; }
    .legend-line { width:24px; height:4px; border-radius:999px; }
    .legend-line.loan { background:#2f67a8; }
    .legend-line.payment { background:#b54f60; }
    .interest-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--gap); margin-bottom:var(--gap); }
    .interest-value { margin-top:8px; font-size:1.55rem; font-weight:900; }
    .interest-layout { display:grid; grid-template-columns:minmax(300px,.8fr) minmax(0,1.2fr); gap:var(--gap); align-items:start; }
    .interest-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .formula-box { margin-top:14px; padding:13px; border-radius:13px; background:rgba(206,219,232,.42); box-shadow:var(--shadow-inset); color:var(--text-soft); line-height:1.55; font-size:.82rem; }
    .formula-result { margin-top:12px; padding:14px; border-radius:13px; background:rgba(247,210,216,.52); color:#7f3442; font-weight:850; }
    .rate-badge { color:#8a3041; background:rgba(247,210,216,.88); }

    .settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--gap); align-items:start; }
    .settings-card { min-height:100%; }
    .settings-card.full-width { grid-column:1 / -1; }
    .settings-heading { display:flex; align-items:center; gap:11px; margin-bottom:16px; }
    .settings-heading h2 { margin:0; font-size:1.05rem; }
    .settings-heading p { margin:4px 0 0; color:var(--text-muted); font-size:.79rem; line-height:1.45; }
    .settings-form-grid { display:grid; gap:12px; }
    .settings-email-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
    .settings-email-group { padding:13px; border-radius:13px; background:rgba(206,219,232,.40); box-shadow:var(--shadow-inset); }
    .settings-email-group > strong { display:block; margin-bottom:9px; }
    .email-chip-list { display:flex; flex-wrap:wrap; gap:7px; }
    .email-chip { max-width:100%; padding:6px 9px; border-radius:999px; background:rgba(247,252,255,.84); border:1px solid rgba(255,255,255,.76); color:var(--text-soft); font-size:.75rem; font-weight:760; overflow-wrap:anywhere; }
    .settings-help { margin:10px 0 0; color:var(--text-muted); font-size:.76rem; line-height:1.5; }
    .chat-button { position:relative; }
    .chat-count { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 5px; display:grid; place-items:center; border-radius:999px; color:#fff; background:#1d8bf1; font-size:.66rem; font-weight:900; box-shadow:0 3px 8px rgba(29,139,241,.35); }
    .chat-count[hidden] { display:none; }
    .chat-backdrop { position:fixed; inset:0; z-index:90; display:flex; justify-content:flex-end; align-items:stretch; padding:10px; background:rgba(38,55,73,.28); backdrop-filter:blur(5px); opacity:0; visibility:hidden; pointer-events:none; transition:opacity 190ms var(--ease),visibility 190ms var(--ease); }
    .chat-backdrop.open { opacity:1; visibility:visible; pointer-events:auto; }
    .chat-panel { width:min(430px,100%); height:calc(100dvh - 20px); display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; border:1px solid rgba(255,255,255,.72); border-radius:22px; background:linear-gradient(155deg,rgba(239,247,253,.98),rgba(216,230,242,.98)); box-shadow:14px 18px 38px rgba(49,69,91,.34),-6px -5px 20px rgba(255,255,255,.72); transform:translateX(26px); transition:transform 210ms var(--ease); }
    .chat-backdrop.open .chat-panel { transform:translateX(0); }
    .chat-head { min-height:72px; padding:12px 14px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid rgba(111,137,161,.18); background:rgba(235,245,252,.88); }
    .chat-peer { min-width:0; display:flex; align-items:center; gap:11px; }
    .chat-peer-avatar { width:44px; height:44px; flex:0 0 44px; border-radius:50%; object-fit:cover; object-position:center 24%; border:2px solid rgba(255,255,255,.95); box-shadow:3px 4px 10px rgba(71,94,117,.26),-2px -2px 8px rgba(255,255,255,.88); background:#dce8f2; }
    .chat-peer h2 { margin:0; color:var(--text); font-size:1rem; }
    .chat-peer span { display:block; margin-top:3px; color:var(--text-muted); font-size:.72rem; }
    .chat-history { position:relative; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:14px 12px 18px; scroll-behavior:smooth; background:linear-gradient(180deg,rgba(226,239,248,.72),rgba(239,246,251,.84)); }
    .chat-loading { position:sticky; top:0; z-index:2; width:max-content; margin:0 auto 8px; padding:6px 10px; border-radius:999px; color:var(--text-soft); background:rgba(255,255,255,.86); box-shadow:var(--shadow-raised-sm); font-size:.72rem; }
    .chat-empty { min-height:100%; display:grid; place-items:center; text-align:center; color:var(--text-muted); padding:35px 20px; line-height:1.6; }
    .chat-day { width:max-content; margin:10px auto; padding:5px 10px; border-radius:999px; color:var(--text-muted); background:rgba(255,255,255,.74); box-shadow:0 2px 8px rgba(69,91,114,.10); font-size:.69rem; }
    .chat-message-row { position:relative; display:flex; align-items:flex-end; gap:7px; margin:7px 0; }
    .chat-message-row.own { flex-direction:row-reverse; }
    .chat-message-avatar { width:28px; height:28px; flex:0 0 28px; border-radius:50%; object-fit:cover; object-position:center 24%; border:1px solid rgba(255,255,255,.95); box-shadow:1px 2px 5px rgba(61,82,103,.2); background:#dce8f2; }
    .chat-message-stack { position:relative; max-width:76%; display:flex; align-items:center; gap:5px; }
    .chat-message-row.own .chat-message-stack { flex-direction:row-reverse; }
    .chat-bubble { min-width:58px; padding:9px 11px 6px; border-radius:16px 16px 16px 5px; color:var(--text); background:rgba(255,255,255,.92); box-shadow:2px 4px 10px rgba(82,104,125,.16); line-height:1.42; font-size:.86rem; overflow-wrap:anywhere; }
    .chat-message-row.own .chat-bubble { color:#fff; border-radius:16px 16px 5px 16px; background:linear-gradient(145deg,#2398f2,#1477d1); box-shadow:2px 4px 10px rgba(20,119,209,.24); }
    .chat-bubble.recalled { color:var(--text-muted); background:rgba(232,238,244,.88); font-style:italic; }
    .chat-message-row.own .chat-bubble.recalled { color:rgba(255,255,255,.86); background:linear-gradient(145deg,#879bae,#6d8296); }
    .chat-time { display:block; margin-top:4px; text-align:right; color:var(--text-muted); font-size:.62rem; line-height:1; }
    .chat-message-row.own .chat-time { color:rgba(255,255,255,.74); }
    .chat-more { width:26px; height:26px; flex:0 0 26px; border:0; border-radius:50%; color:var(--text-muted); background:transparent; cursor:pointer; font-weight:900; letter-spacing:1px; opacity:.58; }
    .chat-more:hover,.chat-more:focus-visible { opacity:1; background:rgba(255,255,255,.78); }
    .chat-menu { position:absolute; z-index:5; top:calc(100% + 4px); left:31px; min-width:142px; padding:6px; display:grid; gap:3px; border:1px solid rgba(255,255,255,.8); border-radius:12px; background:rgba(250,253,255,.98); box-shadow:6px 8px 18px rgba(57,77,98,.24); }
    .chat-message-row.own .chat-menu { left:auto; right:31px; }
    .chat-menu button { border:0; border-radius:9px; padding:9px 10px; text-align:left; color:var(--text-soft); background:transparent; cursor:pointer; font:inherit; font-size:.78rem; }
    .chat-menu button:hover { background:rgba(218,231,242,.78); }
    .chat-menu button.danger { color:var(--danger); }
    .chat-composer { padding:10px 11px calc(10px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:end; gap:8px; border-top:1px solid rgba(111,137,161,.18); background:rgba(238,247,252,.96); }
    .chat-input { width:100%; min-height:42px; max-height:116px; resize:none; overflow-y:auto; border:1px solid rgba(120,145,168,.2); border-radius:18px; padding:11px 13px; color:var(--text); background:rgba(255,255,255,.82); box-shadow:var(--shadow-inset); font:inherit; line-height:1.38; outline:none; }
    .chat-input:focus { border-color:rgba(35,152,242,.48); box-shadow:inset 2px 3px 7px rgba(104,126,149,.2),inset -2px -2px 6px rgba(255,255,255,.82),0 0 0 3px rgba(35,152,242,.12); }
    .chat-send { width:44px; height:44px; border:0; border-radius:50%; display:grid; place-items:center; color:#fff; background:linear-gradient(145deg,#2da2f5,#1477d1); box-shadow:3px 5px 11px rgba(20,119,209,.3),-2px -2px 7px rgba(255,255,255,.76); cursor:pointer; font-size:1rem; }
    .chat-send:disabled { opacity:.55; cursor:wait; }

    /* Chat v1.10 — công cụ Zalo, tệp, sticker, tìm kiếm và cuộc gọi */
    .chat-panel { position:relative; grid-template-rows:auto auto minmax(0,1fr) auto; }
    .chat-head-actions { display:flex; align-items:center; gap:4px; margin-left:auto; }
    .chat-head-button,.chat-tool-button { width:36px; height:36px; border:0; border-radius:9px; display:grid; place-items:center; color:#173c67; background:transparent; cursor:pointer; transition:background 150ms ease,color 150ms ease,transform 150ms ease; }
    .chat-head-button:hover,.chat-tool-button:hover { background:rgba(203,220,235,.65); transform:translateY(-1px); }
    .chat-head-button svg,.chat-tool-button svg,.chat-search-strip svg,.chat-menu-icon { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    #chatClose { font-size:1.55rem; line-height:1; color:var(--text-muted); }
    .chat-search-strip { min-height:48px; padding:7px 11px; display:grid; grid-template-columns:24px minmax(0,1fr) 30px; align-items:center; gap:7px; border-bottom:1px solid rgba(111,137,161,.18); background:rgba(246,251,255,.95); }
    .chat-search-strip[hidden] { display:none; }
    .chat-search-strip svg { width:19px; height:19px; color:var(--text-muted); }
    .chat-search-strip input { width:100%; border:0; outline:0; padding:8px 4px; color:var(--text); background:transparent; font:inherit; }
    .chat-search-strip button { width:30px; height:30px; border:0; border-radius:50%; color:var(--text-muted); background:transparent; cursor:pointer; font-size:1.2rem; }
    .chat-search-strip button:hover { background:rgba(211,224,236,.7); }
    .chat-search-result-note { width:max-content; max-width:90%; margin:3px auto 10px; padding:6px 10px; border-radius:999px; color:var(--text-soft); background:rgba(255,255,255,.78); font-size:.7rem; box-shadow:0 2px 8px rgba(69,91,114,.10); }

    .chat-menu { min-width:196px; padding:5px 0; gap:0; border-radius:7px; background:#fff; border:1px solid rgba(128,146,164,.18); box-shadow:0 8px 24px rgba(44,61,78,.2); overflow:hidden; }
    .chat-menu button { min-height:44px; padding:9px 15px; display:flex; align-items:center; gap:13px; border-radius:0; color:#e1262f; font-size:.9rem; font-weight:500; }
    .chat-menu button:hover { background:#f6f7f9; }
    .chat-menu button.danger { color:#e1262f; }
    .chat-menu-icon { width:21px; height:21px; flex:0 0 21px; }

    .chat-composer { display:block; padding:8px 10px calc(9px + env(safe-area-inset-bottom)); }
    .chat-tool-row { height:39px; display:flex; align-items:center; gap:8px; padding:0 2px 5px; }
    .chat-tool-button { width:36px; height:34px; border-radius:8px; }
    .chat-compose-row { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:end; gap:8px; }
    .chat-sticker-panel { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:6px; padding:8px; margin-bottom:7px; border-radius:13px; background:rgba(255,255,255,.86); box-shadow:var(--shadow-inset); }
    .chat-sticker-panel[hidden] { display:none; }
    .chat-sticker { min-height:38px; border:0; border-radius:9px; background:transparent; cursor:pointer; font-size:1.45rem; }
    .chat-sticker:hover { background:rgba(208,224,238,.66); transform:scale(1.08); }
    .chat-bubble.sticker-bubble { min-width:62px; padding:7px 10px 5px; text-align:center; background:rgba(255,255,255,.72); }
    .chat-message-row.own .chat-bubble.sticker-bubble { background:rgba(255,255,255,.2); }
    .chat-sticker-large { display:block; font-size:3rem; line-height:1.1; }
    .chat-attachment { width:min(250px,65vw); overflow:hidden; }
    .chat-image-preview { width:100%; min-height:110px; max-height:260px; display:block; object-fit:cover; border-radius:12px; background:rgba(190,207,222,.55); cursor:pointer; }
    .chat-image-loading { width:100%; min-height:125px; display:grid; place-items:center; border-radius:12px; color:var(--text-muted); background:rgba(203,219,233,.55); font-size:.75rem; cursor:pointer; }
    .chat-file-card { min-width:210px; display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:9px; padding:4px 2px; color:inherit; cursor:pointer; }
    .chat-file-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:rgba(206,222,236,.72); font-size:1.15rem; }
    .chat-message-row.own .chat-file-icon { background:rgba(255,255,255,.18); }
    .chat-file-info strong,.chat-file-info span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .chat-file-info strong { font-size:.8rem; }
    .chat-file-info span { margin-top:3px; opacity:.72; font-size:.65rem; }
    .chat-call-card { min-width:210px; display:grid; grid-template-columns:40px minmax(0,1fr); gap:9px; align-items:center; }
    .chat-call-card-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:50%; background:rgba(206,222,236,.72); font-size:1.05rem; }
    .chat-message-row.own .chat-call-card-icon { background:rgba(255,255,255,.18); }
    .chat-call-card strong,.chat-call-card span { display:block; }
    .chat-call-card span { margin-top:2px; opacity:.74; font-size:.68rem; }

    .chat-call-layer { position:absolute; inset:72px 0 0; z-index:12; display:flex; align-items:center; justify-content:center; padding:22px; background:linear-gradient(160deg,rgba(26,58,91,.96),rgba(13,34,57,.98)); color:#fff; }
    .chat-call-layer[hidden] { display:none; }
    .call-screen { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
    .call-avatar { width:100px; height:100px; border-radius:50%; object-fit:cover; object-position:center 24%; border:3px solid rgba(255,255,255,.9); box-shadow:0 12px 30px rgba(0,0,0,.35); }
    .call-screen h3 { margin:16px 0 5px; font-size:1.25rem; }
    .call-screen p { margin:0; color:rgba(255,255,255,.72); font-size:.84rem; }
    .call-actions { display:flex; align-items:center; justify-content:center; gap:26px; margin-top:30px; }
    .call-action { width:58px; height:58px; border:0; border-radius:50%; display:grid; place-items:center; color:#fff; cursor:pointer; box-shadow:0 8px 20px rgba(0,0,0,.25); font-size:1.2rem; }
    .call-action.accept { background:#22a65a; }
    .call-action.reject,.call-action.end { background:#e2444f; }
    .call-action.secondary { background:rgba(255,255,255,.18); }
    .call-action svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
    .call-video-stage { position:absolute; inset:0; background:#071421; overflow:hidden; }
    .call-remote-video { width:100%; height:100%; object-fit:cover; background:#071421; }
    .call-local-video { position:absolute; right:14px; top:14px; width:108px; height:150px; object-fit:cover; border-radius:13px; border:2px solid rgba(255,255,255,.75); background:#162a3d; box-shadow:0 8px 20px rgba(0,0,0,.3); }
    .call-active-overlay { position:absolute; inset:auto 0 0; padding:52px 16px 18px; background:linear-gradient(transparent,rgba(0,0,0,.72)); }
    .call-active-overlay .call-actions { margin-top:15px; }
    .call-audio-remote { display:none; }

    /* Chat v1.10.4 — khóa cố định thanh đầu/cuối và CallBridge bắt tay an toàn */
    body.chat-open { overflow:hidden !important; overscroll-behavior:none; }
    .chat-backdrop {
      top:var(--chat-viewport-top,0px);
      bottom:auto;
      height:var(--chat-viewport-height,100dvh);
      max-height:var(--chat-viewport-height,100dvh);
      overflow:hidden;
      box-sizing:border-box;
    }
    .chat-panel {
      display:flex;
      flex-direction:column;
      min-height:0;
      height:calc(var(--chat-viewport-height,100dvh) - 20px);
      max-height:calc(var(--chat-viewport-height,100dvh) - 20px);
      overflow:hidden;
      overscroll-behavior:none;
    }
    .chat-head,.chat-search-strip,.chat-composer { position:relative; z-index:6; flex:0 0 auto; }
    .chat-head { position:sticky; top:0; }
    .chat-search-strip { position:sticky; top:0; }
    .chat-history { flex:1 1 auto; min-height:0; height:0; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; touch-action:pan-y; }
    .chat-composer { position:sticky; bottom:0; }
    .chat-call-layer { inset:0; z-index:20; }

    @media (max-width:1280px) {
      :root { --sidebar-width:232px; --gap:15px; }
      .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }
    @media (max-width:992px) {
      :root { --sidebar-width:224px; }
      .dashboard-grid { grid-template-columns:1fr; }
      .interest-layout { grid-template-columns:1fr; }
      .settings-grid { grid-template-columns:1fr; }
      .settings-card.full-width { grid-column:auto; }
      .side-stack { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }
    @media (max-width:768px) {
      :root { --topbar-height:66px; --shadow-raised:5px 7px 14px rgba(104,126,149,.32),1px 2px 4px rgba(66,87,109,.20),-5px -5px 13px rgba(255,255,255,.76); }
      .app-shell { grid-template-columns:1fr; }
      .sidebar { width:min(86vw,310px); transform:translateX(-110%); transition:transform 220ms var(--ease); }
      body.sidebar-open .sidebar { transform:translateX(0); }
      .topbar { left:0; padding-inline:12px; gap:7px; }
      .mobile-menu { display:grid; }
      .search-box { display:none; }
      .top-actions { margin-left:auto; gap:7px; }
      .top-actions .icon-button { display:grid; }
      .role-chip { display:flex; }
      .top-logout { min-height:38px; padding:7px 10px; font-size:.76rem; }
      .content { grid-column:1; padding:18px 14px 30px; }
      .page-head { align-items:flex-start; flex-direction:column; }
      .side-stack { grid-template-columns:1fr; }
    }
    @media (max-width:560px) {
      .stats-grid, .quick-grid, .payment-mode-grid, .interest-summary-grid, .interest-form-grid { grid-template-columns:1fr; }
      .chart-wrap { height:235px; }
      .card { padding:15px; border-radius:16px; }
      .loan-amount { grid-template-columns:1fr; }
      .top-actions { display:flex; }
      .settings-email-groups { grid-template-columns:1fr; }
      .role-chip.profile-role { padding-right:8px; }
      .search-box { margin:0; }
      .loan-top, .payment-top { flex-direction:column; }
      .payment-main { grid-template-columns:1fr; }
      .payment-amount { min-width:0; width:fit-content; }
      .head-actions { width:100%; }
      .head-actions button { flex:1; }
      .notice { grid-template-columns:auto minmax(0,1fr); }
      .notice > :last-child { grid-column:2; justify-self:start; }
      .modal { padding:17px; border-radius:17px; }
      .modal-actions > button { flex:1; }
    }
    @media (max-width:560px) {
      .chat-backdrop { padding:0; }
      .chat-panel { width:100%; height:var(--chat-viewport-height,100dvh); max-height:var(--chat-viewport-height,100dvh); border:0; border-radius:0; }
      .chat-head { padding-top:calc(10px + env(safe-area-inset-top)); }
      .chat-message-stack { max-width:82%; }
      .chat-more { opacity:.75; }
      .chat-head { gap:6px; padding-inline:9px; }
      .chat-head-actions { gap:1px; }
      .chat-head-button { width:34px; height:34px; }
      .chat-peer-avatar { width:40px; height:40px; flex-basis:40px; }
      .chat-sticker-panel { grid-template-columns:repeat(8,minmax(0,1fr)); gap:3px; padding:6px; }
      .chat-sticker { font-size:1.25rem; padding:0; }
      .chat-call-layer { inset:calc(64px + env(safe-area-inset-top)) 0 0; }
    }
    @media (prefers-reduced-motion:reduce) {
      *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
    }
