/* ==========================================================================
   BUILDTRACK — Construction Project Manager
   Style A: Premium Construction SaaS · Balanced information density
   Structure:
     1. Design tokens            6. Tables & lists
     2. Base & typography        7. Forms & buttons
     3. Layout (AdminLTE 4)      8. Feedback (toasts, loader, empty states)
     4. Page header & breadcrumb 9. Page-specific (login, dashboard, details, reports)
     5. Cards & stat tiles      10. Responsive & print
   ========================================================================== */

/* 1. DESIGN TOKENS ------------------------------------------------------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../lib/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    --bt-navy: #17263C;
    --bt-navy-2: #263B55;
    --bt-navy-3: #34506F;
    --bt-blue: #2563EB;
    --bt-blue-hover: #1D4ED8;
    --bt-blue-soft: #EAF1FE;
    --bt-amber: #F5A623;
    --bt-amber-soft: #FEF5E4;
    --bt-bg: #F1F4F8;
    --bt-card: #FFFFFF;
    --bt-text: #17263C;
    --bt-muted: #64748B;
    --bt-border: #E3E8EF;
    --bt-border-strong: #CBD5E1;
    --bt-success: #16A34A;
    --bt-success-soft: #E8F6EE;
    --bt-warning: #D97706;
    --bt-warning-soft: #FDF3E3;
    --bt-danger: #DC2626;
    --bt-danger-soft: #FDECEC;
    --bt-slate-soft: #EEF2F6;

    --bt-radius: 10px;
    --bt-radius-sm: 7px;
    --bt-shadow: 0 1px 2px rgba(23, 38, 60, 0.05), 0 1px 3px rgba(23, 38, 60, 0.06);
    --bt-shadow-md: 0 4px 14px rgba(23, 38, 60, 0.08);
    --bt-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

    /* Bootstrap overrides */
    --bs-body-font-family: var(--bt-font);
    --bs-body-font-size: 0.875rem;
    --bs-body-color: var(--bt-text);
    --bs-body-bg: var(--bt-bg);
    --bs-secondary-color: var(--bt-muted);
    --bs-border-color: var(--bt-border);
    --bs-primary: var(--bt-blue);
    --bs-primary-rgb: 37, 99, 235;
    --bs-success: var(--bt-success);
    --bs-success-rgb: 22, 163, 74;
    --bs-warning: var(--bt-warning);
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger: var(--bt-danger);
    --bs-danger-rgb: 220, 38, 38;
    --bs-link-color: var(--bt-blue);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: var(--bt-blue-hover);
    --bs-border-radius: var(--bt-radius-sm);
    --bs-focus-ring-color: rgba(37, 99, 235, 0.25);

    --lte-sidebar-width: 248px;
}

/* 2. BASE & TYPOGRAPHY --------------------------------------------------- */
body {
    font-family: var(--bt-font);
    font-size: 0.875rem;
    color: var(--bt-text);
    background-color: var(--bt-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--bt-text);
    font-weight: 650;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.text-muted, .text-secondary {
    color: var(--bt-muted) !important;
}

.text-amber {
    color: var(--bt-amber) !important;
}

.fw-medium {
    font-weight: 550 !important;
}

.fw-semibold {
    font-weight: 620 !important;
}

.small-caps {
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bt-muted);
}

.tabular {
    font-variant-numeric: tabular-nums;
}

/* 3. LAYOUT (AdminLTE 4) ------------------------------------------------- */
.app-wrapper {
    background-color: var(--bt-bg);
}

/* Sidebar */
.app-sidebar {
    background-color: var(--bt-navy) !important;
    border-right: 0;
    box-shadow: none !important;
    --lte-sidebar-color: #B8C4D4;
    --lte-sidebar-hover-color: #FFFFFF;
    --lte-sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --lte-sidebar-active-color: #FFFFFF;
    --lte-sidebar-menu-active-bg: var(--bt-navy-2);
    --lte-sidebar-menu-active-color: #FFFFFF;
    --lte-sidebar-header-color: #7C8FA8;
}

.sidebar-brand {
    height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    background-color: var(--bt-navy);
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1rem;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 8px;
    background: var(--bt-amber);
    color: var(--bt-navy);
    font-size: 1.1rem;
}

.brand-words {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
}

