:root {
    --navy: #16324f;
    --blue: #2f5d7e;
    --cyan: #8cc4df;
    --surface: #f4f7f9;
    --light: #d9eaf4;
    --line: #d9e1e7;
    --text: #233342;
    --muted: #6d7c89;
    --success: #247654;
    --warning: #956315;
    --danger: #ad3037;
    --sidebar-width: 232px;
    --shadow: 0 2px 9px rgba(22, 50, 79, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--surface); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--cyan) 70%, #fff); outline-offset: 2px; }

/* Shared STS application shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; z-index: 30; top: 0; display: flex; height: 100vh; flex-direction: column; overflow: hidden; color: #dce8ef; background: var(--navy); }
.brand { display: flex; height: 108px; flex: 0 0 108px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 14px; border-bottom: 1px solid #ffffff1d; color: #fff; }
.brand:hover { color: #fff; background: #ffffff08; }
.brand img { display: block; width: 176px; max-height: 78px; object-fit: contain; }
.brand-module { color: var(--light); font-size: 9px; font-weight: 850; letter-spacing: 3px; }
.sidebar nav { flex: 1 1 auto; overflow: auto; padding: 10px 8px; }
.nav-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 11px; width: 100%; min-height: 38px; margin: 1px 0; padding: 7px 10px; border-radius: 5px; color: #dce8ef; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: #fff; background: #ffffff14; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--cyan); }
.nav-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 4px; background: #ffffff12; font-size: 10px; font-weight: 850; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user { flex: 0 0 auto; padding: 14px 18px; border-top: 1px solid #ffffff1d; }
.sidebar-user strong, .sidebar-user > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user > small { color: #a8c2d2; }
.sidebar-user-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.sidebar-user-actions form { margin: 0; }
.sidebar-action { display: inline-flex; padding: 0; border: 0; color: #fff; background: transparent; font-size: 12px; font-weight: 650; }
.sidebar-action:hover { color: var(--cyan); }
.main-column { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 82px; align-items: center; gap: 18px; padding: 13px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.page-heading { min-width: 0; }
.page-heading p { margin: 0 0 1px; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.topbar h1 { margin: 0; font-size: 21px; line-height: 1.2; }
.module-context { margin-left: auto; padding: 5px 9px; border-radius: 3px; color: var(--navy); background: var(--light); font-size: 10px; font-weight: 850; letter-spacing: 1px; }
.mobile-menu { display: none; padding: 4px; border: 0; color: var(--navy); background: transparent; font-size: 23px; }
.content { width: 100%; max-width: 1800px; margin-inline: auto; padding: 20px 24px 42px; }

/* Product surfaces */
.grid { display: grid; gap: 12px; }
.cards { grid-template-columns: repeat(4, minmax(140px, 1fr)); margin-bottom: 18px; }
.card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 5px; background: #fff; box-shadow: var(--shadow); }
.card small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .35px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.card strong { display: block; margin-top: 4px; font-size: 24px; line-height: 1.15; }
.panel { min-width: 0; margin: 0 0 18px; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.panel > h2, .panel > h3 { margin: 0 0 15px; font-size: 16px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -2px 0 15px; }
.toolbar h2, .toolbar h3 { margin: 0; font-size: 16px; }
.btn { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--blue); border-radius: 4px; color: #fff; background: var(--blue); font-weight: 750; text-decoration: none; }
.btn:hover { color: #fff; filter: brightness(.94); }
.btn.secondary { color: var(--blue); background: #fff; }
.btn.accent { border-color: var(--blue); background: var(--blue); }
.btn.danger { border-color: var(--danger); background: var(--danger); }
.link-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; text-decoration: underline; }

/* Tables, status and progress */
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; border-bottom: 1px solid var(--line); color: #415563; background: #edf3f6; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
td { padding: 9px 10px; border-bottom: 1px solid #e9eef1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7fafb; }
.badge { display: inline-flex; min-height: 21px; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 999px; color: #50636f; background: #edf2f5; font-size: 10px; font-weight: 800; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
.badge.awarded, .badge.compliant, .badge.ready-to-submit, .badge.approved, .badge.complete, .badge.submitted { color: var(--success); background: #e4f4ed; }
.badge.lost, .badge.non-compliant, .badge.no-go, .badge.rejected { color: var(--danger); background: #ffeaeb; }
.badge.bidding, .badge.in-progress, .badge.internal-review, .badge.go-no-go-pending, .badge.action-required { color: #87560c; background: #fff2df; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #e3e9ed; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.muted { color: var(--muted); }

/* Forms, tabs and workflow details */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.field input, .field select, .field textarea, .review-form input, .review-form select { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus, .review-form input:focus, .review-form select:focus { border-color: var(--blue); }
.field textarea { min-height: 88px; resize: vertical; }
.checkbox-field input { width: auto; }
.wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 18px; padding: 5px 5px 0; border-radius: 5px 5px 0 0; background: #dfe8ed; }
.tabs a { flex: 0 0 auto; padding: 8px 11px; border-radius: 4px 4px 0 0; color: #415563; background: #edf2f5; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tabs a.active { color: var(--navy); background: #fff; }
.alert { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #ebd39f; border-radius: 5px; color: #714c0d; background: #fff7e8; }
.alert.bad { border-color: #f2c7ca; color: #8f2830; background: #ffedef; }
.detail-form { margin-top: 18px; }
details > summary { cursor: pointer; list-style-position: inside; }
.section-list { display: grid; gap: 10px; }
.section-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; }
.section-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-item summary span { color: var(--muted); font-size: 12px; }
.review-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 2fr) auto; gap: 8px; min-width: 480px; }
.form-actions, .approval-form, .compact-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.compact-form select, .compact-form input, .approval-form input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; }
.admin-grid, .approval-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.team-grid { display: grid; gap: 8px; margin-bottom: 14px; }
.team-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 120px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.team-row select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; }
.check { display: flex; align-items: center; gap: 8px; }
.check small { display: block; color: var(--muted); }
.approval-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #f9fbfc; }
.approval-card p { margin: 4px 0 0; }
.approval-card .approval-form { grid-column: 1 / -1; }
.approval-card .approval-form input { flex: 1 1 200px; }

/* Sign-in */
.login { width: min(440px, calc(100% - 32px)); margin: 9vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 18px 50px rgba(7, 27, 44, .3); }
.login-logo-panel { margin: -28px -28px 22px; padding: 18px 34px; border-radius: 6px 6px 0 0; background: var(--navy); }
.login-logo-panel img { display: block; width: 100%; max-height: 100px; object-fit: contain; }
.login .brandline { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.login h1 { margin: 8px 0 4px; }

@media (max-width: 1000px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid, .approval-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100dvh; transform: translateX(-100%); transition: transform .2s ease; }
    .nav-open .sidebar { transform: translateX(0); }
    .nav-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(8, 25, 38, .52); }
    .mobile-menu { display: inline-flex; }
    .topbar { padding-inline: 14px; }
    .module-context { display: none; }
    .content { padding: 16px 14px 32px; }
    .toolbar { align-items: flex-start; flex-wrap: wrap; }
    .panel { padding: 14px; }
}

@media (max-width: 620px) {
    .cards, .form-grid { grid-template-columns: 1fr; }
    .section-item summary { align-items: flex-start; flex-direction: column; }
    .login { margin-block: 4vh; padding: 24px; }
    .login-logo-panel { margin: -24px -24px 20px; }
    .team-row { grid-template-columns: 1fr; }
}
