@font-face {
  font-family: "Noto Kufi Arabic";
  src: url("fonts/NotoKufiArabic-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #10263b;
  --navy-2: #183b53;
  --green: #0f936d;
  --green-dark: #087052;
  --mint: #e7f7f1;
  --bg: #f2f5f8;
  --surface: #fff;
  --text: #233044;
  --muted: #738094;
  --border: #dfe5ec;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning-bg: #fff8e2;
  --shadow: 0 8px 28px rgba(20, 43, 64, .07);
  --shadow-hover: 0 14px 34px rgba(20, 43, 64, .11);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
}
body.menu-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: #117a5c; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.app-shell > main { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1b6570 0%, #175565 52%, #143f52 100%);
  color: #fff;
  padding: 22px 13px 18px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 20px; border-bottom: 1px solid #ffffff18; }
.brand > span, .login-brand {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  border-radius: 13px;
  background: linear-gradient(145deg, #19a982, #0c7d5d);
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: #d0e2e5; font-size: 11px; margin-top: 2px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 17px; }
.sidebar nav a, .logout {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #e1ecef;
  text-decoration: none;
  min-height: 45px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .16s, color .16s, transform .16s, border-color .16s;
}
.sidebar nav a:hover { background: #ffffff13; color: #fff; transform: translateX(-2px); }
.sidebar nav a.active { background: linear-gradient(90deg, #57d2ae32, #ffffff16); color: #fff; border-color: #8be1c64a; box-shadow: inset -3px 0 #79e0bf; }
.sidebar nav a.active .icon { color: #91efd1; }
.sidebar nav a.nav-subitem { min-height: 39px; margin-right: 17px; padding-block: 7px; color: #cfe2e6; font-size: 12px; }
.sidebar nav a.nav-subitem .icon { width: 16px; height: 16px; flex-basis: 16px; }
.logout { margin-top: auto; color: #ffbcbc; border-color: #ffffff10; }
.logout:hover { background: #d84b3f17; color: #ffd3d0; }

.topbar {
  height: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  box-shadow: 0 3px 16px rgba(21, 43, 63, .035);
}
.topbar small, .topbar strong { display: block; }
.topbar small { color: var(--muted); font-size: 11px; }
.topbar-user { display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--border); padding-left: 16px; }
.topbar-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eff4f7; color: var(--navy-2); }
.tenant-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--mint); color: var(--green-dark); padding: 9px 14px; border: 1px solid #cceade; border-radius: 22px; font-size: 12px; font-weight: 700; }
.tenant-pill .icon { width: 17px; height: 17px; }
.mobile-menu-button { display: none; place-items: center; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 11px; padding: 0; cursor: pointer; }
.sidebar-overlay { display: none; }

.content { width: 100%; max-width: 1500px; margin: auto; padding: 30px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-title-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 13px; align-items: center; }
.page-title-copy .page-heading-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #cce9df; border-radius: 14px; background: linear-gradient(145deg, #f0fbf7, #ddf3eb); color: var(--green-dark); box-shadow: 0 6px 18px #0f936d12; }
.page-title-copy .page-heading-icon .icon { width: 23px; height: 23px; }
.page-title-copy h1, .page-title-copy p { grid-column: 2; }
.page-heading h1 { margin: 0; font-size: clamp(23px, 2.2vw, 29px); line-height: 1.25; }
.page-heading p, .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-heading .contract-heading-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; margin-top: 7px; }
.contract-heading-meta > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.contract-heading-meta > strong { color: var(--navy); font-size: 17px; font-weight: 800; line-height: 1.45; }
.contract-heading-meta > small { color: #667789; font-size: 12px; font-weight: 500; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.primary-btn, .secondary-btn, .table-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 0;
  gap: 7px;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.primary-btn { background: linear-gradient(145deg, #149b75, #0d8060); color: #fff; box-shadow: 0 7px 16px #0f936d20; }
.primary-btn:hover { background: linear-gradient(145deg, #0f8967, #096f53); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px #0f936d2e; }
.secondary-btn { background: #fff; color: var(--text); border: 1px solid var(--border); }
.secondary-btn:hover { border-color: #9fb0c1; background: #f8fafb; transform: translateY(-1px); }
.table-btn { min-height: 31px; padding: 5px 10px; background: var(--green); color: #fff; font-size: 12px; }
.table-btn .icon { width: 15px; height: 15px; flex-basis: 15px; }
.danger-outline { color: var(--danger); border-color: #efc4c0; }
.action-colored { color: #fff !important; border: 0 !important; box-shadow: 0 6px 14px rgba(24, 53, 76, .14); }
.action-colored:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 9px 19px rgba(24, 53, 76, .2); }
.action-colored.inline-action-link { min-height: 31px; padding: 5px 10px; border-radius: 8px; }
.btn-tone-success { background: linear-gradient(145deg, #159b76, #0b795a) !important; }
.btn-tone-success:hover { background: linear-gradient(145deg, #118967, #08694e) !important; }
.btn-tone-info { background: linear-gradient(145deg, #2b8292, #206a7d) !important; }
.btn-tone-info:hover { background: linear-gradient(145deg, #247484, #195a6b) !important; }
.btn-tone-print { background: linear-gradient(145deg, #496d94, #304f75) !important; }
.btn-tone-print:hover { background: linear-gradient(145deg, #3c6086, #274466) !important; }
.btn-tone-warning { background: linear-gradient(145deg, #c68125, #a45d14) !important; }
.btn-tone-warning:hover { background: linear-gradient(145deg, #b4711d, #8e4e0e) !important; }
.btn-tone-danger { background: linear-gradient(145deg, #bf5a52, #973d38) !important; }
.btn-tone-danger:hover { background: linear-gradient(145deg, #aa4b45, #81322f) !important; }
.btn-tone-neutral { background: linear-gradient(145deg, #718096, #58687d) !important; }
.btn-tone-neutral:hover { background: linear-gradient(145deg, #627186, #49596d) !important; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats-grid article, .detail-grid article, .financial-summary-grid article {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 19px;
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.stats-grid article:hover, .financial-summary-grid article:hover { transform: translateY(-2px); border-color: #c8d7e1; box-shadow: var(--shadow-hover); }
.stat-icon { position: absolute; top: 16px; left: 16px; display: grid !important; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #edf8f4; color: var(--green); }
.stat-icon .icon { width: 20px; height: 20px; }
.stats-grid article.accent .stat-icon, .financial-summary-grid .treasury-stat .stat-icon { background: #ffffff18; color: #78e4c0; }
.stats-grid span, .stats-grid small, .detail-grid span, .financial-summary-grid span, .financial-summary-grid small { display: block; color: var(--muted); }
.stats-grid strong { display: block; margin: 8px 0 3px; font-size: clamp(25px, 2.7vw, 32px); overflow-wrap: anywhere; }
.stats-grid article.accent { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.stats-grid article.accent span, .stats-grid article.accent small { color: #c5d1dc; }
.mini-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.financial-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.financial-summary-grid strong { display: block; margin: 8px 0 2px; font-size: 20px; overflow-wrap: anywhere; }
.financial-summary-grid .treasury-stat { background: linear-gradient(135deg, var(--navy-2), #24604f); color: #fff; }
.financial-summary-grid .treasury-stat span, .financial-summary-grid .treasury-stat small { color: #c9ddd6; }
.dashboard-welcome { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; min-height: 170px; margin-bottom: 22px; padding: 25px 29px; overflow: hidden; border: 1px solid #bfded5; border-radius: 19px; background: linear-gradient(125deg, #f5fcf9 0%, #e5f5ef 55%, #d8ede8 100%); box-shadow: 0 12px 30px rgba(24, 70, 58, .08); }
.dashboard-welcome::before { content: ""; position: absolute; width: 260px; height: 260px; left: -75px; top: -135px; border: 38px solid rgba(20, 155, 117, .08); border-radius: 50%; }
.dashboard-welcome-copy { position: relative; z-index: 2; min-width: 0; }
.dashboard-eyebrow { display: inline-flex; margin-bottom: 7px; color: #17675f; font-size: 12px; font-weight: 800; }
.dashboard-welcome h1 { margin: 0; color: var(--navy-2); font-size: clamp(23px, 2.6vw, 32px); line-height: 1.4; }
.dashboard-welcome p { max-width: 720px; margin: 6px 0 0; color: #58706e; font-size: 13px; line-height: 1.8; }
.dashboard-welcome-meta { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.dashboard-welcome-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #c5e4da; border-radius: 18px; background: rgba(255, 255, 255, .68); color: #3e6660; font-size: 11px; font-weight: 700; }
.dashboard-welcome-meta .icon { width: 14px; height: 14px; }
.dashboard-welcome-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 9px; }
.dashboard-building-mark { position: absolute; left: 28px; bottom: -28px; color: rgba(15, 118, 110, .07); transform: rotate(-5deg); }
.dashboard-building-mark .icon { width: 132px; height: 132px; }
.dashboard-section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 2px 12px; }
.dashboard-section-title h2 { margin: 0; font-size: 17px; }
.dashboard-section-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.dashboard-section-title > a { color: #17675f; font-size: 12px; font-weight: 800; text-decoration: none; }
.dashboard-stats { gap: 11px; margin-bottom: 21px; }
.dashboard-stats article { min-height: 102px; padding: 13px 15px; border-radius: 13px; box-shadow: 0 6px 17px rgba(24, 53, 76, .055); }
.dashboard-stats .stat-icon { top: 11px; left: 11px; width: 32px; height: 32px; border-radius: 9px; }
.dashboard-stats .stat-icon .icon { width: 17px; height: 17px; }
.dashboard-stats strong { margin: 5px 0 1px; font-size: clamp(19px, 2vw, 24px); line-height: 1.35; }
.dashboard-stats span, .dashboard-stats small { font-size: 11px; }
.dashboard-stats .dashboard-alert-stat { border-color: #efc8a5; background: #fff7ef; }
.dashboard-stats .dashboard-success-stat { border-color: #b8dfcb; background: #f1fbf6; }
.dashboard-stats .dashboard-due-stat { border-color: #efd39d; background: #fffaf0; }
.dashboard-stats .dashboard-commission-stat { border-color: #c9c0e6; background: #f7f4fc; }
.dashboard-financial-grid { gap: 10px; margin-bottom: 22px; }
.dashboard-financial-grid article { min-height: 92px; padding: 14px 15px; border-radius: 13px; box-shadow: 0 6px 17px rgba(24, 53, 76, .05); }
.dashboard-financial-grid strong { margin: 5px 0 1px; font-size: 17px; }
.dashboard-financial-grid span, .dashboard-financial-grid small { font-size: 10.5px; }
.dashboard-contracts-panel { margin-top: 2px; }

.panel, .form-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.panel { overflow-x: auto; }
.form-panel { overflow: visible; }
.panel-head, .list-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fbfcfd); }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head a { font-weight: 700; text-decoration: none; }
.inline-action-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-weight: 700; }
.inline-action-link .icon { width: 15px; height: 15px; flex-basis: 15px; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { text-align: right; padding: 14px; border-bottom: 1px solid #edf1f4; font-size: 13px; vertical-align: middle; }
th { font-weight: 700; }
thead th { background: linear-gradient(180deg, #247681, #1c6470); color: #fff; border-bottom-color: #185964; padding-block: 15px; font-size: 13px; }
thead th:first-child { border-top-right-radius: 9px; }
thead th:last-child { border-top-left-radius: 9px; }
tbody tr { transition: background .13s; }
tbody tr:nth-child(even) { background: #fbfdfd; }
tbody tr:hover { background: #eef8f5; }
.contracts-list-table { min-width: 940px; table-layout: fixed; }
.contracts-list-table th, .contracts-list-table td { padding-inline: 10px; }
.contracts-list-table th:nth-child(1) { width: 70px; }
.contracts-list-table th:nth-child(2), .contracts-list-table th:nth-child(3) { width: 18%; }
.contracts-list-table th:nth-child(n+4):nth-child(-n+8) { width: 9%; }
.contracts-list-table th:nth-child(9) { width: 80px; }
.contracts-list-table td:nth-child(2), .contracts-list-table td:nth-child(3) { white-space: normal; line-height: 1.55; }
.contracts-list-table tbody td:nth-child(4) .table-money-value { border-color: #b9ddd7; background: #e8f6f3; color: #17675f; }
.contracts-list-table tbody td:nth-child(5) .table-money-value { border-color: #efd39d; background: #fff5dd; color: #8a5b08; }
.contracts-list-table tbody td:nth-child(6) .table-money-value { border-color: #b9cce2; background: #edf3fa; color: #315a82; }
.contracts-list-table tbody td:nth-child(7) .table-money-value { border-color: #b8dfcb; background: #e9f8f0; color: #16704f; }
.contracts-list-table tbody td:nth-child(8) .table-money-value { border-color: #efc8a5; background: #fff0e2; color: #9a4d12; }
.contracts-list-table tbody td:nth-child(n+4):nth-child(-n+8) .table-money-value { justify-content: center; min-width: 74px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.investor-list-panel { overflow: hidden; }
.investors-table { min-width: 790px; }
.investors-table tbody td { padding-block: 15px; }
.investor-name-link { color: #146f5b; font-weight: 750; text-decoration: none; }
.investor-name-link:hover { color: #0b5b49; text-decoration: underline; }
.customer-name-link, .customer-name-link:visited { color: inherit; font-size: inherit; font-weight: inherit; text-decoration: none; }
.customer-name-link:hover { color: #146f5b; text-decoration: none; }
.item-name-link { color: #146f5b; font-weight: 750; text-decoration: none; }
.item-name-link:hover { color: #0b5b49; text-decoration: underline; }
.table-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fbfcfd; }
.table-pagination span { color: var(--muted); font-size: 12px; font-weight: 700; }
.investor-balance { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid #cce8dc; border-radius: 9px; background: #edf9f4; color: #12674f; font-weight: 750; }
.table-money-value { display: inline-flex; align-items: center; min-height: 29px; padding: 4px 9px; border: 1px solid #cce8dc; border-radius: 9px; background: #edf9f4; color: #12674f; font-weight: 750; white-space: nowrap; }
.investor-contract-count { display: inline-grid; place-items: center; min-width: 32px; height: 30px; padding-inline: 8px; border-radius: 9px; background: #eaf0f5; color: #40566c; font-weight: 750; }
.investor-print-actions { max-width: 720px; justify-content: flex-end; }
.investor-overview { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.investor-stats-grid { gap: 12px; }
.investor-stats-grid article { min-height: 98px; padding: 16px 16px 14px 58px; }
.investor-stats-grid article > small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.investor-stats-grid .investor-stat-solid { border-color: transparent; color: #fff; }
.investor-stats-grid .investor-stat-solid > span:not(.detail-card-icon), .investor-stats-grid .investor-stat-solid > small { color: #d8ecea; }
.investor-stats-grid .investor-stat-solid .detail-card-icon { background: #ffffff19; color: #fff !important; }
.investor-cash-stat { background: linear-gradient(140deg, #214965, #17364e) !important; }
.investor-stock-stat { background: linear-gradient(140deg, #198f72, #0f6856) !important; }
.investor-active-stat { border-color: #e7cf9f !important; background: #fff7e4 !important; }
.investor-finished-stat { border-color: #b9dfcd !important; background: #edf9f3 !important; }
.investor-movements-panel, .investor-stock-panel { overflow: hidden; }
.investor-movements-table { min-width: 760px; }
.investor-movements-table th:nth-child(1) { width: 145px; }
.investor-movements-table th:nth-child(2) { width: 105px; }
.investor-movements-table th:nth-child(3), .investor-movements-table th:nth-child(4) { width: 140px; }
.movement-description { white-space: normal; line-height: 1.6; }
.movement-type { display: inline-flex; align-items: center; justify-content: center; min-width: 65px; padding: 4px 9px; border-radius: 8px; font-weight: 750; }
.movement-type.deposit { background: #e9f8f0; color: #16704f; }
.movement-type.withdrawal { background: #fff0e2; color: #9a4d12; }
.inventory-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; background: #f8fbfb; border-bottom: 1px solid var(--border); }
.inventory-summary-grid article { min-width: 0; border: 1px solid var(--border); border-radius: 11px; background: #fff; padding: 13px 15px; }
.inventory-summary-grid article:nth-child(1) { border-color: #b9cce2; background: #edf3fa; }
.inventory-summary-grid article:nth-child(2) { border-color: #b8dfcb; background: #e9f8f0; }
.inventory-summary-grid article:nth-child(3) { border-color: #efd39d; background: #fff5dd; }
.inventory-summary-grid span, .inventory-summary-grid strong { display: block; }
.inventory-summary-grid span { color: var(--muted); font-size: 12px; }
.inventory-summary-grid strong { margin-top: 6px; color: var(--text); font-size: 19px; }
.investor-stock-table { min-width: 620px; }
.investor-stock-summary { overflow: hidden; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.investor-stock-page-panel { overflow: hidden; }
.stock-quantity { display: inline-grid; place-items: center; min-width: 34px; height: 29px; border-radius: 8px; background: #edf7f4; color: #17675f; font-weight: 750; }
.customer-overview { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.customer-overview article:nth-child(1) { border-color: #b9cce2; background: #edf3fa; }
.customer-overview article:nth-child(2) { border-color: #b8dfcb; background: #e9f8f0; }
.customer-overview article:nth-child(3) { border-color: #cfd7e2; background: #f2f5f8; }
.customer-overview article:nth-child(4) { border-color: #b9cce2; background: linear-gradient(145deg, #496d94, #304f75); color: #fff; }
.customer-overview article:nth-child(5) { border-color: #b8dfcb; background: linear-gradient(145deg, #159b76, #0b795a); color: #fff; }
.customer-overview article:nth-child(6) { border-color: #efc8a5; background: linear-gradient(145deg, #c68125, #a45d14); color: #fff; }
.customer-overview article:nth-child(n+4) span { color: #e6eef4; }
.customer-contact-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.customer-contracts-panel { overflow: hidden; }
.customer-contracts-table { min-width: 1010px; }
.customer-contracts-table th:nth-child(1) { width: 85px; }
.customer-contracts-table th:nth-child(3) { width: 110px; }
.customer-contracts-table th:nth-child(4), .customer-contracts-table th:nth-child(5), .customer-contracts-table th:nth-child(6) { width: 115px; }
.customer-contracts-table th:nth-child(7) { width: 80px; }
.customer-contracts-table th:nth-child(8) { width: 205px; }
.contract-row-actions { display: flex; align-items: center; gap: 7px; }
.contract-row-actions .secondary-btn, .contract-row-actions .table-btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.investor-row-actions { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 7px; white-space: nowrap; }
.investor-row-actions .secondary-btn, .investor-row-actions .table-btn { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.view-row-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 5px 10px; border-radius: 8px; background: linear-gradient(145deg, #397fa8, #28658d); color: #fff; font-size: 12px; font-weight: 750; text-decoration: none; box-shadow: 0 5px 12px #28658d24; white-space: nowrap; }
.view-row-btn.action-colored { background: linear-gradient(145deg, #496d94, #304f75) !important; }
.view-row-btn:hover, .view-row-btn.action-colored:hover { background: linear-gradient(145deg, #3c6086, #274466) !important; color: #fff; transform: translateY(-1px); }
.view-row-btn .icon { width: 14px; height: 14px; }
.investors-table th:last-child, .investors-table td:last-child { min-width: 140px; }
.status { display: inline-block; background: var(--mint); color: var(--green-dark); border-radius: 20px; padding: 4px 10px; font-weight: 700; }
.warning-status { background: #fff1c9; color: #7d5900; }
.contract-active-status { background: #e5f7ef; color: #137052; box-shadow: inset 0 0 0 1px #c0e7d7; }
.contract-completed-status { background: #e8f0fa; color: #315f8d; box-shadow: inset 0 0 0 1px #c5d6e9; }
.overdue-stats article:nth-child(1) { border-color: #efc8a5; background: #fff0e2; }
.overdue-stats article:nth-child(2) { border-color: #b9cce2; background: #edf3fa; }
.overdue-stats article:nth-child(3) { border-color: #efd39d; background: linear-gradient(145deg, #c68125, #a45d14); color: #fff; }
.overdue-stats article:nth-child(4) { border-color: #efc5c1; background: linear-gradient(145deg, #bf5a52, #973d38); color: #fff; }
.overdue-stats article:nth-child(3) span, .overdue-stats article:nth-child(4) span { color: #f7e9df; }
.overdue-panel { overflow: hidden; }
.overdue-search { border-bottom: 0; }
.overdue-table { min-width: 1220px; }
.overdue-table th:nth-child(1) { width: 82px; }
.overdue-table th:nth-child(4) { width: 70px; }
.overdue-table th:nth-child(5) { width: 112px; }
.overdue-table th:nth-child(6) { width: 100px; }
.overdue-table th:nth-child(7), .overdue-table th:nth-child(8), .overdue-table th:nth-child(9) { width: 110px; }
.overdue-table th:nth-child(10) { width: 120px; }
.overdue-table tbody tr.overdue-warning-row { background: #fffaf0; }
.overdue-table tbody tr.overdue-critical-row { background: #fff2ef; }
.overdue-table tbody tr:hover { background: #eef8f5; }
.overdue-days { display: inline-flex; align-items: center; justify-content: center; min-width: 68px; padding: 4px 8px; border-radius: 8px; background: #fff0d7; color: #99550d; font-weight: 750; }
.overdue-days.critical { background: #fde7e4; color: #a54039; }
.empty { padding: 40px !important; text-align: center; color: var(--muted); }
.list-tools { justify-content: flex-start; }
.list-tools input { width: min(360px, 100%); min-height: 42px; border: 1px solid var(--border); background: #fff; padding: 10px 13px; border-radius: 10px; outline: 0; }
.list-tools input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.contracts-filter-tools { flex-wrap: wrap; }
.contracts-filter-tools > input { flex: 1 1 290px; }
.contracts-status-field { flex: 0 1 230px; min-width: 210px; }

.form-panel { padding: 28px; overflow: visible; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 7px; color: #344054; font-size: 13px; font-weight: 700; }
.required-mark { color: var(--danger); margin-right: 3px; }
.form-control { display: block; width: 100%; min-height: 44px; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; padding: 10px 12px; color: var(--text); outline: 0; transition: border .15s, box-shadow .15s, background .15s; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.form-control:disabled { background: #f0f2f5; color: #667085; cursor: not-allowed; }
textarea.form-control { min-height: 94px; resize: vertical; }
select.form-control { cursor: pointer; }
.custom-select { position: relative; width: 100%; }
.native-select-accessible { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0 !important; pointer-events: none !important; inset: auto 0 0 auto; padding: 0 !important; border: 0 !important; }
.custom-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; padding: 10px 12px; color: var(--muted); text-align: right; cursor: pointer; outline: 0; transition: border .15s, box-shadow .15s, background .15s; }
.custom-select-trigger.has-value { color: var(--text); }
.custom-select-trigger:hover { border-color: #aebdca; background: #fcfdfd; }
.custom-select.open .custom-select-trigger, .custom-select-trigger:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.custom-select-trigger.invalid { border-color: var(--danger); background: var(--danger-bg); box-shadow: 0 0 0 3px #b4231812; }
.custom-select-trigger:disabled { background: #f0f2f5; color: #667085; cursor: not-allowed; }
.custom-select-arrow { color: #8794a5; font-size: 20px; line-height: 1; transition: transform .15s; }
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-panel { position: absolute; z-index: 120; top: calc(100% + 7px); right: 0; left: 0; min-width: min(300px, 92vw); max-height: 340px; overflow: hidden; border: 1px solid #ccd7e1; border-radius: 12px; background: #fff; box-shadow: 0 18px 44px rgba(15, 35, 52, .18); }
.custom-select-panel[hidden] { display: none; }
.custom-select-search-box { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); background: #f8fafb; }
.custom-select-search-box .icon { width: 17px; height: 17px; color: var(--muted); }
.custom-select-search { width: 100%; min-height: 36px; border: 1px solid #d4dce5; border-radius: 8px; background: #fff; padding: 7px 10px; color: var(--text); outline: 0; font-size: 12px; }
.custom-select-search:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876612; }
.custom-select-options { max-height: 275px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.custom-select-option { display: block; width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 9px 10px; color: var(--text); text-align: right; cursor: pointer; font-size: 13px; }
.custom-select-option:hover { background: #edf8f4; color: var(--green-dark); }
.custom-select-option.selected { background: var(--mint); color: var(--green-dark); font-weight: 700; }
.custom-select-empty { padding: 22px 12px; color: var(--muted); text-align: center; font-size: 12px; }
.custom-select-empty[hidden] { display: none; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.checkbox-field { align-self: end; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; }
.checkbox-field label { margin: 0; order: 2; }
.checkbox-field .form-control { width: 18px; height: 18px; min-height: 0; padding: 0; order: 1; accent-color: var(--green); }
.field-invalid .form-control { border-color: var(--danger); background: #fffafa; }
.field-invalid .custom-select-trigger { border-color: var(--danger); background: #fffafa; }
.field-invalid .form-control:focus { box-shadow: 0 0 0 3px #b4231815; }
.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 700; }
.form-actions { display: flex; gap: 10px; padding-top: 21px; margin-top: 24px; border-top: 1px solid var(--border); }
.full-span { grid-column: 1 / -1; }
.hidden { display: none !important; }
.wizard-steps { display: flex; gap: 10px; margin-bottom: 15px; }
.wizard-steps span { flex: 1; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); padding: 11px 14px; font-weight: 700; text-align: center; }
.wizard-steps span.active { border-color: var(--green); background: var(--mint); color: var(--green-dark); }
.stock-info, .review-notice { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; background: #f7f9fb; color: var(--muted); padding: 12px 14px; font-weight: 700; }
.stock-info.available { border-color: #a9dec9; background: var(--mint); color: var(--green-dark); }
.stock-info.unavailable { border-color: #f2c4bf; background: var(--danger-bg); color: var(--danger); }
.readonly-value { border-color: #b9dfd1; background: #effaf6; color: var(--green-dark); font-weight: 800; cursor: default; }
.field-note { min-height: 44px; display: flex; align-items: center; border: 1px dashed #c8d6df; border-radius: 10px; background: #f8fafb; color: var(--muted); padding: 9px 12px; font-size: 12px; }
.calculation-strip, .review-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calculation-strip article, .review-grid article { min-width: 0; border: 1px solid var(--border); border-radius: 11px; background: #fafbfc; padding: 14px; }
.calculation-strip span, .review-grid span { display: block; color: var(--muted); font-size: 12px; }
.calculation-strip strong, .review-grid strong { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.calculation-strip article.highlight { border-color: var(--navy-2); background: var(--navy-2); color: #fff; }
.calculation-strip article.highlight span { color: #c3d1dc; }
.review-notice { margin: 0 0 18px; border-color: #efdca3; background: var(--warning-bg); color: #6e5200; }
.validation-summary, .error-message { display: grid; gap: 3px; margin-bottom: 18px; border: 1px solid #f2c4bf; border-right: 5px solid var(--danger); border-radius: 9px; background: var(--danger-bg); color: #8f1d14; padding: 12px 14px; }
.validation-summary strong { font-size: 14px; }
.validation-summary span, .error-message { font-size: 12px; }
.warning-box { margin-bottom: 18px; border: 1px solid #efdca3; border-right: 5px solid #c89500; border-radius: 9px; background: var(--warning-bg); color: #6e5200; padding: 12px 14px; }
.settlement-amount-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; border: 1px solid #a9dec9; border-right: 5px solid var(--green); border-radius: 12px; background: linear-gradient(135deg, #effaf6, #e3f5ee); padding: 17px 19px; color: var(--green-dark); }
.settlement-amount-banner span { font-weight: 700; }
.settlement-amount-banner strong { font-size: clamp(21px, 2.5vw, 28px); white-space: nowrap; }
.movement-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); align-items: start; gap: 18px; }
.movement-form-panel { min-width: 0; }
.movement-balance-panel { position: sticky; top: 88px; overflow: hidden; border: 1px solid #b8dfd2; border-radius: 17px; background: linear-gradient(145deg, #173b51, #176c67); color: #fff; padding: 24px; box-shadow: 0 16px 36px rgba(18, 62, 75, .18); }
.movement-balance-panel::after { content: ''; position: absolute; width: 145px; height: 145px; left: -45px; bottom: -55px; border-radius: 50%; background: #ffffff0b; }
.movement-balance-panel small, .movement-balance-panel strong, .movement-balance-panel p { position: relative; z-index: 1; display: block; }
.movement-balance-panel small { color: #c9e3df; font-size: 12px; font-weight: 700; }
.movement-balance-panel strong { margin-top: 7px; font-size: clamp(22px, 2.6vw, 31px); line-height: 1.35; }
.movement-balance-panel strong.preview { color: #8ff0cd; }
.movement-balance-panel strong.preview.negative { color: #ffc2b8; }
.movement-balance-panel p { margin: 13px 0 0; color: #d4e3e6; font-size: 12px; line-height: 1.7; }
.movement-balance-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 20px; border-radius: 13px; background: #ffffff16; color: #8ff0cd; }
.movement-balance-icon .icon { width: 23px; height: 23px; }
.movement-balance-divider { height: 1px; margin: 20px 0; background: #ffffff20; }
.flash { display: grid; gap: 2px; margin-bottom: 18px; border: 1px solid #bfe5d7; border-right: 5px solid var(--green); border-radius: 9px; background: var(--mint); color: var(--green-dark); padding: 12px 14px; }
.flash strong { font-size: 13px; }
.flash span { font-size: 12px; }
.flash.error { border-color: #f2c4bf; border-right-color: var(--danger); background: var(--danger-bg); color: #8f1d14; }

.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.detail-grid.customer-overview, .detail-grid.investor-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-grid strong { display: block; margin-top: 7px; font-size: 17px; overflow-wrap: anywhere; }
.detail-grid .highlight { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.detail-grid .highlight span { color: #c3d1dc; }
.contract-summary-grid { gap: 12px; }
.contract-documents-panel { margin-bottom: 17px; overflow: hidden; border: 1px solid #cfdce2; border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.contract-documents-panel > summary { display: flex; align-items: center; gap: 11px; padding: 14px 17px; cursor: pointer; list-style: none; background: linear-gradient(135deg, #173952, #216b69); color: #fff; }
.contract-documents-panel > summary::-webkit-details-marker { display: none; }
.contract-documents-panel > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.contract-documents-panel > summary strong, .contract-documents-panel > summary small { display: block; }
.contract-documents-panel > summary small { margin-top: 2px; color: #c9dcde; font-size: 11px; }
.contract-documents-panel > summary > b { padding: 5px 9px; border-radius: 8px; background: #ffffff17; color: #dff5ef; font-size: 10px; }
.contract-documents-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #ffffff18; color: #7ce5c1; }
.contract-documents-icon .icon { width: 19px; height: 19px; }
.contract-documents-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 13px; background: #f6f9fa; }
.contract-document-link { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 83px; border: 1px solid #d9e3e7; border-radius: 11px; background: #fff; padding: 11px; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.contract-document-link:hover { transform: translateY(-2px); border-color: #abcac8; box-shadow: 0 8px 18px #20395413; }
.contract-document-link > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: #eaf5f3; color: #168766; }
.contract-document-link > span .icon { width: 17px; height: 17px; }
.contract-document-link > div { min-width: 0; }
.contract-document-link strong, .contract-document-link small { display: block; }
.contract-document-link strong { font-size: 11.5px; line-height: 1.45; }
.contract-document-link small { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.contract-document-link em { position: absolute; left: 8px; bottom: 6px; color: #168766; font-size: 9px; font-style: normal; font-weight: 800; }
.contract-document-link.promise-full > span { background: #fff2df; color: #a96216; }
.contract-document-link.promise-split > span { background: #edf3fa; color: #416d97; }
.contract-document-link.receipt > span { background: #eef8ee; color: #3b8650; }
.contract-summary-grid article { min-height: 92px; padding: 15px 16px 14px 60px; }
.contract-summary-grid article:hover { transform: translateY(-2px); border-color: #c8d7e1; box-shadow: var(--shadow-hover); }
.contract-summary-grid strong { margin-top: 5px; font-size: 15px; line-height: 1.55; }
.detail-card-icon { position: absolute; top: 14px; left: 14px; display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #edf8f4; color: var(--green) !important; }
.detail-card-icon .icon { width: 18px; height: 18px; }
.contract-summary-grid .highlight .detail-card-icon { background: #ffffff18; color: #7ce5c1 !important; }
.contract-summary-grid .summary-card-solid { color: #fff; border-color: transparent; }
.contract-summary-grid .summary-card-solid > span:not(.detail-card-icon) { color: #e5f3f1; }
.contract-summary-grid .summary-card-solid .detail-card-icon { background: #ffffff1c; color: #fff !important; }
.contract-summary-grid .summary-profit { background: linear-gradient(140deg, #a86d1d, #865116); }
.contract-summary-grid .summary-total { background: linear-gradient(140deg, #247981, #17616c); }
.contract-summary-grid .investor-summary-card strong { font-size: 13px; line-height: 1.6; }
.installments-table .installment-row > td { transition: background .15s, border-color .15s; }
.installments-table .installment-paid > td { background: #effaf4; border-bottom-color: #d7ecdf; }
.installments-table .installment-paid > td:first-child { box-shadow: inset -4px 0 0 #56b98c; }
.installments-table .installment-paid:hover > td { background: #e5f7ed; }
.installments-table .installment-partial > td { background: #eef6ff; border-bottom-color: #d6e6f5; }
.installments-table .installment-partial > td:first-child { box-shadow: inset -4px 0 0 #5c9bd5; }
.installments-table .installment-partial:hover > td { background: #e4f0fc; }
.partial-status { background: #dceeff; color: #245f91; }
.installments-table .installment-unpaid > td { background: #fff8ed; border-bottom-color: #f0e1c8; }
.installments-table .installment-unpaid > td:first-child { box-shadow: inset -4px 0 0 #e6a34b; }
.installments-table .installment-unpaid:hover > td { background: #fff2df; }
.split-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.users-management { display: grid; gap: 17px; }
.users-management .panel { overflow: hidden; }
.users-table, .roles-table { width: 100%; table-layout: fixed; }
.users-table th:nth-child(1) { width: 16%; }
.users-table th:nth-child(2) { width: 18%; }
.users-table th:nth-child(3) { width: 16%; }
.users-table th:nth-child(4) { width: 12%; }
.users-table th:nth-child(5) { width: 11%; }
.users-table th:nth-child(6) { width: 27%; }
.roles-table th:nth-child(1) { width: 38%; }
.roles-table th:nth-child(2), .roles-table th:nth-child(3) { width: 18%; }
.roles-table th:nth-child(4) { width: 26%; }
.users-table td, .roles-table td { white-space: normal; }
.users-table .actions-column, .roles-table .actions-column { text-align: center; }
.user-row-actions { display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.user-row-actions .table-btn, .user-row-actions .secondary-btn { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.activity-button { background: linear-gradient(135deg, #247981, #17616c); }
.user-activity-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.user-activity-stats article { min-height: 116px; }
.user-activity-stats .last-activity-value { font-size: 18px; }
.user-activity-panel { overflow: hidden; }
.user-activity-search { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #f8fbfb); }
.user-activity-search input { flex: 1; min-width: 220px; }
.activity-result-count { padding: 6px 10px; border-radius: 9px; background: #edf7f4; color: #17675f; font-size: 12px; font-weight: 750; }
.user-activity-table { min-width: 760px; }
.user-activity-table th:nth-child(1) { width: 180px; }
.user-activity-table th:nth-child(2) { width: 130px; }
.user-activity-table th:nth-child(4) { width: 150px; }
.activity-type { display: inline-flex; padding: 5px 10px; border-radius: 8px; background: #e8f6f1; color: #17675f; font-size: 11px; font-weight: 750; }
.activity-type.sensitive { background: #fff0e2; color: #9a4d12; }
.sensitive-activity-row > td { background: #fffaf4; }
.activity-message { font-weight: 650; color: var(--text); }
.ip-address { direction: ltr; display: inline-block; padding: 4px 8px; border-radius: 7px; background: #f0f4f7; color: #4d6575; font-size: 11px; }
.user-name, .role-name { color: var(--text); font-size: 13px; font-weight: 750; }
.role-badge { display: inline-flex; padding: 4px 9px; border-radius: 8px; background: #edf3fa; color: #315a82; font-weight: 700; }
.login-count, .role-stat { display: inline-grid; place-items: center; min-width: 32px; height: 29px; padding-inline: 8px; border-radius: 8px; background: #edf7f4; color: #17675f; font-weight: 750; }
.permissions-count { background: #fff5dd; color: #8a5b08; }
.suspended-status { background: #fdeceb; color: #9b3e38; }
.section-gap { margin-top: 17px; }
.treasury-balance { margin-bottom: 20px; border-radius: 16px; background: linear-gradient(120deg, var(--navy-2), #24604f); color: #fff; padding: 26px; box-shadow: var(--shadow); }
.treasury-balance span, .treasury-balance small { display: block; color: #c9ddd6; }
.treasury-balance strong { display: block; margin: 7px 0; font-size: clamp(29px, 4vw, 37px); }
.treasury-receipt-button, .treasury-payment-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 10px; padding: 9px 14px; color: #fff; font-weight: 750; text-decoration: none; box-shadow: 0 6px 14px #18334a18; }
.treasury-receipt-button { background: linear-gradient(135deg, #16966f, #0f7559); }
.treasury-payment-button { background: linear-gradient(135deg, #d48625, #ad6413); }
.treasury-page-heading { align-items: flex-start; }
.treasury-page-actions { flex-wrap: nowrap; flex: 0 0 auto; }
.treasury-page-actions > * { white-space: nowrap; }
.treasury-page-actions .icon { width: 17px; height: 17px; }
.treasury-scope-note { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; border: 1px solid #cfe2dd; border-radius: 13px; background: #f2faf7; padding: 13px 15px; color: #315a52; }
.treasury-scope-note > .icon { width: 24px; height: 24px; color: #168766; flex: 0 0 auto; }
.treasury-scope-note > div { flex: 1; min-width: 0; }
.treasury-scope-note strong, .treasury-scope-note span { display: block; }
.treasury-scope-note span { margin-top: 3px; color: #607b75; font-size: 12px; }
.voucher-scope-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 15px 20px 4px; }
.voucher-scope-tabs a { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafb; padding: 10px 12px; color: #526978; font-size: 12px; font-weight: 750; text-decoration: none; }
.voucher-scope-tabs a b { display: inline-grid; place-items: center; min-width: 25px; height: 25px; border-radius: 8px; background: #e8eef2; }
.voucher-scope-tabs a.active.receipt { border-color: #9fd8c4; background: #e8f7f1; color: #12674f; }
.voucher-scope-tabs a.active.payment { border-color: #ecc18e; background: #fff1e1; color: #92500e; }
.voucher-scope-tabs a.active.investor-receipt { border-color: #adc8e0; background: #edf4fa; color: #315e86; }
.voucher-scope-tabs a.active.investor-payment { border-color: #c5b9dc; background: #f3effa; color: #665080; }
.voucher-list-count { padding: 6px 10px; border-radius: 9px; background: #edf3fa; color: #527084; font-size: 12px; font-weight: 750; }
.voucher-scope-badge { display: inline-flex; min-width: 118px; justify-content: center; padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.voucher-scope-badge.treasury { background: #e8f7f1; color: #12674f; }
.voucher-scope-badge.investor { background: #edf3fa; color: #315e86; }
.treasury-records-panel { overflow: hidden; }
.treasury-filter-bar { display: grid; grid-template-columns: minmax(210px, .55fr) minmax(280px, 1.45fr) auto; align-items: end; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #f8fbfb); }
.treasury-filter-bar label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.treasury-filter-bar input, .treasury-filter-bar select { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px 12px; color: var(--text); font: inherit; outline: 0; }
.treasury-filter-bar input:focus, .treasury-filter-bar select:focus { border-color: #54aa91; box-shadow: 0 0 0 3px #16876616; }
.treasury-filter-bar .custom-select { min-width: 0; }
.treasury-table-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.treasury-table-heading h2 { margin: 0; font-size: 19px; }
.treasury-table-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.voucher-counts { display: flex; gap: 7px; }
.voucher-counts span { padding: 6px 10px; border-radius: 9px; background: #edf3fa; color: #527084; font-size: 12px; font-weight: 700; }
.voucher-counts span.active { background: #e7f6f0; color: #12674f; box-shadow: inset 0 0 0 1px #b8dfd2; }
.voucher-counts span.active.payment { background: #fff0e2; color: #9a4d12; box-shadow: inset 0 0 0 1px #efc8a5; }
.treasury-records-table { min-width: 930px; }
.treasury-records-table th:nth-child(1) { width: 90px; }
.treasury-records-table th:nth-child(2) { width: 135px; }
.treasury-records-table th:nth-child(3) { width: 115px; }
.treasury-records-table th:last-child { width: 115px; }
.treasury-records-table td:nth-child(4), .treasury-records-table td:nth-child(5), .treasury-records-table .voucher-description { white-space: normal; line-height: 1.55; }
.voucher-number { color: #17675f; font-weight: 800; }
.report-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-overview article:nth-child(1) { border-color: #b9cce2; background: #edf3fa; }
.report-overview article:nth-child(2) { border-color: #b8dfcb; background: #e9f8f0; }
.report-overview article:nth-child(3) { border-color: #efd39d; background: #fff5dd; }
.report-overview article:nth-child(4) { border-color: #c9c0e6; background: #f1eefb; }
.report-overview article:nth-child(5) { border-color: #efc8a5; background: #fff0e2; }
.report-overview article:nth-child(6) { border-color: #aad6d9; background: #eaf7f7; }
.report-center-panel { margin-bottom: 20px; overflow: hidden; }
.operational-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.operational-report-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 116px; padding: 17px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); text-decoration: none; box-shadow: 0 7px 20px rgba(22, 40, 63, .055); transition: transform .16s, box-shadow .16s, border-color .16s; }
.operational-report-card:hover { transform: translateY(-2px); border-color: #9ecabc; box-shadow: 0 12px 26px rgba(22, 40, 63, .1); }
.report-card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #159b76, #0b795a); }
.report-card-icon .icon { width: 23px; height: 23px; }
.report-card-copy { min-width: 0; }
.report-card-copy strong, .report-card-copy small { display: block; }
.report-card-copy strong { margin-bottom: 6px; font-size: 15px; }
.report-card-copy small { color: var(--muted); font-size: 11px; line-height: 1.75; }
.report-card-arrow { color: #78909e; font-size: 21px; font-weight: 800; }
.operational-report-card.tone-orange .report-card-icon { background: linear-gradient(145deg, #d18b2f, #ad6518); }
.operational-report-card.tone-blue .report-card-icon { background: linear-gradient(145deg, #3b82a0, #286680); }
.operational-report-card.tone-purple .report-card-icon { background: linear-gradient(145deg, #7b6ab1, #5b4a91); }
.operational-report-card.tone-navy .report-card-icon { background: linear-gradient(145deg, #355979, #203954); }
.report-result-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-result-summary article:nth-child(1) { border-top: 4px solid #2b8292; }
.report-result-summary article:nth-child(2) { border-top: 4px solid #159b76; }
.report-result-summary article:nth-child(3) { border-top: 4px solid #c68125; }
.report-result-summary article:nth-child(4) { border-top: 4px solid #7b6ab1; }
.report-result-summary article:nth-child(5) { border-top: 4px solid #496d94; }
.report-detail-panel { overflow: visible; }
.report-filter-bar { display: grid; grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(165px, .7fr)) auto; align-items: end; gap: 11px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #f8fbfb); }
.report-filter-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.report-filter-field input, .report-filter-field select { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px 12px; color: var(--text); font: inherit; outline: 0; }
.report-filter-field input:focus, .report-filter-field select:focus { border-color: #54aa91; box-shadow: 0 0 0 3px #16876616; }
.report-filter-field .custom-select { min-width: 0; }
.report-filter-actions { display: flex; align-items: center; gap: 8px; }
.report-table-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; }
.report-table-heading h2 { margin: 0; font-size: 18px; }
.report-table-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.report-table-heading > span { padding: 7px 11px; border-radius: 9px; background: #e8f5f1; color: #17675f; font-size: 12px; font-weight: 800; }
.operational-report-table { min-width: 900px; }

.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form .form-control { max-width: 320px; }
.lookup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.lookup-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 17px; }
.lookup-list span { border-radius: 20px; background: #f0f3f6; padding: 5px 10px; font-size: 12px; }
.print-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.print-grid a { display: block; min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 20px; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border .15s; }
.print-grid a:hover { transform: translateY(-2px); border-color: #7dceb5; }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.provider-grid.compact { grid-template-columns: 1fr; }
.provider-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 13px; background: #fff; padding: 15px; }
.provider-card > div:first-child { min-width: 0; flex: 1; }
.provider-card strong, .provider-card span { display: block; }
.provider-card span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.provider-card small { display: block; margin-top: 5px; color: #527084; font-size: 11px; }
.sms-stats article:nth-child(1) { border-color: #b9cce2; background: #edf3fa; }
.sms-stats article:nth-child(2) { border-color: #efd39d; background: #fff5dd; }
.sms-stats article:nth-child(3) { border-color: #b8dfcb; background: #e9f8f0; }
.sms-stats article:nth-child(4) { border-color: #efc5c1; background: #fdeceb; }
.sms-message-cell { max-width: 420px; white-space: normal; line-height: 1.6; }
.sms-settings-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 17px; align-items: start; }
.sms-provider-list { overflow: hidden; }
.sms-connection-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 20px 18px; padding: 14px 16px; border: 1px solid #d8e1e8; border-radius: 13px; background: #f6f8fa; }
.sms-connection-state > div:first-child { min-width: 0; }
.sms-connection-state span, .sms-connection-state small { display: block; color: var(--muted); font-size: 11px; }
.sms-connection-state strong { display: block; margin-top: 3px; color: #42586a; }
.sms-connection-state.connected { border-color: #a9dac6; background: #e9f8f1; }
.sms-connection-state.connected > div:first-child strong { color: #126a4d; }
.sms-connection-state.failed { border-color: #efc5c1; background: #fff1ef; }
.sms-connection-state.failed > div:first-child strong, .sms-error-text { color: #9b3e38; }
.sms-balance-box { min-width: 120px; padding: 9px 13px; border-radius: 10px; background: #fff; text-align: center; box-shadow: inset 0 0 0 1px rgba(39, 76, 95, .09); }
.sms-balance-box strong { font-size: 20px; color: #126a4d; }
.sms-delivery-detail { max-width: 310px; white-space: normal; }
.sms-delivery-detail span, .sms-delivery-detail small { display: block; }
.sms-delivery-detail small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.sms-recipient-panel { overflow: hidden; }
.sms-recipient-search { display: grid; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fbfcfd); }
.audience-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.audience-switch label { cursor: pointer; }
.audience-switch input { position: absolute; opacity: 0; pointer-events: none; }
.audience-switch span { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); font-weight: 700; transition: .15s; }
.audience-switch input:checked + span { border-color: #54aa91; background: #e7f6f0; color: #12674f; box-shadow: inset 0 0 0 1px #9cd2c1; }
.recipient-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.recipient-search-row input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font: inherit; }
.recipient-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.recipient-toolbar strong, .recipient-toolbar small { display: block; }
.recipient-toolbar small { margin-top: 4px; color: var(--muted); }
.select-all-recipients { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 9px; background: #edf7f4; color: #17675f; font-weight: 700; cursor: pointer; }
.recipient-groups { display: grid; gap: 18px; padding: 18px 20px; }
.recipient-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.recipient-group-head h2 { margin: 0; font-size: 17px; }
.recipient-group-head span { padding: 4px 9px; border-radius: 15px; background: #edf3fa; color: #315a82; font-size: 12px; font-weight: 700; }
.recipient-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 430px; overflow-y: auto; padding: 2px; }
.recipient-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #fff; cursor: pointer; transition: .15s; }
.recipient-card:hover { border-color: #9fcfc0; background: #f7fcfa; }
.recipient-card:has(input:checked) { border-color: #54aa91; background: #eaf8f3; box-shadow: inset 0 0 0 1px #b8dfd2; }
.recipient-card input { width: 17px; height: 17px; accent-color: var(--green); }
.recipient-card span { min-width: 0; }
.recipient-card strong, .recipient-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient-card small { margin-top: 3px; color: var(--muted); }
.recipient-card > b { padding: 3px 7px; border-radius: 7px; background: #edf3fa; color: #315a82; font-size: 11px; }
.sms-wizard-actions { justify-content: flex-end; border-top: 1px solid var(--border); }
.selected-recipient-count { margin-inline-end: auto; color: var(--muted); }
.selected-recipient-count b { color: var(--green-dark); font-size: 18px; }
.sms-compose-panel { padding: 0; overflow: hidden; }
.sms-compose-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); }
.sms-compose-layout > section { border-inline-end: 1px solid var(--border); }
.sms-message-editor { padding: 20px; }
.sms-message-editor label { display: block; margin-bottom: 7px; font-weight: 700; }
.sms-message-editor textarea { width: 100%; min-height: 185px; resize: vertical; border: 1px solid var(--border); border-radius: 11px; padding: 13px; font: inherit; line-height: 1.7; }
.message-counter { margin-top: 6px; color: var(--muted); font-size: 12px; text-align: left; }
.sms-recipient-summary { background: #fbfcfd; }
.selected-recipient-list { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; padding: 14px; }
.selected-recipient-list article { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.selected-recipient-list strong, .selected-recipient-list small { display: block; }
.selected-recipient-list small { color: var(--muted); margin-top: 2px; }
.selected-recipient-list b { color: #315a82; font-size: 11px; }
.provider-flags { display: flex; gap: 5px; }
.provider-flags span { border-radius: 20px; background: #eef2f5; padding: 4px 8px; white-space: nowrap; }
.provider-flags .enabled { background: #e5f6ef; color: #087457; }
.print-grid strong, .print-grid span { display: block; }
.print-grid strong { color: var(--navy); font-size: 16px; }
.print-grid span { color: var(--muted); font-size: 12px; margin-top: 6px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--navy), #234a5c); }
.login-card { width: min(420px, 100%); border-radius: 18px; background: #fff; padding: 36px; box-shadow: 0 24px 80px #08162455; }
.login-brand { margin: auto; }
.login-card h1 { margin: 17px 0 6px; text-align: center; font-size: 23px; }
.login-card > p { margin: 0 0 23px; text-align: center; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 15px; }
.login-card label { font-size: 13px; font-weight: 700; }
.login-card input { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--border); border-radius: 8px; padding: 11px; outline: 0; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #16876618; }
.login-card button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; background: linear-gradient(145deg, #159b76, #0b795a); color: #fff; padding: 11px; font-weight: 700; cursor: pointer; box-shadow: 0 7px 16px #0f936d2b; transition: transform .15s, box-shadow .15s, background .15s; }
.login-card button:hover { background: linear-gradient(145deg, #118967, #08694e); transform: translateY(-1px); box-shadow: 0 10px 22px #0f936d3b; }
.login-button-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.16); font-size: 15px; line-height: 1; }
.demo-hint { display: block; margin-top: 17px; text-align: center; color: var(--muted); font-size: 11px; }

.portal-header { display: flex; justify-content: space-between; gap: 14px; background: var(--navy); color: #fff; padding: 17px max(22px, calc((100% - 1250px) / 2)); }
.portal-header a { color: #71ddb9; }
.portal-content { max-width: 1250px; margin: 28px auto; padding: 0 20px; }
.portal-contract { margin-bottom: 18px; }
.portal-page { min-height: 100vh; background: #f1f5f7; color: var(--text); }
.portal-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 12px max(24px, calc((100% - 1400px) / 2)); border-bottom: 1px solid #dbe5e9; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 20px rgba(22, 40, 63, .055); backdrop-filter: blur(12px); }
.portal-brand, .portal-account, .portal-account span, .portal-account a { display: flex; align-items: center; }
.portal-brand { gap: 11px; min-width: 0; }
.portal-brand > span { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 13px; background: linear-gradient(145deg, #159b76, #0b795a); color: #fff; box-shadow: 0 8px 18px rgba(15, 128, 96, .2); }
.portal-brand > span .icon { width: 22px; height: 22px; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { max-width: 430px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.portal-brand small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.portal-account { gap: 10px; }
.portal-account span { gap: 7px; color: #536675; font-size: 12px; font-weight: 700; }
.portal-account a { gap: 6px; min-height: 36px; padding: 7px 11px; border-radius: 9px; background: #fff0ef; color: #a44741; font-size: 11px; font-weight: 800; text-decoration: none; }
.portal-account .icon { width: 16px; height: 16px; }
.portal-main { width: min(1400px, calc(100% - 40px)); margin: 24px auto 45px; }
.portal-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 170px; margin-bottom: 17px; padding: 25px 28px; overflow: hidden; border: 1px solid #c5dfd8; border-radius: 18px; background: linear-gradient(125deg, #f7fcfa, #e2f3ed); box-shadow: 0 10px 28px rgba(22, 74, 60, .075); }
.portal-hero::after { content: ""; position: absolute; left: -85px; top: -120px; width: 270px; height: 270px; border: 42px solid rgba(21, 155, 118, .07); border-radius: 50%; }
.investor-portal-hero { border-color: #c9d7e5; background: linear-gradient(125deg, #f8fbfd, #e4edf5); }
.investor-portal-hero::after { border-color: rgba(73, 109, 148, .07); }
.portal-hero > * { position: relative; z-index: 2; }
.portal-hero span { color: #17675f; font-size: 11px; font-weight: 800; }
.portal-hero h1 { margin: 5px 0 2px; color: var(--navy-2); font-size: clamp(23px, 2.5vw, 31px); }
.portal-hero p { margin: 0; color: #5f7476; font-size: 12px; }
.portal-hero-actions { display: flex; gap: 8px; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 14px; border-radius: 10px; color: #fff; font-size: 11px; font-weight: 800; text-decoration: none; box-shadow: 0 7px 16px rgba(32, 57, 84, .16); }
.portal-button .icon { width: 16px; height: 16px; }
.portal-button.print { background: linear-gradient(145deg, #496d94, #304f75); }
.portal-button.neutral { background: linear-gradient(145deg, #718096, #58687d); }
.portal-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 18px; }
.portal-stat-grid article { position: relative; min-width: 0; min-height: 116px; padding: 15px 16px; overflow: hidden; border: 1px solid #dbe4e8; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(22, 40, 63, .055); }
.portal-stat-grid small, .portal-stat-grid strong, .portal-stat-grid em { display: block; }
.portal-stat-grid small { color: #687b89; font-size: 10.5px; font-style: normal; }
.portal-stat-grid strong { max-width: calc(100% - 36px); margin: 6px 0 2px; overflow-wrap: anywhere; color: #1f344c; font-size: clamp(19px, 2vw, 24px); line-height: 1.35; }
.portal-stat-grid em { color: #81909b; font-size: 9.5px; font-style: normal; }
.portal-stat-icon { position: absolute; left: 12px; top: 12px; display: grid !important; place-items: center; width: 33px; height: 33px; border-radius: 9px; background: #edf3f7; color: #53728a; }
.portal-stat-icon .icon { width: 17px; height: 17px; }
.portal-stat-grid .tone-blue { border-color: #c7d8e7; background: #f1f6fb; }
.portal-stat-grid .tone-green { border-color: #b8dfcb; background: #f0faf5; }
.portal-stat-grid .tone-orange { border-color: #efd1ad; background: #fff7ef; }
.portal-stat-grid .tone-purple { border-color: #d2c9e8; background: #f7f4fc; }
.portal-stat-grid .tone-teal { border-color: #b9dcdb; background: #eff9f8; }
.portal-stat-grid .tone-dark { border-color: #284965; background: linear-gradient(135deg, #203954, #285d57); }
.portal-stat-grid .tone-dark small, .portal-stat-grid .tone-dark strong, .portal-stat-grid .tone-dark em { color: #fff; }
.portal-stat-grid .tone-dark small, .portal-stat-grid .tone-dark em { color: #c8d8dc; }
.portal-stat-grid .tone-dark .portal-stat-icon { background: rgba(255,255,255,.12); color: #74dfbd; }
.portal-next-due { grid-column: span 2; }
.portal-panel { margin-bottom: 17px; overflow: hidden; border: 1px solid #dbe4e8; border-radius: 16px; background: #fff; box-shadow: 0 7px 21px rgba(22, 40, 63, .055); }
.portal-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border-bottom: 1px solid #e5ebee; background: linear-gradient(180deg, #fff, #fafcfc); }
.portal-panel-head h2 { margin: 0; font-size: 17px; }
.portal-panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.portal-panel-head > span { padding: 6px 10px; border-radius: 9px; background: #e9f6f1; color: #17675f; font-size: 10px; font-weight: 800; }
.portal-table { min-width: 850px; }
.portal-table th, .portal-table td { padding: 12px 13px; font-size: 11.5px; }
.portal-table thead th { background: linear-gradient(180deg, #315d6c, #254c5b); }
.portal-table-button { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 8px; background: #e6f5ef; color: #17675f; font-size: 10px; font-weight: 800; text-decoration: none; }
.portal-status { display: inline-flex; padding: 5px 9px; border-radius: 14px; font-size: 9.5px; font-weight: 800; }
.portal-status.active, .portal-status.completed { background: #e7f7ef; color: #147153; }
.portal-status.completed { background: #e9eef7; color: #496783; }
.portal-status.partial { background: #fff3dc; color: #986019; }
.portal-status.due { background: #fff0e8; color: #a65326; }
.portal-pagination { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 13px; border-top: 1px solid #e7ecef; font-size: 11px; }
.portal-pagination a { padding: 6px 11px; border-radius: 8px; background: #edf5f4; color: #17675f; font-weight: 800; text-decoration: none; }
.portal-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.portal-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; padding: 20px 22px; border: 1px solid #d9e4e8; border-radius: 16px; background: #fff; box-shadow: 0 7px 20px rgba(22,40,63,.05); }
.portal-page-heading > div:last-child { display: flex; gap: 8px; }
.portal-page-heading span { color: #17675f; font-size: 10px; font-weight: 800; }
.portal-page-heading h1 { margin: 3px 0; font-size: 24px; }
.portal-page-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.portal-contract-state { font-size: 19px !important; }
.portal-login-organization { display: block; margin: -2px 0 13px; color: #17675f; text-align: center; font-size: 12px; }
.detail-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 17px; }

@media (max-width: 1180px) {
  .financial-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid, .stats-grid, .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid.customer-overview, .detail-grid.investor-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-panels { grid-template-columns: 1fr; }
  .calculation-strip, .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .print-grid, .lookup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sms-settings-layout { grid-template-columns: 1fr; }
  .operational-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-result-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-welcome { grid-template-columns: 1fr; }
  .dashboard-welcome-actions { justify-content: flex-start; }
  .portal-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-two-columns { grid-template-columns: 1fr; }
  .contract-documents-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; right: 0; width: min(285px, 86vw); transform: translateX(105%); transition: transform .2s ease; box-shadow: -15px 0 40px #07111f55; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 30; background: #0b172966; }
  .app-shell.sidebar-open + .sidebar-overlay { display: block; }
  .mobile-menu-button { display: grid; }
  .topbar { justify-content: flex-start; padding: 0 18px; }
  .topbar-user { border-left: 0; padding-left: 0; }
  .content { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .movement-layout { grid-template-columns: 1fr; }
  .movement-balance-panel { position: static; }
  .checkbox-field { align-self: auto; }
  .sms-compose-layout { grid-template-columns: 1fr; }
  .sms-compose-layout > section { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .treasury-filter-bar { grid-template-columns: 1fr; }
  .voucher-scope-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .content { padding: 15px; }
  .topbar { height: 66px; gap: 12px; }
  .tenant-pill { margin-right: auto; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-title-copy { width: 100%; }
  .page-title-copy .page-heading-icon { width: 43px; height: 43px; border-radius: 12px; }
  .page-heading .actions { width: 100%; }
  .page-heading .actions > *, .page-heading > .primary-btn, .page-heading > .secondary-btn { flex: 1 1 auto; }
  .stats-grid, .mini-stats, .financial-summary-grid, .detail-grid, .report-cards, .print-grid, .lookup-grid, .detail-grid.compact { grid-template-columns: 1fr; }
  .operational-report-grid, .report-result-summary, .report-filter-bar { grid-template-columns: 1fr; }
  .report-filter-actions { align-items: stretch; flex-direction: column; }
  .report-filter-actions > * { width: 100%; }
  .dashboard-welcome { min-height: 0; padding: 21px 18px; }
  .dashboard-welcome-actions { align-items: stretch; flex-direction: column; }
  .dashboard-welcome-actions > * { width: 100%; }
  .dashboard-welcome-meta { align-items: stretch; flex-direction: column; }
  .dashboard-section-title { align-items: flex-start; }
  .portal-topbar { position: static; align-items: stretch; flex-direction: column; padding: 13px 16px; }
  .portal-account { justify-content: space-between; }
  .portal-account span { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-main { width: min(100% - 24px, 1400px); margin-top: 14px; }
  .portal-hero, .portal-page-heading { align-items: stretch; flex-direction: column; padding: 20px 17px; }
  .portal-hero-actions, .portal-page-heading > div:last-child { align-items: stretch; flex-direction: column; }
  .portal-button { width: 100%; }
  .portal-stat-grid { grid-template-columns: 1fr; }
  .portal-next-due { grid-column: auto; }
  .contract-documents-panel > summary { align-items: flex-start; }
  .contract-documents-panel > summary > b { display: none; }
  .contract-documents-grid { grid-template-columns: 1fr; }
  .portal-panel-head { align-items: flex-start; flex-direction: column; }
  .detail-grid.customer-overview, .detail-grid.investor-overview { grid-template-columns: 1fr; }
  .calculation-strip, .review-grid { grid-template-columns: 1fr; }
  .wizard-steps { flex-direction: column; }
  .panel-head, .list-tools { align-items: stretch; flex-direction: column; }
  .list-tools input, .list-tools button { width: 100%; }
  .contracts-filter-tools > input { flex: 0 0 auto; }
  .contracts-status-field { width: 100%; min-width: 0; flex: 0 0 auto; }
  .form-panel { padding: 18px; }
  .form-actions { flex-direction: column; }
  .form-actions > * { width: 100%; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-card { align-items: stretch; flex-direction: column; }
  .audience-switch, .recipient-list { grid-template-columns: 1fr; }
  .inventory-summary-grid { grid-template-columns: 1fr; }
  .recipient-search-row { grid-template-columns: 1fr; }
  .recipient-toolbar { align-items: stretch; flex-direction: column; }
  .treasury-table-heading { align-items: stretch; flex-direction: column; }
  .treasury-scope-note { align-items: stretch; flex-direction: column; }
  .treasury-scope-note > .secondary-btn { width: 100%; }
  .voucher-scope-tabs { grid-template-columns: 1fr; padding-inline: 14px; }
  .voucher-counts { width: 100%; }
  .voucher-counts span { flex: 1; text-align: center; }
  .select-all-recipients { justify-content: center; }
  .sms-wizard-actions { align-items: stretch; }
  .selected-recipient-count { margin-inline-end: 0; text-align: center; }
  .inline-form .form-control { max-width: none; }
  .login-card { padding: 28px 22px; }
  .portal-header { flex-direction: column; }
  th, td { padding: 11px 13px; }
}

@media print {
  .sidebar, .topbar, .page-heading .actions, .flash, .mobile-menu-button { display: none !important; }
  .app-shell { display: block; }
  .content { max-width: none; padding: 0; }
  .panel, .form-panel, .stats-grid article, .detail-grid article { box-shadow: none; }
  thead th { background: #eef1f3 !important; color: #253342 !important; border-bottom-color: #cfd6dc !important; }
}
