:root {
  color-scheme: light;
  --page: #fffaf5;
  --surface: #ffffff;
  --surface-soft: #fff2e9;
  --ink: #2b1d1a;
  --ink-soft: #5a3d36;
  --muted: #7b5c52;
  --line: #f2d7ca;
  --green: #c96f4d;
  --green-dark: #b65d3d;
  --green-pale: #fff0e7;
  --amber: #d38d3d;
  --amber-pale: #fff3d4;
  --red: #b8574b;
  --red-pale: #fde9e5;
  --shadow: 0 18px 50px rgba(201, 111, 77, .12);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; background: radial-gradient(ellipse at 50% 5%, #fff3ea 0, var(--page) 56%); }
.auth-card { width: min(100%, 420px); padding: 42px; border: 1px solid #eeede7; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: block; flex: 0 0 auto; border-radius: 11px; }
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -1.1px; }
.brand-name span { color: var(--green); }
.brand-version { color: var(--ink-soft); font-size: 11px; font-weight: 600; line-height: 1.2; }
.brand-updated { color: var(--muted); font-size: 10px; line-height: 1.3; }
.brand-auth { margin-bottom: 38px; }
.eyebrow, .workspace-label, .nav-section { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.auth-card .eyebrow { margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
.auth-card h1 { margin-bottom: 8px; font-family: "Manrope", sans-serif; font-size: 27px; letter-spacing: -1px; }
.muted { color: var(--muted); line-height: 1.6; }
.auth-card > .muted { margin-bottom: 25px; }
.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .16s, box-shadow .16s; }
input:focus, select:focus, textarea:focus { border-color: #9bab9d; box-shadow: 0 0 0 3px rgba(82,108,90,.1); }
input::placeholder, textarea::placeholder { color: #a7aaa3; }
textarea { min-height: 88px; resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; transition: background .16s, border-color .16s, transform .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: white; color: var(--ink-soft); border-color: var(--line); }
.button-secondary:hover { background: var(--surface-soft); }
.button-danger { color: var(--red); background: var(--red-pale); }
.button-wide { width: 100%; margin-top: 4px; min-height: 43px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); font-weight: 700; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.form-message { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 12px; }
.auth-footnote { position: absolute; bottom: 20px; margin: 0; color: #989a92; font-size: 11px; }
.notice { padding: 12px; border-radius: 8px; margin: 0 0 18px; font-size: 12px; line-height: 1.5; }
.notice-warning { color: #755c38; background: #f8f1e4; }
.notice code { font-size: 11px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 4; width: 248px; display: flex; flex-direction: column; padding: 27px 17px 17px; background: linear-gradient(180deg, #fff7f2 0%, #fffaf5 100%); border-right: 1px solid var(--line); }
.sidebar > .brand { margin: 0 0 45px 8px; }
.workspace-label { padding: 0 10px; margin-bottom: 12px; font-size: 9px; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 11px; color: #62675f; border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 500; }
.nav-link:hover { background: #f1f0eb; color: var(--ink); }
.nav-link.active { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }
.nav-icon { width: 18px; color: #7e867c; font-size: 17px; text-align: center; }
.nav-link.active .nav-icon { color: var(--green); }
.nav-section { margin: 26px 10px 6px; font-size: 9px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-help { display: flex; gap: 10px; padding: 13px 10px; margin-bottom: 17px; border-radius: 9px; background: #f2f1ec; }
.help-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #aeb2a9; border-radius: 50%; color: #788073; font-size: 11px; }
.sidebar-help strong, .sidebar-help span { display: block; }
.sidebar-help strong { margin-bottom: 3px; font-size: 11px; }
.sidebar-help div span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.profile-row { display: flex; align-items: center; gap: 9px; padding: 15px 3px 0; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--green-dark); background: #e1e8df; font-size: 12px; font-weight: 700; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 17px; }
.icon-button:hover { background: #efeee9; color: var(--ink); }
.main-content { min-height: 100vh; margin-left: 248px; }
.topbar { height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55); }
.breadcrumb { display: flex; gap: 10px; color: #969990; font-size: 12px; }
.breadcrumb strong { color: var(--ink-soft); font-weight: 600; }
.breadcrumb-separator { color: #c4c5be; }
.topbar-right { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #7c9b76; box-shadow: 0 0 0 3px #e8eee5; }
.page-content { max-width: 1280px; padding: 39px 42px 55px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 7px; font-family: "Manrope", sans-serif; font-size: 28px; letter-spacing: -1.1px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card, .panel, .record-card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.metric-card { min-height: 117px; padding: 18px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-pale); font-size: 14px; }
.metric-value { margin-top: 13px; font-family: "Manrope", sans-serif; font-size: 27px; font-weight: 700; letter-spacing: -1px; }
.supplier-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.supplier-summary article { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.supplier-summary span { color: var(--muted); font-size: 10px; }
.supplier-summary strong { font-family: "Manrope", sans-serif; font-size: 22px; }
.radar-panel { display: grid; gap: 14px; padding: 17px 18px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fbfaf7; }
.radar-panel h2 { margin: 0 0 5px; font-size: 13px; }
.radar-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.radar-form { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: end; gap: 10px; }
.radar-form label { font-size: 10px; }
.radar-form input { padding: 9px 10px; font-size: 11px; }
.radar-links { display: flex; flex-wrap: wrap; gap: 8px 15px; padding-top: 10px; border-top: 1px solid var(--line); }
.radar-links a { color: var(--green-dark); font-size: 11px; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .85fr); gap: 16px; }
.panel { overflow: hidden; }
.panel-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 13px; font-weight: 700; }
.panel-header small { color: var(--muted); font-size: 10px; }
.panel-body { padding: 4px 18px; }
.priority-list { display: grid; }
.priority-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0efe9; }
.priority-item:last-child { border-bottom: 0; }
.priority-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.priority-mark.is-blocked { background: var(--red); }
.priority-copy strong, .priority-copy span { display: block; }
.priority-copy strong { margin-bottom: 4px; font-size: 12px; }
.priority-copy span { color: var(--muted); font-size: 10px; }
.priority-date { color: var(--muted); font-size: 10px; white-space: nowrap; }
.module-list { display: grid; gap: 10px; padding: 15px 18px; }
.module-tile { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); text-align: left; }
.module-tile:hover { border-color: #cbd4c8; background: #f7f8f4; }
.module-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--green-pale); color: var(--green); font-size: 15px; }
.module-tile strong, .module-tile small { display: block; }
.module-tile strong { margin-bottom: 4px; font-size: 12px; }
.module-tile small { color: var(--muted); font-size: 10px; }
.module-arrow { margin-left: auto; color: #a0a49a; }
.toolbar { display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; }
.risk-notice { margin-bottom: 18px; }
.risk-notice strong { margin-right: 4px; }
.text-overdue { color: var(--red) !important; font-weight: 700; }
.search-input { max-width: 330px; padding-left: 36px; background: white; }
.search-wrap { position: relative; flex: 1; }
.search-wrap::before { content: "⌕"; position: absolute; top: 8px; left: 13px; z-index: 1; color: #92968d; font-size: 18px; }
.filter-select { width: auto; min-width: 150px; padding: 10px 30px 10px 11px; color: var(--ink-soft); font-size: 12px; }
.record-list { display: grid; gap: 10px; }
.record-card { padding: 17px 18px; transition: border-color .15s, box-shadow .15s; }
.record-card:hover { border-color: #d3d8cf; box-shadow: 0 5px 15px rgba(44,49,42,.035); }
.record-top { display: flex; justify-content: space-between; gap: 15px; }
.record-title { min-width: 0; }
.record-title h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.record-title p { margin: 0; color: var(--muted); font-size: 11px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 15px; color: #777d73; font-size: 11px; }
.record-meta span { display: inline-flex; align-items: center; gap: 5px; }
.record-actions { display: flex; align-items: flex-start; gap: 7px; flex: 0 0 auto; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; background: #f1f1ed; color: #73776f; font-size: 10px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-pale); color: var(--green-dark); }
.badge-amber { background: var(--amber-pale); color: #96652c; }
.badge-red { background: var(--red-pale); color: #a04b43; }
.badge-blue { background: #e9eff3; color: #526d80; }
.star-button { border: 0; background: transparent; color: #b6b7b0; font-size: 18px; line-height: 1; }
.star-button.is-favorite { color: #bd8f42; }
.empty-state { padding: 48px 20px; border: 1px dashed #dedfd7; border-radius: 11px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; }
.empty-state p { margin: 0; font-size: 11px; line-height: 1.6; }
.process-progress { display: flex; gap: 4px; margin-top: 14px; }
.progress-segment { height: 4px; flex: 1; border-radius: 4px; background: #e9e9e3; }
.progress-segment.done { background: #779078; }
.progress-segment.blocked { background: #c87b6e; }
.step-summary { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.modal { width: min(700px, calc(100% - 28px)); max-width: 700px; max-height: min(88vh, 900px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 80px rgba(31,35,30,.2); }
.modal::backdrop { background: rgba(32,36,32,.37); backdrop-filter: blur(2px); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; padding: 21px 24px 16px; border-bottom: 1px solid var(--line); background: white; }
.modal-header h2 { margin: 0 0 5px; font-family: "Manrope", sans-serif; font-size: 18px; letter-spacing: -.5px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 20px 24px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.section-label { margin: 21px 0 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.steps-stack { display: grid; gap: 11px; }
.step-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.step-dependency { margin: -4px 0 11px; color: var(--muted); font-size: 10px; }
.step-document { margin: 10px 0 0; font-size: 11px; }
.step-document a { color: var(--green-dark); font-weight: 600; }
.department-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; margin: 0 0 18px; }
.department-card { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.department-card strong { font-size: 11px; }
.department-card span, .department-card small { color: var(--muted); font-size: 10px; }
.flow-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 17px; }
.flow-metrics article { display: grid; align-content: start; gap: 6px; min-height: 84px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.flow-metrics span, .flow-metrics small { color: var(--muted); font-size: 10px; }
.flow-metrics strong { font-family: "Manrope", sans-serif; font-size: 20px; }
.activity-comment { display: block; margin: 4px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.step-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.step-card-top strong { font-size: 12px; }
.step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.step-grid label { font-size: 10px; }
.step-grid input, .step-grid select, .step-grid textarea { padding: 9px 10px; background: white; font-size: 11px; }
.step-grid textarea { min-height: 57px; }
.step-footer { display: flex; justify-content: flex-end; margin-top: 10px; }
.activity-list { display: grid; gap: 12px; }
.activity-item { display: grid; grid-template-columns: 8px 1fr; gap: 9px; }
.activity-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #94a491; }
.activity-item strong { display: block; margin-bottom: 3px; font-size: 11px; }
.activity-item small { color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #dfe5dc; border-radius: 9px; background: #fff; box-shadow: var(--shadow); color: var(--ink-soft); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: #ecd2cd; color: #943f36; }
.loading { padding: 50px 20px; color: var(--muted); text-align: center; }

@media (max-width: 1000px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .topbar { padding: 0 28px; }
  .page-content { padding: 32px 28px 45px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplier-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 66px; padding: 5px 8px; flex-direction: row; align-items: center; border-top: 1px solid var(--line); border-right: 0; background: rgba(251,250,247,.97); }
  .sidebar > .brand, .workspace-label, .sidebar-bottom, .nav-section { display: none; }
  .main-nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .nav-link { min-height: 52px; justify-content: center; flex-direction: column; gap: 1px; padding: 3px; font-size: 10px; }
  .nav-icon { height: 20px; font-size: 17px; }
  .main-content { margin-left: 0; padding-bottom: 66px; }
  .topbar { height: 55px; padding: 0 19px; }
  .topbar-right { font-size: 0; }
  .page-content { padding: 26px 17px 35px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 24px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 105px; padding: 13px; }
  .metric-value { font-size: 24px; }
  .metric-top { font-size: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .radar-form { grid-template-columns: 1fr; }
  .search-wrap { min-width: 100%; }
  .filter-select { flex: 1; }
  .record-top { flex-wrap: wrap; }
  .record-actions { width: 100%; justify-content: space-between; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .step-grid { grid-template-columns: 1fr; }
  .modal-header { padding: 17px 18px 14px; }
  .modal-body { padding: 17px 18px 20px; }
  .auth-card { padding: 32px 24px; }
}
