:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --surface-muted: #f7f8f9;
  --surface-deep: #eef1f4;
  --ink: #1f2328;
  --muted: #68717c;
  --line: #d8dde3;
  --line-strong: #bcc4cd;
  --brand: #18202a;
  --brand-soft: #2e3946;
  --accent: #9b5b27;
  --accent-soft: rgba(155, 91, 39, 0.12);
  --success: #266245;
  --warn: #9b6b24;
  --danger: #a73f38;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06);
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --font-sans: -apple-system, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: linear-gradient(180deg, #f6f7f8 0%, #eef1f3 100%);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-size: 12px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px;
}
.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hero-bar-compact {
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, #f5f7f9 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--brand) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
}
.brand h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.01em;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.topline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
}
.sidebar,
.panel,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.sidebar {
  border-radius: var(--radius-xl);
  padding: 10px;
  position: sticky;
  top: 12px;
  align-self: start;
}
.sidebar-v2 {
  background: linear-gradient(180deg, #fcfcfd 0%, #f5f6f7 100%);
}
.sidebar-summary {
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  margin-bottom: 10px;
}
.sidebar-summary h2 {
  margin: 2px 0 4px;
  font-size: 15px;
}
.sidebar-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.sidebar-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.workflow-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.workflow-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.workflow-item.active {
  border-color: #c6b7a7;
  background: #faf7f2;
}
.workflow-item strong {
  display: block;
  font-size: 12px;
}
.workflow-item small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}
.workflow-no {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.nav-section + .nav-section { margin-top: 10px; }
.nav-label {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0 6px;
}
.nav-list {
  display: grid;
  gap: 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 9px;
  border-radius: var(--radius-md);
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease;
}
.nav-item strong {
  font-size: 12px;
  font-weight: 700;
}
.nav-item small {
  color: var(--muted);
  font-size: 10px;
}
.nav-item:hover,
.nav-item.active {
  background: #f2f4f6;
  border-color: var(--line-strong);
}
.content {
  display: grid;
  gap: 10px;
}
.panel {
  border-radius: var(--radius-xl);
  padding: 12px;
}
.panel-inset {
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-muted);
}
.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-header h2,
.panel-header h3,
.panel-header h4 { margin: 0; }
.panel-header h2 { font-size: 18px; }
.panel-header h3 { font-size: 14px; }
.panel-header h4 { font-size: 12px; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}
.section-title h2,
.section-title h3 { margin: 0; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.grid-4,
.grid-3,
.grid-2,
.grid-1 { display: grid; gap: 10px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-1 { grid-template-columns: minmax(0, 1fr); }
.stat-card,
.flow-card,
.metric-card {
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}
.stat-card .label,
.metric-card .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value,
.metric-card .value { margin-top: 5px; font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-card .meta,
.metric-card .meta { margin-top: 3px; color: var(--muted); font-size: 10px; }
.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.flow-card {
  display: block;
  color: inherit;
  min-height: 132px;
}
.flow-step {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eceff3;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}
.flow-card h3 {
  margin: 8px 0 4px;
  font-size: 14px;
}
.flow-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.flow-meta {
  margin-top: 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.summary-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}
.kv-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--line);
}
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
}
.kv-row span { color: var(--muted); }
.kv-row strong { font-weight: 700; text-align: right; }
.toolbar,
.form-grid {
  display: grid;
  gap: 8px;
}
.toolbar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 4px; }
.field label { font-size: 11px; color: var(--muted); }
.input,
.select,
.textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 78px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 7px 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-accent { background: var(--accent); color: #fff; }
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}
.table.table-compact { min-width: 720px; }
.table th,
.table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 11px;
  line-height: 1.4;
}
.table thead th {
  background: #f3f5f7;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.table tbody tr:hover { background: #fafbfc; }
.notice-strip {
  padding: 7px 9px;
  border-radius: var(--radius-md);
  background: #f8f4ee;
  color: var(--ink);
  border: 1px solid #e4d7c7;
  font-size: 11px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: rgba(38, 98, 69, 0.11); color: var(--success); }
.badge-warn { background: rgba(155, 107, 36, 0.11); color: var(--warn); }
.badge-danger { background: rgba(167, 63, 56, 0.11); color: var(--danger); }
.badge-muted { background: rgba(104, 113, 124, 0.12); color: var(--muted); }
.muted { color: var(--muted); font-size: 10px; }
.list-plain {
  display: grid;
  gap: 6px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.list-item:last-child { border-bottom: 0; }
.timeline {
  display: grid;
  gap: 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-time {
  color: var(--muted);
  font-size: 10px;
}
.timeline-body strong {
  display: block;
  font-size: 12px;
}
.timeline-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.map-shell {
  width: 100%;
  min-height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f8fa 0%, #edf1f4 100%);
}
.map-label {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(24, 32, 42, 0.9);
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
}
.map-info {
  line-height: 1.6;
  min-width: 180px;
  font-size: 11px;
}
.pre {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: #1f2328;
  color: #f5f7fa;
  overflow: auto;
  min-height: 90px;
  font-size: 10px;
  line-height: 1.5;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login-card {
  width: min(980px, 100%);
  max-width: 920px;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 12px;
}
.login-showcase,
.login-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f8f9 100%);
}
.login-showcase h1 {
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1.2;
}
.login-showcase p,
.login-panel p { color: var(--muted); font-size: 12px; }
.small-kicker {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf1f5;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .flow-grid,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { padding: 8px; }
  .hero-bar,
  .panel-header,
  .section-title { flex-direction: column; align-items: stretch; }
  .flow-grid,
  .grid-4,
  .grid-3,
  .grid-2,
  .toolbar,
  .form-grid,
  .form-grid-3,
  .form-grid-4,
  .summary-strip,
  .login-card { grid-template-columns: 1fr; }
  .brand h1 { font-size: 16px; }
  .login-showcase h1 { font-size: 22px; }
}
