/* ============================================================
   bookkeeper.css  –  Elinom Bookkeeper Dashboard Styles
   Version 1.0 | March 2026
   ============================================================ */

/* ── Layout shell ─────────────────────────────────────────── */
.bk-shell {
  display: flex;
  min-height: calc(100vh - 56px);   /* below workspace topbar */
  background: #f1f5f9;
}

/* ── Left sidebar ─────────────────────────────────────────── */
.bk-sidebar {
  width: 230px;
  min-width: 230px;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.5rem 0 2rem;
  box-shadow: 4px 0 24px rgb(15,23,42,.18);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  z-index: 100;
}

.bk-sidebar-header {
  padding: 0 1.2rem 1.2rem;
  border-bottom: 1px solid rgb(255,255,255,.07);
  margin-bottom: .6rem;
}

.bk-sidebar-header h2 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0;
}

.bk-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: .72rem 1.3rem;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s;
  color: #94a3b8;
  font-size: .88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.bk-nav-item:hover {
  background: rgb(99,102,241,.1);
  color: #c7d2fe;
}

.bk-nav-item.active {
  background: linear-gradient(90deg, rgb(99,102,241,.18), transparent);
  color: #a5b4fc;
  border-left-color: #6366f1;
  font-weight: 600;
}

.bk-nav-item .bk-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .92rem;
  flex-shrink: 0;
  background: rgb(255,255,255,.05);
  transition: background .15s;
}

.bk-nav-item.active .bk-nav-icon {
  background: rgb(99,102,241,.25);
  color: #818cf8;
}

