@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap');

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-teal: #0f766e;
    --primary-amber: #f59e0b;
    --sidebar-top: #0f172a;
    --sidebar-bottom: #1e293b;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --bg: #f3f6fb;
    --border: #dbe4ef;
    --text-main: #102338;
    --text-soft: #5f7187;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.45;
}

body.app-shell {
    margin: 0;
    background: radial-gradient(circle at top right, #f8fbff 0%, var(--bg) 46%, #eef3fa 100%);
}

body.page-opportunities .top-navbar {
    position: relative;
    z-index: 2000;
}

body.page-opportunities .dashboard-content {
    position: relative;
    z-index: auto;
}

body.page-opportunities .sales-page-header,
body.page-opportunities .sales-panel#opportunity-editor {
    position: relative;
    z-index: 1;
}

body.page-opportunities #createOpportunityModal.show,
body.page-opportunities #createQuotationModal.show,
body.page-opportunities .sales-board-loader:not(.d-none),
body.page-opportunities .sidebar-overlay.show {
    z-index: 3000;
}

body.page-engineer_opportunity_actions .dashboard-content {
    max-width: 1380px;
}

body.page-engineer_opportunity_actions .sales-page-header {
    padding: 18px 22px;
    border: 1px solid rgba(210, 221, 233, 0.9);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(248, 251, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 52%, rgba(242, 247, 252, 0.96) 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

body.page-engineer_opportunity_actions .sales-page-header h1 {
    font-size: 1.28rem;
    letter-spacing: -0.02em;
}

body.page-engineer_opportunity_actions .sales-page-header p {
    max-width: 760px;
    color: #5f7187;
    font-size: 0.88rem;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    z-index: 990;
    pointer-events: none;
}

.sidebar-overlay.show {
    display: block;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.16);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.2rem 1.1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark.brand-mark-text {
    flex-direction: column;
    gap: 0;
    line-height: 1;
}

.brand-mark.brand-mark-text span {
    font-size: 0.92rem;
    font-weight: 800;
}

.brand-mark.brand-mark-text small {
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    opacity: 0.9;
    text-transform: uppercase;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.86);
    line-height: 1.2;
}

.sidebar-brand small,
.sidebar-user-role {
    color: rgba(226, 232, 240, 0.7);
}

.sidebar-menu {
    padding: 0.95rem 0.55rem;
    gap: 0.25rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 42px;
    color: rgba(237, 245, 255, 0.86);
    border-radius: 11px;
    padding: 0.7rem 0.85rem;
    transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.menu-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    background: #ef4444;
    color: #fff;
}

.sidebar-footer {
    padding: 1rem 1.1rem 1.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.sidebar-user,
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-name,
.topbar-user-name {
    font-weight: 700;
}

.sidebar-user-copy,
.topbar-user-copy {
    min-width: 0;
}

.user-avatar-shell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.user-avatar-image {
    object-fit: cover;
    display: block;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 980;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(6px);
}


.top-navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.5rem;
}

.topbar-copy {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.page-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f2238;
}

.topbar-subtitle {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-date {
    text-align: right;
}

.topbar-date-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    font-weight: 700;
}

.topbar-date-value,
.topbar-user-role {
    font-size: 0.83rem;
    color: var(--text-soft);
}

.dashboard-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
}

.card-soft,
.table-card,
.form-card,
.metric-card {
    background: var(--surface);
    border: 1px solid #d7e0ea;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.table-card,
.form-card {
    padding: 1rem 1.1rem;
}

.metric-card {
    padding: 1.2rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #0f766e);
}

.metric-label {
    color: var(--text-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.metric-value {
    font-size: 2rem;
    line-height: 1.05;
    font-weight: 800;
    color: #0f172a;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.metric-blue { color: #2563eb; background: #e9f0ff; }
.metric-amber { color: #c28600; background: #fff5d9; }
.metric-orange { color: #ea580c; background: #ffebdf; }
.metric-green { color: #0a9a46; background: #dff5e6; }

.section-title {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #35506d;
    font-weight: 700;
}

.page-hero {
    border: 1px solid #d7e3ef;
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 26%),
        linear-gradient(135deg, #0f172a 0%, #16385b 55%, #0f766e 100%);
    color: #f8fbff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.page-hero-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 800;
    color: rgba(248, 251, 255, 0.72);
    margin-bottom: 0.35rem;
}

.page-hero-title {
    margin: 0 0 0.4rem;
    font-size: 1.55rem;
    line-height: 1.1;
    font-weight: 800;
}

.page-hero-copy {
    margin: 0;
    max-width: 62ch;
    color: rgba(248, 251, 255, 0.82);
    font-size: 0.94rem;
}

.page-hero-badges {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.modern-data-card {
    padding-top: 0.9rem;
}

.modern-filter-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,255,0.98) 100%);
}

.modern-filter-card form {
    align-items: end;
}

.modern-filter-card .form-label {
    margin-bottom: 0.45rem;
}

.modern-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.modern-card-subtitle {
    color: #6a7c92;
    font-size: 0.86rem;
}

.modern-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #cfe0f5;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.engineering-project-table-card {
    padding-top: 1rem;
}

.engineering-project-table-card .modern-card-head {
    margin-bottom: 1.15rem;
    padding: 0 1.15rem;
}

.engineering-project-table-card .modern-card-subtitle {
    margin-top: 0.18rem;
}

.engineering-project-table-wrap {
    border-top: 1px solid #e4edf6;
}

.engineering-project-table-card .modern-data-table thead th,
.engineering-project-table-card .modern-data-table tbody td {
    white-space: nowrap;
}

.engineering-project-table-card .modern-data-table thead th {
    padding-left: 1rem;
    padding-right: 1rem;
}

.engineering-project-table-card .modern-data-table tbody td {
    padding: 0.9rem 1rem;
}

.modern-data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.modern-data-table thead th {
    background: linear-gradient(180deg, #f9fbfe 0%, #f1f6fc 100%);
    color: #3b536d;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    border-bottom: 1px solid #dce7f3;
}

.modern-data-table thead th:first-child {
    border-top-left-radius: 14px;
}

.modern-data-table thead th:last-child {
    border-top-right-radius: 14px;
}

.modern-data-table tbody td {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #ebf1f7;
}

.modern-data-table tbody tr:hover td {
    background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
}

.modern-data-table tbody td {
    vertical-align: middle;
}

.modern-data-table .btn {
    border-radius: 10px;
}

.project-action-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.16rem;
    min-width: 0;
}

.project-action-cluster {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.14rem;
    padding: 0.06rem;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #e4ecf5;
    flex: 0 0 auto;
}

.project-action-cluster-primary {
    background: #eef4ff;
    border-color: #d7e5ff;
}

.project-action-cluster-secondary {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.project-bom-main-btn {
    min-width: 72px;
    justify-content: center;
}

.project-bom-toggle {
    width: auto;
}

.project-bom-toggle > .btn {
    white-space: nowrap;
    padding: 0.28rem 0.5rem;
    font-size: 0.71rem;
    font-weight: 800;
    border-radius: 9px;
}

.project-action-btn {
    min-height: 28px;
    padding: 0.22rem 0.5rem;
    border-radius: 8px;
    font-size: 0.69rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    line-height: 1.1;
    border: 1px solid transparent;
    transition: transform 0.13s ease, box-shadow 0.13s ease, background-color 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

/* Ghost secondary button — unified neutral style */
.project-action-ghost {
    background: transparent;
    border-color: transparent;
    color: #475569;
}

.project-action-ghost:hover,
.project-action-ghost:focus {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.1);
    transform: translateY(-1px);
}

/* Accent ghost — Final BOM gets a subtle teal tint */
.project-action-ghost-accent {
    color: #0369a1;
}

.project-action-ghost-accent:hover,
.project-action-ghost-accent:focus {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0c4a6e;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.12);
}

/* Danger ghost — Delete icon only */
.project-action-ghost-danger {
    color: #94a3b8;
}

.project-action-ghost-danger:hover,
.project-action-ghost-danger:focus {
    background: #fff1f2;
    border-color: #fda4af;
    color: #be123c;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.1);
}

.project-action-cluster .dropdown,
.project-action-cluster .dropdown > .btn {
    width: auto;
}

/* Coordinator action button cluster */
.coord-action-cluster {
    display: inline-flex;
    align-items: stretch;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(14, 79, 168, 0.08);
}
.coord-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 500;
    color: #1d4ed8;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 150ms ease, color 150ms ease;
    line-height: 1.3;
    min-height: 32px;
}
.coord-action-btn i {
    font-size: 13px;
    flex-shrink: 0;
}
.coord-action-btn:hover,
.coord-action-btn:focus {
    background: #dbeafe;
    color: #1e3a8a;
    text-decoration: none;
    outline: none;
}
.coord-action-btn:active {
    background: #bfdbfe;
}
.coord-action-btn.coord-action-primary {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}
.coord-action-btn.coord-action-primary:hover,
.coord-action-btn.coord-action-primary:focus {
    background: #1d4ed8;
    color: #fff;
}
.coord-action-divider {
    width: 1px;
    background: #bfdbfe;
    flex-shrink: 0;
    align-self: stretch;
}

.project-export-btn-dark {
    border-color: #cbd5e1;
    color: #1e293b;
    background: #f8fafc;
}

.project-export-btn-dark:hover,
.project-export-btn-dark:focus,
.project-export-btn-dark.show {
    color: #0f172a;
    background: #eef2f7;
    border-color: #94a3b8;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.project-bom-main-btn:hover,
.project-bom-main-btn:focus,
.project-bom-main-btn.show {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.project-action-menu {
    border-radius: 14px;
    border: 1px solid #dbe4ef;
    padding: 0.35rem;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    min-width: 200px;
}

.project-action-menu .dropdown-header {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0.4rem 0.7rem 0.2rem;
}

.project-action-menu .dropdown-item {
    border-radius: 10px;
    font-size: 0.78rem;
    padding: 0.42rem 0.62rem;
    display: flex;
    align-items: center;
}

@media (max-width: 900px) {
    .project-action-toolbar {
        min-width: 0;
    }

    .project-action-toolbar,
    .project-action-cluster {
        flex-direction: column;
        align-items: stretch;
    }

    .project-action-cluster .dropdown,
    .project-action-cluster .dropdown > .btn,
    .project-bom-toggle,
    .project-bom-toggle > .btn,
    .project-action-btn {
        width: 100%;
    }
}

.modern-data-table .form-control.form-control-sm {
    min-height: 34px;
    border-radius: 9px;
}

.modern-data-table .status-chip {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.modern-request-form-card {
    background:
        linear-gradient(160deg, rgba(37, 99, 235, 0.08), rgba(15, 118, 110, 0.04)),
        #fff;
}

.equipment-request-card {
    overflow: hidden;
}

.equipment-request-meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.18));
    color: #174ea6;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.equipment-request-table tbody tr {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.equipment-request-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(248, 251, 255, 0.95), rgba(241, 248, 255, 0.9));
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.05);
}

.request-jo-cell {
    min-width: 126px;
}

.request-jo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
}

.request-jo-badge.is-pending {
    background: #fff7ed;
    color: #b45309;
    border-color: #fdba74;
}

.request-jo-badge.is-assigned {
    background: #ecfeff;
    color: #0f766e;
    border-color: #67e8f9;
}

.request-project-name,
.request-item-name,
.request-supplier,
.request-price,
.request-qty {
    font-weight: 700;
    color: #12263f;
}

.request-project-meta,
.request-item-desc,
.request-uom,
.request-note-empty,
.request-action-hint {
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.45;
}

.request-item-name {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.request-inline-meta,
.request-inline-price {
    margin-top: 0.2rem;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.4;
}

.request-inline-price {
    font-weight: 700;
    color: #12263f;
}

.request-item-desc {
    max-width: 160px;
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
}

.request-notes-cell {
    min-width: 140px;
    max-width: 160px;
}

.request-note + .request-note {
    margin-top: 0.35rem;
}

.request-action-cell {
    min-width: 210px;
    max-width: 230px;
}

.request-inline-notes {
    padding: 0.15rem 0.1rem 0;
}

.request-note-empty {
    display: inline-block;
    margin-top: 0.1rem;
}

.request-action-hint {
    display: block;
    max-width: 180px;
    line-height: 1.35;
    margin-top: 0.15rem;
}

.request-assign-form,
.request-review-form {
    padding: 0.7rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(243, 247, 253, 0.92));
    border: 1px solid rgba(196, 213, 233, 0.9);
}

.request-assign-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
}

.request-assign-select {
    border-radius: 10px;
    border-color: #c8d7ea;
    min-height: 38px;
    background-color: #fff;
    font-size: 0.86rem;
}

.request-assign-btn {
    min-height: 36px;
    width: 100%;
    padding-inline: 0.8rem;
    border-radius: 10px;
}

.equipment-request-table td {
    vertical-align: middle;
}

.equipment-request-table td:nth-child(2) {
    min-width: 108px;
}

.equipment-request-table td:nth-child(4) {
    min-width: 88px;
}

.equipment-request-table td:nth-child(5),
.equipment-request-table td:nth-child(6),
.equipment-request-table td:nth-child(7) {
    white-space: nowrap;
}

.request-review-form .form-control,
.request-review-form .form-select {
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.86rem;
}

.request-review-form textarea.form-control {
    min-height: 74px;
}

.request-action-cell .btn {
    white-space: nowrap;
}