.brand-words .brand-name {
    color: #FFFFFF;
    font-weight: 750;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.brand-words .brand-tagline {
    color: #8FA1B8;
    font-size: 0.66rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-company {
    margin: 0.85rem 0.85rem 0.35rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--bt-radius-sm);
    background-color: var(--bt-navy-2);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-company .company-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 6px;
    background: #FFFFFF;
    object-fit: contain;
}

.sidebar-company .company-initials {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 6px;
    background: var(--bt-navy-3);
    color: var(--bt-amber);
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-company .company-text {
    min-width: 0;
}

.sidebar-company .company-name {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-company .company-code {
    color: #8FA1B8;
    font-size: 0.68rem;
}

.sidebar-menu .nav-header {
    font-size: 0.66rem !important;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 1rem 1.1rem 0.4rem !important;
    color: #7C8FA8 !important;
}

.sidebar-menu .nav-item {
    padding: 0 0.6rem;
}

.sidebar-menu .nav-link {
    border-radius: var(--bt-radius-sm);
    padding: 0.55rem 0.75rem;
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    position: relative;
}

.sidebar-menu .nav-link .nav-icon {
    font-size: 1.05rem;
    width: 1.6rem;
    margin-right: 0.45rem;
    text-align: center;
}

.sidebar-menu .nav-link.active {
    background-color: var(--bt-navy-2) !important;
    color: #FFFFFF !important;
    box-shadow: inset 3px 0 0 var(--bt-amber);
}

.sidebar-menu .nav-link.active .nav-icon {
    color: var(--bt-amber);
}

/* Top navigation */
.app-header {
    background-color: var(--bt-card) !important;
    border-bottom: 1px solid var(--bt-border) !important;
    min-height: 60px;
    box-shadow: none;
}

.app-header .nav-link {
    color: var(--bt-muted);
}

.app-header .nav-link:hover {
    color: var(--bt-text);
    text-decoration: none;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    position: relative;
    font-size: 1.1rem;
}

.header-icon-btn:hover {
    background-color: var(--bt-slate-soft);
}

.header-icon-btn .dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bt-amber);
    border: 2px solid #FFFFFF;
}

.header-company {
    font-weight: 600;
    color: var(--bt-text);
    font-size: 0.9rem;
}

.user-chip {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.5rem !important;
    border-radius: 999px;
}

.user-chip:hover {
    background-color: var(--bt-slate-soft);
}

.avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bt-blue-soft);
    color: var(--bt-blue);
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.avatar-initials.lg {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    font-size: 1.15rem;
}

.user-chip .user-name {
    font-weight: 600;
    color: var(--bt-text);
    font-size: 0.82rem;
    line-height: 1.1;
}

.user-chip .user-role {
    color: var(--bt-muted);
    font-size: 0.7rem;
}

.dropdown-menu {
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow-md);
    border-radius: var(--bt-radius);
    font-size: 0.86rem;
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
}

.dropdown-item i {
    width: 1.3rem;
    color: var(--bt-muted);
}

.dropdown-item:active {
    background-color: var(--bt-blue);
}

.dropdown-item:active i {
    color: #FFFFFF;
}

/* Main area & footer */
.app-main {
    background-color: var(--bt-bg);
}

.app-content {
    padding: 0 0.5rem 1.5rem;
}

.app-footer {
    background-color: var(--bt-card);
    border-top: 1px solid var(--bt-border);
    color: var(--bt-muted);
    font-size: 0.78rem;
    padding: 0.85rem 1.5rem;
}

