:root {
  color-scheme: light;
  --primary: #2459d3;
  --primary-dark: #1746b4;
  --primary-soft: #edf3ff;
  --ink: #172033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --success: #14966f;
  --success-soft: #e9f8f2;
  --warning: #d27b18;
  --warning-soft: #fff4df;
  --danger: #d24b4b;
  --danger-soft: #fff0f0;
  --purple: #7357d8;
  --sidebar: 232px;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(23, 32, 51, 0.06);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #eaf1ff 0, transparent 42%), #f4f7fb; }
.auth-card { width: min(420px, 100%); padding: 42px 36px; border: 1px solid #dde5f2; border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(19, 42, 82, .12); text-align: center; }
.auth-brand { width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; }
.auth-card h1 { margin: 0; color: #14233f; font-size: 26px; }
.auth-card p { margin: 12px 0 26px; color: #64748b; line-height: 1.7; }
.auth-login { width: 100%; justify-content: center; text-decoration: none; }
.auth-card small { display: block; margin-top: 22px; color: #94a3b8; line-height: 1.6; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--sidebar); padding: 22px 14px;
  display: flex; flex-direction: column;
  color: #dce7ff; background: #12213f;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; color: white;
  background: linear-gradient(145deg, #4e7bf1, #2460dc);
  box-shadow: 0 8px 20px rgba(36, 96, 220, .35);
}
.brand strong { display: block; font-size: 15px; color: white; }
.brand small { display: block; margin-top: 2px; color: #8fa6d3; font-size: 11px; }
.nav-label { padding: 9px 12px 6px; color: #728ab8; font-size: 11px; }
.side-nav { display: grid; gap: 5px; }
.nav-item {
  position: relative; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px;
  display: flex; align-items: center; gap: 11px; color: #aebee0; background: transparent;
  cursor: pointer; text-align: left; transition: .18s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(74, 121, 238, .22); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: #6d94ff; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 999px; color: #fff; background: #e55b5b; font-size: 11px; text-align: center; }
.nav-badge.urgent { background: #ff7a45; box-shadow: 0 0 0 3px rgba(255,122,69,.15); }
.sidebar-footer { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; }
.version { color: #7186ad; font-size: 11px; }
.environment-pill, .top-environment { width: fit-content; border-radius: 999px; font-weight: 700; }
.environment-pill { padding: 4px 8px; font-size: 10px; }
.environment-pill.database { color: #b9f3df; background: rgba(20,150,111,.2); }
.environment-pill.demo { color: #ffe4a6; background: rgba(210,123,24,.2); }
.environment-pill.offline { color: #d1d7e2; background: rgba(255,255,255,.08); }

.topbar {
  position: fixed; z-index: 20; top: 0; left: var(--sidebar); right: 0; height: 66px;
  padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title h1 { margin: 0; font-size: 18px; }
.topbar-title span { color: var(--subtle); font-size: 12px; }
.top-environment { padding: 4px 8px; font-size: 10px; }
.top-environment.database { color: #087653; background: var(--success-soft); }
.top-environment.demo { color: #9a5b0f; background: var(--warning-soft); }
.top-environment.offline { color: #667085; background: #eef1f5; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.role-switch { min-width: 178px; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: #475467; background: white; }
.topbar-admin-test { min-width: 410px; max-width: 640px; height: 50px; margin-left: auto; margin-right: 16px; padding: 6px 7px 6px 10px; border: 1px solid #c9d9f5; border-radius: 11px; display: flex; align-items: center; gap: 8px; color: #173f79; background: linear-gradient(135deg,#edf4ff,#f8fbff); }
.topbar-admin-test.impersonating { color: #75440d; border-color: #edcb91; background: linear-gradient(135deg,#fff5df,#fffaf0); }
.topbar-admin-test.switching { opacity: .7; }
.topbar-admin-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; background: var(--primary); }
.topbar-admin-test.impersonating .topbar-admin-icon { background: var(--warning); }
.topbar-admin-icon svg { width: 16px; height: 16px; }
.topbar-admin-label { min-width: 74px; }
.topbar-admin-label strong, .topbar-admin-label small { display: block; white-space: nowrap; }
.topbar-admin-label strong { font-size: 11px; }
.topbar-admin-label small { margin-top: 1px; color: #627694; font-size: 9px; }
.topbar-admin-test.impersonating .topbar-admin-label small { color: #8c642f; }
.topbar-admin-test select { min-width: 190px; max-width: 280px; height: 34px; padding: 5px 28px 5px 9px; border: 1px solid #b9cbea; border-radius: 8px; flex: 1; color: #29466e; background: #fff; font-size: 12px; }
.topbar-admin-test.impersonating select { border-color: #e2bc7a; color: #75440d; }
.topbar-admin-test .btn { min-height: 34px; height: 34px; padding: 5px 9px; flex: 0 0 auto; font-size: 11px; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; background: white; cursor: pointer; }
.icon-button svg { width: 18px; height: 18px; }
.notification-wrap { position: relative; }
.notification-button { position: relative; }
.notification-button.active { color: var(--primary); border-color: #b9cdfa; background: var(--primary-soft); }
.notification-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid white; border-radius: 999px; display: grid; place-items: center; color: white; background: var(--danger); font-size: 10px; font-weight: 700; }
.notification-panel { position: absolute; z-index: 30; top: 47px; right: 0; width: 380px; max-height: min(560px, calc(100vh - 82px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 18px 50px rgba(17,31,55,.2); transform-origin: top right; animation: notification-open .12s ease-out; }
@keyframes notification-open { from { opacity: 0; transform: translateY(-4px) scale(.99); } }
.notification-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.notification-head strong { font-size: 15px; }
.notification-head span { margin-left: 8px; color: var(--muted); font-size: 11px; }
.notification-head button { padding: 0; border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 12px; }
.notification-list { max-height: 420px; overflow-y: auto; }
.notification-item { padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 11px; }
.notification-item.unread { background: #f8faff; }
.notification-item.unread .list-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: 2px; }
.notification-text { color: #596579; font-size: 12px; line-height: 1.55; }
.notification-time { margin-top: 5px; color: var(--subtle); font-size: 11px; }
.notification-foot { padding: 10px 15px; color: var(--subtle); background: #fafbfc; text-align: center; font-size: 11px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #527bea, #294eb0); font-size: 13px; font-weight: 700; }
.main { min-height: 100vh; margin-left: var(--sidebar); padding: 92px 28px 40px; }
.page { max-width: 1380px; margin: 0 auto; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }

.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.page-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.btn { min-height: 38px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: white; cursor: pointer; font-weight: 600; font-size: 13px; transition: .16s ease; }
.btn:hover { border-color: #b9c4d5; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { border-color: var(--primary); color: white; background: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { border-color: var(--success); color: white; background: var(--success); }
.btn.danger { border-color: #efc6c6; color: var(--danger); background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 6px 11px; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-head { min-height: 56px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head a, .text-link { border: 0; color: var(--primary); background: transparent; font-size: 12px; cursor: pointer; }
.card-body { padding: 18px; }
.empty { padding: 36px 18px; color: var(--muted); text-align: center; }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.empty-icon svg { width: 22px; }

.metric { padding: 18px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -12px; top: -14px; width: 70px; height: 70px; border-radius: 50%; background: var(--primary-soft); }
.metric-icon { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.metric-icon.green { color: var(--success); background: var(--success-soft); }
.metric-icon.orange { color: var(--warning); background: var(--warning-soft); }
.metric-icon.purple { color: var(--purple); background: #f2efff; }
.metric-icon svg { width: 18px; }
.metric-label { margin-top: 14px; color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 4px; font-size: 26px; font-weight: 750; letter-spacing: -.6px; }
.metric-hint { margin-top: 6px; color: var(--subtle); font-size: 11px; }

.list { display: grid; }
.list-row { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: #fafbfc; }
.list-row.task-row-attention { position: relative; background: linear-gradient(90deg,#fff9f3,#fff); }
.list-row.task-row-attention::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #ff7a45; }
.list-main { min-width: 0; flex: 1; }
.list-title { margin: 0 0 5px; font-size: 14px; font-weight: 650; }
.list-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.dot.blue { background: var(--primary); }
.dot.green { background: var(--success); }
.dot.orange { background: var(--warning); }
.dot.red { background: var(--danger); }
.task-attention-banner { margin-bottom: 16px; padding: 16px 18px; border: 1px solid #ffd0b8; border-radius: 13px; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg,#fff4eb,#fffaf5); box-shadow: 0 8px 24px rgba(196,87,28,.08); }
.task-attention-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; flex: 0 0 auto; place-items: center; color: white; background: #f06a2b; box-shadow: 0 7px 16px rgba(240,106,43,.24); }
.task-attention-icon svg { width: 21px; height: 21px; }
.task-attention-copy { min-width: 0; flex: 1; display: grid; gap: 5px; }
.task-attention-copy strong { color: #8e3e19; font-size: 15px; }
.task-attention-copy span { color: #7e665b; font-size: 12px; line-height: 1.55; }
.task-new-tag { margin-left: 8px; padding: 2px 6px; border-radius: 999px; display: inline-flex; color: #bd4d1a; background: #fff0e8; font-size: 10px; vertical-align: 1px; }
.task-new-tag.returned { color: #b43c3c; background: var(--danger-soft); }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: #526070; background: #eef1f5; font-size: 11px; white-space: nowrap; }
.status.progress { color: #2459b7; background: #eaf1ff; }
.status.pending { color: #9a6515; background: var(--warning-soft); }
.status.done { color: #11785a; background: var(--success-soft); }
.status.returned { color: #b43c3c; background: var(--danger-soft); }
.status.locked { color: #7a8493; background: #f0f2f5; }
.status.draft { color: #684dbd; background: #f0edff; }

.toolbar { margin-bottom: 16px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.search { position: relative; min-width: 220px; flex: 1; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; transform: translateY(-50%); color: var(--subtle); }
.search input { width: 100%; height: 38px; padding: 8px 12px 8px 36px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.search input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: #7da1f5; box-shadow: 0 0 0 3px rgba(36,89,211,.1); }
.filter-select { height: 38px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 9px; color: #475467; background: white; }

.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-card { padding: 17px; cursor: pointer; transition: .18s ease; }
.project-card:hover { transform: translateY(-2px); border-color: #c6d2e6; box-shadow: 0 10px 28px rgba(30,55,95,.09); }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-code { margin-bottom: 6px; color: var(--subtle); font-size: 11px; }
.project-scope-tag { display: inline-flex; margin-left: 8px; padding: 3px 7px; border: 1px solid #c9d9f6; border-radius: 999px; color: #2c5fae; background: #eef4ff; font-weight: 700; }
.project-card h3 { margin: 0; font-size: 16px; line-height: 1.45; }
.project-meta { margin: 18px 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meta-block small { display: block; color: var(--subtle); font-size: 11px; }
.meta-block span { display: block; margin-top: 3px; font-size: 13px; }
.progress-line { height: 6px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.progress-line > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3a70e3, #6a8ff0); }
.progress-caption { margin-top: 7px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

.detail-hero { margin-bottom: 16px; padding: 21px; }
.breadcrumb { margin-bottom: 15px; display: flex; gap: 6px; color: var(--muted); font-size: 12px; }
.breadcrumb button { padding: 0; border: 0; color: var(--primary); background: transparent; cursor: pointer; }
.detail-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-title h2 { margin: 0 0 8px; font-size: 23px; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.tabs { margin: 0 -21px -21px; padding: 19px 21px 0; display: flex; gap: 24px; overflow-x: auto; }
.tab { padding: 0 1px 13px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }

.step-list { position: relative; }
.workflow-step { position: relative; padding: 0 0 20px 36px; }
.workflow-step:last-child { padding-bottom: 0; }
.workflow-step::before { content: ""; position: absolute; left: 13px; top: 25px; bottom: 0; width: 1px; background: var(--line); }
.workflow-step:last-child::before { display: none; }
.step-node { position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: #7e8999; background: #eef1f5; border: 3px solid white; box-shadow: 0 0 0 1px var(--line); font-size: 11px; font-weight: 700; }
.step-node.progress { color: white; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.step-node.done { color: white; background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.step-node.pending { color: white; background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.step-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.step-box-top { display: flex; justify-content: space-between; gap: 12px; }
.step-box h4 { margin: 0 0 7px; font-size: 14px; }
.step-info { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 12px; }
.step-output { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: #526070; font-size: 12px; }

.profile-line { display: flex; align-items: center; gap: 12px; }
.profile-line .avatar { width: 46px; height: 46px; }
.profile-line h3 { margin: 0 0 3px; font-size: 16px; }
.profile-line p { margin: 0; color: var(--muted); font-size: 12px; }
.info-list { display: grid; }
.info-row { min-height: 48px; padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row label { color: var(--muted); }
.info-row span { text-align: right; }

.task-layout, .review-layout { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }
.task-side { position: sticky; top: 82px; align-self: start; }
.task-desc { color: #465166; font-size: 13px; line-height: 1.75; }
.deliverable { padding: 12px; border: 1px solid #dfe5ef; border-radius: 10px; background: #f9fafc; }
.deliverable + .deliverable { margin-top: 9px; }
.review-checklist {
  display: grid;
  gap: 9px;
}
.review-check-item {
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #f9fafc;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #465166;
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}
.review-check-item input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.review-check-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.review-check-item:has(input:checked) {
  border-color: #b9cdfa;
  background: #f3f7ff;
  color: #284e96;
}
.file-pill { display: flex; align-items: center; gap: 9px; }
.file-pill .file-open-button { margin-left: auto; flex: 0 0 auto; }
.project-files-list { display: grid; gap: 9px; }
.file-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }

.notice { padding: 12px 14px; border: 1px solid #cbdcff; border-radius: 10px; color: #2b55a4; background: #f2f6ff; font-size: 12px; line-height: 1.6; }
.notice.warning { border-color: #f2d89f; color: #8a5b13; background: #fffaed; }
.task-return-reason { padding: 16px 18px; border: 1px solid #f2b7b7; border-radius: 12px; display: flex; align-items: flex-start; gap: 13px; color: #873535; background: #fff5f5; box-shadow: 0 8px 22px rgba(169,57,57,.06); }
.task-return-reason-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; background: #c94b4b; }
.task-return-reason-icon svg { width: 19px; height: 19px; }
.task-return-reason strong { display: block; margin: 1px 0 6px; font-size: 15px; }
.task-return-reason p { margin: 0 0 5px; color: #712d2d; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.task-return-reason span { color: #9b5a5a; font-size: 12px; }
.identity-denied { max-width: 560px; margin: 70px auto; padding: 34px; text-align: center; }
.identity-denied .empty-icon { width: 56px; height: 56px; border-radius: 17px; color: var(--danger); background: var(--danger-soft); }

.message-row { align-items: flex-start; }
.message-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.message-icon.orange { color: var(--warning); background: var(--warning-soft); }
.message-icon.green { color: var(--success); background: var(--success-soft); }
.message-row.unread .list-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--danger); vertical-align: 2px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(17, 27, 46, .48); backdrop-filter: blur(2px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 16px; background: white; box-shadow: 0 22px 65px rgba(12,21,38,.28); animation: pop .18s ease; }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(6px); } }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #4b5567; font-size: 12px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; outline: none; }
.field textarea { min-height: 95px; resize: vertical; line-height: 1.6; }
.field-hint { color: var(--subtle); font-size: 11px; }
.test-only-hint { color: #b45309; }
.field.has-error select { border-color: #d85a5a; box-shadow: 0 0 0 3px rgba(169,57,57,.08); }
.dept-mismatch-warning { color: #a93939; line-height: 1.45; }
.required::after { content: " *"; color: var(--danger); }
.wizard-track { margin-bottom: 22px; display: flex; align-items: center; }
.wizard-step { display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 12px; }
.wizard-step span { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; font-weight: 700; }
.wizard-step.active, .wizard-step.done { color: var(--primary); font-weight: 650; }
.wizard-step.active span { color: white; background: var(--primary); }
.wizard-step.done span { color: white; background: var(--success); }
.wizard-line { height: 1px; margin: 0 10px; flex: 1; background: var(--line); }
.meeting-upload { min-height: 74px; padding: 13px; border: 1px dashed #aebed9; border-radius: 11px; display: flex; align-items: center; gap: 12px; background: #f9fbff; cursor: pointer; transition: .16s ease; }
.meeting-upload:hover { border-color: var(--primary); background: #f4f7ff; }
.meeting-upload.has-file { border-style: solid; border-color: #a8d9c8; background: #f4fbf8; }
.upload-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.meeting-upload.has-file .upload-mark { color: var(--success); background: var(--success-soft); }
.upload-mark svg { width: 19px; height: 19px; }
.upload-description { color: var(--muted); font-size: 11px; line-height: 1.5; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.editor-row { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.editor-row + .editor-row { margin-top: 11px; }
.editor-row-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.editor-step { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.step-number { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 14px; }
.editor-fields .field label { color: var(--muted); font-weight: 500; }
.editor-task-content { grid-column: 1 / -1; }
.editor-task-content textarea { min-height: 88px; line-height: 1.6; resize: vertical; }
.person-search { padding-right: 30px !important; }
.person-match { grid-column: 1 / -1; margin-top: 10px; padding: 9px 11px; border: 1px solid #b8dfd2; border-radius: 9px; display: flex; align-items: center; gap: 8px; color: #17654f; background: #f2fbf7; font-size: 11px; line-height: 1.5; }
.person-match strong { flex: 0 0 auto; }
.person-match span { flex: 1; }
.person-match em { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: rgba(14,118,88,.1); font-style: normal; white-space: nowrap; }
.person-match.needs-confirmation { border-color: #f2d18d; color: #955b10; background: #fffbeb; }
.person-match.needs-confirmation em { background: rgba(180,83,9,.1); }
.person-match.unmatched { border-color: #efb7b7; color: #9f3333; background: #fff6f6; }
.person-match.unmatched em { background: rgba(169,57,57,.1); }
.flow-mode-card { margin-bottom: 14px; padding: 14px; border: 1px solid #cbd8ee; border-radius: 11px; background: #f7f9fd; }
.flow-mode-title { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; color: #263c64; }
.flow-mode-title > div { display: grid; gap: 3px; }
.flow-mode-title span { color: var(--muted); font-size: 11px; font-weight: 400; }
.flow-mode-title > svg { width: 22px; height: 22px; color: var(--primary); }
.flow-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.flow-mode-options button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 2px; text-align: left; color: var(--text); background: white; cursor: pointer; }
.flow-mode-options button span { color: var(--muted); font-size: 11px; }
.flow-mode-options button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.graph-tools { margin-top: 10px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.serial-dependency, .dependency-editor { margin-top: 11px; padding: 10px 11px; border: 1px solid #d8e1ef; border-radius: 9px; background: white; }
.serial-dependency { display: flex; align-items: center; gap: 9px; color: #40577d; }
.serial-dependency > svg { width: 18px; height: 18px; color: var(--primary); }
.serial-dependency > div { display: grid; gap: 2px; }
.serial-dependency span { color: var(--muted); font-size: 11px; }
.dependency-editor-head { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dependency-editor-head > div { display: grid; gap: 2px; }
.dependency-editor-head span { color: var(--muted); font-size: 11px; }
.dependency-editor-head > label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dependency-editor-head select { padding: 5px 26px 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 11px; }
.dependency-options { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 7px; }
.dependency-option { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: #4b5567; background: #fbfcfe; cursor: pointer; font-size: 11px; }
.dependency-option input { width: auto; margin: 0; accent-color: var(--primary); }
.dependency-option span { color: var(--primary); font-weight: 700; }
.dependency-option.selected { border-color: #9db8ef; color: #234d9e; background: #f0f5ff; }
.dependency-summary { margin-top: 9px; padding: 7px 9px; border-radius: 7px; display: flex; align-items: center; gap: 6px; color: #40577d; background: #f4f7fc; font-size: 11px; }
.dependency-summary svg { width: 14px; height: 14px; color: var(--primary); }
.mode-selection { padding: 4px 0 8px; }
.mode-selection-head { margin-bottom: 16px; text-align: center; }
.mode-selection-head h4 { margin: 0 0 5px; font-size: 17px; }
.mode-selection-head p { margin: 0; color: var(--muted); font-size: 12px; }
.mode-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.mode-choice { min-height: 154px; padding: 18px; border: 1px solid #d5deed; border-radius: 13px; position: relative; display: flex; align-items: flex-start; gap: 13px; text-align: left; color: var(--text); background: white; cursor: pointer; transition: .16s ease; }
.mode-choice:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(36,89,211,.1); }
.mode-choice-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.mode-choice-icon svg { width: 21px; height: 21px; }
.mode-choice-copy { min-width: 0; display: grid; gap: 7px; }
.mode-choice-copy strong { color: #172033; font-size: 15px; }
.mode-choice-copy em { color: #4b5f80; font-size: 12px; font-style: normal; line-height: 1.5; }
.mode-choice-copy small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.mode-choice > b { padding: 3px 7px; border-radius: 999px; position: absolute; top: 10px; right: 10px; color: var(--success); background: var(--success-soft); font-size: 10px; }
.mode-selection-note { margin-top: 13px; color: var(--muted); text-align: center; font-size: 11px; }
.selected-mode { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #bfd0ef; border-radius: 10px; display: flex; align-items: center; gap: 11px; background: #f4f7fd; }
.selected-mode-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: white; }
.selected-mode-icon svg { width: 18px; height: 18px; }
.selected-mode > div { min-width: 0; flex: 1; display: grid; gap: 2px; }
.selected-mode > div span { color: var(--muted); font-size: 11px; }
.serial-editor-note, .parallel-editor-note { margin-bottom: 12px; padding: 9px 11px; border-radius: 9px; display: flex; align-items: center; gap: 7px; color: #40577d; background: #f5f7fb; font-size: 11px; }
.serial-editor-note svg, .parallel-editor-note svg { width: 16px; height: 16px; color: var(--primary); }
.parallel-editor { display: grid; gap: 13px; }
.parallel-stage-editor { padding: 13px; border: 1px solid #cfd9e9; border-radius: 12px; background: #f7f9fc; }
.parallel-stage-head { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.parallel-stage-head > div { display: flex; align-items: center; gap: 8px; }
.parallel-stage-head > div > span { padding: 4px 8px; border-radius: 7px; color: white; background: var(--primary); font-size: 11px; font-weight: 700; }
.parallel-stage-head strong { color: #334766; font-size: 12px; }
.parallel-stage-tasks .editor-row { background: white; }
.parallel-stage-tasks .editor-row + .editor-row { margin-top: 9px; }
.stage-transition { margin: 11px 0 -2px; padding-top: 10px; border-top: 1px dashed #c8d3e5; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; }
.stage-transition span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--primary); background: white; transform: rotate(90deg); }
.stage-transition svg { width: 13px; height: 13px; }
.add-stage-button { width: 100%; justify-content: center; border-style: dashed !important; }
.confirm-flow, .confirm-stages { margin-top: 18px; }
.confirm-stages { display: grid; gap: 10px; }
.confirm-stage { padding: 11px; border: 1px solid #d5deed; border-radius: 10px; background: #f8fafe; }
.confirm-stage-head { margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.confirm-stage-head span { padding: 3px 7px; border-radius: 6px; color: white; background: var(--primary); font-size: 10px; }
.confirm-stage-head strong { font-size: 12px; }
.confirm-stage-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.confirm-task { padding: 9px; border-radius: 8px; display: grid; gap: 3px; background: white; font-size: 11px; }
.confirm-task span { color: var(--muted); }
.parallel-project-flow { display: grid; gap: 8px; }
.project-stage { padding: 14px; border: 1px solid #d3ddec; border-radius: 12px; background: #f8fafe; }
.project-stage-head { margin-bottom: 11px; display: flex; align-items: center; gap: 10px; }
.project-stage-head > span { padding: 5px 9px; border-radius: 7px; color: white; background: var(--primary); font-size: 11px; font-weight: 700; }
.project-stage-head > div { display: grid; gap: 2px; }
.project-stage-head small { color: var(--muted); font-size: 10px; }
.project-stage-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.project-stage-task { padding: 12px; border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 5px; text-align: left; color: var(--text); background: white; cursor: pointer; }
.project-stage-task:hover { border-color: #a8bde5; box-shadow: 0 5px 14px rgba(25,55,105,.07); }
.project-stage-task > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-stage-task > span, .project-stage-task > em { color: var(--muted); font-size: 11px; font-style: normal; }
.project-stage-task > em { padding-top: 5px; border-top: 1px dashed var(--line); }
.project-stage-arrow { height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; }
.project-stage-arrow svg { width: 14px; height: 14px; color: var(--primary); transform: rotate(90deg); }
.drag-handle { display: inline-grid; place-items: center; color: var(--subtle); cursor: grab; }
.drag-handle svg { width: 18px; height: 18px; }
.dependency { color: var(--muted); font-size: 11px; }

/* Administrator console */
.admin-page { max-width: 1420px; }
.admin-identity, .readonly-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.admin-identity { padding: 8px 12px; color: #214f9b; background: #eef4ff; border: 1px solid #cfdef8; }
.admin-identity svg, .readonly-pill svg { width: 14px; height: 14px; }
.admin-readonly-banner { margin-bottom: 16px; padding: 14px 16px; border: 1px solid #bcd2f5; border-radius: 12px; display: flex; align-items: flex-start; gap: 12px; color: #173f79; background: linear-gradient(135deg,#f0f6ff,#f8fbff); }
.admin-readonly-banner > span { width: 34px; height: 34px; border-radius: 9px; display: grid; flex: 0 0 auto; place-items: center; color: white; background: var(--primary); }
.admin-readonly-banner svg { width: 18px; height: 18px; }
.admin-readonly-banner strong { display: block; margin-bottom: 3px; font-size: 14px; }
.admin-readonly-banner p { margin: 0; color: #5b7091; font-size: 12px; line-height: 1.6; }
.admin-tabs { margin-bottom: 16px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; background: white; box-shadow: 0 5px 18px rgba(25,55,105,.04); }
.admin-tabs button { min-height: 42px; padding: 8px 10px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; transition: .16s ease; }
.admin-tabs button:hover { color: var(--primary); background: #f4f7fc; }
.admin-tabs button.active { color: white; background: var(--primary); box-shadow: 0 5px 12px rgba(36,93,206,.22); }
.admin-tabs svg { width: 15px; height: 15px; }
.admin-content { min-width: 0; }
.readonly-pill { padding: 5px 9px; color: #55708f; background: #f1f4f8; border: 1px solid #dde4ed; }
.admin-overview-grid { grid-template-columns: minmax(0,1.45fr) minmax(300px,.85fr); }
.admin-progress-list, .admin-alert-list, .service-status-list { display: grid; gap: 12px; }
.admin-progress-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 16px; }
.admin-progress-item > div:first-child { display: grid; gap: 3px; }
.admin-progress-item strong { font-size: 13px; }
.admin-progress-item span { color: var(--muted); font-size: 11px; }
.admin-progress-value { display: flex; align-items: center; gap: 8px; }
.admin-progress-value b { color: var(--primary); font-size: 13px; }
.admin-progress-item .progress-line { grid-column: 1/-1; }
.admin-alert { padding: 13px; border: 1px solid #dbe6f5; border-radius: 10px; display: flex; align-items: flex-start; gap: 11px; color: #305d9e; background: #f6f9fe; }
.admin-alert.warning { color: #a26412; border-color: #f1d8a7; background: #fffaf0; }
.admin-alert > span { width: 30px; height: 30px; border-radius: 8px; display: grid; flex: 0 0 auto; place-items: center; background: rgba(50,100,180,.09); }
.admin-alert svg { width: 16px; height: 16px; }
.admin-alert div { display: grid; gap: 4px; }
.admin-alert strong { font-size: 12px; }
.admin-alert small { color: var(--muted); line-height: 1.5; }
.admin-section-head { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.admin-section-head h3 { margin: 0 0 5px; font-size: 16px; }
.admin-section-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: #607089; background: #f8fafe; text-align: left; font-weight: 600; white-space: nowrap; }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: #3f4c61; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfcfe; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td strong { color: var(--text); font-size: 12px; }
.admin-table td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.admin-table-empty { padding: 34px !important; color: var(--muted) !important; text-align: center !important; }
.admin-note-grid { align-items: stretch; }
.admin-rule-note { padding: 16px; display: flex; align-items: flex-start; gap: 12px; }
.admin-rule-note > span { width: 34px; height: 34px; border-radius: 9px; display: grid; flex: 0 0 auto; place-items: center; color: var(--primary); background: #edf3ff; }
.admin-rule-note svg { width: 17px; height: 17px; }
.admin-rule-note strong { font-size: 13px; }
.admin-rule-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.admin-boundary-note { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.admin-boundary-note svg { width: 16px; height: 16px; flex: 0 0 auto; }
.admin-rule-card { padding: 16px; }
.admin-rule-card-head { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.admin-rule-card-head > span:first-child { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: #edf3ff; }
.admin-rule-card-head svg { width: 17px; height: 17px; }
.admin-rule-card-head div { display: grid; gap: 3px; }
.admin-rule-card-head strong { font-size: 13px; }
.admin-rule-card-head small { color: var(--muted); font-size: 10px; }
.admin-chain { margin-top: 16px; display: grid; grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr); align-items: center; gap: 3px; }
.admin-chain > div { min-height: 94px; padding: 10px 8px; border: 1px solid #dce5f2; border-radius: 9px; display: grid; align-content: start; gap: 5px; background: #f8fafe; }
.admin-chain > div.muted { opacity: .62; border-style: dashed; }
.admin-chain b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--primary); font-size: 10px; }
.admin-chain span { color: var(--muted); font-size: 10px; }
.admin-chain strong { font-size: 11px; }
.admin-chain > i, .admin-level-chain > i { color: #94a5be; }
.admin-chain > i svg, .admin-level-chain > i svg { width: 15px; height: 15px; }
.admin-level-chain { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr) 24px minmax(0,1fr) 24px minmax(0,1fr); align-items: center; gap: 8px; }
.admin-level-chain > div { min-height: 100px; padding: 14px; border: 1px solid #d8e2f1; border-radius: 10px; display: grid; align-content: start; gap: 6px; background: #f8fafe; }
.admin-level-chain > div:first-child { border-color: #bcd2f5; background: #f1f6ff; }
.admin-level-chain b { color: var(--primary); font-size: 11px; }
.admin-level-chain span { font-size: 13px; font-weight: 700; }
.admin-level-chain small { color: var(--muted); line-height: 1.5; }
.admin-system-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.service-status-list > div { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.service-status-list > div:last-child { border-bottom: 0; }
.service-status-list > div > div { display: grid; gap: 3px; }
.service-status-list strong { font-size: 12px; }
.service-status-list small { color: var(--muted); font-size: 10px; }
.service-status-list b { color: #9a6a23; font-size: 11px; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: #d99b3d; box-shadow: 0 0 0 4px #fff4df; }
.service-dot.ready { background: #16a37a; box-shadow: 0 0 0 4px #e4f7f0; }
.service-dot.ready ~ b { color: #168267; }

#toast-root { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 250px; max-width: 360px; padding: 12px 14px; border-radius: 11px; color: white; background: #172033; box-shadow: 0 12px 32px rgba(10,20,38,.25); animation: toast-in .2s ease; font-size: 13px; }
.toast.success { background: #0e7658; }
.toast.error { background: #a93939; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-nav { display: none; }
.mobile-only { display: none; }
.desktop-only { display: initial; }

@media (max-width: 1120px) {
  .topbar.has-admin-test .topbar-title span, .topbar.has-admin-test .top-environment { display: none; }
  .topbar-admin-test { min-width: 360px; margin-right: 10px; }
  .topbar-admin-label { display: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .editor-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-overview-grid, .admin-system-grid { grid-template-columns: 1fr; }
  .admin-rule-card { grid-column: span 1; }
  .admin-chain { grid-template-columns: minmax(0,1fr) 18px minmax(0,1fr); }
  .admin-chain > i:nth-of-type(2), .admin-chain > div:nth-of-type(3) { display: none; }
}

@media (max-width: 760px) {
  :root { --radius: 12px; }
  .sidebar { display: none; }
  .topbar { left: 0; height: 58px; padding: 0 15px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title span, .top-environment, .desktop-only { display: none; }
  .topbar.has-admin-test .topbar-title { display: none; }
  .topbar-admin-test { min-width: 0; max-width: none; height: 44px; margin: 0 7px 0 0; padding: 4px; flex: 1; gap: 5px; }
  .topbar-admin-icon, .topbar-admin-label { display: none; }
  .topbar-admin-test select { min-width: 0; max-width: none; height: 34px; font-size: 11px; }
  .topbar-admin-test .btn { width: 34px; padding: 0; }
  .topbar-admin-test .btn span { display: none; }
  .role-switch { min-width: 126px; max-width: 146px; height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
  .top-actions { gap: 7px; }
  .top-actions .avatar { width: 32px; height: 32px; }
  .main { margin-left: 0; padding: 78px 13px 86px; }
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head h2 { font-size: 20px; }
  .page-head p { display: none; }
  .page-actions .btn:not(.primary) { display: none; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .project-grid, .task-layout, .review-layout { grid-template-columns: 1fr; }
  .metrics-mobile { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .metric { padding: 15px; }
  .metric-value { font-size: 22px; }
  .metric-hint { display: none; }
  .dashboard-grid { display: block; }
  .dashboard-grid > * + * { margin-top: 14px; }
  .card-head { min-height: 50px; padding: 13px 14px; }
  .card-body { padding: 14px; }
  .list-row { padding: 13px 14px; }
  .toolbar { padding: 9px; flex-wrap: wrap; }
  .search { width: 100%; min-width: 0; flex-basis: 100%; }
  .filter-select { flex: 1; min-width: 0; }
  .project-card { padding: 15px; }
  .detail-hero { padding: 16px; }
  .detail-title { display: block; }
  .detail-title .page-actions { margin-top: 13px; }
  .tabs { margin: 0 -16px -16px; padding: 16px 16px 0; gap: 20px; }
  .task-side { position: static; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-name, .editor-output { grid-column: auto; }
  .person-match { display: grid; gap: 4px; }
  .person-match em { width: max-content; }
  .flow-mode-options { grid-template-columns: 1fr; }
  .graph-tools { align-items: flex-start; flex-wrap: wrap; }
  .dependency-editor-head { align-items: flex-start; flex-direction: column; }
  .mode-choice-grid, .confirm-stage-grid, .project-stage-grid { grid-template-columns: 1fr; }
  .mode-choice { min-height: 128px; }
  .selected-mode { align-items: flex-start; flex-wrap: wrap; }
  .selected-mode .btn { margin-left: 45px; }
  .parallel-stage-head { align-items: flex-start; }
  .meeting-upload { align-items: flex-start; flex-wrap: wrap; }
  .meeting-upload .btn { margin-left: 50px; }
  .task-attention-banner { padding: 13px; align-items: flex-start; flex-wrap: wrap; }
  .task-attention-copy { width: calc(100% - 58px); }
  .task-attention-banner .btn { width: 100%; }
  .file-pill { align-items: flex-start; flex-wrap: wrap; }
  .file-pill .file-open-button { margin-left: 43px; }
  .notification-panel { position: fixed; top: 58px; left: 10px; right: 10px; width: auto; max-height: calc(100vh - 135px); }
  .notification-list { max-height: calc(100vh - 245px); }
  .mobile-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 7px 9px env(safe-area-inset-bottom); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
  .mobile-nav button { border: 0; display: grid; justify-items: center; align-content: center; gap: 3px; color: #818b9b; background: transparent; font-size: 10px; }
  .mobile-nav button.active { color: var(--primary); }
  .mobile-nav svg { width: 20px; height: 20px; }
  .mobile-nav.admin-mobile-nav { grid-template-columns: repeat(2,1fr); }
  .admin-identity { padding: 7px 9px; font-size: 11px; }
  .admin-readonly-banner { padding: 12px; }
  .admin-tabs { margin-left: -3px; margin-right: -3px; padding: 4px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-tabs button { min-height: 38px; padding: 7px 5px; gap: 5px; font-size: 10px; }
  .admin-tabs svg { width: 13px; height: 13px; }
  .admin-section-head { align-items: flex-start; flex-direction: column; }
  .admin-table { min-width: 690px; }
  .admin-note-grid { display: grid; }
  .admin-rule-card { padding: 14px; }
  .admin-chain { grid-template-columns: 1fr; }
  .admin-chain > i { display: grid; place-items: center; transform: rotate(90deg); }
  .admin-chain > i:nth-of-type(2), .admin-chain > div:nth-of-type(3) { display: grid; }
  .admin-level-chain { grid-template-columns: 1fr; }
  .admin-level-chain > i { display: grid; place-items: center; transform: rotate(90deg); }
  .mobile-only { display: initial; }
  #toast-root { left: 13px; right: 13px; bottom: 76px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 390px) {
  .metrics-mobile { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .metric-icon { width: 32px; height: 32px; }
  .list-meta { gap: 5px 9px; }
}