/* ── Equipment Request Detail Card ── */
.er-detail-card {
    padding: 0.1rem 0;
}
.er-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #dde3ef;
    flex-shrink: 0;
}
.er-item-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #12263f;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.er-more-badge {
    display: inline-flex;
    align-items: center;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 20px;
}
.er-dest-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15em 0.6em;
    border-radius: 20px;
}
.er-meta-row {
    font-size: 0.82rem;
    color: #4b5d73;
    margin-top: 0.15rem;
}
.er-price { color: #0f766e; font-weight: 600; }
.er-total { color: #1e40af; font-size: 0.82rem; }
.er-desc {
    font-size: 0.8rem;
    color: var(--text-soft);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.er-notes {
    font-size: 0.78rem;
    color: #64748b;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    padding: 0.3rem 0.55rem;
    border-radius: 0 6px 6px 0;
}
.er-note-label {
    font-weight: 700;
    color: #334155;
}
.equipment-request-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}
.equipment-request-table td {
    vertical-align: middle;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.modern-order-table td:nth-child(5) {
    font-weight: 700;
}

.table {
    margin-bottom: 0;
    font-size: 0.93rem;
}

.table thead th {
    background: #f8fafd;
    color: #3c4e63;
    font-size: 0.76rem;
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 700;
    border-bottom: 1px solid #dce4ee;
    padding: 0.62rem 0.7rem;
}

.table tbody td {
    border-bottom: 1px solid #e8edf4;
    padding: 0.56rem 0.7rem;
    vertical-align: middle;
    color: #1f3449;
}

.table tbody tr:hover td {
    background: #f9fbfe;
}

.timeline-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sticky-actions {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
}

.bom-project-meta {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.bom-meta-block {
    padding-top: 0.25rem;
}

.bom-section {
    padding: 1.4rem 1.6rem;
}

.bom-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bom-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.bom-grid thead th:last-child,
.bom-grid tbody td:last-child {
    width: 54px;
    text-align: center;
}

.bom-input {
    min-height: 36px;
    background: #f3f6fb;
    border-color: #e2e8f0;
}

.bom-input:focus {
    background: #fff;
}

.bom-value {
    font-weight: 500;
    color: #0f2238;
    white-space: nowrap;
}

.bom-action-cell {
    vertical-align: middle;
}

.bom-remove-btn {
    color: #ff2f2f;
    padding: 0.25rem;
    text-decoration: none;
}

.bom-remove-btn:hover {
    color: #d61f1f;
}

.bom-section-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    padding-top: 1.2rem;
}

.bom-total-figure {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f2238;
}

.bom-summary-card {
    border-color: #b9d4ff;
    background: linear-gradient(180deg, #edf5ff 0%, #eaf2fc 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
}

.bom-summary-grid {
    flex: 1 1 auto;
}

.bom-summary-line,
.bom-summary-subtotal {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #334155;
    margin-bottom: 0.8rem;
}

.bom-summary-divider {
    border-top: 1px solid #9ec5ff;
    margin: 0.8rem 0 0.9rem;
}

.bom-summary-subtotal {
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f2238;
}

.bom-summary-subtotal span:last-child {
    color: #2563eb;
    font-size: 1.15rem;
}

.bom-summary-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.approvals-modal {
    border-radius: 16px;
    border: 1px solid #d8e2ee;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.modal-content {
    border-radius: 18px;
    border: 1px solid #dbe4ef;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-bottom: 1px solid #e1ebf5;
}

.modal-header .modal-title {
    font-weight: 800;
    color: #11263d;
}

.modal-body {
    background: #fbfdff;
}

.modal-footer {
    background: #f7faff;
    border-top: 1px solid #e1ebf5;
}

.qa-modal-footer {
    gap: 0.75rem;
}

.qa-approval-modal .modal-content {
    min-height: 100dvh;
}

.qa-modal-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.qa-modal-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

.approvals-modal-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid #e2eaf4;
    padding: 1rem 1.25rem;
}

.approvals-modal-title-wrap .modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: #102338;
}

.approvals-modal-body {
    padding: 1.15rem 1.25rem;
    background: #fbfdff;
}

.approvals-block {
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.approvals-block-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #31547a;
    background: #f6f9ff;
    border-bottom: 1px solid #e2eaf4;
    padding: 0.9rem 0.95rem;
}

.approvals-block .form-label {
    margin: 0.85rem 0 0.45rem;
    padding: 0 0.95rem;
}

.approvals-block .form-control,
.approvals-block .form-select,
.approvals-block .approvals-side-actions {
    margin-left: 0.95rem;
    margin-right: 0.95rem;
}

.approvals-block .approvals-side-actions {
    margin-bottom: 0.95rem;
}

.approvals-mu-grid {
    padding: 0.9rem 0.95rem 1rem;
    align-items: end;
}

.approvals-mu-grid .form-label {
    margin: 0 0 0.45rem;
    padding: 0;
}

.approvals-mu-grid .form-control,
.approvals-mu-grid .form-select {
    margin: 0;
    min-height: 42px;
}

.approvals-switch-field {
    margin: 0;
    min-height: 42px;
    border: 1px solid #d7e2ee;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.95rem;
}

.approvals-switch-field .form-check-input {
    float: none;
    margin: 0;
    flex: 0 0 auto;
}

.approvals-switch-field .form-check-label {
    margin: 0;
    color: #14304d;
    font-weight: 600;
    line-height: 1.2;
}

.approvals-switch-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.approvals-switch-meta {
    font-size: 0.76rem;
    color: #5c7089;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.approvals-layout {
    align-items: stretch;
}

.approvals-info-card {
    margin-bottom: 0.85rem;
}

.approvals-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.3rem;
    padding: 0.9rem 0.95rem 1rem;
}

.approvals-info-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5f7187;
    margin-bottom: 0.22rem;
}

.approvals-info-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #132b45;
}

.approvals-totals-card {
    border: 1px solid #dbe7f8;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
    padding: 1rem;
}

.approvals-totals-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #31547a;
    margin-bottom: 0.75rem;
}

.approvals-total-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    color: #20364f;
}

.approvals-total-line strong {
    font-weight: 700;
}

.approvals-total-divider {
    border-top: 1px solid #c8ddff;
    margin: 0.55rem 0 0.7rem;
}

.approvals-total-line-subtotal {
    font-size: 1.05rem;
    margin-bottom: 0;
}

/* Director Initial BOM breakdown -- shared by approvals_manager.php and director_approved_boms.php's
   "Director Correction" panel so both use the same visual layout (2026-09-07). */
