:root {
    --ink: #192334;
    --muted: #6e7a8b;
    --primary: #315bdb;
    --primary-deep: #2548b6;
    --soft-blue: #eaf0ff;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --line: #e5eaf2;
    --success: #167b57;
    --amber: #a96b00;
    --rose: #bc355d;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
    min-height: 74px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.navbar-brand { color: var(--ink); }
.navbar-brand:hover { color: var(--ink); }
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    color: white;
    background: linear-gradient(145deg, #406be4, #233fa1);
    border-radius: 11px;
    place-items: center;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.brand-name { font-size: .9rem; font-weight: 750; line-height: 1.1; }
.brand-caption { color: var(--muted); font-size: .65rem; letter-spacing: .03em; }
.navbar .nav-link { color: #617083; font-size: .9rem; font-weight: 600; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--primary); }
.user-menu { padding: .35rem .5rem; color: var(--ink); border: 1px solid var(--line); background: white; }
.user-menu:hover { color: var(--ink); border-color: #cbd4e3; }
.user-initials { display: grid; width: 29px; height: 29px; color: #2649b0; background: var(--soft-blue); border-radius: 50%; place-items: center; font-size: .72rem; font-weight: 800; }
.user-role { color: var(--muted); font-size: .67rem; line-height: 1.2; }

.page-shell { width: min(1440px, 100%); margin: 0 auto; padding-right: 1.25rem; padding-left: 1.25rem; }
.eyebrow { color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-title { margin: .35rem 0 .35rem; font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 750; letter-spacing: -.035em; }
.page-subtitle { color: var(--muted); font-size: .96rem; }
.back-link { color: var(--muted); font-size: .85rem; font-weight: 650; text-decoration: none; }
.back-link::before { content: "← "; }
.back-link:hover { color: var(--primary); }

.btn { border-radius: .55rem; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-deep); --bs-btn-hover-border-color: var(--primary-deep); --bs-btn-active-bg: var(--primary-deep); --bs-btn-active-border-color: var(--primary-deep); }
.form-control, .form-select { min-height: 42px; color: var(--ink); border-color: #d9e0ea; border-radius: .55rem; }
.form-control:focus, .form-select:focus { border-color: #94a9ea; box-shadow: 0 0 0 .2rem rgba(49, 91, 219, .13); }
.form-label { margin-bottom: .38rem; color: #3c4859; font-size: .85rem; font-weight: 700; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

.multi-select {
    position: relative;
    width: 100%;
}

.multi-select-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    border: 1px solid #d6d8de;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
}

.multi-select-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eef2ff;
    color: #1f2937;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.2rem 0.55rem 0.2rem 0.7rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.multi-select-remove {
    border: 0;
    background: transparent;
    color: #374151;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.multi-select-search {
    border: 0;
    box-shadow: none;
    background: transparent;
    flex: 1 1 120px;
    min-width: 120px;
    padding: 0.3rem 0.1rem;
}

.multi-select-search:focus {
    outline: none;
}

.multi-select-menu {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d6d8de;
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 0.35rem;
    display: none;
}

.multi-select.open .multi-select-menu {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.4rem;
    cursor: pointer;
    color: #1f2937;
}

.multi-select-option:hover,
.multi-select-option.is-selected {
    background: #f3f4f6;
}

.multi-select-option input {
    margin: 0;
}

.multi-select-empty {
    padding: 0.6rem 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.metric-card {
    min-height: 148px;
    padding: 1.3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(19, 37, 70, .04);
}
.metric-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.metric-card strong { display: block; margin: .5rem 0 .35rem; font-size: 2rem; line-height: 1; letter-spacing: -.05em; }
.metric-note { color: #93a0af; font-size: .76rem; }
.metric-amber { border-top: 3px solid #edb752; }
.metric-blue { border-top: 3px solid #6e90f2; }
.metric-rose { border-top: 3px solid #eb8aa4; }

.surface-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 8px 24px rgba(19, 37, 70, .04); }
.surface-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.35rem 1.05rem; }
.surface-card-header h2 { margin: 0 0 .2rem; font-size: 1rem; font-weight: 750; }
.surface-card-header p { margin: 0; color: var(--muted); font-size: .82rem; }
.filter-bar { padding: 1.1rem 1.35rem; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.form-aside { top: 1rem; padding-bottom: 1.35rem; }
.form-aside > :not(.surface-card-header) { margin-right: 1.35rem; margin-left: 1.35rem; }

.app-table { font-size: .86rem; }
.app-table thead th { padding: .8rem 1.35rem; color: #000; background: #fbfcfe; border-bottom-color: var(--line); font-size: 14px; letter-spacing: .06em; white-space: nowrap; }
.app-table tbody td { padding: .95rem 1.35rem; border-bottom-color: #edf0f5; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fafbfe; }

.etc-brand-table { min-width: 760px; table-layout: fixed; }
.etc-brand-table .etc-brand-column { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; }
.etc-brand-table thead .etc-brand-column { z-index: 2; background: #fbfcfe; }
.etc-brand-table .etc-stage-column { width: 72px; padding: .45rem .3rem; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.etc-brand-table thead .etc-stage-column { font-size: 12px; line-height: 1.15; }
.etc-brand-table tbody .etc-stage-column { font-size: .78rem; }
.etc-brand-table tbody tr:hover .etc-brand-column { background: #fafbfe; }
.order-link { color: var(--primary); font-weight: 750; text-decoration: none; }
.order-link:hover { color: var(--primary-deep); text-decoration: underline; }
.etc-brand-link { color: inherit; text-decoration: none; }
.etc-brand-link:hover { color: var(--primary); text-decoration: underline; }
.status-pill, .priority { display: inline-flex; align-items: center; padding: .27rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 750; line-height: 1; text-transform: capitalize; white-space: nowrap; }
.status-draft { color: #5d697b; background: #edf0f5; }
.status-submitted { color: #906000; background: #fff1d4; }
.status-in_progress { color: #2853bd; background: #e9efff; }
.status-returned { color: #ae3150; background: #ffebf0; }
.status-on_hold { color: #7351a4; background: #f0eaff; }
.status-completed { color: #137452; background: #e4f7ef; }
.priority-low { color: #5b697a; background: #edf0f5; }
.priority-normal { color: #2853bd; background: #e9efff; }
.priority-high { color: #9a6300; background: #fff2d7; }
.priority-urgent { color: #b4294d; background: #ffe7ee; }

.queue-list { padding: 0 .4rem .5rem; }
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .82rem .95rem; border-top: 1px solid #eff2f6; }
.queue-row:first-child { border-top: 0; }
.queue-row strong { display: block; font-size: .84rem; }
.queue-row small { display: block; margin-top: .1rem; color: var(--muted); font-size: .72rem; }
.queue-sequence { display: inline-block; width: 24px; color: #a1adbd; font-size: .68rem; font-weight: 800; }
.queue-count { display: grid; min-width: 28px; height: 28px; color: #3553ac; background: #edf2ff; border-radius: 8px; place-items: center; font-size: .78rem; font-weight: 800; }
.empty-state { padding: 2rem 1.35rem; color: var(--muted); font-size: .9rem; text-align: center; }

.workflow-line { display: flex; min-width: max-content; padding: 1.4rem 1.25rem; }
.workflow-step { position: relative; width: 80px; padding-right: 1rem; text-align: center; }
.workflow-step.repeat-hidden { display: none; }
.workflow-stage-link { display: block; color: inherit; text-decoration: none; }
.workflow-stage-link[aria-disabled="true"] { cursor: default; }
.workflow-stage-link:not([aria-disabled="true"]):hover strong { color: var(--primary); }
.workflow-stage-link:focus-visible { border-radius: .35rem; outline: 2px solid var(--primary); outline-offset: 4px; }
.workflow-step:not(:last-child)::after { position: absolute; top: 15px; left: calc(50% + 16px); width: calc(100% - 32px); height: 2px; background: #e1e7f0; content: ""; }
.workflow-dot { position: relative; z-index: 1; display: grid; width: 31px; height: 31px; margin: 0 auto .5rem; color: #8794a7; background: #edf1f6; border-radius: 50%; place-items: center; font-size: .72rem; font-weight: 800; }
.workflow-step strong { display: block; font-size: .76rem; }
.workflow-step small { display: block; margin-top: .15rem; color: var(--muted); font-size: .65rem; }
.workflow-step.current .workflow-dot { color: white; background: var(--primary); box-shadow: 0 0 0 5px #e8eeff; }
.workflow-step.current strong { color: var(--primary); }
.workflow-step.complete .workflow-dot { color: white; background: var(--success); }
.workflow-step.complete:not(:last-child)::after { background: #8dd5b9; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 1.35rem; gap: 1.5rem 1rem; }
.detail-grid span, .detail-label { display: block; margin-bottom: .28rem; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.detail-grid strong { display: block; font-size: .88rem; }
.detail-grid small { display: block; margin-top: .18rem; color: var(--muted); font-size: .76rem; }
.text-preline { white-space: pre-line; }
.activity-list { padding: 0 1.35rem 1.35rem; }
.stage-update-data { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stage-update-data > div { min-width: 0; }
.stage-update-data span { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.stage-update-data strong, .stage-update-data p { color: var(--ink); font-size: .9rem; }
.stage-update-remarks { grid-column: 1 / -1; }
.r-and-d-editor-toolbar { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.r-and-d-formula-editor { min-height: 220px; padding: .85rem 1rem; overflow-wrap: anywhere; white-space: pre-wrap; background: #fff; border: 1px solid #d9e0ea; border-radius: .55rem; }
.r-and-d-formula-editor:focus { border-color: #94a9ea; outline: 0; box-shadow: 0 0 0 .2rem rgba(49, 91, 219, .13); }
.r-and-d-formula-editor:empty::before { color: var(--muted); content: attr(data-placeholder); pointer-events: none; }
.stage-formula-content { overflow-wrap: anywhere; white-space: pre-wrap; }
.stage-formula-content table { width: 100%; border-collapse: collapse; }
.stage-formula-content th, .stage-formula-content td { padding: .4rem .55rem; border: 1px solid var(--line); }
@media (max-width: 767.98px) { .stage-update-data { grid-template-columns: 1fr; } .stage-update-remarks { grid-column: auto; } }
.activity-item { position: relative; display: flex; gap: .95rem; padding: .15rem 0 1.4rem; }
.activity-item:last-child { padding-bottom: 0; }
.activity-item:not(:last-child)::before { position: absolute; top: 17px; bottom: 0; left: 6px; width: 1px; background: #dbe2ed; content: ""; }
.activity-marker { position: relative; z-index: 1; flex: 0 0 13px; height: 13px; margin-top: .2rem; background: #8ba4eb; border: 3px solid #eaf0ff; border-radius: 50%; }
.activity-item strong { font-size: .85rem; }
.activity-item p { color: #536073; font-size: .83rem; }
.activity-item small { color: var(--muted); font-size: .72rem; }
.summary-list { padding: 0 1.35rem 1.35rem; }
.summary-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-top: 1px solid #eef1f5; }
.summary-list dt { color: var(--muted); font-size: .76rem; font-weight: 600; }
.summary-list dd { margin: 0; color: #364255; font-size: .78rem; font-weight: 700; text-align: right; }

.admin-count { color: var(--primary); background: var(--soft-blue); border-radius: 7px; font-size: .72rem; font-weight: 800; padding: .2rem .45rem; }
.checkbox-list { display: grid; gap: .6rem; padding: .95rem; border: 1px solid #d9e0ea; border-radius: .55rem; }
.checkbox-list .form-check { margin: 0; }
.checkbox-list .form-check-label { color: #3c4859; font-size: .84rem; }
.form-section { padding: 1.35rem; }

.login-page { min-height: 100vh; background: #172455; }
.login-wrap { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; }
.login-panel { display: grid; width: min(1050px, 100%); min-height: 620px; overflow: hidden; background: white; border-radius: 1.3rem; grid-template-columns: 1.05fr .95fr; box-shadow: 0 30px 80px rgba(4, 10, 35, .35); }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(2.5rem, 6vw, 5rem); color: white; background: radial-gradient(circle at 20% 15%, #587beb, transparent 28%), linear-gradient(145deg, #19336f, #101d48); }
.login-intro h1 { max-width: 420px; margin: .75rem 0 1rem; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 750; letter-spacing: -.055em; line-height: 1.08; }
.login-intro p { max-width: 400px; color: #c7d5ff; line-height: 1.7; }
.login-feature-list { display: grid; gap: .65rem; margin-top: 2rem; }
.login-feature-list span { color: #dce6ff; font-size: .82rem; font-weight: 650; }
.login-feature-list span::before { margin-right: .55rem; color: #82e4bd; content: "✓"; }
.login-card-wrap { display: grid; padding: 2rem; background: #f8faff; place-items: center; }
.login-card { width: min(410px, 100%); padding: 2.1rem; background: white; border-radius: 1rem; }
.login-card h2 { font-size: 1.7rem; font-weight: 750; letter-spacing: -.04em; }
.demo-credentials { padding: .8rem; color: #657186; background: #f3f6fc; border-radius: .55rem; font-size: .73rem; }

@media (max-width: 991.98px) {
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-panel { grid-template-columns: 1fr; }
    .login-intro { min-height: 290px; }
}

@media (max-width: 575.98px) {
    .page-shell { padding-right: 1rem; padding-left: 1rem; }
    .app-table thead th, .app-table tbody td { padding-right: .9rem; padding-left: .9rem; }
    .surface-card-header { padding-right: 1rem; padding-left: 1rem; }
    .detail-grid { grid-template-columns: 1fr; padding-right: 1rem; padding-left: 1rem; }
    .activity-list, .summary-list { padding-right: 1rem; padding-left: 1rem; }
    .login-wrap { padding: 0; }
    .login-panel { min-height: 100vh; border-radius: 0; }
    .login-intro { min-height: 230px; padding: 2rem; }
    .login-card-wrap { padding: 1rem; }
    .login-card { padding: 1.6rem; }
}
.surface-card-header {
    padding: 20px 20px 16px;
}

.surface-card > form,
.surface-card > .summary-list,
.surface-card > .p-3 {
    padding: 20px;
}

.surface-card form + form {
    margin-top: 18px;
}

.surface-card .form-label {
    margin-bottom: 8px;
}

.summary-list > div {
    padding: 10px 0;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6478d0;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.page-heading-arrow {
    font-size: 16px;
    color: #9ca3af;
}

.page-subtitle {
    font-size: 13px;
    color: #6b7280;
}
css
.stage-update-data {
    display: flex;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 12px;
}

.stage-update-data > div {
    align-items: center;
    vertical-align: middle;
}

.stage-update-data p {
    margin-top: 0;
    margin-bottom: 0;
}

.stage-update-data .status-pill,
.stage-update-data .btn {
    vertical-align: middle;
}