.bk-nav-badge {
  margin-left: auto;
  background: #6366f1;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.bk-nav-badge.amber  { background: #f59e0b; }
.bk-nav-badge.rose   { background: #f43f5e; }
.bk-nav-badge.mint   { background: #10b981; }

/* ── Main content ─────────────────────────────────────────── */
.bk-main {
  flex: 1;
  min-width: 0;
  padding: 1.8rem 2rem 3rem;
  overflow-y: auto;
}

/* ── Section panels ───────────────────────────────────────── */
.bk-section {
  display: none;
  animation: bkFadeIn .25s ease;
}
.bk-section.active { display: block; }

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

/* ── Page header ──────────────────────────────────────────── */
.bk-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  gap: .8rem;
}

.bk-page-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -.3px;
}

.bk-page-header p {
  font-size: .83rem;
  color: #64748b;
  margin: 2px 0 0;
}

/* ── Stats row ────────────────────────────────────────────── */
.bk-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.bk-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 2px 12px rgb(15,23,42,.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgb(15,23,42,.05);
}

.bk-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bk-stat-icon.violet  { background: rgb(99,102,241,.12); color: #6366f1; }
.bk-stat-icon.mint    { background: rgb(16,185,129,.12);  color: #10b981; }
.bk-stat-icon.amber   { background: rgb(245,158,11,.12);  color: #f59e0b; }
.bk-stat-icon.rose    { background: rgb(244,63,94,.12);   color: #f43f5e; }
.bk-stat-icon.sky     { background: rgb(56,189,248,.12);  color: #38bdf8; }

.bk-stat-info span {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.bk-stat-info strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 2px;
}

/* ── Card / panel ─────────────────────────────────────────── */
.bk-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgb(15,23,42,.06);
  border: 1px solid rgb(15,23,42,.05);
  overflow: hidden;
}

.bk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  flex-wrap: wrap;
}

.bk-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.bk-card-body {
  padding: 1.2rem 1.4rem;
}

/* ── Toolbar / search row ─────────────────────────────────── */
.bk-toolbar {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.bk-search {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 0 .9rem;
  gap: .5rem;
  height: 36px;
  transition: border-color .15s;
}

.bk-search:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgb(99,102,241,.12);
}

.bk-search i  { color: #94a3b8; font-size: .82rem; }

.bk-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .84rem;
  color: #0f172a;
  min-width: 180px;
}

.bk-select {
  height: 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  font-size: .84rem;
  color: #475569;
  padding: 0 .9rem;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}

.bk-select:focus { border-color: #6366f1; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-bk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .17s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-bk.primary {
  background: linear-gradient(135deg,#6366f1,#4f46e5);
  color: #fff;
  box-shadow: 0 2px 8px rgb(99,102,241,.3);
}

.btn-bk.primary:hover {
  background: linear-gradient(135deg,#818cf8,#6366f1);
  box-shadow: 0 4px 14px rgb(99,102,241,.4);
}

.btn-bk.mint {
  background: linear-gradient(135deg,#10b981,#059669);
  color: #fff;
  box-shadow: 0 2px 8px rgb(16,185,129,.28);
}
.btn-bk.mint:hover { background: linear-gradient(135deg,#34d399,#10b981); }

.btn-bk.rose {
  background: linear-gradient(135deg,#f43f5e,#e11d48);
  color: #fff;
  box-shadow: 0 2px 8px rgb(244,63,94,.28);
}
.btn-bk.rose:hover { background: linear-gradient(135deg,#fb7185,#f43f5e); }

.btn-bk.ghost {
  background: transparent;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
}
.btn-bk.ghost:hover { background: #f8fafc; color: #334155; }

.btn-bk.amber {
  background: linear-gradient(135deg,#f59e0b,#d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgb(245,158,11,.28);
}

/* ── Table ────────────────────────────────────────────────── */
.bk-table-wrap { overflow-x: auto; }

.bk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
}

.bk-table thead th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.bk-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}

.bk-table tbody tr:last-child { border-bottom: none; }
.bk-table tbody tr:hover { background: #f8fafc; }

.bk-table td {
  padding: .78rem 1rem;
  color: #334155;
  vertical-align: middle;
}

.bk-table td strong { color: #0f172a; font-weight: 600; }

/* ── Status badge ─────────────────────────────────────────── */
.bk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.bk-badge.active    { background: rgb(16,185,129,.12); color: #059669; }
.bk-badge.inactive  { background: rgb(100,116,139,.12); color: #475569; }
.bk-badge.pending   { background: rgb(245,158,11,.12);  color: #d97706; }
.bk-badge.overdue   { background: rgb(244,63,94,.12);   color: #e11d48; }
.bk-badge.done      { background: rgb(16,185,129,.12);  color: #059669; }
.bk-badge.review    { background: rgb(56,189,248,.12);  color: #0284c7; }
.bk-badge.approved  { background: rgb(16,185,129,.12);  color: #059669; }
.bk-badge.rejected  { background: rgb(244,63,94,.12);   color: #e11d48; }
.bk-badge.high      { background: rgb(244,63,94,.12);   color: #e11d48; }
.bk-badge.medium    { background: rgb(245,158,11,.12);  color: #d97706; }
.bk-badge.low       { background: rgb(56,189,248,.12);  color: #0284c7; }
.bk-badge.matched   { background: rgb(16,185,129,.12);  color: #059669; }
.bk-badge.unmatched { background: rgb(244,63,94,.12);   color: #e11d48; }
.bk-badge.partial   { background: rgb(245,158,11,.12);  color: #d97706; }

/* ── Avatar chip ──────────────────────────────────────────── */
.bk-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

/* ── Two-column grid ──────────────────────────────────────── */
.bk-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

/* ── Task card ────────────────────────────────────────────── */
.bk-task-item {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}

.bk-task-item:hover {
  box-shadow: 0 4px 18px rgb(15,23,42,.08);
  border-color: #e2e8f0;
}

.bk-task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.bk-task-checkbox.checked {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.bk-task-body { flex: 1; min-width: 0; }

.bk-task-title {
  font-size: .875rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 3px;
}

.bk-task-title.done-text {
  text-decoration: line-through;
  color: #94a3b8;
}

.bk-task-meta {
  font-size: .775rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

/* ── Reconciliation split view ────────────────────────────── */
.bk-recon-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.bk-recon-panel {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
}

.bk-recon-panel-head {
  padding: .8rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: .82rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.bk-recon-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
  font-size: .84rem;
}

.bk-recon-row:last-child { border-bottom: none; }

.bk-recon-row:hover { background: #f8fafc; }

.bk-recon-row.selected {
  background: rgb(99,102,241,.07);
  border-left: 3px solid #6366f1;
}

.bk-recon-amount {
  margin-left: auto;
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
}

.bk-recon-amount.credit { color: #10b981; }
.bk-recon-amount.debit  { color: #f43f5e; }

.bk-match-actions {
  display: flex;
  justify-content: center;
  gap: .8rem;
  padding: 1rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* ── Category pill select ─────────────────────────────────── */
.bk-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  background: #f1f5f9;
  color: #475569;
}

.bk-cat-pill:hover { background: #e2e8f0; }

.bk-cat-pill.selected {
  background: rgb(99,102,241,.12);
  border-color: #6366f1;
  color: #6366f1;
}

/* ── Notes section ────────────────────────────────────────── */
.bk-notes-sidebar {
  width: 240px;
  min-width: 240px;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  max-height: 520px;
}

.bk-notes-layout {
  display: flex;
  gap: 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  min-height: 480px;
}

.bk-notes-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bk-note-list-item {
  padding: .75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}

.bk-note-list-item:hover  { background: #f8fafc; }
.bk-note-list-item.active { background: rgb(99,102,241,.07); border-left: 3px solid #6366f1; }
.bk-note-list-item .client-name { font-size: .85rem; font-weight: 600; color: #0f172a; }
.bk-note-list-item .note-preview { font-size: .77rem; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-note-list-item .note-date { font-size: .71rem; color: #cbd5e1; margin-top: 3px; }

.bk-note-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
}

.bk-note-editor textarea {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: .9rem;
  font-size: .88rem;
  color: #0f172a;
  resize: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  min-height: 300px;
  transition: border-color .15s;
}

.bk-note-editor textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgb(99,102,241,.1);
}

/* ── Approval card ────────────────────────────────────────── */
.bk-approval-item {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: box-shadow .15s;
}

.bk-approval-item:hover { box-shadow: 0 4px 20px rgb(15,23,42,.08); }

.bk-approval-left { flex: 1; min-width: 200px; }
.bk-approval-left h4 { font-size: .92rem; font-weight: 700; color: #0f172a; margin: 0 0 3px; }
.bk-approval-left p  { font-size: .8rem; color: #64748b; margin: 0; }

.bk-approval-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.bk-approval-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Progress bar ─────────────────────────────────────────── */
.bk-progress-wrap {
  background: #f1f5f9;
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.bk-progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  transition: width .5s ease;
}

/* ── Modal overlay ────────────────────────────────────────── */
.bk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15,23,42,.55);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
          -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.bk-modal-backdrop.open { display: flex; }

.bk-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  width: min(580px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgb(15,23,42,.25);
  animation: bkFadeIn .2s ease;
}

.bk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.bk-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.bk-modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #64748b;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.bk-modal-close:hover { background: #e2e8f0; color: #0f172a; }

.bk-form-group {
  margin-bottom: 1rem;
}

.bk-form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bk-form-group input,
.bk-form-group select,
.bk-form-group textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: .88rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color .15s;
  font-family: 'DM Sans', sans-serif;
  box-sizing: border-box;
}

.bk-form-group input:focus,
.bk-form-group select:focus,
.bk-form-group textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgb(99,102,241,.1);
  background: #fff;
}

/* ── Toast notification ───────────────────────────────────── */
#bkToast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99999;
  background: #1e293b;
  color: #fff;
  padding: .75rem 1.3rem;
  border-radius: 12px;
  font-size: .87rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgb(15,23,42,.18);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

#bkToast.show {
  opacity: 1;
  transform: translateY(0);
}

#bkToast.success { border-left: 4px solid #10b981; }
#bkToast.error   { border-left: 4px solid #f43f5e; }
#bkToast.info    { border-left: 4px solid #38bdf8; }

/* ── Upload drop zone ─────────────────────────────────────── */
.bk-dropzone {
  border: 2.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #f8fafc;
  position: relative;
}

.bk-dropzone:hover,
.bk-dropzone.dragover {
  border-color: #6366f1;
  background: rgb(99,102,241,.04);
}

.bk-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.bk-dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgb(99,102,241,.1);
  color: #6366f1;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.bk-dropzone h4 {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 .3rem;
}

.bk-dropzone p {
  font-size: .8rem;
  color: #94a3b8;
  margin: 0;
}

/* ── Document type tabs ───────────────────────────────────── */
.bk-doc-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.bk-doc-tab {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}

.bk-doc-tab.active {
  background: rgb(99,102,241,.1);
  border-color: #6366f1;
  color: #6366f1;
}

/* ── Extracted-data preview card ──────────────────────────── */
.bk-extract-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: .85rem;
}

.bk-extract-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .35rem 0;
  border-bottom: 1px solid rgb(16,185,129,.1);
}

.bk-extract-row:last-child { border-bottom: none; }

.bk-extract-label {
  width: 110px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #059669;
  flex-shrink: 0;
}

.bk-extract-value {
  flex: 1;
  font-weight: 600;
  color: #0f172a;
}

.bk-extract-input {
  flex: 1;
  border: 1.5px solid #bbf7d0;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: .84rem;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.bk-extract-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgb(16,185,129,.1);
}

/* ── Bank feed channel indicator ──────────────────────────── */
.bk-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
}

.bk-channel-badge.bank    { background: rgb(56,189,248,.12); color: #0284c7; }
.bk-channel-badge.receipt { background: rgb(16,185,129,.12); color: #059669; }
.bk-channel-badge.invoice { background: rgb(167,139,250,.12); color: #7c3aed; }

/* ── Client portal view ───────────────────────────────────── */
.bk-portal-preview {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 18px;
  padding: 2rem;
  color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.bk-portal-preview::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgb(99,102,241,.15);
}

.bk-portal-header {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.5rem;
}

.bk-portal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0;
}

.bk-portal-header p {
  font-size: .8rem;
  color: #64748b;
  margin: 0;
}

.bk-portal-task {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem 1rem;
  background: rgb(255,255,255,.06);
  border-radius: 12px;
  margin-bottom: .6rem;
  border: 1px solid rgb(255,255,255,.08);
  transition: background .15s;
}

.bk-portal-task:hover { background: rgb(255,255,255,.1); }

.bk-portal-task-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.bk-portal-task-icon.upload  { background: rgb(16,185,129,.2);  color: #34d399; }
.bk-portal-task-icon.approve { background: rgb(99,102,241,.2);  color: #a5b4fc; }
.bk-portal-task-icon.review  { background: rgb(245,158,11,.2);  color: #fbbf24; }

.bk-portal-task-text { flex: 1; }
.bk-portal-task-text strong { display: block; font-size: .86rem; font-weight: 600; color: #f1f5f9; }
.bk-portal-task-text span   { font-size: .78rem; color: #94a3b8; }

.bk-portal-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .8rem;
  margin-top: 1.2rem;
}

.bk-portal-kpi {
  background: rgb(255,255,255,.06);
  border-radius: 12px;
  padding: .9rem 1rem;
  border: 1px solid rgb(255,255,255,.08);
  text-align: center;
}

.bk-portal-kpi .kpi-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #f1f5f9;
  line-height: 1.1;
}

.bk-portal-kpi .kpi-label {
  font-size: .72rem;
  color: #64748b;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Upload progress bar ──────────────────────────────────── */
.bk-upload-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  margin-top: .5rem;
  display: none;
}

.bk-upload-progress.active { display: block; }

.bk-upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 20px;
  animation: bkUploadPulse 1.2s ease-in-out infinite alternate;
}

/* ── New helper classes for p2.js-rendered content ────────── */
.text-red  { color: #ef4444; }
.text-green { color: #10b981; }

/* Bank feed category select */
.bk-cat-sel {
  font-size: .8125rem;
  padding: .25rem .5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.bk-cat-sel:focus { outline: none; border-color: #6366f1; }

/* Reconciliation rows */
.recon-row {
  padding: .625rem .75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: .4rem;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.recon-row:hover { border-color: #a5b4fc; background: #f5f3ff; }
.recon-row.selected { border-color: #6366f1; background: #ede9fe; }
.recon-row.matched  { border-color: #10b981; background: #d1fae5; cursor: default; }
.recon-row-desc { font-size: .85rem; font-weight: 600; color: #0f172a; }
.recon-row-meta { display: flex; justify-content: space-between; font-size: .78rem; color: #64748b; margin-top: .2rem; }

/* Note list items */
.note-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .15s;
}
.note-item:hover  { background: #f8fafc; }
.note-item.active { background: #ede9fe; }

/* Action buttons in cards */
.bk-action-btn {
  font-size: .78rem;
  padding: .3rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  transition: all .15s;
}
.bk-action-btn:hover       { background: #f1f5f9; border-color: #94a3b8; }
.bk-action-btn.danger      { color: #ef4444; border-color: #fca5a5; }
.bk-action-btn.danger:hover{ background: #fee2e2; }

/* Drag-over dropzone highlight */
.bk-dropzone.drag-over {
  border-color: #6366f1;
  background: #ede9fe;
}


@keyframes bkUploadPulse {
  from { width: 20%; }
  to   { width: 90%; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (width <= 1024px) {
  .bk-sidebar {
    width: 60px;
    min-width: 60px;
    padding: 1rem 0;
    overflow: hidden;
  }

  .bk-sidebar-header,
  .bk-nav-item span,
  .bk-nav-badge { display: none; }

  .bk-nav-item {
    justify-content: center;
    padding: .8rem 0;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .bk-nav-item.active {
    background: rgb(99,102,241,.12);
    border-bottom-color: #6366f1;
  }

  .bk-nav-item .bk-nav-icon {
    width: 36px; height: 36px; font-size: 1rem;
  }
}

@media (width <= 900px) {
  .bk-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 250px;
    min-width: 250px;
    height: 100vh;
    z-index: 9999;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgb(0,0,0,0.3);
    overflow-y: auto;
    padding: 1rem;
  }
  .bk-sidebar.mobile-open { left: 0; }

  .bk-sidebar.mobile-open .bk-sidebar-header,
  .bk-sidebar.mobile-open .bk-nav-item span,
  .bk-sidebar.mobile-open .bk-nav-badge { display: initial; }

  .bk-sidebar.mobile-open .bk-nav-item {
    justify-content: flex-start;
    padding: .8rem 1rem;
  }
  .bk-main { margin-left: 0; padding: 16px; width: 100%; }

  .bk-recon-split,
  .bk-grid-2 {
    grid-template-columns: 1fr;
  }

  .bk-notes-sidebar {
    width: 100%;
    min-width: unset;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .bk-notes-layout {
    flex-direction: column;
    min-height: 500px;
  }
}

@media (width <= 600px) {
  .bk-main { padding: 1rem; }
  .bk-page-header h1 { font-size: 1.15rem; }
  .bk-stats-row { grid-template-columns: 1fr 1fr; }
  .bk-approval-item { flex-direction: column; align-items: flex-start; }
}

@media (width <= 480px) {
  .bk-stats-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ── Workspace Top Bar ─────────────────────────────────────── */
.bk-topbar {
  height: 56px;
  background: #0f172a;
  border-bottom: 1px solid rgb(255,255,255,.08);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 12px rgb(0,0,0,.28);
}

.bk-topbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.bk-topbar-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.bk-topbar-divider {
  width: 1px;
  height: 22px;
  background: rgb(255,255,255,.12);
  margin: 0 .1rem;
  flex-shrink: 0;
}

.bk-topbar-workspace {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bk-topbar-app {
  font-size: .65rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1;
}

.bk-topbar-title {
  font-size: .9rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
  white-space: nowrap;
}

.bk-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.bk-topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgb(255,255,255,.06);
  border: 1px solid rgb(255,255,255,.1);
  border-radius: 8px;
  padding: .3rem .85rem;
}

.bk-topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .67rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.bk-topbar-username {
  font-size: .82rem;
  font-weight: 600;
  color: #c7d2fe;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-topbar-exit {
  font-size: .77rem;
  padding: .3rem .8rem;
  background: rgb(255,255,255,.05);
  border: 1px solid rgb(255,255,255,.1);
  border-radius: 7px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: all .15s;
  white-space: nowrap;
}
.bk-topbar-exit:hover { background: rgb(255,255,255,.1); color: #f1f5f9; }

.bk-topbar-logout {
  font-size: .77rem;
  padding: .3rem .8rem;
  background: rgb(239,68,68,.1);
  border: 1px solid rgb(239,68,68,.28);
  border-radius: 7px;
  color: #fca5a5;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: all .15s;
  white-space: nowrap;
}
.bk-topbar-logout:hover { background: rgb(239,68,68,.2); }

@media (width <= 768px) {
  .bk-topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    height: auto;
    min-height: 52px;
  }

  .bk-topbar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .bk-topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: 0;
    width: 100%;
  }

  .bk-topbar-username {
    max-width: 96px;
  }

  .bk-topbar-exit .fa-arrow-left,
  .bk-topbar-logout .fa-sign-out-alt {
    margin: 0;
  }
}

/* ── Reports section ───────────────────────────────────────── */
.bk-report-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.bk-report-tab {
  padding: .45rem 1.1rem;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}

.bk-report-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}

.bk-report-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.bk-report-section-row td {
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .5rem .75rem;
}

.bk-report-total-row td {
  background: #f1f5f9;
  border-top: 2px solid #e2e8f0;
  font-size: .9rem;
}

.bk-cf-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex: 1;
  min-width: 120px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1rem;
}

.bk-cf-label {
  font-size: .78rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.bk-cf-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}
.bk-cf-value.mint  { color: #10b981; }
.bk-cf-value.rose  { color: #f43f5e; }
.bk-cf-value.violet { color: #6366f1; }
.bk-cf-value.amber { color: #f59e0b; }

/* ── Workspace footer ──────────────────────────────────────── */
.bk-workspace-footer {
  height: 48px;
  background: #0f172a;
  border-top: 1px solid rgb(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  font-size: .78rem;
  color: #475569;
}

.bk-workspace-footer a {
  color: #64748b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: color .15s;
}
.bk-workspace-footer a:hover { color: #94a3b8; }

/* ═══ MOBILE OVERRIDES — Bookkeeper-specific ═══ */
@media (width <= 600px) {
  .bk-portal-summary {
    grid-template-columns: 1fr !important;
  }
}