.abd-wrap { display: flex; flex-direction: column; gap: 6px; }
.abd-section-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin: 14px 0 6px; }
.abd-section-label:first-child { margin-top: 2px; }
.abd-card { background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.abd-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 2px; font-size: 13.5px; color: #1f2937; }
.abd-row span.abd-label { color: #2f6fed; }
.abd-row strong { font-weight: 700; color: #111827; }
.abd-row-highlight { border-radius: 8px; padding: 10px 12px; margin-top: 4px; }
.abd-row-selling { background: #fdf1d9; border: 1px solid #f3ddab; }
.abd-row-selling span.abd-label { color: #8a5a00; font-weight: 600; }
.abd-row-selling strong { color: #b8730a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.abd-row-profit { background: #e7f6ec; border: 1px solid #bfe6cb; margin-bottom: 2px; }
.abd-row-profit span.abd-label { color: #1f7a3d; font-weight: 600; }
.abd-row-profit strong { color: #1f9d46; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.abd-badge { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.abd-badge-selling { background: #f5a623; color: #fff; }
.abd-badge-profit { background: #2fa84f; color: #fff; }
.abd-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.abd-compare-card { border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.abd-compare-engineer { background: #eef4ff; border: 1px solid #cfe0fb; }
.abd-compare-director { background: #f6eefc; border: 1px solid #e2cdf5; }
.abd-compare-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.abd-compare-engineer .abd-compare-title { color: #2f6fed; }
.abd-compare-director .abd-compare-title { color: #8b3fd1; }
.abd-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.abd-dot-blue { background: #2f6fed; }
.abd-dot-purple { background: #8b3fd1; }
.abd-compare-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #4b5563; }
.abd-compare-row strong { color: #111827; font-weight: 700; }
.abd-compare-divider { border-top: 1px solid rgba(0,0,0,.08); margin: 2px 0; }
.abd-compare-profit { padding-top: 2px; }
.abd-compare-profit span { color: #374151; font-weight: 600; }
.abd-compare-profit strong { color: #1f9d46; font-size: 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 640px) { .abd-compare-grid { grid-template-columns: 1fr; } }

.approvals-pricing-wrap {
    margin-top: 1rem;
    padding-top: 0.3rem;
}

.approvals-mini-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-size: 0.88rem;
    padding: 0.65rem 0.95rem 0.9rem;
    border-top: 1px solid #edf2f8;
}

.approvals-mini-total strong {
    font-size: 1.2rem;
    color: #0f2238;
}

.approvals-modal-footer {
    border-top: 1px solid #e2eaf4;
    background: #f7faff;
    padding: 0.9rem 1.25rem;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: flex-end;
}

.approvals-action-form {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.approvals-remarks-field {
    flex: 1 1 320px;
    max-width: 520px;
}

.approvals-remarks-field textarea {
    min-height: 82px;
    resize: vertical;
    background: #fff;
}

.approvals-action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.approvals-close-btn {
    margin-left: auto;
}

.approvals-side-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.approvals-action-panel {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.75rem;
}

.approvals-side-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.approvals-side-note {
    color: #70839a;
    font-size: 0.72rem;
    margin-top: 0.6rem;
}

.approvals-pending-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.approvals-pending-item {
    border: 1px solid #d9e4f3;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    background: #fbfdff;
}

.approvals-pending-item.active {
    border-color: #9cc2ff;
    background: #edf5ff;
}

.approval-queue-card {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
}

.approval-queue-card .modern-card-head {
    align-items: center;
    padding-bottom: 0.2rem;
}

.approval-board {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.approval-board-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(140px, 0.8fr) minmax(100px, 0.5fr) minmax(130px, 0.6fr) auto;
    gap: 0.9rem;
    align-items: center;
    border: 1px solid #dbe7f5;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.96));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.approval-board-edit .approval-board-row {
    grid-template-columns: minmax(0, 1.9fr) minmax(150px, 0.8fr) minmax(180px, 0.9fr) minmax(320px, 1.2fr);
}

.approval-board-main {
    min-width: 0;
}

.approval-board-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: #64809f;
    margin-bottom: 0.35rem;
}

.approval-board-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #102338;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.approval-board-copy {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.approval-board-remark {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.83rem;
    color: #7c5e10;
    line-height: 1.4;
    padding: 0.4rem 0.7rem;
    background: #fef9c3;
    border-left: 3px solid #eab308;
    border-radius: 4px;
    margin: 0.4rem 0 0.1rem;
}

.approval-board-remark i {
    margin-top: 0.15rem;
    color: #b45309;
    flex-shrink: 0;
}

.approval-board-remark span {
    white-space: pre-wrap;
    word-break: break-word;
}

.approval-board-remark-label {
    font-weight: 600;
    font-style: normal;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.approval-board-meta {
    min-width: 0;
}

.approval-board-meta-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #688099;
    margin-bottom: 0.28rem;
}

.approval-board-meta-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #17365b;
}

.approval-board-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
}

.approval-board-note {
    color: #475569;
    font-weight: 600;
    line-height: 1.45;
}

.approval-board-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.approval-board-actions-wide {
    min-width: 0;
}

.approval-empty-state {
    border: 1px dashed #cddcf0;
    border-radius: 16px;
    padding: 1.35rem 1.2rem;
    background: linear-gradient(180deg, rgba(248,251,255,0.98), rgba(242,247,253,0.98));
    text-align: center;
}

.approval-empty-title {
    font-size: 1rem;
    font-weight: 800;
    color: #17365b;
    margin-bottom: 0.3rem;
}

.approval-empty-copy {
    color: #688099;
    font-size: 0.9rem;
}

.approval-queue-table thead th {
    background:
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: #294766;
}

.approval-queue-table tbody td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.approval-queue-table tbody tr:hover td {
    background:
        linear-gradient(90deg, rgba(247,250,255,0.98), rgba(239,246,255,0.94));
}

.approval-queue-table tbody td:first-child {
    font-weight: 800;
    color: #17365b;
}

.approval-queue-table .dataTables_empty {
    padding: 1.6rem 1rem !important;
    color: #688099;
    font-weight: 700;
    text-align: center !important;
    background:
        linear-gradient(180deg, rgba(248,251,255,0.92), rgba(241,246,252,0.92));
}

.approval-inline-form {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}

.approval-inline-form .form-control {
    min-width: 200px;
    flex: 1 1 220px;
    background: #fff;
}

.btn-review-primary {
    color: #fff;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.btn-review-primary:hover,
.btn-review-primary:focus {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 12px 22px rgba(29, 78, 216, 0.22);
}

@media (max-width: 1200px) {
    .approval-board-row,
    .approval-board-edit .approval-board-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .approval-board-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .approval-board-actions,
    .approval-board-actions-wide {
        width: 100%;
    }

    .approval-inline-form {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        align-items: stretch;
    }

    .approval-inline-form .form-control {
        min-width: 0;
        width: 100%;
        grid-column: 1 / -1;
        flex: initial;
    }

    .approval-inline-form .btn,
    .approval-inline-form .approval-open-btn {
        width: 100%;
        justify-content: center;
    }

    .qa-modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        position: sticky;
        bottom: 0;
        z-index: 3;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .qa-modal-footer .btn {
        width: 100%;
        justify-content: center;
        margin: 0;
    }
}

.tracker-status-btn {
    border: 1px solid transparent;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    border-radius: 999px;
    padding: 0.24rem 0.55rem;
    line-height: 1.15;
    white-space: nowrap;
}

.tracker-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.71rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.16rem 0.52rem;
    border: 1px solid transparent;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.71rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.16rem 0.52rem;
    border: 1px solid transparent;
}

.status-approved {
    color: #0a9a46 !important;
    background: #dff5e6 !important;
    border-color: #a8e1bd !important;
}

.status-pending {
    color: #c28600 !important;
    background: #fff5d9 !important;
    border-color: #f1dd98 !important;
}

.status-alert {
    color: #ea580c !important;
    background: #ffebdf !important;
    border-color: #f6c6a7 !important;
}

.status-progress {
    color: #2563eb !important;
    background: #e5efff !important;
    border-color: #bfd3fb !important;
}

.status-draft {
    color: #6b7280 !important;
    background: #edf0f4 !important;
    border-color: #d6dce5 !important;
}

.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.88rem;
}

.activity-copy {
    min-width: 0;
}

.activity-green { color: #0a9a46; background: #dff5e6; }
.activity-amber { color: #c28600; background: #fff5d9; }
.activity-orange { color: #ea580c; background: #ffebdf; }
.activity-blue { color: #2563eb; background: #e5efff; }
.activity-gray { color: #6b7280; background: #edf0f4; }

.settings-modal {
    border: 1px solid #d5dfeb;
    border-radius: 12px;
    overflow: hidden;
}

.settings-modal-header {
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #e5ecf4;
    background: #fdfefe;
}

.settings-modal-body {
    padding: 0.9rem 1rem;
    background: #fafcff;
}

.settings-modal-footer {
    border-top: 1px solid #e5ecf4;
    background: #fdfefe;
    padding: 0.85rem 1rem;
}

.settings-feature-grid {
    margin-top: 0.2rem;
}

.settings-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid #d8e2ee;
    border-radius: 9px;
    padding: 0.62rem 0.7rem;
    background: #fff;
    cursor: pointer;
}

.settings-feature-card:hover {
    border-color: #bfcde0;
    background: #fcfdff;
}

.settings-feature-check {
    padding-top: 0.05rem;
}

.settings-feature-copy strong {
    display: block;
    font-size: 0.92rem;
    color: #0f2238;
    line-height: 1.2;
}

.settings-feature-copy .small {
    font-size: 0.79rem;
    margin-top: 0.1rem;
}

.settings-note {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: #eef4fd;
}

.tracker-modal .modal-header {
    border-bottom: 1px solid #e2eaf4;
}

.tracker-modal-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f2238;
}

.tracker-timeline-card,
.tracker-info-card {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    padding: 0.9rem 1rem;
}

.tracker-timeline-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #31547a;
    margin-bottom: 0.65rem;
}

.tracker-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    min-width: 860px;
}

.tracker-timeline-wrap {
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.tracker-step {
    flex: 1 1 0;
    text-align: center;
    position: relative;
    min-width: 120px;
    padding: 0 0.35rem;
}

.tracker-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 10px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: #cfd9e6;
}

.tracker-step.done:not(:last-child)::after {
    background: #16a34a;
}

.tracker-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin: 0 auto 0.35rem;
    background: #d1d9e5;
    color: #fff;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.tracker-step.done .tracker-step-dot {
    background: #16a34a;
}

.tracker-step.current .tracker-step-dot {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* JO Tracker timeline fix: a Rejected BOM bounces back to its creation step for edits -- shown
   frozen there in red rather than reset to step 0 or drawn as done/current. */
.tracker-step.rejected .tracker-step-dot {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
}

.tracker-step.rejected .tracker-step-label {
    color: #dc2626;
}

.tracker-step-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
    white-space: normal;
}

.tracker-tabs .nav-link {
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #3f5877;
    background: #f3f7fc;
    border: 1px solid #dbe4ef;
}

.tracker-tabs .nav-link.active {
    color: #0f2238;
    background: #fff;
    border-color: #bfd3ec;
}

.tracker-info-card h6 {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #31547a;
    margin-bottom: 0.7rem;
}

.tracker-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    font-size: 0.84rem;
}

.tracker-info-row span {
    color: #5f7187;
}

.tracker-info-row strong {
    color: #0f2238;
}

.tracker-summary-card {
    border: 1px solid #b9d4ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #edf5ff 0%, #eaf2fc 100%);
    padding: 1rem;
}

.tracker-comparison-card {
    position: relative;
}

.tracker-comparison-card-engineer {
    border-color: #b8d4fb;
    background: linear-gradient(180deg, #eef6ff 0%, #e0efff 100%);
    box-shadow: inset 0 0 0 1px rgba(115, 166, 245, 0.18);
}

.tracker-comparison-card-director {
    border-color: #d9e9d3;
    background: linear-gradient(180deg, #fbfff7 0%, #f1f9eb 100%);
}

.tracker-comparison-card-engineer h5 {
    color: #1d4f91;
}

.tracker-comparison-card-director h5 {
    color: #2f6b35;
}

.tracker-summary-card-engineer {
    border-color: #a8caf8;
    background: linear-gradient(180deg, #e8f2ff 0%, #dcecff 100%);
}

.tracker-summary-card-director {
    border-color: #c8e1bf;
    background: linear-gradient(180deg, #f4fbe9 0%, #edf7df 100%);
}

.tracker-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
    color: #20364f;
}

.tracker-summary-divider {
    border-top: 1px solid #9ec5ff;
    margin: 0.5rem 0 0.65rem;
}

.tracker-summary-row.subtotal {
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: 0;
}

.tracker-summary-row.subtotal strong {
    color: #2563eb;
}

.tracker-activity-item {
    border-bottom: 1px solid #e8eef7;
    padding: 0.5rem 0;
}

.tracker-activity-item:last-child {
    border-bottom: 0;
}

.tracker-price {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 700;
}

.tracker-price-engineer {
    color: #2563eb;
}

.tracker-price-director {
    color: #ea580c;
}

.tracker-eye-btn {
    padding: 0.1rem 0.2rem;
    text-decoration: none;
}

.tracker-price-engineer .tracker-eye-btn {
    color: #2563eb;
}

.tracker-price-director .tracker-eye-btn {
    color: #ea580c;
}

.tracker-breakdown-total {
    border-radius: 10px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.tracker-breakdown-total-engineer {
    background: #eaf1ff;
}

.tracker-breakdown-total-engineer strong {
    color: #2563eb;
    font-size: 1.5rem;
}

.tracker-breakdown-total-director {
    background: #fff2e8;
}

.tracker-breakdown-total-director strong {
    color: #ea580c;
    font-size: 1.5rem;
}

.tracker-dropdown {
    min-width: 118px;
}

.tracker-dropdown-btn {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #9fc0ff;
    background: #eef4ff;
    color: #245bda;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.32rem 0.75rem;
    line-height: 1.15;
}

.tracker-dropdown-btn:hover,
.tracker-dropdown-btn:focus,
.tracker-dropdown-btn.show {
    background: #dfeaff;
    border-color: #7ba7fb;
    color: #184ec8;
}

.tracker-dropdown-btn-secondary {
    border-color: #cfd8e5;
    background: #fff;
    color: #183153;
}

.tracker-dropdown-btn-secondary:hover,
.tracker-dropdown-btn-secondary:focus,
.tracker-dropdown-btn-secondary.show {
    background: #f6f9fd;
    border-color: #b8c8db;
    color: #102338;
}

.tracker-dropdown-menu {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    padding: 0.35rem;
    box-shadow: 0 12px 28px rgba(15, 34, 56, 0.12);
}

.tracker-dropdown-menu .dropdown-item {
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #183153;
    padding: 0.45rem 0.65rem;
}

/* Order form chip stack — Actions column in purchase_orders.php */
.of-action-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.of-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 140ms ease, border-color 140ms ease, transform 100ms ease;
    letter-spacing: .01em;
}
.of-chip:hover { transform: translateY(-1px); text-decoration: none; }
.of-chip:active { transform: translateY(0); }

/* COF — blue */
.of-chip-cof {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.of-chip-cof:hover { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }

/* Draft raw order */
.of-chip-draft {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}
.of-chip-draft:hover { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }

/* Submitted raw order */
.of-chip-submitted {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.of-chip-submitted:hover { background: #dcfce7; border-color: #86efac; color: #15803d; }

.of-chip i { font-size: 12px; flex-shrink: 0; }

.of-chip-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    margin-left: 2px;
    flex-shrink: 0;
}

.tracker-dropdown-menu .dropdown-item:hover,
.tracker-dropdown-menu .dropdown-item:focus {
    background: #eef4ff;
    color: #184ec8;
}

.po-sheet {
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 1.75rem;
}

.po-format {
    font-size: 11px;
    color: #132b45;
    border: 1px solid #cfd8e5;
    border-radius: 10px;
    padding: 14px 16px;
}

.po-format h2,
.po-format h6 {
    color: #102338;
}

.po-format h2 {
    font-size: 35px;
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 3px;
}

.po-head {
    border-bottom: 1px solid #dbe4ef;
    padding-bottom: 0.75rem;
}

.po-head-right {
    line-height: 1.35;
}

.po-meta-grid h6,
.po-format > h6 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.po-items-table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    background: #edf3fa !important;
    color: #284a72 !important;
}

.po-items-table tbody td {
    font-size: 0.83rem;
}

.po-totals-table th,
.po-totals-table td {
    font-size: 0.95rem;
    border-color: #dbe4ef;
}

.po-grand-total th,
.po-grand-total td {
    background: #c8dbf2 !important;
}

.po-grand-total td {
    color: #2563eb;
    font-size: 1.75rem;
    font-weight: 800 !important;
}

.po-signatures .border-top {
    border-top: 1px solid #bfcde0 !important;
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    font-size: 0.86rem;
    min-height: 38px;
    padding: 0.56rem 0.9rem;
}

.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: #93c5fd;
    background: #eff6ff;
}

.btn-outline-primary:hover {
    color: #fff;
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

.btn-outline-secondary {
    color: #475569;
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-outline-secondary:hover {
    color: #fff;
    background: #64748b;
    border-color: #64748b;
}

.form-control,
.form-select {
    min-height: 38px;
    border-radius: 10px;
    border-color: #d0d9e4;
    background: #fcfdff;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #9fb8de;
    box-shadow: 0 0 0 0.18rem rgba(59, 130, 246, 0.16);
}

.form-label {
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #35506d;
}

.badge {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.56rem;
}

.app-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(92vw, 360px);
    pointer-events: none;
    align-items: flex-end;
}

.app-toast {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.16), 0 1.5px 4px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid rgba(15, 23, 42, 0.07);
    min-height: 52px;
    max-width: 360px;
    width: 360px;
}

.app-toast-accent {
    width: 4px;
    min-width: 4px;
    align-self: stretch;
    background: var(--toast-accent, #3b82f6);
    border-radius: 12px 0 0 12px;
}

.app-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    font-size: 1.15rem;
    color: var(--toast-accent, #3b82f6);
}

.app-toast-body {
    flex: 1;
    padding: 12px 4px 12px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.app-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.15s, color 0.15s;
}

.app-toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.9rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: #5f7187;
    font-size: 0.88rem;
    font-weight: 700;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 38px;
    border: 1px solid #d0d9e4;
    border-radius: 10px;
    background: #fcfdff;
    padding: 0.4rem 0.75rem;
    margin-left: 0.45rem;
}

.dataTables_wrapper .dataTables_info {
    color: #6a7c92;
    font-size: 0.85rem;
    padding-top: 0.9rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: 1px solid #d3dfef !important;
    background: #fff !important;
    color: #28415c !important;
    margin-left: 0.35rem;
    padding: 0.35rem 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

.tracker-data-table td:nth-child(3),
.tracker-data-table td:nth-child(4) {
    font-weight: 700;
    color: #132b45;
}

.tracker-data-table td:nth-child(10),
.tracker-data-table td:nth-child(11),
.tracker-data-table td:nth-child(12) {
    white-space: nowrap;
}

.tracker-data-table .tracker-dropdown-btn,
.tracker-data-table .tracker-status-btn {
    min-height: 32px;
}

.btn-menu-toggle,
.btn-close-sidebar {
    display: none;
    border: 0;
    background: transparent;
    color: inherit;
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.btn-menu-toggle:hover,
.btn-close-sidebar:hover {
    background: #eff6ff;
}

.login-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef4fb 0%, #f8fbff 48%, #edf3f9 100%);
}

.login-stage {
    min-height: 100vh;
    padding: 2rem;
    display: grid;
    place-items: center;
}

.login-card-split {
    width: min(100%, 1040px);
    min-height: 620px;
    display: grid;
    grid-template-columns: 0.98fr 1.02fr;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 228, 239, 0.85);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.login-panel-form {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.login-panel-inner {
    max-width: 430px;
    margin: 0 auto;
    padding: 3rem 2.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.9rem;
}

.login-kicker::before {
    content: "";
    width: 28px;
    height: 2px;
    background: #2563eb;
    border-radius: 999px;
}

.login-title {
    margin: 0 0 0.45rem;
    font-size: 2.15rem;
    font-weight: 800;
    color: #0f172a;
}

.login-subtitle {
    margin: 0 0 1.8rem;
    color: var(--text-soft);
    font-size: 0.96rem;
}

.login-form .form-control {
    background: #fff;
}

.password-wrap {
    position: relative;
}

.login-input-password {
    padding-right: 4rem;
}

.password-toggle {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 700;
}

.login-submit {
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.75rem 0 1rem;
    color: #7b8ba2;
    font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #dbe4ef;
}

.login-role-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.login-role-links div {
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #dbe4ef;
    background: #f8fbff;
    color: #35506d;
    font-size: 0.8rem;
    font-weight: 600;
}

.login-note {
    text-align: center;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.6;
}

.login-panel-visual {
    position: relative;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.78), rgba(37, 99, 235, 0.78)),
        url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;
}

.login-visual-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.35));
}

.login-visual-content {
    position: absolute;
    inset: auto 2.3rem 2.3rem 2.3rem;
    z-index: 1;
    color: #fff;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.login-visual-content h2 {
    font-size: 2.2rem;
    line-height: 1.05;
    margin-bottom: 0.9rem;
    font-weight: 800;
}

.login-visual-content p {
    margin: 0;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.96rem;
}

@media print {
    @page {
        size: Letter portrait;
        margin: 8mm;
    }

    html,
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body * {
        display: none !important;
    }

    .main-content,
    .dashboard-content,
    .card.card-soft.form-card {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .card.card-soft.form-card > *:not(#printable-po) {
        display: none !important;
    }

    #printable-po,
    #printable-po * {
        display: revert !important;
        visibility: visible !important;
    }

    #printable-po {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 6mm 7mm !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        border-radius: 0 !important;
        overflow: visible !important;
        transform: none !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    #printable-po.po-format {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }

    #printable-po .table th,
    #printable-po .table td {
        padding: 0.18rem 0.28rem !important;
    }

    #printable-po h2 {
        font-size: 1.3rem !important;
        margin-bottom: 0.2rem !important;
    }

    #printable-po h6 {
        font-size: 0.78rem !important;
        margin-bottom: 0.2rem !important;
    }

    #printable-po .row {
        --bs-gutter-x: 0.7rem !important;
        --bs-gutter-y: 0.4rem !important;
    }

    #printable-po .mt-5,
    #printable-po .mt-4,
    #printable-po .mb-4,
    #printable-po .mb-3 {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    #printable-po .po-head {
        padding-bottom: 0.35rem !important;
        margin-bottom: 0.55rem !important;
    }

    #printable-po .po-signatures .mb-4 {
        margin-bottom: 0.8rem !important;
    }

    #printable-po .po-signatures .small {
        font-size: 0.68rem !important;
    }

    .table,
    .table th,
    .table td {
        color: #000 !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .btn-menu-toggle,
    .btn-close-sidebar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-navbar-inner {
        padding: 0.9rem 1rem;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .login-card-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-panel-visual {
        min-height: 300px;
    }

    .bento-stat-a,
    .bento-stat-b,
    .bento-stat-c,
    .bento-stat-d {
        grid-column: span 6;
        grid-row: auto;
    }

    .engineer-bento-hero,
    .bento-main,
    .bento-side-top,
    .bento-side-bottom {
        grid-column: span 12;
        grid-row: auto;
    }

    .director-bento-hero,
    .director-bento-projects,
    .director-bento-activity,
    .director-bento-chart-a,
    .director-bento-chart-b,
    .director-bento-chart-c {
        grid-column: span 12;
        grid-row: auto;
    }

    .director-bento-stat-a,
    .director-bento-stat-b,
    .director-bento-stat-c,
    .director-bento-stat-d {
        grid-column: span 6;
        grid-row: auto;
    }

    .director-command-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .topbar-actions {
        gap: 0.65rem;
    }

    .topbar-date {
        display: none;
    }

    .topbar-user-copy {
        display: none;
    }

    .director-bento-stat-a,
    .director-bento-stat-b,
    .director-bento-stat-c,
    .director-bento-stat-d {
        grid-column: span 12;
        grid-row: auto;
    }

    .table-card,
    .form-card {
        padding: 0.85rem;
    }

    .metric-value {
        font-size: 1.65rem;
    }

    .bom-section {
        padding: 1rem;
    }

    .bom-section-head,
    .bom-summary-card {
        flex-direction: column;
        align-items: stretch;
    }

    .bom-summary-actions {
        justify-content: stretch;
    }

    .bom-summary-actions .btn {
        width: 100%;
    }

    .approvals-modal-header,
    .approvals-modal-body,
    .approvals-modal-footer {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .approvals-modal-title-wrap .modal-title {
        font-size: 1.18rem;
    }

    .approvals-info-grid {
        grid-template-columns: 1fr;
    }

    .approvals-mini-total {
        justify-content: space-between;
    }

    .approvals-close-btn {
        width: 100%;
    }

    .tracker-timeline {
        min-width: 760px;
    }

    .tracker-step {
        min-width: 110px;
        text-align: center;
    }

    .login-stage {
        padding: 1rem;
    }

    .login-panel-inner {
        padding: 2rem 1.4rem;
    }

    .login-visual-content {
        inset: auto 1.4rem 1.4rem 1.4rem;
    }

    .login-visual-content h2 {
        font-size: 1.7rem;
    }

    .bento-stat-a,
    .bento-stat-b,
    .bento-stat-c,
    .bento-stat-d,
    .bento-main,
    .bento-side-top,
    .bento-side-bottom {
        grid-column: span 12;
    }
}

.breadcrumb-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-soft);
}
.breadcrumb-shell a { color: #4b6a8d; }
.breadcrumb-shell strong { color: #1e3a5f; font-weight: 700; }

.bom-timeline-wrap {
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.bom-timeline {
    display: flex;
    align-items: flex-start;
    min-width: 920px;
}

.bom-step {
    flex: 1 1 0;
    text-align: center;
    position: relative;
    min-width: 120px;
    padding: 0 0.35rem;
}

.bom-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 10px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: #cfd9e6;
}

.bom-step.done:not(:last-child)::after {
    background: #16a34a;
}

.bom-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin: 0 auto 0.35rem;
    background: #d1d9e5;
    color: #fff;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.bom-step.done .bom-step-dot {
    background: #16a34a;
}

.bom-step.current .bom-step-dot {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.bom-step-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
    white-space: normal;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.55rem;
    font-size: 0.86rem;
    color: #4b6078;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 0.55rem;
    font-size: 0.84rem;
    color: #4b6078;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d0d9e4;
    border-radius: 8px;
    padding: 0.22rem 0.45rem;
    background: #fff;
}

.dataTables_wrapper .paginate_button {
    border-radius: 8px !important;
}

.manual-pagination-wrapper .dataTables_paginate {
    float: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
}

.manual-pagination-wrapper .dataTables_paginate .paginate_button:first-child {
    margin-left: 0;
}

.manual-pagination-wrapper .paginate_button.disabled,
.manual-pagination-wrapper .paginate_button.disabled:hover {
    background: #f1f5f9 !important;
    border-color: #d3dfef !important;
    color: #64748b !important;
    cursor: default;
    pointer-events: none;
}

.manual-pagination-wrapper .paginate_button.ellipsis,
.manual-pagination-wrapper .paginate_button.ellipsis:hover {
    background: #f8fafc !important;
    color: #475569 !important;
}

/* Engineer dashboard bento layout */
.engineer-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    grid-auto-flow: dense;
}

.bento-card {
    min-width: 0;
}

.engineer-bento-hero {
    grid-column: 1 / span 12;
    grid-row: 1;
}

.bento-stat-a,
.bento-stat-b,
.bento-stat-c,
.bento-stat-d {
    grid-column: span 3;
}

.bento-stat-a {
    grid-column: 1 / span 3;
    grid-row: 2;
}

.bento-stat-b {
    grid-column: 4 / span 3;
    grid-row: 2;
}

.bento-stat-c {
    grid-column: 7 / span 3;
    grid-row: 2;
}

.bento-stat-d {
    grid-column: 10 / span 3;
    grid-row: 2;
}

.bento-main {
    grid-column: 1 / span 8;
    grid-row: 3;
}

.bento-side-top,
.bento-side-bottom {
    grid-column: span 4;
}

.bento-side-top {
    grid-column: 1 / span 8;
    grid-row: 4;
}

.bento-side-bottom {
    grid-column: 9 / span 4;
    grid-row: 3 / span 2;
}

.bento-side-bottom .form-card {
    max-height: 540px;
    overflow: auto;
}

.director-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    grid-auto-flow: dense;
}

.director-bento-hero {
    grid-column: 1 / span 6;
    grid-row: 1 / span 2;
}

.director-bento-stat-a,
.director-bento-stat-b,
.director-bento-stat-c,
.director-bento-stat-d {
    grid-column: span 3;
}

.director-bento-stat-a {
    grid-column: 7 / span 3;
    grid-row: 1;
}

.director-bento-stat-b {
    grid-column: 10 / span 3;
    grid-row: 1;
}

.director-bento-stat-c {
    grid-column: 7 / span 3;
    grid-row: 2;
}

.director-bento-stat-d {
    grid-column: 10 / span 3;
    grid-row: 2;
}

.director-bento-projects {
    grid-column: 1 / span 8;
    grid-row: 3;
}

.director-bento-activity {
    grid-column: 9 / span 4;
    grid-row: 3;
}

.director-bento-chart-a,
.director-bento-chart-b,
.director-bento-chart-c {
    grid-column: span 4;
}

.director-bento-chart-a {
    grid-column: 1 / span 4;
    grid-row: 4;
}

.director-bento-chart-b {
    grid-column: 5 / span 4;
    grid-row: 4;
}

.director-bento-chart-c {
    grid-column: 9 / span 4;
    grid-row: 4;
}

.director-command-card {
    min-height: 100%;
    border: 1px solid #d7e0ea;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #16324f 55%, #0f766e 100%);
    color: #f8fbff;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.director-command-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
}

.director-command-card h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.15;
    font-weight: 800;
}

.director-command-card p {
    margin: 0;
    max-width: 46ch;
    color: rgba(248, 251, 255, 0.82);
}

.director-command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.director-command-actions .btn-outline-primary,
.director-command-actions .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fbff;
    border-color: rgba(255, 255, 255, 0.22);
}

.director-command-actions .btn-outline-primary:hover,
.director-command-actions .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.director-command-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: auto;
}

.director-command-pill {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.director-command-pill span {
    color: rgba(248, 251, 255, 0.76);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.director-command-pill strong {
    font-size: 1.35rem;
    font-weight: 900;
}

.director-activity-list {
    max-height: 560px;
    overflow: auto;
}

.project-trail-pane {
    border: 1px solid #dbe5f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #fcfdff 0%, #f6f9fd 100%);
    padding: 1.15rem;
    height: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.project-trail-pane-title {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #23476d;
}

.project-trail-entry {
    padding: 1rem 0;
    border-bottom: 1px solid #dbe5f0;
}

.project-trail-entry:first-child {
    padding-top: 0.15rem;
}

.project-trail-entry:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.project-trail-entry-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.45rem;
}

.project-trail-entry-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.project-trail-entry-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eaf1ff;
    color: #3867f4;
    font-size: 0.95rem;
}

.project-trail-entry-title {
    font-size: 1rem;
    font-weight: 800;
    color: #10263f;
    line-height: 1.25;
}

.project-trail-entry-meta {
    margin-top: 0.18rem;
    color: #5b6f86;
    font-size: 0.88rem;
}

.project-trail-link-note {
    margin-left: 2.95rem;
    margin-bottom: 0.5rem;
    color: #50657e;
    font-size: 0.88rem;
    line-height: 1.4;
}

.project-trail-entry-time {
    margin-top: 0.6rem;
    margin-left: 2.95rem;
    color: #5f7288;
    font-size: 0.88rem;
}

.project-trail-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.22rem 0.72rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.project-trail-chip-neutral {
    border: 1px solid #d7e0ea;
    background: #ffffff;
    color: #10263f;
}

.project-trail-chip-soft {
    border: 1px solid #bfd0ff;
    background: #f5f8ff;
    color: #2957d3;
}

.project-trail-chip-strong {
    border: 1px solid #cde8d6;
    background: #edf9f1;
    color: #0f7b43;
}

.project-trail-comment-body {
    margin-top: 0.5rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border: 1px solid #dbe6ff;
    color: #16324f;
    font-weight: 600;
    line-height: 1.45;
}

.project-trail-comment-block {
    margin-left: 2.95rem;
    margin-top: 0.55rem;
}

@media (max-width: 767.98px) {
    .project-trail-pane {
        padding: 1rem;
    }

    .project-trail-entry-header {
        flex-direction: column;
        align-items: stretch;
    }

    .project-trail-link-note,
    .project-trail-comment-block,
    .project-trail-entry-time {
        margin-left: 0;
    }
}

.bom-breakdown {
    border-top: 1px solid #dbe4ef;
    padding-top: 1rem;
}

.bom-breakdown-title {
    font-size: 1rem;
    font-weight: 800;
    color: #16324f;
    margin-bottom: 0.85rem;
    letter-spacing: 0.01em;
}

.bom-breakdown-meta {
    margin-bottom: 1rem;
}

.bom-breakdown-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    color: #425b78;
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.bom-breakdown-stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.bom-breakdown-line {
    background: #f5eadf;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bom-breakdown-line-label {
    font-size: 1rem;
    font-weight: 700;
    color: #13263f;
}

.bom-breakdown-line-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: #f05a00;
    line-height: 1;
    text-align: right;
}

.bom-breakdown-line-highlight {
    background: linear-gradient(135deg, #fff1e7 0%, #ffe0c4 100%);
    border: 1px solid #f8c38f;
}

.bom-breakdown-line-highlight .bom-breakdown-line-label {
    color: #8f3600;
}

.bom-breakdown-line-highlight .bom-breakdown-line-value {
    font-size: 1.2rem;
}

.bom-view-section {
    margin-bottom: 1.2rem;
}

.bom-view-section-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #17324f;
    margin-bottom: 0.65rem;
}

.bom-view-section .table {
    border-collapse: separate;
    border-spacing: 0;
}

.bom-view-section .table thead th {
    background: #eef3f9;
    color: #37506d;
    font-size: 0.8rem;
    text-transform: none;
    font-weight: 800;
    border-bottom: 1px solid #d7e2ee;
}

.bom-view-section .table tbody td {
    vertical-align: middle;
}

.bom-other-costs-box {
    background: linear-gradient(180deg, #eef5ff 0%, #e7f0fb 100%);
    border: 1px solid #b9d2f4;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.bom-other-costs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
}

.bom-other-costs-row:not(:last-child) {
    border-bottom: 1px solid rgba(123, 160, 210, 0.2);
}

.bom-other-costs-label {
    color: #163a63;
    font-weight: 500;
}

.bom-other-costs-value {
    color: #10263f;
    font-weight: 800;
    min-width: 140px;
    text-align: right;
}

.modal-xxl {
    max-width: min(96vw, 1760px);
}

.bom-editor-table {
    table-layout: auto;
    min-width: 1320px;
}

.bom-editor-table thead th {
    font-size: 0.76rem;
    white-space: nowrap;
    padding: 0.65rem 0.55rem;
    vertical-align: middle;
}

.bom-editor-table tbody td {
    padding: 0.55rem 0.5rem;
    vertical-align: middle;
}

.bom-editor-table .form-control,
.bom-editor-table .form-select {
    min-width: 72px;
    font-size: 0.92rem;
    padding: 0.52rem 0.7rem;
}

.bom-editor-table input[name="material_part_number[]"] {
    min-width: 86px;
}

.bom-editor-table input[name="material_description[]"] {
    min-width: 180px;
}

.bom-editor-table input[name="material_uom[]"] {
    min-width: 72px;
}

.bom-editor-table select[name="material_supplier[]"],
.bom-editor-table input[name="material_supplier_manual[]"] {
    min-width: 140px;
}

.bom-editor-table .text-end.small,
.bom-editor-table [data-material-base-total],
.bom-editor-table [data-material-mu-25],
.bom-editor-table [data-material-mu-32],
.bom-editor-table [data-material-mu-40],
.bom-editor-table [data-material-mu-50],
.bom-editor-table [data-service-total],
.bom-editor-table [data-service-final],
.bom-editor-table [data-director-material-base-total],
.bom-editor-table [data-director-material-mu-25],
.bom-editor-table [data-director-material-mu-32],
.bom-editor-table [data-director-material-mu-40],
.bom-editor-table [data-director-material-mu-50],
.bom-editor-table [data-director-service-total],
.bom-editor-table [data-director-service-final] {
    white-space: nowrap;
    min-width: 86px;
    font-size: 0.82rem;
}

.bom-editor-table .btn.btn-sm {
    white-space: nowrap;
}

.bom-service-table input[name="service_role[]"] {
    min-width: 180px;
}

@media (max-width: 1399.98px) {
    .bom-editor-table {
        min-width: 1180px;
    }

    .bom-editor-table thead th {
        font-size: 0.72rem;
    }

    .bom-editor-table .form-control,
    .bom-editor-table .form-select {
        font-size: 0.88rem;
        padding: 0.45rem 0.58rem;
    }
}

.jo-tracker-card {
    overflow: visible;
}

.jo-tracker-card .modern-card-head {
    padding: 0 1.15rem;
    margin-bottom: 0;
}

.jo-tracker-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
    padding: 1rem 1.15rem 0;
}

.jo-project-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(207, 221, 237, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(148, 163, 184, 0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    padding: 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.jo-project-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid rgba(220, 230, 242, 0.7);
}

.jo-project-card-header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.jo-project-card-index {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6f87a3;
    margin-bottom: 0.45rem;
}

.jo-project-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #16324c;
    line-height: 1.1;
    text-wrap: balance;
}

.jo-project-card-subtitle {
    margin-top: 0.3rem;
    color: #607a95;
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: 28ch;
}

.jo-project-meta-grid,
.jo-project-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.jo-project-meta-grid {
    border: 1px solid rgba(229, 238, 248, 0.95);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
    padding: 0.8rem;
}

.jo-project-summary-item-wide {
    grid-column: 1 / -1;
}

.jo-project-summary-item .tracker-eye-btn {
    margin-top: 0.55rem;
    border: 1px solid #d7e0eb;
    border-radius: 999px;
    color: #51657c;
    background: #f8fafc;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jo-project-summary-item .tracker-eye-btn:hover,
.jo-project-summary-item .tracker-eye-btn:focus {
    background: #eef2f7;
    color: #334155;
}

.jo-project-meta-item,
.jo-project-summary-item {
    border: 1px solid rgba(227, 236, 247, 0.95);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 0.7rem 0.78rem 0.75rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.jo-project-meta-item {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0.2rem 0.3rem;
    box-shadow: none;
    min-height: 0;
}

.jo-project-meta-item span,
.jo-project-summary-item span,
.jo-project-section-title {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #6d84a0;
}

.jo-project-meta-item strong,
.jo-project-summary-item strong {
    display: block;
    margin-top: 0.38rem;
    color: #16324c;
    font-size: 0.86rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.28;
}

.jo-project-meta-item .tracker-eye-btn {
    margin-top: 0.55rem;
    border: 1px solid #d7e0eb;
    border-radius: 999px;
    color: #51657c;
    background: #f8fafc;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jo-project-meta-item .tracker-eye-btn:hover,
.jo-project-meta-item .tracker-eye-btn:focus {
    background: #eef2f7;
    color: #334155;
}

.jo-project-files,
.jo-project-summary,
.jo-project-edit-panel {
    border: 1px solid rgba(229, 238, 248, 0.95);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
    padding: 0.8rem 0.8rem 0.85rem;
}

.jo-project-file-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.jo-project-empty-pill {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #eef4fb;
    color: #5b7691;
    font-weight: 700;
    font-size: 0.84rem;
}

.jo-project-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.jo-project-summary {
    position: relative;
}

.jo-project-summary::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, #cbd5e1 0%, #e2e8f0 100%);
}

.jo-project-summary .jo-project-section-title,
.jo-project-edit-panel .jo-project-section-title {
    padding-left: 0.55rem;
}

.jo-project-summary-grid .jo-project-summary-item:first-child {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-color: rgba(215, 224, 235, 0.95);
}

.jo-project-summary-grid .jo-project-summary-item:first-child strong {
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.jo-project-description,
.jo-project-notes {
    margin: 0.7rem 0 0;
    color: #284561;
    line-height: 1.55;
    font-size: 0.92rem;
}

.jo-project-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.65rem;
    align-items: start;
}

.jo-project-edit-panel .form-control,
.jo-project-edit-panel .form-select {
    border-radius: 14px;
    border-color: #d9e6f4;
    background: rgba(255, 255, 255, 0.96);
    min-height: 40px;
}

.jo-project-edit-panel .form-control:focus,
.jo-project-edit-panel .form-select:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.12);
}

.jo-project-form-grid > div,
.jo-project-meta-item,
.jo-project-summary-item {
    min-width: 0;
}

.jo-project-form-grid > div {
    display: flex;
    flex-direction: column;
}

.jo-project-edit-panel .form-label {
    min-height: 2rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: flex-end;
    font-size: 0.68rem;
    line-height: 1.2;
}

.jo-project-form-upload .jo-tracker-file-input,
.jo-project-form-grid input[type="date"],
.jo-project-form-grid input[type="text"],
.jo-project-form-grid input[type="number"],
.jo-project-form-grid .form-select {
    width: 100%;
}

.jo-project-form-upload .jo-tracker-file-input {
    min-height: 40px;
    padding: 0.2rem 0.45rem;
    border-radius: 14px;
    border: 1px solid #d9e6f4;
    background: rgba(255, 255, 255, 0.96);
}

.jo-project-form-upload .jo-tracker-file-input::file-selector-button {
    margin-right: 0.45rem;
    border: 0;
    border-right: 1px solid #d6e1ef;
    background: #f5f7fa;
    color: #475569;
    font-weight: 700;
    padding: 0.38rem 0.55rem;
}

/* Quotation reference input-group matches form rounded style */
.jo-project-form-grid .input-group .input-group-text {
    border-radius: 14px 0 0 14px;
    border-color: #d9e6f4;
    background: rgba(245, 247, 250, 0.96);
    font-size: 0.78rem;
    color: #334155;
    min-height: 40px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.jo-project-form-grid .input-group .btn {
    border-radius: 0 14px 14px 0;
    border-color: #d9e6f4;
    min-height: 40px;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Existing file list inside upload cells */
.jo-project-form-upload .jo-existing-files-list {
    border: 1px solid #d9e6f4;
    border-radius: 14px 14px 0 0;
    background: rgba(245, 247, 250, 0.96);
    padding: 0.3rem 0.55rem;
    margin-bottom: -1px;
}

.jo-project-form-upload .jo-existing-files-list + .jo-tracker-file-input {
    border-radius: 0 0 14px 14px;
    border-top-color: #d9e6f4;
}

.jo-project-form-upload:not(:has(.jo-existing-files-list)) .jo-tracker-file-input {
    border-radius: 14px;
}

.jo-project-form-full,
.jo-project-form-actions {
    grid-column: 1 / -1;
}

.jo-form-span2 {
    grid-column: span 2;
}

.jo-project-form-actions {
    display: flex;
    justify-content: flex-end;
}

.jo-existing-file {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.jo-existing-file input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.jo-attach-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.78rem;
    word-break: break-all;
}

.jo-attach-link:hover {
    text-decoration: underline;
}

.jo-attach-link .bi {
    font-size: 0.85rem;
}

.jo-project-card .btn-review-primary {
    min-width: 118px;
    border-radius: 14px;
    box-shadow: none;
    font-weight: 700;
}

.jo-project-form-upload .jo-tracker-file-input {
    max-width: 100%;
}

.jo-tracker-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0.35rem;
}

.jo-tracker-table {
    min-width: 2200px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.jo-tracker-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #eef4fb 0%, #e5edf7 100%);
    color: #22425f;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    border-bottom: 1px solid #cdd8e6;
    padding: 0.8rem 0.75rem;
}

.jo-tracker-table tbody td {
    font-size: 0.88rem;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid #e3ebf5;
    vertical-align: middle;
    color: #17324f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jo-tracker-table tbody tr:hover td {
    background: #f8fbff;
}

.jo-tracker-table td:first-child,
.jo-tracker-table th:first-child {
    text-align: center;
}

.jo-tracker-description {
    white-space: normal;
    line-height: 1.45;
}

.jo-tracker-action-cell {
    overflow: visible !important;
    white-space: normal !important;
    position: relative;
    z-index: 4;
}

.jo-tracker-action-cell .tracker-dropdown {
    display: inline-block;
    position: relative;
}

.jo-tracker-action-cell .tracker-dropdown-menu {
    z-index: 1065;
}

.jo-tracker-attachment-cell {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.jo-tracker-attachment-cell .form-control {
    min-width: 0;
}

.jo-tracker-file-input {
    max-width: 150px;
    font-size: 0.76rem;
    padding: 0.25rem 0.45rem;
}

.jo-tracker-file-input::file-selector-button {
    margin-right: 0.45rem;
    border: 0;
    border-right: 1px solid #d6e1ef;
    background: #f5f9ff;
    color: #1d4ed8;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
}

.jo-tracker-save-row td {
    padding: 0.55rem 0.75rem 0.85rem;
    background: #f8fbff;
    border-bottom: 1px solid #dbe7f4;
}

.jo-tracker-save-row td:hover {
    background: #f8fbff;
}

.jo-tracker-save-row form {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
}

.jo-tracker-save-cell {
    text-align: left;
    white-space: nowrap;
}

.jo-tracker-save-row .btn {
    min-width: 108px;
}

.jo-tracker-inline-action-cell form {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.jo-tracker-inline-action-cell .btn {
    min-width: 92px;
}

.jo-tracker-empty {
    color: transparent;
}

.jo-tracker-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.15rem;
    border-top: 1px solid #e4edf6;
}

.jo-tracker-page-pill {
    min-width: 120px;
    text-align: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: #eef4fb;
    color: #21405b;
    font-weight: 700;
    font-size: 0.88rem;
}

@media (max-width: 991px) {
    .jo-tracker-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jo-project-meta-grid,
    .jo-project-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jo-project-body,
    .jo-project-form-grid {
        grid-template-columns: 1fr;
    }

    .jo-form-span2 {
        grid-column: span 1;
    }

    .jo-project-card-header {
        flex-direction: column;
    }

    .jo-project-card-header-actions {
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .jo-tracker-cards {
        grid-template-columns: 1fr;
    }
}

.crm-shell {
    display: grid;
    gap: 1.25rem;
}

.crm-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.5rem 1.6rem;
    border: 1px solid #d8e5f3;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
    box-shadow: 0 20px 40px rgba(21, 47, 80, 0.06);
}

.crm-eyebrow {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4f6b8f;
    margin-bottom: 0.4rem;
}

.crm-title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: #18324d;
}

.crm-copy {
    margin: 0.45rem 0 0;
    max-width: 760px;
    color: #5a718d;
}

.crm-hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.crm-stat-card,
.crm-card,
.crm-detail-panel,
.crm-side-form {
    border: 1px solid #d8e5f3;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(16, 39, 66, 0.05);
}

.crm-stat-card {
    padding: 1.2rem 1.25rem;
    display: grid;
    gap: 0.2rem;
}

.crm-stat-card span {
    color: #5c7593;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.crm-stat-card strong {
    font-size: 2rem;
    line-height: 1;
    color: #18324d;
}

.crm-stat-card small {
    color: #7b8ea7;
}

.crm-card {
    padding: 1.25rem 1.35rem;
}

.crm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crm-card-head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #18324d;
}

.crm-card-head p {
    margin: 0.35rem 0 0;
    color: #67809e;
    font-size: 0.92rem;
}

.crm-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.crm-pipeline-item {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: #f7fbff;
    border: 1px solid #dce9f6;
    display: grid;
    gap: 0.22rem;
}

.crm-phase-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a91ac;
}

.crm-pipeline-item strong {
    color: #1b3653;
}

.crm-pipeline-item small {
    color: #617c98;
}

.crm-table thead th {
    color: #5a7696;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom-color: #dce7f3;
}

.crm-table tbody td {
    border-bottom-color: #e9f0f8;
    color: #213b57;
}

.crm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    background: #e9f4ff;
    color: #22598d;
    font-size: 0.82rem;
    font-weight: 700;
}

.crm-badge-muted {
    background: #f0f4f9;
    color: #48627e;
}

.crm-detail-panel,
.crm-side-form {
    padding: 1.1rem;
}

.crm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem 1rem;
}