/* 4. PAGE HEADER & BREADCRUMB ------------------------------------------- */
.app-content-header {
    padding: 1.15rem 0.5rem 1rem;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.page-header .breadcrumb {
    font-size: 0.76rem;
    margin-bottom: 0.3rem;
    --bs-breadcrumb-divider-color: var(--bt-border-strong);
    --bs-breadcrumb-item-active-color: var(--bt-muted);
}

.page-header .breadcrumb a {
    color: var(--bt-muted);
}

.page-header .breadcrumb a:hover {
    color: var(--bt-blue);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.page-description {
    color: var(--bt-muted);
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 5. CARDS & STAT TILES ------------------------------------------------- */
.card {
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    background-color: var(--bt-card);
    --bs-card-cap-bg: transparent;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--bt-border);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-header::after {
    display: none;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 650;
    margin: 0;
    float: none;
}

.card-subtitle {
    color: var(--bt-muted);
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.card-body {
    padding: 1.1rem;
}

.card-footer {
    background-color: #FAFBFD;
    border-top: 1px solid var(--bt-border);
    padding: 0.75rem 1.1rem;
}

.stat-card {
    padding: 1rem 1.1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
}

.stat-card .stat-label {
    color: var(--bt-muted);
    font-size: 0.78rem;
    font-weight: 550;
    margin-bottom: 0.3rem;
}

.stat-card .stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--bt-text);
}

.stat-card .stat-meta {
    color: var(--bt-muted);
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tone-blue { background: var(--bt-blue-soft); color: var(--bt-blue); }
.tone-amber { background: var(--bt-amber-soft); color: #B7791F; }
.tone-green { background: var(--bt-success-soft); color: var(--bt-success); }
.tone-red { background: var(--bt-danger-soft); color: var(--bt-danger); }
.tone-navy { background: #E6EBF2; color: var(--bt-navy); }
.tone-slate { background: var(--bt-slate-soft); color: var(--bt-muted); }

.finance-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-strip .finance-item {
    padding: 1rem 1.15rem;
    border-right: 1px solid var(--bt-border);
}

.finance-strip .finance-item:last-child {
    border-right: 0;
}

.finance-item .finance-label {
    color: var(--bt-muted);
    font-size: 0.76rem;
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.finance-item .finance-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.finance-item .finance-note {
    color: var(--bt-muted);
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.progress {
    background-color: var(--bt-slate-soft);
    border-radius: 999px;
    height: 0.5rem;
}

.progress.progress-thin {
    height: 0.35rem;
}

.progress-bar {
    border-radius: 999px;
}

.bg-amber {
    background-color: var(--bt-amber) !important;
}

.border-amber {
    border-color: var(--bt-amber) !important;
}

.accent-top {
    border-top: 3px solid var(--bt-amber);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.5rem;
    margin: 0;
}

.detail-list.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-list dt {
    color: var(--bt-muted);
    font-size: 0.74rem;
    font-weight: 550;
    margin-bottom: 0.15rem;
}

.detail-list dd {
    margin: 0;
    font-weight: 550;
    word-break: break-word;
}

.detail-list .span-all {
    grid-column: 1 / -1;
}

.meta-line {
    color: var(--bt-muted);
    font-size: 0.75rem;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.65em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-soft-blue { background: var(--bt-blue-soft); color: var(--bt-blue); }
.badge-soft-green { background: var(--bt-success-soft); color: var(--bt-success); }
.badge-soft-amber { background: var(--bt-warning-soft); color: var(--bt-warning); }
.badge-soft-red { background: var(--bt-danger-soft); color: var(--bt-danger); }
.badge-soft-slate { background: var(--bt-slate-soft); color: var(--bt-muted); }
.badge-soft-navy { background: #E6EBF2; color: var(--bt-navy); }

/* 6. TABLES & LISTS ----------------------------------------------------- */
.table {
    --bs-table-color: var(--bt-text);
    --bs-table-hover-bg: #F7F9FC;
    --bs-table-border-color: var(--bt-border);
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table > thead > tr > th {
    background-color: #F8FAFC;
    color: var(--bt-muted);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--bt-border);
    padding: 0.7rem 0.9rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 0.7rem 0.9rem;
    vertical-align: middle;
}

.table > tfoot > tr > td,
.table > tfoot > tr > th {
    padding: 0.75rem 0.9rem;
    background-color: #F8FAFC;
    font-weight: 700;
    border-top: 2px solid var(--bt-border-strong);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table .cell-primary {
    font-weight: 600;
    color: var(--bt-text);
}

.table .cell-sub {
    color: var(--bt-muted);
    font-size: 0.75rem;
}

.table a.cell-primary:hover {
    color: var(--bt-blue);
}

.th-sort {
    color: inherit !important;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.th-sort:hover {
    color: var(--bt-text) !important;
    text-decoration: none;
}

.th-sort .bi {
    font-size: 0.7rem;
    opacity: 0.5;
}

.th-sort.sorted .bi {
    opacity: 1;
    color: var(--bt-blue);
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bt-radius-sm);
    color: var(--bt-muted);
    background: transparent;
    border: 1px solid transparent;
}

.btn-icon:hover {
    background-color: var(--bt-slate-soft);
    color: var(--bt-text);
}

.btn-icon.danger:hover {
    background-color: var(--bt-danger-soft);
    color: var(--bt-danger);
}

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--bt-border);
}

.list-toolbar .search-box {
    position: relative;
    flex: 1 1 240px;
    max-width: 340px;
}

.list-toolbar .search-box .bi {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bt-muted);
}

.list-toolbar .search-box .form-control {
    padding-left: 2.1rem;
}

.list-toolbar .form-select,
.list-toolbar .form-control {
    width: auto;
    min-width: 140px;
}

.list-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--bt-border);
    color: var(--bt-muted);
    font-size: 0.8rem;
}

.pagination {
    --bs-pagination-font-size: 0.8rem;
    --bs-pagination-color: var(--bt-text);
    --bs-pagination-border-color: var(--bt-border);
    --bs-pagination-active-bg: var(--bt-blue);
    --bs-pagination-active-border-color: var(--bt-blue);
    --bs-pagination-hover-bg: var(--bt-slate-soft);
    --bs-pagination-padding-x: 0.65rem;
    --bs-pagination-padding-y: 0.3rem;
    margin: 0;
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: 6px !important;
    min-width: 32px;
    text-align: center;
}

.mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--bt-border);
}

.mini-list li:last-child {
    border-bottom: 0;
}

/* 7. FORMS & BUTTONS ---------------------------------------------------- */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: var(--bt-text);
}

.form-label .req {
    color: var(--bt-danger);
    margin-left: 2px;
}

.form-control,
.form-select {
    font-size: 0.875rem;
    border-color: var(--bt-border-strong);
    border-radius: var(--bt-radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--bt-text);
}

.form-select {
    padding-right: 2.25rem;
}

.form-control-sm,
.form-select-sm {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bt-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-text {
    color: var(--bt-muted);
    font-size: 0.74rem;
}

.input-group-text {
    background-color: #F8FAFC;
    border-color: var(--bt-border-strong);
    color: var(--bt-muted);
    font-size: 0.85rem;
}

.field-validation-error,
.text-danger.field-error {
    color: var(--bt-danger);
    font-size: 0.76rem;
    margin-top: 0.25rem;
    display: block;
}

.input-validation-error {
    border-color: var(--bt-danger) !important;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.1rem;
}

.form-section {
    padding-bottom: 1.1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px dashed var(--bt-border);
}

.form-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bt-navy);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-section-title .bi {
    color: var(--bt-amber);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--bt-radius-sm);
    padding: 0.48rem 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.32rem 0.7rem;
}

.btn-primary {
    --bs-btn-bg: var(--bt-blue);
    --bs-btn-border-color: var(--bt-blue);
    --bs-btn-hover-bg: var(--bt-blue-hover);
    --bs-btn-hover-border-color: var(--bt-blue-hover);
    --bs-btn-active-bg: var(--bt-blue-hover);
    --bs-btn-active-border-color: var(--bt-blue-hover);
    --bs-btn-disabled-bg: var(--bt-blue);
    --bs-btn-disabled-border-color: var(--bt-blue);
}

.btn-outline-secondary,
.btn-light {
    --bs-btn-color: var(--bt-text);
    --bs-btn-bg: #FFFFFF;
    --bs-btn-border-color: var(--bt-border-strong);
    --bs-btn-hover-color: var(--bt-text);
    --bs-btn-hover-bg: var(--bt-slate-soft);
    --bs-btn-hover-border-color: var(--bt-border-strong);
    --bs-btn-active-color: var(--bt-text);
    --bs-btn-active-bg: var(--bt-slate-soft);
    --bs-btn-active-border-color: var(--bt-border-strong);
}

.btn-amber {
    --bs-btn-color: var(--bt-navy);
    --bs-btn-bg: var(--bt-amber);
    --bs-btn-border-color: var(--bt-amber);
    --bs-btn-hover-color: var(--bt-navy);
    --bs-btn-hover-bg: #E39612;
    --bs-btn-hover-border-color: #E39612;
    --bs-btn-active-bg: #E39612;
    --bs-btn-active-border-color: #E39612;
}

.btn-danger {
    --bs-btn-bg: var(--bt-danger);
    --bs-btn-border-color: var(--bt-danger);
}

.btn-outline-danger {
    --bs-btn-color: var(--bt-danger);
    --bs-btn-border-color: #F3B4B4;
    --bs-btn-hover-bg: var(--bt-danger);
    --bs-btn-hover-border-color: var(--bt-danger);
}

.btn .spinner-border {
    width: 0.9rem;
    height: 0.9rem;
    border-width: 0.15em;
}

.logo-preview {
    width: 96px;
    height: 96px;
    border-radius: var(--bt-radius);
    border: 1px dashed var(--bt-border-strong);
    background: #FAFBFD;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 96px;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 8. FEEDBACK ----------------------------------------------------------- */
.toast-stack {
    position: fixed;
    top: 72px;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(360px, calc(100vw - 2rem));
}

.app-toast {
    background: #FFFFFF;
    border: 1px solid var(--bt-border);
    border-left: 4px solid var(--bt-blue);
    border-radius: var(--bt-radius-sm);
    box-shadow: var(--bt-shadow-md);
    font-size: 0.85rem;
}

.app-toast.toast-success {
    border-left-color: var(--bt-success);
}

.app-toast.toast-error {
    border-left-color: var(--bt-danger);
}

.app-toast .toast-body {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
}

.app-toast .toast-icon {
    font-size: 1.1rem;
    line-height: 1.2;
}

.app-toast.toast-success .toast-icon {
    color: var(--bt-success);
}

.app-toast.toast-error .toast-icon {
    color: var(--bt-danger);
}

.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--bt-amber);
    z-index: 2000;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.3s ease;
}

