html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.bf-income-table-wrapper {
    max-height: 175px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

.bf-expense-table-wrapper {
    max-height: 380px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

/* Budget Entry tables */
.bf-table {
    font-size: 0.8rem;
    table-layout: fixed;
    width: 100%;
}

    .bf-table th,
    .bf-table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        padding: 4px 6px;
    }

    .bf-table .form-control {
        font-size: 0.8rem;
        padding: 2px 4px;
        height: auto;
    }

    /* Even tighter for form-control-sm (Bootstrap override) */
    .bf-table .form-control-sm {
        font-size: 0.8rem;
        padding: 2px 4px;
    }

    .bf-table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }

/*  Sticky first column 
    Important: Sticky column works only if: 
    (1) widths are fixed; (2) no wrapping of text within column; (3) table uses table-layout: fixed.
*/
.bf-sticky-col-1 {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 3;
}

/* Sticky second column (for expense) */
.bf-sticky-col-2 {
    position: sticky;
    left: 60px; /* must match width of col 1 */
    background: #fff;
    z-index: 3;
}

/* Sticky header cells for frozen columns must sit above other header cells */
.bf-table thead th.bf-sticky-col-1,
.bf-table thead th.bf-sticky-col-2 {
    z-index: 4;
}

/* Wider text columns */
.bf-col-source {
    width: 140px;
}
/* Income Source */
.bf-col-desc {
    width: 200px;
}
/* COA Sub Description */

/* Fixed numeric columns */
.bf-col-fy {
    width: 90px;
    text-align: right;
}

.bf-col-income-m {
    width: 85px;
    text-align: right;
}
.bf-col-m {
    width: 80px;
    text-align: right;
}

/* Small status column */
.bf-col-status {
    width: 100px;
}

.bf-expense-subtotal td {
    background: #f8f9fa;
    font-weight: 600;
}

.bf-income-subtotal td {
    background: #f8f9fa;
    font-weight: 600;
}

/* Group header */
.bf-group {
    font-weight: 600;
    margin-top: 8px;
}