.crm-detail-grid span,
.crm-notes-block span {
    display: block;
    margin-bottom: 0.2rem;
    color: #7087a2;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.crm-detail-grid strong {
    color: #17314d;
}

.crm-notes-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e3edf7;
}

.crm-notes-block p {
    margin: 0;
    color: #27425d;
}

.crm-side-form {
    display: grid;
    gap: 0.9rem;
}

.crm-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
    gap: 1rem;
}

.crm-list-stack {
    display: grid;
    gap: 0.8rem;
}

.crm-list-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: #f7fbff;
    border: 1px solid #dce9f6;
}

@media (max-width: 1199px) {
    .crm-stats-grid,
    .crm-pipeline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .crm-hero,
    .crm-card-head,
    .crm-list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-stats-grid,
    .crm-pipeline-grid,
    .crm-detail-grid {
        grid-template-columns: 1fr;
    }
}

.sales-shell-body {
    margin: 0;
    background: #f6f8fc;
    color: #0f172a;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.sales-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
}

.sales-sidebar {
    background: #ffffff;
    border-right: 1px solid #dde4ee;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 12px 14px;
}

.sales-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 14px;
}

.sales-brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3867f4;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

.sales-nav {
    display: grid;
    gap: 4px;
    align-content: start;
}

.sales-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    color: #17263a;
    text-decoration: none;
    font-size: 0.87rem;
}