.page-progress.active {
    opacity: 1;
    width: 75%;
}

.page-progress.done {
    width: 100%;
    opacity: 0;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bt-slate-soft);
    color: var(--bt-muted);
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.empty-state p {
    color: var(--bt-muted);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.alert {
    border-radius: var(--bt-radius-sm);
    font-size: 0.85rem;
    border-width: 1px;
}

.alert-danger {
    background-color: var(--bt-danger-soft);
    border-color: #F6C9C9;
    color: #9B1C1C;
}

.alert-warning {
    background-color: var(--bt-warning-soft);
    border-color: #F6DDB3;
    color: #8A4B05;
}

.alert-info {
    background-color: var(--bt-blue-soft);
    border-color: #C9DAFB;
    color: #1E40AF;
}

.alert-success {
    background-color: var(--bt-success-soft);
    border-color: #BFE5CD;
    color: #166534;
}

.modal-content {
    border: 0;
    border-radius: var(--bt-radius);
    box-shadow: 0 20px 50px rgba(23, 38, 60, 0.25);
}

.modal-header,
.modal-footer {
    border-color: var(--bt-border);
}

.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bt-danger-soft);
    color: var(--bt-danger);
    flex: 0 0 44px;
}

/* 9. PAGE-SPECIFIC ------------------------------------------------------ */

