:root {
  --bg: #f5f7f9;
  --line: #dfe6eb;
  --ink: #202e38;
  --muted: #617380;
  --soft-blue: #eaf5fb;
  --soft-orange: #fff2e9;
}
body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { letter-spacing: 0; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #85bfdc; outline-offset: 3px;
}
input, select, textarea { min-width: 0; max-width: 100%; }
.cloud-save-status{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 0;font-size:12px;color:#496d5a;border-bottom:1px solid #deebe2}
.cloud-save-status[hidden]{display:none}
.cloud-save-status[data-state=error]{color:#8c4a20;background:#fff6ec;padding:12px;border-color:#e8c4a5}
.cloud-save-status button{padding:8px 12px;background:white;border:1px solid #d3b69f;border-radius:4px;font-size:12px}
button:disabled { opacity: .55; cursor: wait; }
.app-shell { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding: 24px 16px; gap: 24px; background: #fff; scrollbar-width: thin; }
.brand { gap: 10px; }
.brand-logo { width: 44px; height: 48px; flex-shrink: 0; border: 0; object-fit: contain; }
.brand strong { font-size: 12px; line-height: 1.45; }
.brand span { font-size: 11px; line-height: 1.5; margin-top: 4px; }
.navigation-search { display: grid; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.navigation-search input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #f8fafb; }
.nav-list { gap: 22px; }
.nav-group { display: grid; gap: 3px; }
.nav-group-label { margin: 0 10px 5px; color: #75838c; font-size: 11px; font-weight: 650; text-transform: uppercase; }
.nav-button { min-height: 37px; font-size: 13px; padding: 9px 11px; border-left: 3px solid transparent; border-radius: 5px; }
.nav-button.active { color: #07597e; background: #eaf5fb; border-left-color: #1683b0; font-weight: 650; }
.nav-button:hover { background: #f1f5f7; color: #07597e; }
.workspace { padding: 0 30px 30px; }
.topbar { min-height: 100px; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 26px; line-height: 1.25; }
.topbar .eyebrow { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.user-badge { min-width: 0; max-width: 280px; padding: 7px; gap: 10px; }
.user-badge > span { width: 36px; height: 36px; flex: 0 0 36px; background: #e1f1f9; color: #06618f; font-size: 13px; }
.user-badge > div { min-width: 0; }
.user-badge strong { font-size: 13px; overflow-wrap: anywhere; }
.user-badge small { font-size: 11px; }
.navigation-toggle { display: none; }
section { background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 0; min-width: 0; }
.view { padding: 0; }
.active-view { gap: 28px; }
.split-layout { gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.split-layout > section, .view > section { padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 18px; gap: 12px; flex-wrap: wrap; align-items: center; }
.section-heading h2 { font-size: 17px; line-height: 1.35; }
.eyebrow { font-size: 10px; font-weight: 650; margin-bottom: 4px; color: #a34e23; }
.metric-grid { gap: 16px; }
.metric-card { padding: 20px; border: 1px solid var(--line); border-top: 3px solid #92c7df; box-shadow: none; }
.metric-card:nth-child(2) { border-top-color: #8cc5a5; }
.metric-card:nth-child(3) { border-top-color: #e7b988; }
.metric-card:nth-child(4) { border-top-color: #b9afe0; }
.metric-card > span { font-size: 11px; color: var(--muted); font-weight: 650; }
.metric-card > strong { font-size: 30px; line-height: 1.2; margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.metric-card p { font-size: 11px; }
.dashboard-grid { gap: 24px; }
.dashboard-grid > section { padding: 20px 0; border-top: 1px solid var(--line); min-width: 0; }
.dashboard-grid .section-heading { margin-bottom: 22px; }
.bar-chart { max-height: 340px; overflow: auto; padding-right: 6px; }
.bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
.bar-label { white-space: normal; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.bar-label small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.bar-track { height: 8px; background: #e6edf2; }
.bar-fill { background: #83bed9; }
.bar-value { font-size: 13px; }
.mini-kpi { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-width: 0; }
.mini-kpi span { font-size: 12px; }
.mini-kpi strong { font-size: 24px; }
#pcbStatusChart, #packingChart, #pipelineChart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
#pcbStatusChart { grid-template-columns: minmax(0, 1fr); }
.status-distribution { display: grid; grid-template-columns: 1fr auto; gap: 5px; font-size: 12px; }
.status-distribution strong { font-variant-numeric: tabular-nums; }
.status-passed { background: #8bc4a5; }
.status-failed { background: #e7ac98; }
.status-packed { background: #afa1ce; }
@media (min-width: 1200px) { .dashboard-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
#pcbStatusChart > .status-card, #pipelineChart > .status-card { grid-column: 1 / -1; }
.status-card { padding: 16px; box-shadow: none; }
.status-card h3 { font-size: 14px; }
.status-card p { font-size: 12px; line-height: 1.65; margin: 0; }
.status-card.watch { background: #f9fbfc; border-color: var(--line); }
.status-card.good { background: #f1f8f4; border-color: #d8e8df; }
label, .account-form label { font-size: 12px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]), select { min-height: 40px; border-radius: 5px; }
textarea { min-height: 96px; border-radius: 5px; resize: vertical; }
.primary-button, .ghost-button, .secondary-button, .danger-button { min-height: 40px; font-size: 13px; font-weight: 600; border-radius: 5px; }
.small-button { min-height: 32px; font-size: 12px; }
.icon-button { width: 34px; height: 34px; min-width: 34px; flex-shrink: 0; padding: 7px; }
.button-icon { width: 18px; height: 18px; object-fit: contain; }
.form-grid { gap: 14px; }
.table-wrap { max-width: 100%; max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; scrollbar-width: thin; }
table { font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; background: #f2f6f8; font-size: 10px; font-weight: 650; padding: 12px; white-space: nowrap; }
td { padding: 12px; vertical-align: middle; }
tbody tr:hover { background: #f4f9fc; }
.goal-summary-card { box-shadow: none; }
.goal-assignment-section, .current-goals-section, .assigned-goals-section { background: transparent; border: 0; padding: 0; }
.goal-assignment-card { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 20px 0; }
.account-menu { box-shadow: 0 12px 36px #203f551f; }
.account-menu-head { background: #f5f9fc; }
.auth-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px 20px; min-height: 100dvh; background: #f5f8fa; }
.auth-brand { display: flex; align-items: center; gap: 14px; width: min(100%, 420px); }
.auth-logo { width: 62px; height: 62px; object-fit: contain; border-radius: 6px; }
.auth-brand h1 { font-size: 22px; line-height: 1.35; }
.auth-brand .eyebrow { font-size: 10px; }
.auth-card { width: min(100%, 420px); padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #28475b08; gap: 18px; }
.auth-card h2 { font-size: 22px; }
.auth-card input { width: 100%; }
.auth-card .helper-text { font-size: 12px; margin: 0; }
.auth-links { gap: 12px; flex-wrap: wrap; }
.auth-links button { font-size: 12px; }
#resetOtpPanel, #signupOtpPanel, #resetPasswordFields { display: grid; gap: 16px; }
.app-footer { border-top: 1px solid var(--line); background: transparent; margin-top: 28px; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .workspace { padding: 0 22px 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .navigation-open .sidebar { display: flex; position: fixed; left: 0; top: 76px; z-index: 60; width: min(300px, 88vw); height: calc(100dvh - 76px); box-shadow: 12px 0 30px #253e5226; }
  .workspace { padding: 0 16px 24px; }
  .topbar { min-height: 76px; gap: 10px; margin-bottom: 22px; flex-direction: row; align-items: center; }
  .topbar h1 { font-size: 19px; overflow-wrap: anywhere; }
  .topbar > div:first-of-type { flex: 1; min-width: 0; }
  .navigation-toggle { display: block; padding: 8px; min-height: 36px; }
  .user-badge { padding: 0; }
  .user-badge > div { display: none; }
  .account-menu { position: fixed; top: 76px; right: 12px; width: calc(100vw - 24px); max-height: calc(100dvh - 92px); }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card > strong { font-size: 26px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form-grid, .goal-editor-card .form-grid { grid-template-columns: minmax(0, 1fr); }
  .section-heading { align-items: flex-start; }
  .auth-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