.sales-nav-link:hover,
.sales-nav-link.active {
    background: #eaf1ff;
    color: #2457ec;
}

.sales-user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #f7f9fc;
}

.sales-user-avatar,
.sales-user-avatar-fallback {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.sales-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3867f4;
    color: #fff;
    font-weight: 700;
}

.sales-user-panel strong,
.sales-user-panel small {
    display: block;
}

.sales-user-panel small {
    color: #6d7d91;
    font-size: 0.75rem;
}

.sales-main {
    min-width: 0;
}

.sales-topbar {
    height: 42px;
    background: #fff;
    border-bottom: 1px solid #dde4ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
}

.sales-search {
    width: min(260px, 100%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 30px;
    border-radius: 8px;
    background: #f3f5f9;
    color: #8796ab;
}

.sales-search input,
.sales-search-large input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    color: #24364c;
    font-size: 0.82rem;
}

.sales-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sales-icon-btn {
    position: relative;
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #18283b;
}

.sales-icon-btn span {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sales-page-wrap {
    padding: 18px 16px 24px;
}

.sales-alert {
    margin-bottom: 14px;
}

.sales-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 16px;
}

.sales-page-header h1,
.sales-detail-title-row h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.sales-page-header p,
.sales-detail-title-row p {
    margin: 2px 0 0;
    color: #65758b;
    font-size: 0.84rem;
}

