/* =========================================================
   PREMIUM BANK BOOK MODULE CSS
   File: assets/css/bankbook.css
   Scope: .bankbook-page only - preserves all other ALFAA pages
   ========================================================= */

.bankbook-page {
  --bb-blue: #2563eb;
  --bb-blue-dark: #155eef;
  --bb-navy: #10194a;
  --bb-text: #11183f;
  --bb-muted: #62729a;
  --bb-border: #e3eaf5;
  --bb-bg: #f7faff;
  --bb-green: #039648;
  --bb-red: #ef3137;
  --bb-purple: #7846d8;
  --bb-orange: #f97316;
  --bb-card-shadow: 0 10px 28px rgba(33, 50, 99, .055);
  display: grid;
  gap: 22px;
  min-width: 0;
  color: var(--bb-text);
}

/* ==================== PAGE HEADER ==================== */
.bankbook-page .bb-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}
.bankbook-page .bb-page-header h1 {
  margin: 0 0 8px;
  font-size: 29px;
  letter-spacing: -.035em;
  font-weight: 800;
  color: var(--bb-navy);
}
.bankbook-page .bb-page-header p {
  margin: 0;
  font-size: 14px;
  color: var(--bb-muted);
  font-weight: 500;
}
.bankbook-page .bb-header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}
.bankbook-page .bb-search {
  width: 304px;
  height: 50px;
  border: 1px solid var(--bb-border);
  border-radius: 9px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  color: #7182a8;
  box-shadow: 0 2px 5px rgba(34, 50, 90, .02);
}
.bankbook-page .bb-search:focus-within {
  border-color: #aac5fc;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
.bankbook-page .bb-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--bb-text);
  background: transparent;
}
.bankbook-page .bb-search input::placeholder { color: #7384aa; }
.bankbook-page .bb-filter-btn,
.bankbook-page .bb-primary-btn {
  height: 50px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0 21px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.bankbook-page .bb-filter-btn {
  background: #fff;
  border: 1px solid var(--bb-border);
  color: var(--bb-navy);
}
.bankbook-page .bb-filter-btn:hover { background: #f8faff; border-color: #cad8ee; }
.bankbook-page .bb-primary-btn {
  border: 1px solid var(--bb-blue-dark);
  color: #fff;
  background: linear-gradient(135deg, #1760ed, #0860ef);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.bankbook-page .bb-primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(37, 99, 235, .25); }
.bankbook-page .bb-primary-btn .fa-chevron-down { font-size: 10px; margin-left: 3px; }

/* ==================== SUMMARY KPI CARDS ==================== */
.bankbook-page .bb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
}
.bankbook-page .bb-kpi {
  min-height: 142px;
  border-radius: 10px;
  border: 1px solid var(--bb-border);
  background: #fff;
  box-shadow: var(--bb-card-shadow);
  padding: 23px 21px;
  display: flex;
  align-items: flex-start;
  gap: 17px;
  min-width: 0;
}
.bankbook-page .bb-kpi-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.bankbook-page .bb-kpi.blue .bb-kpi-icon { color: var(--bb-blue); background: #e8f0ff; }
.bankbook-page .bb-kpi.green .bb-kpi-icon { color: var(--bb-green); background: #e4f8ed; }
.bankbook-page .bb-kpi.red .bb-kpi-icon { color: var(--bb-red); background: #ffe7e8; }
.bankbook-page .bb-kpi.purple .bb-kpi-icon { color: var(--bb-purple); background: #f0e9ff; }
.bankbook-page .bb-kpi p {
  margin: 5px 0 13px;
  color: #4a5a87;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.bankbook-page .bb-kpi strong {
  display: block;
  color: var(--bb-navy);
  font-size: clamp(19px, 1.55vw, 22px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.bankbook-page .bb-kpi small {
  display: block;
  margin-top: 13px;
  color: var(--bb-muted);
  font-size: 12px;
  font-weight: 500;
}

/* ==================== MAIN LAYOUT ==================== */
.bankbook-page .bb-layout {
  display: block;
  width: 100%;
  min-width: 0;
}
.bankbook-page .bb-table-card {
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  box-shadow: var(--bb-card-shadow);
  overflow: hidden;
}
.bankbook-page .bb-table-card--full { width: 100%; }
.bankbook-page .bb-card-head {
  min-height: 78px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eef3fb;
}
.bankbook-page .bb-card-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--bb-navy);
}
.bankbook-page .bb-card-title h2 { margin-bottom: 5px; }
.bankbook-page .bb-card-title p {
  margin: 0;
  color: var(--bb-muted);
  font-size: 12px;
  font-weight: 500;
}
.bankbook-page .bb-active-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bb-blue);
  background: #eff5ff;
  padding: 7px 9px 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.bankbook-page .bb-active-filter button {
  border: 0;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  background: #dbe9ff;
  width: 19px;
  height: 19px;
}
.bankbook-page .bb-table-wrap { width: 100%; overflow-x: auto; }
.bankbook-page table { width: 100%; border-collapse: collapse; min-width: 1040px; }
.bankbook-page thead th {
  background: #fbfcff;
  color: #52658f;
  padding: 18px 25px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  height: 55px;
  position: sticky;
  top: 0;
}
.bankbook-page tbody td {
  height: 83px;
  padding: 0 25px;
  border-top: 1px solid #edf2fa;
  font-size: 13px;
  color: #1d2b59;
  white-space: nowrap;
}
.bankbook-page tbody tr:hover td { background: #fafdff; }
.bankbook-page .bb-bank-name {
  display: flex;
  align-items: center;
  gap: 15px;
}
.bankbook-page .bb-bank-name strong { display: block; font-size: 14px; font-weight: 750; color: var(--bb-navy); margin-bottom: 7px; }
.bankbook-page .bb-bank-name small { font-size: 12px; color: #63759f; }
.bankbook-page .bb-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}
.bankbook-page .bb-logo img { max-width: 38px; max-height: 38px; display: block; object-fit: contain; }
.bankbook-page .bb-account-number { font-weight: 600; color: #233465; }
.bankbook-page .bb-currency {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 7px;
  color: #06914a;
  background: #e7f8ee;
  border: 1px solid #d1f1dd;
  font-size: 12px;
  font-weight: 700;
}
.bankbook-page .bb-balance { font-weight: 750; color: var(--bb-green); }
.bankbook-page .bb-status {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border-radius: 7px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
}
.bankbook-page .bb-status.active { color: #06914a; background: #e4f7eb; border: 1px solid #d0efdc; }
.bankbook-page .bb-status.inactive { color: #dc2626; background: #feecec; border: 1px solid #fde0e0; }
.bankbook-page .bb-action-heading,
.bankbook-page .bb-action-cell { width: 82px; text-align: center; }
.bankbook-page .bb-action-cell .bb-more { margin: 0 auto; }
.bankbook-page .bb-more {
  height: 39px;
  width: 39px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e3f2;
  border-radius: 8px;
  background: #fff;
  color: #172554;
  cursor: pointer;
}
.bankbook-page .bb-more:hover { background: #f3f7ff; }
.bankbook-page .bb-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 162px;
  color: var(--bb-muted);
  font-weight: 600;
}

/* ==================== TABLE FOOTER ==================== */
.bankbook-page .bb-table-footer {
  min-height: 78px;
  border-top: 1px solid #edf2fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 25px;
  color: #556793;
  font-size: 12px;
}
.bankbook-page .bb-table-footer p { margin: 0; }
.bankbook-page .bb-pager { display: flex; gap: 8px; align-items: center; }
.bankbook-page .bb-pager button {
  min-width: 39px;
  height: 39px;
  background: #fff;
  color: #203369;
  border: 1px solid #dbe4f4;
  border-radius: 7px;
  cursor: pointer;
}
.bankbook-page .bb-pager button.active { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); font-weight: 700; }
.bankbook-page .bb-pager button:disabled { opacity: .45; cursor: not-allowed; }
.bankbook-page .bb-table-footer label { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.bankbook-page .bb-table-footer select {
  width: 80px;
  height: 40px;
  border: 1px solid #dce5f4;
  border-radius: 7px;
  color: #223463;
  background: #fff;
  padding: 0 12px;
  outline: none;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1390px) {
  .bankbook-page .bb-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .bankbook-page .bb-page-header { flex-direction: column; }
  .bankbook-page .bb-header-actions { width: 100%; flex-wrap: wrap; }
  .bankbook-page .bb-search { flex: 1; min-width: 280px; }
}
@media (max-width: 760px) {
  .bankbook-page { gap: 16px; }
  .bankbook-page .bb-page-header h1 { font-size: 25px; }
  .bankbook-page .bb-header-actions { display: grid; grid-template-columns: 1fr; }
  .bankbook-page .bb-search, .bankbook-page .bb-filter-btn, .bankbook-page .bb-primary-btn { width: 100%; }
  .bankbook-page .bb-kpi-grid { grid-template-columns: 1fr; }
  .bankbook-page .bb-card-head { padding: 15px 16px; min-height: auto; flex-wrap: wrap; gap: 12px; }
  .bankbook-page .bb-table-footer { padding: 16px; flex-wrap: wrap; }
}

/* ==================== PORTALLED ACTION MENU ====================
   Kept outside the table scroll container so row actions are never clipped. */
.bb-floating-menu {
  position: fixed;
  z-index: 10050;
  width: 185px;
  padding: 7px;
  border: 1px solid #dfe7f4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 35, 77, .18);
  display: grid;
  gap: 3px;
}
.bb-floating-menu__title {
  padding: 8px 10px 9px;
  margin-bottom: 2px;
  border-bottom: 1px solid #edf2fa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #63759f;
  font: 700 11px/1.2 Inter, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bb-floating-menu button {
  height: 38px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  background: transparent;
  color: #11183f;
  font: 600 13px Inter, Arial, sans-serif;
  cursor: pointer;
}
.bb-floating-menu button i { color: #50658f; width: 16px; }
.bb-floating-menu button:hover { background: #f3f7ff; color: #2563eb; }
.bb-floating-menu button:hover i { color: #2563eb; }
