/* ==========================================================================
   Kişi Başı app styles — layout shell, components, responsive tables, a11y
   ========================================================================== */

html { scroll-behavior: smooth; }
body { font-family: var(--kb-font); background: var(--kb-bg); color: var(--kb-text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -0.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.kb-amount, .kb-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Focus ring (keyboard) */
:focus-visible { outline: 3px solid rgba(var(--kb-brand-1-rgb), 0.6); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; box-shadow: var(--kb-focus-ring); }

/* Skip link */
.kb-skip { position: absolute; left: -999px; top: 8px; z-index: 3000; background: var(--kb-brand-1); color: #fff; padding: 8px 14px; border-radius: var(--kb-radius-sm); }
.kb-skip:focus { left: 8px; text-decoration: none; }

.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }

/* --------------------------------------------------------------------------
   Shell: sidebar + topbar
   -------------------------------------------------------------------------- */
.kb-shell { display: flex; min-height: 100vh; }

.kb-sidebar { width: var(--kb-sidebar-w); background: var(--kb-sidebar-bg); border-right: 1px solid var(--kb-border); display: flex; flex-direction: column; flex-shrink: 0; }
@media (min-width: 992px) {
  .kb-sidebar { position: fixed; inset: 0 auto 0 0; height: 100vh; z-index: 1030; }
  .kb-main { margin-left: var(--kb-sidebar-w); }
}
.kb-sidebar .offcanvas-body { display: flex; flex-direction: column; flex: 1; padding: 0; }

.kb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; font-weight: 700; font-size: 1.15rem; color: var(--kb-text); text-decoration: none; }
.kb-brand:hover { text-decoration: none; color: var(--kb-text); }
.kb-brand img { width: 36px; height: 36px; border-radius: 10px; }
.kb-brand-text { background: var(--kb-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.kb-nav { list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.kb-nav-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--kb-text-faint); padding: 14px 12px 6px; }
.kb-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--kb-radius-sm); color: var(--kb-text-muted); font-weight: 500; transition: background 0.15s, color 0.15s; }
.kb-nav-link:hover { background: var(--kb-surface-2); color: var(--kb-text); text-decoration: none; }
.kb-nav-link.active { background: var(--kb-brand-soft); color: var(--kb-brand-1); }
[data-bs-theme="dark"] .kb-nav-link.active { color: #a9b6f6; }
.kb-nav-link .bi { font-size: 1.15rem; width: 22px; text-align: center; }
.kb-nav-badge { margin-left: auto; }

.kb-sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--kb-border); display: flex; flex-direction: column; gap: 8px; }
.kb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--kb-radius-sm); }
.kb-user-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-user-mail { font-size: 0.75rem; color: var(--kb-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kb-topbar { position: sticky; top: 0; z-index: 1020; height: var(--kb-topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--kb-topbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--kb-border); }
.kb-topbar-title { font-weight: 650; font-size: 1.05rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.kb-topbar .btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--kb-radius-sm); color: var(--kb-text-muted); position: relative; }
.kb-topbar .btn-icon:hover { background: var(--kb-surface-2); color: var(--kb-text); }
.kb-badge-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--kb-negative); color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.kb-content { padding: 20px 16px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
@media (min-width: 768px) { .kb-content { padding: 28px 28px 64px; } }

.kb-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.kb-page-header h1 { font-size: 1.5rem; margin: 0; }
.kb-page-sub { color: var(--kb-text-muted); margin: 2px 0 0; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Cards, stats, chips, avatars
   -------------------------------------------------------------------------- */
.kb-card { background: var(--kb-surface); border: 1px solid var(--kb-border); border-radius: var(--kb-radius); box-shadow: var(--kb-shadow-sm); }
.kb-card-body { padding: 18px 20px; }
.kb-card-header { padding: 14px 20px; border-bottom: 1px solid var(--kb-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kb-card-header h2, .kb-card-header h3 { font-size: 1rem; margin: 0; }

.kb-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.kb-stat-label { font-size: 0.8rem; color: var(--kb-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.kb-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.kb-stat-value small { font-size: 0.7em; font-weight: 500; color: var(--kb-text-muted); }
.kb-stat-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }

.kb-pos { color: var(--kb-positive) !important; }
.kb-neg { color: var(--kb-negative) !important; }
.kb-muted { color: var(--kb-text-muted); }

.kb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--kb-radius-pill); font-size: 0.78rem; font-weight: 600; background: var(--kb-surface-2); color: var(--kb-text-muted); border: 1px solid transparent; white-space: nowrap; }
.kb-chip-brand { background: var(--kb-brand-soft); color: var(--kb-brand-1); }
[data-bs-theme="dark"] .kb-chip-brand { color: #a9b6f6; }
.kb-chip-pos { background: var(--kb-positive-soft); color: var(--kb-positive); }
.kb-chip-neg { background: var(--kb-negative-soft); color: var(--kb-negative); }
.kb-chip-warn { background: var(--kb-warning-soft); color: var(--kb-warning); }
.kb-chip-info { background: var(--kb-info-soft); color: var(--kb-info); }
a.kb-chip:hover { text-decoration: none; border-color: var(--kb-border-strong); }
.kb-chip.active { background: var(--kb-brand-1); color: #fff; }

.kb-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.kb-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; color: #fff; flex-shrink: 0; letter-spacing: 0.02em; }
.kb-avatar-sm { width: 26px; height: 26px; font-size: 0.66rem; }
.kb-avatar-lg { width: 48px; height: 48px; font-size: 1.05rem; }
.kb-avatar-0 { background: linear-gradient(135deg, #667eea, #764ba2); }
.kb-avatar-1 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.kb-avatar-2 { background: linear-gradient(135deg, #10b981, #059669); }
.kb-avatar-3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kb-avatar-4 { background: linear-gradient(135deg, #ec4899, #be185d); }
.kb-avatar-5 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.kb-avatar-6 { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.kb-avatar-7 { background: linear-gradient(135deg, #f97316, #c2410c); }
.kb-avatar-virtual { background: var(--kb-surface-3); color: var(--kb-text-muted); border: 1px dashed var(--kb-border-strong); }
.kb-person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.kb-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Org cards (dashboard) */
.kb-org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kb-org-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; min-height: 160px; color: inherit; position: relative; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.kb-org-card:hover { transform: translateY(-2px); box-shadow: var(--kb-shadow); border-color: var(--kb-brand-1); text-decoration: none; color: inherit; }
.kb-org-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--kb-text-muted); }
.kb-org-card-title { font-size: 1.1rem; font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-org-card-desc { color: var(--kb-text-muted); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.kb-org-card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.kb-org-card.closed { opacity: 0.8; border-style: dashed; }

/* Empty state */
.kb-empty { text-align: center; padding: 44px 20px; color: var(--kb-text-muted); }
.kb-empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--kb-brand-soft); color: var(--kb-brand-1); display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 14px; }
[data-bs-theme="dark"] .kb-empty-icon { color: #a9b6f6; }
.kb-empty h3 { font-size: 1.1rem; color: var(--kb-text); margin-bottom: 6px; }
.kb-empty p { max-width: 420px; margin: 0 auto 16px; }

/* Org header */
.kb-org-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.kb-org-header h1 { font-size: 1.45rem; margin: 0 0 4px; }
.kb-org-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-tabs { margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.kb-tabs::-webkit-scrollbar { display: none; }
.kb-tabs .nav { flex-wrap: nowrap; gap: 4px; }
.kb-tabs .nav-link { white-space: nowrap; border-radius: var(--kb-radius-pill); padding: 8px 16px; font-weight: 500; }
.kb-closed-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--kb-radius); background: var(--kb-warning-soft); color: var(--kb-warning); margin-bottom: 16px; font-weight: 500; }

/* --------------------------------------------------------------------------
   Tables (→ card lists on small screens)
   -------------------------------------------------------------------------- */
.kb-table-wrap { overflow-x: auto; }
.kb-table { width: 100%; margin: 0; }
.kb-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--kb-text-muted); font-weight: 600; border-bottom: 1px solid var(--kb-border); padding: 10px 12px; white-space: nowrap; background: transparent; }
.kb-table td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--kb-border); }
.kb-table tbody tr:last-child td { border-bottom: 0; }
.kb-table tbody tr[data-href], .kb-table tbody tr[data-expense-id] { cursor: pointer; }
.kb-table tbody tr[data-href]:hover, .kb-table tbody tr[data-expense-id]:hover { background: var(--kb-surface-2); }
.kb-table tfoot td { font-weight: 650; background: var(--kb-surface-2); }
.kb-table .text-end { text-align: right; }
.kb-table tr.kb-me td { background: var(--kb-brand-soft); }
.kb-table tr.kb-flash td { animation: kb-flash 1.2s ease-out; }
@keyframes kb-flash { from { background: var(--kb-brand-soft); } to { background: transparent; } }

@media (max-width: 767.98px) {
  .kb-table.kb-table-cards thead { display: none; }
  .kb-table.kb-table-cards, .kb-table.kb-table-cards tbody, .kb-table.kb-table-cards tfoot { display: block; }
  .kb-table.kb-table-cards tr { display: block; border: 1px solid var(--kb-border); border-radius: var(--kb-radius); margin-bottom: 10px; padding: 6px 4px; background: var(--kb-surface); }
  .kb-table.kb-table-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 6px 10px; text-align: right; }
  .kb-table.kb-table-cards td[data-label]::before { content: attr(data-label); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--kb-text-muted); font-weight: 600; text-align: left; flex-shrink: 0; }
  .kb-table.kb-table-cards td.kb-td-primary { font-weight: 600; font-size: 1rem; }
  .kb-table.kb-table-cards td.kb-td-primary::before { display: none; }
  .kb-table.kb-table-cards td.kb-td-actions { justify-content: flex-end; }
  .kb-table.kb-table-cards td.kb-td-actions::before { display: none; }
  .kb-table.kb-table-cards tfoot tr { background: var(--kb-surface-2); }
}

/* Pagination */
.kb-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; flex-wrap: wrap; }
.kb-pager .pagination { margin: 0; }
.pagination { --bs-pagination-active-bg: var(--kb-brand-1); --bs-pagination-active-border-color: var(--kb-brand-1); --bs-pagination-color: var(--kb-text); --bs-pagination-bg: var(--kb-surface); --bs-pagination-border-color: var(--kb-border); --bs-pagination-hover-bg: var(--kb-surface-2); --bs-pagination-hover-color: var(--kb-text); --bs-pagination-disabled-bg: var(--kb-surface); --bs-pagination-disabled-color: var(--kb-text-faint); --bs-pagination-focus-box-shadow: var(--kb-focus-ring); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label { font-weight: 550; font-size: 0.88rem; }
.form-control, .form-select { background: var(--kb-surface); color: var(--kb-text); border-color: var(--kb-border-strong); border-radius: var(--kb-radius-sm); padding: 0.55rem 0.8rem; }
.form-control::placeholder { color: var(--kb-text-faint); }
.input-group-text { background: var(--kb-surface-2); color: var(--kb-text-muted); border-color: var(--kb-border-strong); }
.form-text { color: var(--kb-text-muted); }
.kb-amount-input { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kb-form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* Segmented control (split type) */
.kb-segmented { display: inline-flex; background: var(--kb-surface-2); border-radius: var(--kb-radius-pill); padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; }
.kb-segmented label { padding: 6px 14px; border-radius: var(--kb-radius-pill); font-size: 0.85rem; font-weight: 550; color: var(--kb-text-muted); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.kb-segmented input:checked + label { background: var(--kb-surface); color: var(--kb-brand-1); box-shadow: var(--kb-shadow-sm); }
[data-bs-theme="dark"] .kb-segmented input:checked + label { color: #a9b6f6; }
.kb-segmented input:focus-visible + label { box-shadow: var(--kb-focus-ring); }

/* Split editor */
.kb-split-list { display: flex; flex-direction: column; gap: 6px; }
.kb-split-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--kb-border); border-radius: var(--kb-radius-sm); background: var(--kb-surface); }
.kb-split-row.is-off { opacity: 0.55; }
.kb-split-row .kb-split-input { width: 130px; }
.kb-split-row .kb-split-computed { font-size: 0.82rem; color: var(--kb-text-muted); white-space: nowrap; min-width: 90px; text-align: right; }
.kb-split-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--kb-radius-sm); background: var(--kb-surface-2); font-size: 0.9rem; }
.kb-split-summary.is-ok { background: var(--kb-positive-soft); color: var(--kb-positive); }
.kb-split-summary.is-bad { background: var(--kb-negative-soft); color: var(--kb-negative); }
@media (max-width: 575.98px) {
  .kb-split-row { grid-template-columns: auto 1fr; }
  .kb-split-row .kb-split-input { width: 100%; grid-column: 2; }
  .kb-split-row .kb-split-computed { grid-column: 2; text-align: left; }
}

/* Currency checkbox grid */
.kb-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.kb-check-tile { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--kb-border); border-radius: var(--kb-radius-sm); background: var(--kb-surface); cursor: pointer; }
.kb-check-tile:has(input:checked) { border-color: var(--kb-brand-1); background: var(--kb-brand-soft); }

/* --------------------------------------------------------------------------
   Settle up
   -------------------------------------------------------------------------- */
.kb-transfer { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--kb-border); border-radius: var(--kb-radius); background: var(--kb-surface); }
.kb-transfer-arrow { color: var(--kb-text-faint); font-size: 1.2rem; }
.kb-transfer-amount { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
@media (max-width: 575.98px) {
  .kb-transfer { grid-template-columns: 1fr auto 1fr; }
  .kb-transfer .kb-transfer-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
}

/* Members */
.kb-member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--kb-border); flex-wrap: wrap; }
.kb-member:last-child { border-bottom: 0; }
.kb-member-info { flex: 1; min-width: 160px; }
.kb-member-sub { font-size: 0.78rem; color: var(--kb-text-muted); }
.kb-member-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* Invite links */
.kb-invite { padding: 14px; border: 1px solid var(--kb-border); border-radius: var(--kb-radius); background: var(--kb-surface); display: flex; flex-direction: column; gap: 8px; }
.kb-invite.is-invalid { opacity: 0.7; border-style: dashed; }
.kb-invite-url { font-family: var(--kb-font-mono); font-size: 0.82rem; word-break: break-all; background: var(--kb-surface-2); padding: 8px 10px; border-radius: var(--kb-radius-sm); }
.kb-invite-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--kb-text-muted); }
.kb-qr { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: var(--kb-radius); }
.kb-qr svg { width: 220px; height: 220px; }
.kb-code { font-family: var(--kb-font-mono); font-weight: 700; letter-spacing: 0.15em; font-size: 1.4rem; }