.sales-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    border: 0;
    background: #0f1224;
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

.sales-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.sales-kpi-card,
.sales-panel,
.sales-filter-card,
.sales-board-column,
.sales-progress-panel,
.sales-detail-screen {
    background: #fff;
    border: 1px solid #dde4ee;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sales-kpi-card {
    padding: 16px;
}

.sales-kpi-card.compact {
    padding: 14px 16px;
}

.sales-kpi-label {
    color: #6f8095;
    font-size: 0.74rem;
    margin-bottom: 18px;
}

.sales-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
}

.sales-kpi-value.small {
    font-size: 1.05rem;
}

.sales-kpi-meta {
    margin-top: 6px;
    color: #66778f;
    font-size: 0.75rem;
}

.sales-kpi-meta.positive {
    color: #14a44d;
}

.sales-probability-bar {
    margin-top: 10px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e7eef7;
    overflow: hidden;
}

.sales-probability-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

.sales-dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.sales-panel {
    padding: 16px;
}

.sales-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 16px;
}

.sales-panel-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.sales-panel-head span,
.sales-panel-head a {
    color: #6e7e93;
    font-size: 0.75rem;
    text-decoration: none;
}

.sales-trend-chart {
    height: 240px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
}

.sales-trend-col {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.sales-trend-bars {
    height: 200px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 6px;
}

.sales-trend-bar {
    width: 22px;
    border-radius: 8px 8px 0 0;
}

.sales-trend-bar.primary {
    background: #4a7be8;
}

.sales-trend-bar.secondary {
    background: #20b88a;
}

.sales-donut-wrap {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding-top: 8px;
}

.sales-donut {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    position: relative;
}

.sales-donut::after {
    content: "";
    position: absolute;
    inset: 24px;
    background: #fff;
    border-radius: 50%;
}

.sales-donut-legend {
    display: grid;
    gap: 8px;
    font-size: 0.82rem;
    color: #43556d;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
}

.dot.blue { background: #4a7be8; }
.dot.green { background: #1fc28b; }
.dot.amber { background: #f4a310; }
.dot.gray { background: #97a2b3; }

.sales-recent-list,
.sales-phase-list,
.sales-board-stack,
.sales-form-stack {
    display: grid;
    gap: 10px;
}

.sales-recent-item,
.sales-lead-card,
.sales-opportunity-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.sales-opportunity-card[draggable="true"] {
    cursor: grab;
}

.sales-opportunity-card.is-dragging {
    opacity: .65;
    transform: rotate(1deg);
    cursor: grabbing;
}

.sales-board-column.is-drop-target {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 18px;
}

.sales-board-column.is-drop-target .sales-board-stack {
    outline: 2px dashed rgba(37, 99, 235, 0.28);
    outline-offset: 6px;
    border-radius: 16px;
}

.sales-board-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sales-board-loader:not(.d-none) {
    pointer-events: auto;
}


.sales-board-loader-box {
    min-width: 240px;
    padding: 18px 22px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #d9e3f0;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
    display: flex;
    align-items: center;
    gap: 14px;
}

.sales-board-loader-text {
    color: #24324a;
    font-weight: 600;
}

.sales-recent-item strong,
.sales-opportunity-card strong,
.sales-lead-card strong {
    display: block;
    color: #101826;
}

.sales-recent-item small,
.sales-opportunity-card small,
.sales-lead-card small {
    color: #708095;
}

.sales-recent-right {
    text-align: right;
}

.sales-tag,
.sales-chip,
.sales-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.sales-tag,
.sales-chip {
    background: #f1f4f8;
    color: #4e6178;
}

.sales-status-pill {
    background: #e8f4ff;
    color: #2463eb;
}

.sales-status-pill.muted {
    background: #f0e9ff;
    color: #8657e6;
}

.sales-phase-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 120px;
    gap: 12px;
    align-items: center;
}

.sales-phase-copy {
    display: flex;
    align-items: center;
}

.sales-phase-track {
    height: 6px;
    background: #edf1f6;
    border-radius: 999px;
    overflow: hidden;
}

.sales-phase-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f5bb2b 0%, #4a7be8 50%, #1fc28b 100%);
}

.sales-detail-screen {
    padding: 16px;
    margin-bottom: 14px;
}

.sales-detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 14px;
}

.sales-back-link {
    margin-bottom: 8px;
}

.sales-back-link a {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-decoration: none;
}

.sales-detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sales-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.7fr);
    gap: 14px;
}

.sales-detail-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.sales-detail-two-col span,
.sales-detail-note span {
    display: block;
    font-size: 0.74rem;
    color: #78879a;
    margin-bottom: 3px;
}

.sales-detail-two-col strong {
    font-size: 0.92rem;
    color: #0f172a;
}

.sales-detail-note {
    border-top: 1px solid #e6ebf2;
    margin-top: 16px;
    padding-top: 16px;
}

.sales-detail-note p {
    margin: 0;
    color: #334155;
}

.sales-progress-panel {
    padding: 16px;
    margin-bottom: 14px;
}

.sales-progress-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sales-progress-bar {
    height: 8px;
    background: #e7ebf1;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sales-progress-bar span {
    display: block;
    height: 100%;
    background: #12162c;
}

.sales-progress-status {
    font-size: 0.78rem;
    color: #6d7d91;
}

.sales-filter-card {
    padding: 10px 14px 8px;
    margin-bottom: 12px;
}

.sales-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sales-filter-bar .sales-search-large {
    flex: 1 1 220px;
    min-width: 0;
}
.sales-filter-bar .sales-filter-select {
    flex: 0 0 auto;
    width: 140px;
}
.sales-filter-bar .sales-primary-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.sales-filter-bar .btn-outline-secondary {
    flex: 0 0 auto;
    white-space: nowrap;
}

.sales-search-large {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    border-radius: 8px;
    background: #f3f5f9;
    border: 1px solid #e2e8f0;
    padding: 0 12px;
    color: #93a0b1;
}

.sales-filter-pill {
    height: 40px;
    border-radius: 10px;
    background: #f7f8fb;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 0.8rem;
}

.sales-filter-select {
    min-width: 0;
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
}

.sales-filter-summary {
    color: #94a3b8;
    font-size: 12px;
}