/* Login / auth */
.auth-body {
    min-height: 100vh;
    background: var(--bt-bg);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-visual {
    position: relative;
    background-color: var(--bt-navy);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    color: #FFFFFF;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-visual::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    border: 44px solid rgba(245, 166, 35, 0.12);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-brand .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 1.4rem;
    border-radius: 10px;
}

.auth-brand .brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.auth-brand .brand-tagline {
    color: #9FB0C6;
    font-size: 0.78rem;
}

.auth-pitch {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-pitch h1 {
    color: #FFFFFF;
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.2;
    margin-bottom: 0.9rem;
}

.auth-pitch h1 span {
    color: var(--bt-amber);
}

.auth-pitch p {
    color: #B8C4D4;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.auth-features li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: #D7DFEA;
    font-size: 0.88rem;
}

.auth-features .bi {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    background: rgba(245, 166, 35, 0.14);
    color: var(--bt-amber);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-visual-footer {
    color: #7C8FA8;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    background: #FFFFFF;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card.wide {
    max-width: 560px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 750;
    margin-bottom: 0.3rem;
}

.auth-card .auth-sub {
    color: var(--bt-muted);
    margin-bottom: 1.6rem;
}

.auth-card .form-control {
    padding: 0.6rem 0.8rem;
}

.auth-card .btn-lg {
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
}

.auth-footer {
    margin-top: 2rem;
    color: var(--bt-muted);
    font-size: 0.75rem;
    text-align: center;
}

.auth-mobile-brand {
    display: none;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 2.6rem;
}

.password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--bt-muted);
    width: 32px;
    height: 32px;
}

/* Dashboard */
.welcome-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.status-rows {
    display: grid;
    gap: 0.8rem;
}

.status-row .status-row-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.status-row .status-row-top span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 550;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    color: var(--bt-text);
    font-weight: 600;
    font-size: 0.82rem;
    background: #FFFFFF;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.quick-action:hover {
    text-decoration: none;
    border-color: var(--bt-blue);
    background-color: #FAFCFF;
    color: var(--bt-text);
}

.quick-action .stat-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 1rem;
    border-radius: 8px;
}

.chart-box {
    position: relative;
    height: 240px;
}

/* Details pages */
.entity-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.entity-hero .entity-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.entity-hero h2 {
    font-size: 1.2rem;
    margin: 0;
}