/* Join / pending */
.kb-join-card { max-width: 520px; margin: 24px auto; }
.kb-pulse { width: 72px; height: 72px; border-radius: 50%; background: var(--kb-brand-soft); color: var(--kb-brand-1); display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; position: relative; }
.kb-pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(var(--kb-brand-1-rgb), 0.5); animation: kb-pulse 1.8s ease-out infinite; }
@keyframes kb-pulse { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* Toasts */
.kb-toasts { position: fixed; top: 12px; right: 12px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 24px)); }
.toast { border-left: 4px solid var(--kb-info); }
.toast.toast-success { border-left-color: var(--kb-positive); }
.toast.toast-danger { border-left-color: var(--kb-negative); }
.toast.toast-warning { border-left-color: var(--kb-warning); }
.toast .toast-body { display: flex; align-items: flex-start; gap: 10px; }
.toast .toast-body .bi { font-size: 1.1rem; margin-top: 1px; }

/* Modal (expense detail) */
.kb-detail-amount { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; }
.kb-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.kb-detail-grid dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--kb-text-muted); margin-bottom: 2px; }
.kb-detail-grid dd { margin: 0; font-weight: 550; }
.kb-share-list { display: flex; flex-direction: column; }
.kb-share-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--kb-border); }
.kb-share-row:last-child { border-bottom: 0; }
.kb-share-row .kb-amount { margin-left: auto; font-weight: 600; }