/* ---- Opportunity view toggle ---- */
.sales-filter-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.opp-view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 3px;
}
.opp-view-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.opp-view-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.opp-view-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ---- Opportunity list view ---- */
.opp-list-view {
    margin-top: 14px;
}
.opp-list-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.opp-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}
/* Reset any card styles that bleed into table rows */
.opp-list-table tr,
.opp-list-table td {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}
.opp-list-table thead th {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 9px 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    white-space: nowrap;
    user-select: none;
    cursor: default;
}
.opp-list-table thead th.opp-col-sort {
    cursor: pointer;
}
.opp-list-table thead th.opp-col-sort:hover {
    background: #f1f5f9 !important;
    color: #475569;
}
.opp-sort-icon {
    font-size: 10px;
    opacity: 0.35;
    margin-left: 2px;
    transition: opacity 0.15s;
}
.opp-sort-icon.active-asc,
.opp-sort-icon.active-desc {
    opacity: 1;
    color: #3b82f6;
}
.opp-list-table tbody tr.opp-list-row {
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background 0.1s, opacity 0.35s ease, transform 0.35s ease;
}
.opp-list-table tbody tr.opp-list-row.is-saving {
    opacity: 0.5;
    pointer-events: none;
}
.opp-list-table tbody tr.opp-list-row.is-removing {
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
}
.opp-list-table tbody tr.opp-list-row:last-child {
    border-bottom: none !important;
}
.opp-list-table tbody tr.opp-list-row:hover {
    background: #f8fafc !important;
}
.opp-list-table tbody td {
    padding: 9px 12px !important;
    vertical-align: middle !important;
    line-height: 1.4;
    color: #334155;
}
.opp-col-right {
    text-align: right !important;
}
.opp-list-company {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 13px;
    display: block;
    line-height: 1.3;
}
.opp-list-company:hover {
    color: #3b82f6;
}
.opp-list-client {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 1px;
    display: block;
}
.opp-list-value {
    font-weight: 600;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.opp-list-date {
    color: #94a3b8;
    white-space: nowrap;
    font-size: 12px;
}
.opp-list-empty {
    color: #cbd5e1;
}
.opp-list-no-results {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 13px;
}
.opp-list-actions {
    white-space: nowrap;
    text-align: right !important;
}
.opp-list-actions .btn {
    font-size: 12px;
    padding: 3px 10px;
    line-height: 1.6;
}
.opp-list-row.is-saving {
    opacity: 0.6;
}
/* Win % badge */
.opp-win-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 1px 7px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.opp-win-badge.high   { background: #dcfce7; color: #16a34a; }
.opp-win-badge.medium { background: #fef9c3; color: #a16207; }
.opp-win-badge.low    { background: #fee2e2; color: #dc2626; }

.sales-board-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.sales-board-column {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    min-height: 520px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.sales-board-column:hover {
    border-color: #c8d5e6;
    background: #fbfdff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.sales-board-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2px 2px 10px;
    border-top: 3px solid #d1d9e6;
    border-radius: 12px 12px 0 0;
}

.sales-board-column[data-drop-status="New Opportunity"] {
    background: linear-gradient(180deg, #fff8eb 0%, #f8fafc 22%);
    border-color: #f6d18b;
}

.sales-board-column[data-drop-status="Technical Review"] {
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 22%);
    border-color: #bfd0ff;
}

.sales-board-column[data-drop-status="Costing Pricing"] {
    background: linear-gradient(180deg, #f2efff 0%, #f8fafc 22%);
    border-color: #cec3ff;
}

.sales-board-column[data-drop-status="Quoted"] {
    background: linear-gradient(180deg, #eafbf4 0%, #f8fafc 22%);
    border-color: #aee3ca;
}

.sales-board-column[data-drop-status="Follow-up & Negotiation"] {
    background: linear-gradient(180deg, #fff1f2 0%, #f8fafc 22%);
    border-color: #f3bcc4;
}

.sales-board-column[data-drop-status="Converted"] {
    background: linear-gradient(180deg, #eefcf7 0%, #f8fafc 22%);
    border-color: #9fe3c5;
}

.sales-board-column[data-drop-status="New Opportunity"] .sales-board-head {
    border-top-color: #f0ad2c;
}

.sales-board-column[data-drop-status="Technical Review"] .sales-board-head {
    border-top-color: #4a7be8;
}

.sales-board-column[data-drop-status="Costing Pricing"] .sales-board-head {
    border-top-color: #7c5cff;
}

.sales-board-column[data-drop-status="Quoted"] .sales-board-head {
    border-top-color: #20b88a;
}

.sales-board-column[data-drop-status="Follow-up & Negotiation"] .sales-board-head {
    border-top-color: #e06a7d;
}

.sales-board-column[data-drop-status="Converted"] .sales-board-head {
    border-top-color: #12805c;
}

.sales-board-head h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
}

.sales-board-head small,
.sales-board-head span {
    color: #6f8095;
    font-size: 0.68rem;
}

.sales-board-stack {
    gap: 10px;
}

.sales-opportunity-card {
    display: grid;
    gap: 10px;
    padding: 12px 12px 14px;
    border: 1px solid #dde5ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.sales-opportunity-card:hover {
    transform: translateY(-2px);
    border-color: #cad6e6;
    background: #fcfdff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.sales-opportunity-card.is-saving {
    opacity: 0.72;
    transform: none;
    pointer-events: none;
}

.sales-card-title-link {
    color: inherit;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
    transition: color 0.16s ease;
}

.sales-card-title-link:hover {
    color: #2459d8;
}

.sales-opportunity-ref {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.sales-opportunity-actions {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.sales-card-primary-link,
.sales-card-secondary-link {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sales-card-primary-link {
    background: #fff;
    border: 1px solid #cfd9e6;
    color: #101826 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    width: 100%;
}

.sales-card-primary-link i,
.sales-card-primary-link span {
    color: inherit !important;
}

.sales-card-primary-link i {
    font-size: 0.9rem;
}

.sales-card-primary-link:hover {
    border-color: #b9c7da;
    color: #101826 !important;
    background: #f8fafc;
    box-shadow: 0 8px 18px rgba(37, 89, 216, 0.08);
    transform: translateY(-1px);
}

.sales-board-column .sales-card-primary-link:visited,
.sales-board-column .sales-card-primary-link:active,
.sales-board-column .sales-card-primary-link:focus {
    color: #101826 !important;
    text-decoration: none;
}

.sales-card-secondary-link {
    color: #64748b;
    justify-content: flex-start;
    padding: 0;
    min-height: auto;
    font-weight: 600;
}

.sales-card-secondary-link:hover {
    color: #2459d8;
    text-decoration: none;
}

.sales-opportunity-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -2px;
}

.sales-card-status-editor {
    display: grid;
    gap: 8px;
}

.sales-card-sub-status-select,
.sales-card-lost-reason-select {
    min-height: 34px;
    border-radius: 10px;
    font-size: 0.72rem;
    color: #334155;
    border-color: #d9e2ee;
    background: #fbfdff;
}

.sales-card-sub-status-select:focus,
.sales-card-lost-reason-select:focus {
    border-color: #9fb8ea;
    box-shadow: 0 0 0 0.16rem rgba(37, 89, 216, 0.12);
}

.sales-sub-status-pill {
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #d7e0ec;
    background: #f8fafc;
    color: #516173;
    font-size: 0.62rem;
    font-weight: 700;
}

.sales-opportunity-meta-grid {
    display: grid;
    gap: 8px;
}

.sales-opportunity-top,
.sales-opportunity-footer,
.sales-lead-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.sales-opportunity-meta,
.sales-lead-inline {
    color: #6d7d91;
    font-size: 0.73rem;
    line-height: 1.4;
}

.sales-opportunity-meta i,
.sales-opportunity-probability i,
.sales-opportunity-money i {
    margin-right: 6px;
}

.sales-opportunity-footer {
    padding-top: 8px;
    border-top: 1px solid #e8edf4;
    align-items: center;
}

.sales-opportunity-money span,
.sales-opportunity-probability {
    color: #64748b;
    font-size: 0.73rem;
    font-weight: 600;
}

.sales-opportunity-probability {
    color: #16a34a;
    display: inline-flex;
    align-items: center;
}

.sales-status-pill {
    min-height: 24px;
    padding: 3px 9px;
    font-size: 0.62rem;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sales-status-pill[data-status="New Opportunity"] {
    background: #fff0cc;
    border-color: #f3cd75;
    color: #9a6700;
}

.sales-status-pill[data-status="Technical Review"] {
    background: #e8f0ff;
    border-color: #bed0ff;
    color: #2752b8;
}

.sales-status-pill[data-status="Costing Pricing"] {
    background: #efeaff;
    border-color: #cec0ff;
    color: #5d3fd3;
}

.sales-status-pill[data-status="Quoted"] {
    background: #e7faf1;
    border-color: #abdfc6;
    color: #0f8c63;
}

.sales-status-pill[data-status="Follow-up & Negotiation"] {
    background: #fff0f3;
    border-color: #f1bfca;
    color: #c04c67;
}

.sales-status-pill[data-status="Converted"] {
    background: #e4faf1;
    border-color: #9fd9bd;
    color: #0b6b4b;
}

.sales-tag {
    min-height: 24px;
    padding: 3px 9px;
    font-size: 0.62rem;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sales-opportunity-card:hover .sales-status-pill,
.sales-opportunity-card:hover .sales-tag {
    transform: translateY(-1px);
}

.sales-empty-card {
    padding: 14px;
    border: 1px dashed #d6dee9;
    border-radius: 12px;
    color: #7b889b;
    font-size: 0.82rem;
    text-align: center;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.sales-board-column:hover .sales-empty-card {
    border-color: #c8d5e6;
    background: #fbfdff;
}

.sales-lead-list {
    display: grid;
    gap: 12px;
}

.sales-lead-main,
.sales-lead-side {
    display: grid;
    gap: 6px;
}

.sales-lead-side {
    justify-items: end;
}

.sales-create-opportunity-card,
.sales-workflow-info {
    border: 1px solid #dde4ee;
    border-radius: 14px;
    background: #fff;
    padding: 16px;
}

.sales-create-opportunity-card {
    margin-bottom: 16px;
}

.sales-create-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}

.sales-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e6ebf2;
}

.sales-workflow-info {
    background: #eef5ff;
    border-color: #bdd4ff;
}

.sales-form-page {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.sales-tabs-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.sales-tab-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #d9e3f0;
    background: #fff;
    color: #4e6178;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.sales-tab-pill.active {
    background: #f3f7ff;
    border-color: #b8cdf7;
    color: #2459d8;
}

.sales-divider {
    height: 1px;
    margin: 14px 0;
    background: #e4ebf4;
}

.sales-mini-stack,
.sales-timeline-list,
.sales-lifecycle-list,
.sales-performance-grid {
    display: grid;
    gap: 12px;
}

body.page-engineer_opportunity_actions .sales-panel {
    border-color: rgba(216, 225, 237, 0.95);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

body.page-engineer_opportunity_actions .sales-panel-head {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(227, 234, 243, 0.9);
}

body.page-engineer_opportunity_actions .sales-panel-head h3 {
    color: #102338;
    font-size: 1rem;
    font-weight: 800;
}

body.page-engineer_opportunity_actions .sales-detail-two-col {
    gap: 14px 16px;
}

body.page-engineer_opportunity_actions .sales-detail-two-col > div {
    padding: 12px 14px;
    border: 1px solid rgba(228, 235, 243, 0.95);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

body.page-engineer_opportunity_actions .engineer-actions-card {
    border-color: rgba(219, 228, 239, 0.96) !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

body.page-engineer_opportunity_actions .engineer-actions-card:hover {
    transform: translateY(-1px);
    border-color: rgba(147, 197, 253, 0.95) !important;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

body.page-engineer_opportunity_actions .engineer-actions-card.border-primary,
body.page-engineer_opportunity_actions .engineer-actions-card.bg-light {
    background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%) !important;
    border-color: rgba(96, 165, 250, 0.9) !important;
}

body.page-engineer_opportunity_actions .badge.text-bg-light.border {
    padding: 0.46rem 0.66rem;
    border-color: rgba(209, 219, 233, 0.95) !important;
    background: #f8fbff !important;
    color: #35506b !important;
    font-weight: 700;
}

body.page-engineer_opportunity_actions .btn {
    border-radius: 12px;
}

.engineer-fsr-modal-dialog {
    max-height: calc(100vh - 2rem);
}

.engineer-fsr-modal-content {
    max-height: calc(100vh - 2rem);
}

.engineer-fsr-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.engineer-fsr-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-engineer_opportunity_actions .sales-primary-btn {
    background: linear-gradient(135deg, #102338 0%, #1f4b7a 100%);
    box-shadow: 0 10px 18px rgba(16, 35, 56, 0.16);
}

body.page-engineer_opportunity_actions .sales-primary-btn:hover {
    color: #fff;
    transform: translateY(-1px);
}

body.page-engineer_opportunity_actions .engineer-actions-worklist .sales-mini-stack {
    gap: 10px;
}

body.page-engineer_opportunity_actions .engineer-actions-worklist .sales-mini-stack::-webkit-scrollbar {
    width: 10px;
}

body.page-engineer_opportunity_actions .engineer-actions-worklist .sales-mini-stack::-webkit-scrollbar-thumb {
    background: rgba(159, 173, 191, 0.75);
    border-radius: 999px;
    border: 2px solid #f7faff;
}

body.page-engineer_opportunity_actions .engineer-actions-filters {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

body.page-engineer_opportunity_actions .engineer-actions-detail {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 252, 255, 0.98) 100%);
}

body.page-engineer_opportunity_actions .sales-required-doc {
    border-color: rgba(223, 231, 241, 0.95);
    background: #f9fbfd;
}

.sales-required-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e5ebf3;
    border-radius: 10px;
    background: #fbfdff;
    font-size: 0.83rem;
    color: #334155;
}

.sales-timeline-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.sales-timeline-item p,
.sales-timeline-item small {
    margin: 0;
}

.sales-timeline-item p {
    color: #4f5f74;
    font-size: 0.82rem;
}

.sales-timeline-item small {
    color: #7b889b;
    font-size: 0.74rem;
}

.sales-timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: #4a7be8;
    box-shadow: 0 0 0 4px rgba(74, 123, 232, 0.14);
}

.sales-lifecycle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.sales-lifecycle-item.current .sales-lifecycle-copy strong {
    color: #16a34a;
}

.sales-lifecycle-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
}

.sales-lifecycle-item.current .sales-lifecycle-icon {
    background: #e8fff0;
    color: #16a34a;
}

.sales-lifecycle-copy {
    display: grid;
    gap: 2px;
}

.sales-lifecycle-copy small {
    color: #7b889b;
    font-size: 0.74rem;
}

.sales-filter-bar.executive {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-panel-alert {
    border-color: #f5c2c7;
    background: #fff7f7;
}

.sales-alert-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #f4d2d5;
    border-radius: 12px;
    background: #fff;
}

.sales-alert-row small {
    display: block;
    color: #7b889b;
    margin-top: 2px;
}

.sales-performance-card {
    padding: 14px;
    border: 1px solid #e4ebf4;
    border-radius: 12px;
    background: #fbfdff;
}

.sales-performance-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.sales-performance-head span {
    color: #16a34a;
    font-size: 0.75rem;
    font-weight: 700;
}

.sales-performance-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sales-performance-metrics small {
    display: block;
    color: #7b889b;
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.sales-performance-metrics strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.quotation-table th {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.quotation-table td {
    vertical-align: middle;
}

.quotation-table {
    table-layout: auto;
    min-width: 1320px;
    width: max-content;
    max-width: none;
}

.sales-create-opportunity-card .table-responsive,
.sales-panel .table-responsive,
.sales-opportunity-modal-body .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.sales-create-opportunity-card,
.sales-panel,
.sales-opportunity-modal-body,
.sales-embedded-page {
    min-width: 0;
    overflow-x: hidden;
}

.quotation-table td .form-control,
.quotation-table td .form-select {
    min-width: 96px;
}

.quotation-table td .canvass-item-description,
.quotation-table td .quotation-item-description {
    min-width: 180px;
}

.quotation-table td .canvass-item-qty,
.quotation-table td .quotation-item-qty {
    min-width: 72px;
}

.quotation-table td .canvass-item-purchase-price,
.quotation-table td .canvass-item-fsp-price,
.quotation-table td .canvass-item-total,
.quotation-table td .quotation-item-unit-price,
.quotation-table td .quotation-item-markup,
.quotation-table td .quotation-item-unit-total,
.quotation-table td .quotation-item-total {
    min-width: 110px;
}

.quotation-table td input[type="url"] {
    min-width: 140px;
}

.quotation-table td input[type="file"] {
    min-width: 180px;
}

.quotation-grand-total-card {
    margin-top: 14px;
    margin-left: auto;
    width: min(320px, 100%);
    border: 1px solid #b8cdf7;
    border-radius: 14px;
    background: #eef5ff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quotation-grand-total-card span {
    color: #1e3a5f;
    font-weight: 700;
}

.quotation-grand-total-card strong {
    color: #2459d8;
    font-size: 1.15rem;
}

.sales-quotation-list {
    display: grid;
    gap: 12px;
}

.sales-quotation-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #e4ebf4;
    border-radius: 12px;
    background: #fbfdff;
    text-decoration: none;
    color: inherit;
}

.sales-quotation-main,
.sales-quotation-side {
    display: grid;
    gap: 4px;
}

.sales-quotation-remark {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 2px;
    padding: 4px 9px;
    border-radius: 8px;
    background: #fef9c3;
    border: 1px solid #fde68a;
    color: #78350f;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.4;
}

.sales-quotation-remark-label {
    font-weight: 800;
    font-style: normal;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
    white-space: nowrap;
}

.sales-quotation-main small,
.sales-quotation-side small {
    color: #748396;
}

.sales-quotation-side {
    text-align: right;
    justify-items: end;
}

.executive-table thead th {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sales-workflow-info p,
.sales-workflow-info ul {
    margin: 0 0 10px;
    color: #27405f;
    font-size: 0.84rem;
}

.sales-workflow-info ul {
    padding-left: 18px;
}

.sales-opportunity-modal {
    max-width: 980px;
    height: calc(100vh - 2rem);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

#createOpportunityModal:not(.show),
#createQuotationModal:not(.show) {
    display: none;
    pointer-events: none;
}

#createOpportunityModal.show,
#createQuotationModal.show {
    display: block;
}

.sales-opportunity-modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

.sales-opportunity-modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.sales-opportunity-modal-header {
    padding: 18px 20px 10px;
    border-bottom: 0;
    align-items: flex-start;
}

.sales-opportunity-modal-header .modal-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 3px;
}

.sales-opportunity-modal-body {
    padding: 8px 20px 20px;
    background: #f8fbff;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.sales-quotation-modal-shell {
    max-width: 1400px;
}

.sales-embedded-frame {
    display: block;
    width: 100%;
    min-height: 82vh;
    border: 0;
    background: #f8fbff;
}

@media (max-width: 1199px) {
    .sales-shell {
        grid-template-columns: 1fr;
    }

    .sales-sidebar {
        display: none;
    }

    .sales-kpi-grid,
    .sales-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-dashboard-panels,
    .sales-detail-grid,
    .sales-filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .sales-page-wrap {
        padding: 14px 10px 20px;
    }

    .sales-page-header,
    .sales-detail-title-row,
    .sales-opportunity-top,
    .sales-opportunity-footer,
    .sales-lead-card {
        flex-direction: column;
    }

    .sales-kpi-grid,
    .sales-board-grid,
    .sales-detail-two-col {
        grid-template-columns: 1fr;
    }

    .sales-phase-row {
        grid-template-columns: 1fr;
    }
}

/* ── Opportunity Files Tab ──────────────────────────────── */
.opp-files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.opp-file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-bottom: 1px solid #f0f4f8;
    transition: background 120ms ease;
}

.opp-file-row:last-child { border-bottom: none; }
.opp-file-row:hover { background: #f8fafc; }

.opp-file-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.opp-file-icon-quotation  { background: #eff6ff; color: #2563eb; }
.opp-file-icon-bom        { background: #f0fdf4; color: #16a34a; }
.opp-file-icon-bom-final  { background: #fefce8; color: #ca8a04; }
.opp-file-icon-fsr        { background: #fdf4ff; color: #9333ea; }
.opp-file-icon-canvass    { background: #fff7ed; color: #ea580c; }

.opp-file-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opp-file-info strong {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opp-file-info span {
    font-size: 11.5px;
    color: #64748b;
}

.opp-file-meta {
    font-size: 11px !important;
    color: #94a3b8 !important;
}

.opp-file-status {
    display: inline-block;
    font-size: 11px !important;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    width: fit-content;
}

.opp-file-status-approved { background: #dcfce7; color: #15803d; }
.opp-file-status-pending  { background: #fef9c3; color: #92400e; }
.opp-file-status-none     { background: #f1f5f9; color: #94a3b8; }

.opp-file-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.opp-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    background: #1e3a5f;
    color: #fff;
    border: 1px solid #1e3a5f;
    white-space: nowrap;
    transition: background 120ms ease;
}

.opp-file-btn:hover { background: #162d4a; color: #fff; }

.opp-file-btn-outline {
    background: #fff;
    color: #1e3a5f;
    border-color: #cbd5e1;
}

.opp-file-btn-outline:hover { background: #f1f5f9; color: #1e3a5f; }

.opp-file-btn-disabled {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    cursor: default;
}


/* ── Notification Bell & Panel ─────────────────────────────── */
.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.notif-bell-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
.notif-bell-btn .bi-bell-fill { color: #2563eb; }
.notif-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    pointer-events: none;
}
.notif-panel {
    border: 1.5px solid #e2e8f0;
    border-radius: 16px !important;
    box-shadow: 0 12px 40px rgba(15,23,42,0.13), 0 2px 8px rgba(15,23,42,0.06);
    overflow: hidden;
}
.notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1.5px solid #f1f5f9;
    background: #fff;
}
.notif-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.01em;
}
.notif-panel-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}
.notif-markread-btn {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.notif-markread-btn:hover { background: #dbeafe; }
.notif-list {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    color: #94a3b8;
    font-size: 13px;
}
.notif-empty-icon { font-size: 28px; opacity: 0.4; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item--unread { background: var(--ni-bg, #f8fafc); }
.notif-item--unread:hover { filter: brightness(0.97); }
.notif-item-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 1px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}
.notif-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    margin-top: 6px;
}

/* Inventory Catalog */
.inv-badge-active {
    background: var(--success);
    color: #fff;
}
.inv-badge-inactive {
    background: var(--text-soft);
    color: #fff;
}
.inv-badge-low-stock {
    background: var(--warning);
    color: #fff;
}
.inv-col-sort {
    color: inherit;
    text-decoration: none;
}
.inv-sort-icon {
    opacity: 0.35;
    margin-left: 4px;
}
.inv-sort-icon.active-asc,
.inv-sort-icon.active-desc {
    opacity: 1;
    color: var(--primary-blue);
}
.archive-empty {
    text-align: center;
    padding: 72px 24px;
}
.archive-empty i {
    display: block;
    font-size: 2.8rem;
    color: #cbd5e1;
    margin-bottom: 14px;
}
.archive-empty h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
}
.archive-empty p {
    margin: 0;
    font-size: .83rem;
    color: #94a3b8;
}

/* PERP-30 Phase 14: rotate the layers chevron when a row is expanded */
.inv-layer-toggle .bi-chevron-right { display: inline-block; transition: transform .15s; }
.inv-layer-toggle[aria-expanded="true"] .bi-chevron-right { transform: rotate(90deg); }

/* FOF warehouse review modal (2026-09-24): full-screen Warehouse Manager review on supply_final_order_form.php --
   the Client PO from Sales on top, the Final Order Form, then the Warehouse decision; buttons pinned in the footer. */
.fof-wh-modal .modal-body { background: var(--bg); padding: 1rem 1.25rem; }
.fof-wh-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.fof-wh-section-title { font-weight: 700; color: var(--text-main); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .03em; font-size: .85rem; }
.fof-wh-subtitle { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; color: var(--text-main); }
.fof-wh-po-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem 1rem; margin-bottom: .75rem; }
.fof-wh-po-fields dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; color: var(--text-soft); margin: 0; }
.fof-wh-po-fields dd { margin: 0; font-weight: 600; color: var(--text-main); overflow-wrap: anywhere; }
.fof-wh-po-notes { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; margin-bottom: .75rem; font-size: .9rem; }
.fof-wh-desc { white-space: normal; overflow-wrap: anywhere; min-width: 220px; }
.fof-wh-po-totals { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .92rem; }
.fof-wh-po-grand { font-size: 1rem; margin-top: .2rem; }
.fof-wh-attachment { height: 60vh; min-height: 320px; border: 1px solid var(--border); border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fof-wh-attachment iframe { width: 100%; height: 100%; border: 0; }
.fof-wh-attachment img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fof-wh-attachment-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--text-soft); text-align: center; padding: 1rem; }
.fof-wh-attachment-empty .bi { font-size: 2rem; }
.fof-wh-fof-summary { margin-left: auto; }
.fof-wh-footer { justify-content: space-between; align-items: flex-end; gap: .75rem; background: var(--surface); box-shadow: 0 -2px 8px rgba(15, 23, 42, .06); }
.fof-wh-reason { flex: 1 1 360px; max-width: 640px; }
@media (max-width: 1199.98px) {
    .fof-wh-attachment { height: 50vh; }
}
@media (max-width: 575.98px) {
    .fof-wh-modal .modal-body { padding: .75rem; }
    .fof-wh-footer > * { flex: 1 1 100%; max-width: none; }
    .fof-wh-footer .btn { flex: 1 1 auto; }
}
/* PERP-47: Correct Description mode and the "Corrected by Warehouse" history. */
.fof-wh-correct-note { background: #fff8e6; border: 1px solid #f5d98c; border-radius: 8px; padding: .5rem .75rem; margin-bottom: .5rem; font-size: .85rem; }
.fof-wh-correct-bar { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; margin: .5rem 0; }
.fof-wh-history summary { cursor: pointer; padding: .35rem 0; }
.fof-wh-history .fof-wh-corrections { font-size: .85rem; }
/* PERP-48: split / merge-back controls and the "Split from line N" marker. */
.fof-split-marker { font-size: .72rem; color: var(--text-soft); font-style: italic; white-space: nowrap; }
.fof-split-marker:empty { display: none; }
.fof-split-row > td:first-child { border-left: 3px solid #93c5fd; }
.fof-wh-line-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; margin-top: .25rem; text-align: left; }
.fof-wh-split summary { font-size: .8rem; color: var(--primary-blue); cursor: pointer; list-style: none; text-align: right; }
.fof-wh-split summary::-webkit-details-marker { display: none; }
.fof-wh-split-body { display: flex; flex-direction: column; gap: .2rem; min-width: 150px; padding: .4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-soft); margin-top: .25rem; }
/* PERP-49: the Client PO check and link suggestions in the Warehouse review. */
.fof-wh-po-check { border-radius: 8px; padding: .6rem .75rem; margin-bottom: .75rem; font-size: .88rem; }
.fof-wh-po-check.is-ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.fof-wh-po-check.is-bad { background: #fef2f2; border: 1px solid #fecaca; }
.fof-wh-suggested { font-size: .72rem; color: #92400e; margin-top: .15rem; }
/* PERP-49 fix (2026-09-25): a refused Approve reopens the review on the Client PO check and outlines it; the unlinked
   line selects are outlined too, so the Warehouse Manager sees where to act. */
.fof-wh-po-check.is-focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .35); }
.fof-wh-link-missing { outline: 2px solid #dc2626; outline-offset: 1px; }

/* PERP-52 (2026-09-25): the Client PO modal on Client PO Monitoring (#bpoModal) is full screen in every mode. The form is
   on the left, the attached client PO on the right; in view mode every field is read-only. */
.bpo-modal .modal-content { height: 100%; }
.bpo-modal form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.bpo-modal .modal-body { overflow-y: auto; min-height: 0; }
.bpo-modal .modal-footer { flex-shrink: 0; }
.bpo-client-box { background: #f8fafc; border: 1px solid #e4eaf3; border-radius: 10px; padding: 12px 14px; }
.bpo-total-box { text-align: right; border-top: 1px solid #e4eaf3; padding-top: 12px; margin-top: 12px; }
.bpo-total-line { font-size: .95rem; }
.bpo-item-box { border: 1px solid #e4eaf3; border-radius: 10px; padding: 12px 14px; }
/* PERP-116: the status strip under a Client PO line in the view */
.bpo-item-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 10px -14px -12px; padding: 8px 14px; border-top: 1px dashed #e4eaf3; border-radius: 0 0 10px 10px; background: #f8fafd; font-size: .8125rem; color: #5b6b85; }
.bpo-item-status strong { color: #1d2a44; font-variant-numeric: tabular-nums; }
.bpo-attachment-pane { position: sticky; top: 0; }
.bpo-attachment-pane .fof-wh-attachment { height: calc(100vh - 230px); min-height: 360px; }
.bpo-modal.is-view .form-control[readonly],
.bpo-modal.is-view .form-control:disabled,
.bpo-modal.is-view .form-select:disabled { background: #f8fafc; color: var(--text-main); opacity: 1; }
.bpo-modal.is-view .bpo-create-only { display: none !important; }
.bpo-modal:not(.is-view) .bpo-view-only { display: none !important; }
@media (max-width: 1199.98px) {
    .bpo-attachment-pane { position: static; }
    .bpo-attachment-pane .fof-wh-attachment { height: 60vh; }
}

/* PERP-140 (2026-10-02): phone width -- the top bar fits the screen on every page (the Account button was cut off at 390 px). */
@media (max-width: 575.98px) {
    .main-content { min-width: 0; }
    .top-navbar-inner { padding: 0.65rem 1rem; gap: 0.5rem; }
    .topbar-copy { min-width: 0; flex: 1 1 auto; gap: 0.6rem; }
    .topbar-copy > div { min-width: 0; }
    .page-title { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-subtitle, .breadcrumb-shell { display: none; }
    .topbar-actions { flex: 0 0 auto; gap: 0.4rem; }
    .topbar-actions .btn { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* Final BOM vs Actual, side by side (2026-10-04, plan .planning/workstreams/final-bom-actual-side-by-side/PLAN.md): one-line rows of a fixed height on both
   cards so row N of the Final BOM card sits level with row N of the Actual card. Display only. */
.final-bom-side-by-side .fbs-table {
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0.4rem;
    background: rgba(255, 255, 255, 0.72);
}
.final-bom-side-by-side .fbs-table th,
.final-bom-side-by-side .fbs-table td {
    height: 2.1rem;
    padding: 0.25rem 0.45rem;
    font-size: 0.76rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.final-bom-side-by-side .fbs-table th {
    font-size: 0.7rem;
    color: #3b4a5f;
    text-transform: none;
}
.final-bom-side-by-side .fbs-table tfoot td {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #c9d6e6;
}
.final-bom-side-by-side .fbs-card h6 {
    margin: 0.9rem 0 0.35rem;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #51627a;
}
.final-bom-side-by-side .fbs-subtitle {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #51627a;
    height: 1.2rem;
}
.final-bom-side-by-side .fbs-grand {
    margin-top: 0.8rem;
    font-size: 0.92rem;
    min-height: 1.4rem;
}
.final-bom-side-by-side .fbs-table .badge {
    font-size: 0.62rem;
    font-weight: 600;
}

/* Client PO Notes visible in every process: the Sales instruction block and the "Sales note" chip (includes/client_po_notes.php) */
.cpn-banner { background: #fff8e1; border: 1px solid #f0c36d; border-left: 4px solid #e0a100; border-radius: 8px; padding: .5rem .75rem; margin-bottom: .75rem; font-size: .9rem; }
.cpn-banner-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8a5a00; margin-bottom: .25rem; }
.cpn-banner-row + .cpn-banner-row { margin-top: .4rem; padding-top: .4rem; border-top: 1px dashed #f0c36d; }
.cpn-banner-po { font-weight: 700; color: var(--text-main); margin-right: .35rem; }
.cpn-banner-text { overflow-wrap: anywhere; white-space: normal; color: var(--text-main); }
.cpn-chip { position: relative; display: inline-block; vertical-align: middle; }
.cpn-chip > summary { list-style: none; cursor: pointer; display: inline-block; background: #fff8e1; border: 1px solid #f0c36d; color: #8a5a00; border-radius: 999px; padding: 0 .5rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.cpn-chip > summary::-webkit-details-marker { display: none; }
.cpn-pop { position: absolute; z-index: 40; left: 0; top: 100%; margin-top: .25rem; min-width: 240px; max-width: 340px; background: #fff8e1; border: 1px solid #f0c36d; border-radius: 8px; padding: .5rem .65rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); font-size: .85rem; font-weight: 400; white-space: normal; overflow-wrap: anywhere; color: var(--text-main); text-align: left; }
.cpn-pop-row + .cpn-pop-row { margin-top: .35rem; }