.utilization-ring {
    --value: 0;
    --tone: var(--bt-blue);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--tone) calc(var(--value) * 1%), var(--bt-slate-soft) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.utilization-ring .ring-inner {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.utilization-ring .ring-value {
    font-size: 1.25rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.utilization-ring .ring-label {
    font-size: 0.66rem;
    color: var(--bt-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-tile {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1.1rem;
    height: 100%;
    color: var(--bt-text);
}

.settings-tile:hover {
    text-decoration: none;
    color: var(--bt-text);
}

.card-link-hover {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link-hover:hover {
    border-color: var(--bt-blue);
    box-shadow: var(--bt-shadow-md);
}

/* Reports */
.report-sheet {
    background: #FFFFFF;
}

.report-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bt-navy);
    margin-bottom: 1rem;
}

.report-company {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.report-company img,
.report-company .company-initials {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
}

.report-company .company-initials {
    background: var(--bt-navy);
    color: var(--bt-amber);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
}

.report-company .rc-name {
    font-size: 1.1rem;
    font-weight: 750;
}

.report-company .rc-meta {
    color: var(--bt-muted);
    font-size: 0.75rem;
}

.report-title-block {
    text-align: right;
}

.report-title-block .report-title {
    font-size: 1.1rem;
    font-weight: 750;
    color: var(--bt-navy);
    margin: 0;
}

.report-title-block .report-date {
    color: var(--bt-muted);
    font-size: 0.75rem;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    font-size: 0.78rem;
    color: var(--bt-muted);
    margin-bottom: 1rem;
}

.report-filters strong {
    color: var(--bt-text);
    font-weight: 600;
}

.report-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.72rem;
    color: var(--bt-muted);
    border-top: 1px solid var(--bt-border);
    padding-top: 0.75rem;
    margin-top: 1.25rem;
}

.report-group-row td {
    background: #F3F6FA !important;
    font-weight: 700;
    color: var(--bt-navy);
}

.report-subtotal-row td {
    background: #FAFBFD !important;
    font-weight: 650;
}

.print-only {
    display: none !important;
}

/* 10. RESPONSIVE & PRINT ------------------------------------------------ */
@media (max-width: 1199.98px) {
    .finance-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-strip .finance-item:nth-child(2) {
        border-right: 0;
    }

    .finance-strip .finance-item:nth-child(-n+2) {
        border-bottom: 1px solid var(--bt-border);
    }
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .auth-mobile-brand {
        display: flex;
        margin-bottom: 1.75rem;
    }

    .auth-mobile-brand .brand-name {
        color: var(--bt-navy);
    }

    .auth-mobile-brand .brand-tagline {
        color: var(--bt-muted);
    }

    .detail-list.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-content-header {
        padding-top: 0.9rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .page-actions {
        width: 100%;
    }

    .list-toolbar .search-box {
        max-width: none;
        flex-basis: 100%;
    }

    .list-toolbar .form-select,
    .list-toolbar .form-control {
        flex: 1 1 140px;
    }

    .detail-list,
    .detail-list.cols-3 {
        grid-template-columns: 1fr;
    }

    .finance-strip {
        grid-template-columns: 1fr;
    }

    .finance-strip .finance-item {
        border-right: 0;
        border-bottom: 1px solid var(--bt-border);
    }

    .finance-strip .finance-item:last-child {
        border-bottom: 0;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .report-head {
        flex-direction: column;
    }

    .report-title-block {
        text-align: left;
    }

    .header-company {
        display: none;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    body {
        background: #FFFFFF !important;
        font-size: 10.5pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-sidebar,
    .app-header,
    .app-footer,
    .app-content-header,
    .no-print,
    .toast-stack,
    .page-progress,
    .btn,
    .pagination,
    .list-toolbar,
    .report-filter-card,
    .sidebar-overlay {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .app-wrapper,
    .app-main,
    .app-content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #FFFFFF !important;
        min-height: 0 !important;
        grid-template-areas: none !important;
    }

    .container-fluid {
        padding: 0 !important;
        max-width: none !important;
    }

    .card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .card-body {
        padding: 0 !important;
    }

    .table {
        font-size: 9.5pt;
    }

    .table > thead > tr > th {
        background: #EEF2F6 !important;
        color: #17263C !important;
    }

    .table > thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    .table-responsive {
        overflow: visible !important;
    }
}

/* ---------- Expense form: project position panel ---------- */
.project-summary {
    position: sticky;
    top: 1rem;
}

.summary-figures {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .45rem 1rem;
    margin-bottom: .9rem;
    font-size: .875rem;
}

.summary-figures dt {
    font-weight: 400;
    color: var(--bt-muted);
}

.summary-figures dd {
    margin: 0;
    text-align: right;
}

.text-pre-line {
    white-space: pre-line;
}

.w-40 {
    width: 40%;
}

/* Bootstrap's .card is a column flexbox; stat cards lay out label and icon side by side. */
.card.stat-card {
    flex-direction: row;
}

/* Lets a flex child shrink so long text truncates instead of pushing siblings out. */
.min-w-0 {
    min-width: 0;
}

/* Category matrices (project-wise and date-wise reports): many numeric columns. */
.report-matrix {
    font-size: 0.75rem;
}

.table.report-matrix > thead > tr > th,
.table.report-matrix > tbody > tr > td,
.table.report-matrix > tfoot > tr > td {
    padding: 0.4rem 0.45rem;
}

.table.report-matrix > thead > tr > th {
    font-size: 0.68rem;
    letter-spacing: 0;
}

.report-matrix .col-project {
    min-width: 190px;
}

/* Date range pair in list toolbars: both inputs shrink together on narrow screens. */
.date-range {
    min-width: 0;
}

.date-range input {
    flex: 1 1 0;
    min-width: 0;
}

@media print {
    /* Ten numeric columns must fit an A4 landscape page. */
    .table.report-matrix {
        font-size: 8pt;
    }

    .report-matrix .col-project {
        min-width: 150px;
    }

    /* A scroll box would cut off the columns that scroll on screen. */
    .table-responsive {
        overflow: visible;
    }
}

/* ---------- Release 2: side forms on master-data pages ---------- */
@media (min-width: 992px) {
    .form-sticky {
        position: sticky;
        top: 1rem;
    }
}

.btn-icon:disabled,
.btn-icon[disabled] {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- Release 2: purchase entry ---------- */
/* Keeps absolutely positioned content (e.g. visually-hidden labels) inside the scroll box on narrow screens. */
.table-responsive {
    position: relative;
}

.purchase-grid {
    min-width: 760px;
}

.purchase-grid > thead > tr > th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bt-muted);
    border-bottom-width: 1px;
}

.purchase-grid > tbody > tr > td {
    border-bottom: 1px solid #EEF2F7;
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.purchase-grid .col-material { width: 38%; }
.purchase-grid .col-qty { width: 17%; }
.purchase-grid .col-price { width: 14%; }
.purchase-grid .col-discount { width: 12%; }
.purchase-grid .col-total { width: 15%; }
.purchase-grid .col-remove { width: 4%; }

.purchase-grid .unit-addon {
    min-width: 3.25rem;
    justify-content: center;
    font-size: 0.72rem;
    color: #64748B;
}

.purchase-totals {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: .75rem;
    padding: 1rem 1.25rem;
}

.purchase-totals .pt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
}

.purchase-totals .pt-input {
    max-width: 10rem;
}

.purchase-totals .pt-net {
    border-top: 2px solid #17263C;
    margin-top: .5rem;
    padding-top: .65rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #17263C;
}

.purchase-totals .pt-note {
    font-size: 0.72rem;
    color: #64748B;
    margin-top: .25rem;
}

.purchase-lines > tfoot > tr > td {
    border-bottom: 0;
    padding-top: .35rem;
    padding-bottom: .35rem;
    color: #475569;
}

.purchase-lines > tfoot > tr.total-row > td {
    border-top: 2px solid #17263C;
    font-weight: 700;
    font-size: 1rem;
    color: #17263C;
}

.table > tbody > tr.row-muted > td {
    color: #94A3B8;
}

.table > tbody > tr.row-muted .cell-primary {
    text-decoration: line-through;
}

/* ---------- Release 2: purchase print document ---------- */
.purchase-print-meta,
.document-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1rem 0 1.25rem;
    font-size: 0.82rem;
    line-height: 1.55;
}

.purchase-print-meta .ppm-label,
.document-meta .ppm-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748B;
    font-weight: 600;
}

.purchase-print-meta .ppm-strong,
.document-meta .ppm-strong {
    font-weight: 700;
    font-size: 0.95rem;
    color: #17263C;
}

.signature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    font-size: 0.75rem;
    color: #64748B;
}

.signature-row > div {
    border-top: 1px solid #94A3B8;
    padding-top: .35rem;
    display: flex;
    flex-direction: column;
}

.signature-row .sig-name {
    color: #17263C;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .purchase-print-meta,
    .document-meta,
    .signature-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@page purchase-document {
    size: A4 portrait;
    margin: 14mm;
}

@media print {
    .purchase-document {
        page: purchase-document;
    }

    .purchase-print-meta,
    .document-meta {
        font-size: 9pt;
    }
}

/* ---------- Release 2: inventory ---------- */
.movement-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .6rem;
}

.movement-type {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .7rem .8rem;
    border: 1px solid var(--bt-border);
    border-radius: .6rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.movement-type .bi {
    font-size: 1.1rem;
    color: #64748B;
}

.movement-type .mt-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--bt-navy);
}

.movement-type .mt-help {
    font-size: .72rem;
    color: var(--bt-muted);
    line-height: 1.3;
}

.movement-type:hover {
    border-color: #93B4F5;
}

.btn-check:focus-visible + .movement-type {
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .25);
}

.btn-check:checked + .movement-type {
    border-color: #2563EB;
    background: #EFF5FF;
    box-shadow: inset 0 0 0 1px #2563EB;
}

.btn-check:checked + .movement-type.is-in .bi {
    color: #16A34A;
}

.btn-check:checked + .movement-type.is-out .bi {
    color: #DC2626;
}

.stock-preview .sp-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    font-size: .88rem;
}

