@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%);
}

a {
    text-decoration: none;
}

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

.sidebar-overlay.show {
    display: block;
}

.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;
    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);
}

.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;
}

.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;
}

.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);
}

.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.7rem 0.85rem;
}

.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;
}

.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;
}

.tracker-status-btn {
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
}

.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);
}

.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-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;
}

.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;
}

.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;
}

.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;
    }
}

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

    .topbar-date {
        display: none;
    }

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

    .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;
    }
}

.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;
}