/* Skeleton */
.kb-skeleton { position: relative; overflow: hidden; background: var(--kb-surface-2); border-radius: var(--kb-radius-sm); min-height: 14px; }
.kb-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: kb-shimmer 1.4s infinite; }
@keyframes kb-shimmer { to { transform: translateX(100%); } }

/* Live indicator */
.kb-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--kb-text-muted); }
.kb-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kb-text-faint); }
.kb-live.is-on::before { background: var(--kb-positive); box-shadow: 0 0 0 3px var(--kb-positive-soft); }
.kb-live.is-reconnecting::before { background: var(--kb-warning); }

/* Misc */
.kb-divider { border: 0; border-top: 1px solid var(--kb-border); margin: 16px 0; }
.kb-danger-zone { border: 1px solid var(--kb-negative); border-radius: var(--kb-radius); }
.kb-danger-zone .kb-card-header { border-bottom-color: var(--kb-negative-soft); color: var(--kb-negative); }
.kb-hidden { display: none !important; }
.kb-min0 { min-width: 0; }
.kb-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { border-radius: var(--kb-radius-sm); font-weight: 550; }
.btn-sm { border-radius: 6px; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.kb-copy-input { font-family: var(--kb-font-mono); font-size: 0.82rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Print */
@media print {
  .kb-sidebar, .kb-topbar, .kb-toasts, .btn, .kb-tabs, .kb-pager { display: none !important; }
  .kb-main { margin-left: 0; }
}

/* Balances: person cell opens the per-person expenses modal */
.kb-person-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; border-radius: var(--kb-radius-sm, 8px); }
.kb-person-btn:hover .kb-person-name, .kb-person-btn:focus-visible .kb-person-name { text-decoration: underline; }
.kb-person-btn:focus-visible { outline: 2px solid var(--kb-primary); outline-offset: 2px; }
.kb-share-btn { width: 100%; background: none; border: 0; padding: 0.5rem 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.kb-share-btn:hover { background: var(--kb-surface-2, rgba(0,0,0,.03)); }