.stock-preview .sp-total {
    margin-top: .35rem;
    padding-top: .6rem;
    border-top: 2px solid var(--bt-navy);
    font-weight: 700;
    font-size: 1rem;
}

.stock-ledger .ledger-note {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 22rem;
    white-space: normal;
}

/* ---------- Release 2: labor ---------- */
.att-status {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    background: #fff;
    white-space: nowrap;
}

.att-option {
    padding: .25rem .55rem;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--bt-muted);
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease;
}

.att-option:hover {
    background: var(--bt-slate-soft);
}

.btn-check:focus-visible + .att-option {
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .25);
}

.btn-check:disabled + .att-option {
    cursor: not-allowed;
    opacity: .6;
}

.btn-check:checked + .att-present {
    background: var(--bt-success);
    color: #fff;
}

.btn-check:checked + .att-halfday {
    background: var(--bt-warning);
    color: #fff;
}

.btn-check:checked + .att-absent {
    background: var(--bt-danger);
    color: #fff;
}

.btn-check:checked + .att-leave {
    background: var(--bt-blue);
    color: #fff;
}

.btn-check:checked + .att-none {
    background: var(--bt-slate-soft);
    color: var(--bt-navy);
}

.attendance-table tbody tr.att-invalid > td {
    background: var(--bt-danger-soft);
}

.attendance-table input[type="number"] {
    min-width: 5rem;
}

.attendance-table tfoot td {
    border-top: 2px solid var(--bt-navy);
    border-bottom: 0;
}

.list-group-item.att-current {
    background: var(--bt-blue-soft);
    box-shadow: inset 3px 0 0 var(--bt-blue);
}

.attendance-table td:first-child,
.attendance-table th:first-child {
    min-width: 13rem;
}

/* ---------- Release 2: project income receipt ---------- */
.receipt-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.1rem;
    border: 2px solid var(--bt-navy);
    border-radius: var(--bt-radius-sm);
    background: var(--bt-amber-soft);
}

.receipt-amount .ra-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    color: var(--bt-navy);
}

.receipt-amount .ra-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bt-navy);
}

.receipt-words {
    margin: .75rem 0 1rem;
    font-size: .85rem;
}

.receipt-table {
    font-size: .82rem;
}

.receipt-table th {
    width: 9rem;
    color: var(--bt-muted);
    font-weight: 600;
}

.receipt-position th {
    width: auto;
}

@page receipt-document {
    size: A4 portrait;
    margin: 14mm;
}

@media print {
    .receipt-document {
        page: receipt-document;
    }

    .receipt-amount {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* 2-8 Notes under a business report */
.report-notes {
    font-size: 0.78rem;
    color: var(--bt-muted);
    padding-left: 1.1rem;
    margin: 0.5rem 0 0;
}

.report-notes li + li {
    margin-top: 0.2rem;
}

.report-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bt-navy);
    margin: 1.25rem 0 0.5rem;
}

/* 2-8 Wide money tables (profit & loss) stay readable at laptop width */
.table.report-wide {
    font-size: 0.78rem;
}

.table.report-wide > :not(caption) > * > * {
    padding: 0.4rem 0.45rem;
}

.table.report-wide .col-project {
    min-width: 11rem;
}

/* ---------- 3-3 BOQ grid, lines and print ---------- */
.boq-grid {
    min-width: 980px;
}

.boq-grid .col-no { width: 3%; }
.boq-grid .col-item { width: 24%; }
.boq-grid .col-desc { width: 30%; }
.boq-grid .col-qty { width: 15%; }
.boq-grid .col-price { width: 11%; }
.boq-grid .col-total { width: 13%; }
.boq-grid .col-remove { width: 4%; }

.boq-grid .boq-remarks {
    font-size: 0.75rem;
    color: #475569;
}

.boq-lines .boq-code {
    font-size: 0.72rem;
    color: #64748B;
}

.boq-lines .boq-remark {
    font-size: 0.75rem;
    color: #64748B;
}

[data-boq-parent-row][hidden] {
    display: none !important;
}

/* --- 3-4 Cost estimates ------------------------------------------------- */
.estimate-grid {
    min-width: 1080px;
}

.estimate-grid .col-no { width: 3%; }
.estimate-grid .col-work { width: 21%; }
.estimate-grid .col-unit { width: 8%; }
.estimate-grid .col-qty { width: 9%; }
.estimate-grid .col-rate { width: 10.5%; }
.estimate-grid .col-total { width: 12%; }
.estimate-grid .col-remove { width: 3.5%; }

.estimate-grid .est-boq-ref {
    padding-top: .3rem;
    line-height: 1.2;
}

.estimate-grid select[disabled] {
    background-color: #F1F5F9;
}

.est-adjustments .est-adjustment-row {
    display: grid;
    grid-template-columns: 1fr 6.5rem 9rem;
    gap: .5rem;
    align-items: center;
    margin-bottom: .5rem;
}

.estimate-lines .boq-code {
    font-size: 0.72rem;
    color: #64748B;
}

.estimate-summary td {
    padding: .3rem .25rem;
    border-color: #E2E8F0;
}

.estimate-summary .total-row td {
    font-weight: 700;
    color: #17263C;
    border-top: 2px solid #17263C;
}

@media print {
    .estimate-lines {
        font-size: 0.72rem;
    }
}

.estimate-grid [data-field='UnitId'] {
    padding-left: .4rem;
    padding-right: 1.6rem;
    background-position: right .35rem center;
}

.estimate-grid input.form-control-sm[type='number'] {
    padding-left: .4rem;
    padding-right: .4rem;
}

/* --- 3-5 Quotations ----------------------------------------------------- */
.quotation-grid {
    min-width: 900px;
}

.quotation-grid .col-no { width: 3%; }
.quotation-grid .col-work { width: 44%; }
.quotation-grid .col-unit { width: 9%; }
.quotation-grid .col-qty { width: 12%; }
.quotation-grid .col-price { width: 13%; }
.quotation-grid .col-total { width: 15%; }
.quotation-grid .col-remove { width: 4%; }

.quotation-grid .est-boq-ref {
    padding-top: .3rem;
    line-height: 1.2;
}

.quotation-grid .boq-remarks {
    font-size: 0.75rem;
    color: #475569;
}

.quotation-grid select[disabled] {
    background-color: #F1F5F9;
}

.quotation-grid [data-field='UnitId'] {
    padding-left: .4rem;
    padding-right: 1.6rem;
    background-position: right .35rem center;
}

.quotation-lines .boq-code,
.quotation-lines .boq-remark {
    font-size: 0.72rem;
    color: #64748B;
}

.quotation-terms {
    font-size: 0.78rem;
    white-space: pre-line;
}

/* ---------- 3-6 Contracts ---------- */
.sub-panel {
    margin: 0;
    padding: .75rem .5rem .85rem;
    border: 1px dashed #CBD5E1;
    border-radius: .5rem;
    background: #F8FAFC;
}

.contract-terms-table th {
    width: 28%;
    font-weight: 600;
    color: #17263C;
    background: #F8FAFC;
}

.contract-terms-table td,
.contract-terms-table th {
    font-size: 0.82rem;
    vertical-align: top;
}

.contract-document .quotation-terms {
    font-size: 0.82rem;
}

/* ---------- 3-8 Cost control ---------- */
.cc-util {
    min-width: 6.5rem;
}

/* ---------- 3-9 Report hub sections ---------- */
.report-hub-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bt-muted);
    margin: 0 0 0.75rem;
}

/* ---------- 4-7 Payroll: salary slips print one per page ---------- */
.salary-slip + .salary-slip {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--bt-border, #CBD5E1);
}

@media print {
    .salary-slip + .salary-slip {
        break-before: page;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }
}
