:root {
  color-scheme: dark;
  --bg: #191919;
  --sidebar: #202020;
  --panel: #202020;
  --panel-2: #252525;
  --hover: #2b2b2b;
  --border: #343434;
  --border-soft: #2b2b2b;
  --text: #f1f1ef;
  --muted: #a6a6a2;
  --dim: #787774;
  --accent: #8f3f98;
  --accent-soft: #352338;
  --green: #4fb286;
  --yellow: #d8a657;
  --red: #d46565;
  --blue: #599dd5;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: #b898e7; text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #aa67b2;
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--sidebar);
  border-right: 1px solid var(--border-soft); padding: 14px 10px; display: flex; flex-direction: column; z-index: 20;
}
.workspace { display: flex; gap: 10px; align-items: center; padding: 7px 8px 20px; }
.workspace > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.workspace span { font-size: 12px; color: var(--muted); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #a24cab, #6c2d73); color: white; font-weight: 700; font-size: 19px;
  box-shadow: 0 8px 30px #8f3f9830;
}
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
nav { display: grid; gap: 3px; }
.nav-item {
  width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 6px;
  display: flex; align-items: center; gap: 11px; color: #c7c7c4; text-align: left; cursor: pointer;
}
.nav-item span { width: 20px; text-align: center; color: var(--muted); font-size: 17px; }
.nav-item b { margin-left: auto; background: var(--accent); color: white; min-width: 18px; border-radius: 999px; padding: 1px 5px; text-align: center; font-size: 11px; }
.nav-item b:empty { display: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: #303030; color: white; }
.nav-item.active span { color: #d9aedf; }
.sidebar-footer { margin-top: auto; padding: 16px 9px 5px; border-top: 1px solid var(--border-soft); }
.ai-status { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.ai-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px #4fb28680; }
.text-button { border: 0; background: none; color: var(--muted); padding: 4px 0; cursor: pointer; }
.text-button:hover { color: white; }

.main { min-width: 0; }
.topbar {
  min-height: 86px; padding: 17px 34px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px);
}
.topbar h1 { margin: 2px 0 0; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.breadcrumb { margin: 0; color: var(--dim); font-size: 12px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.icon-button, .secondary-button, .primary-button {
  border: 1px solid var(--border); border-radius: 7px; min-height: 34px; padding: 7px 13px; cursor: pointer;
  background: var(--panel-2); transition: background .15s, border-color .15s, transform .15s;
}
.icon-button { width: 36px; padding: 0; font-size: 17px; }
.secondary-button:hover, .icon-button:hover { background: #303030; border-color: #4a4a4a; }
.primary-button { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.primary-button:hover { background: #a34cac; }
button:disabled { opacity: .45; cursor: not-allowed; }
.menu-button { display: none; }
.content { max-width: 1500px; margin: 0 auto; padding: 30px 34px 60px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px; padding: 18px 20px; min-height: 126px; }
.metric-card.accent { background: linear-gradient(145deg, #2a212c, #222022); border-color: #503151; }
.metric-card p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; font-size: clamp(22px, 2.2vw, 31px); letter-spacing: -.04em; font-weight: 600; }
.metric-card span { display: block; margin-top: 7px; color: var(--dim); font-size: 11px; }
.notice-row { display: flex; gap: 8px; margin: 12px 0 22px; flex-wrap: wrap; }
.mini-alert { border: 1px solid var(--border-soft); border-radius: 999px; padding: 6px 11px; color: var(--muted); font-size: 12px; }
.mini-alert b { color: white; margin-right: 4px; }
.mini-alert.warn { border-color: #745e35; background: #2c281e; }
.mini-alert.danger { border-color: #6b3838; background: #2e2222; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 12px; margin-bottom: 12px; }
.panel { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px; overflow: hidden; }
.panel-heading { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-soft); }
.panel-heading h2 { margin: 3px 0 0; font-size: 15px; font-weight: 600; }
.eyebrow { margin: 0; color: var(--dim); letter-spacing: .09em; font-size: 10px; font-weight: 600; }
.pipeline-chart { padding: 18px 20px 21px; }
.pipeline-row { display: grid; grid-template-columns: 75px minmax(80px, 1fr) 28px 95px; align-items: center; gap: 10px; min-height: 30px; }
.pipeline-row > span { color: var(--muted); font-size: 12px; }
.pipeline-row b { font-size: 12px; text-align: right; }
.pipeline-row small { color: var(--dim); text-align: right; }
.bar-track { height: 7px; background: #303030; border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, #713879, #a34cac); border-radius: inherit; }
.task-list { padding: 8px 18px 16px; }
.task-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); }
.task-item:last-child { border-bottom: 0; }
.task-check { width: 16px; height: 16px; border: 1px solid #5a5a58; border-radius: 4px; flex: 0 0 auto; margin-top: 1px; }
.task-item div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.task-item strong { font-size: 12px; font-weight: 500; }
.task-item small { color: var(--dim); font-size: 11px; }

.table-panel { margin-top: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th { padding: 10px 14px; color: var(--dim); font-size: 10px; letter-spacing: .04em; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border-soft); }
td { padding: 11px 14px; color: #cacac7; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #262626; }
.project-cell { display: flex; align-items: center; gap: 10px; }
.project-cell > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.project-cell strong { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.project-cell small { color: var(--dim); }
.project-icon { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: #d8addd; }
.project-icon.large { width: 45px; height: 45px; border-radius: 10px; font-size: 20px; }
.badge, .source-pill { display: inline-flex; align-items: center; border-radius: 4px; padding: 3px 7px; font-size: 10px; white-space: nowrap; background: #333; color: #ccc; }
.badge.lead, .badge.hearing { background: #24303a; color: #90b9db; }
.badge.proposal, .badge.estimate { background: #302a1f; color: #dab570; }
.badge.contracted, .badge.in_progress { background: #25342d; color: #88c3a1; }
.badge.review, .badge.needs_review { background: var(--accent-soft); color: #d7a6dd; }
.badge.delivered, .badge.invoiced { background: #2c2d3d; color: #a5a9e5; }
.badge.paid, .badge.completed { background: #26362e; color: #8bd1aa; }
.badge.lost, .badge.cancelled { background: #3b2828; color: #db9696; }
.badge.on_hold, .badge.stalled { background: #373126; color: #d0b176; }
.source-pill.slack { background: #352438; color: #d2a5d9; }
.source-pill.chatwork { background: #3c2525; color: #e2a2a2; }
.source-pill.line { background: #223628; color: #83ce93; }
.source-pill.mixed { background: #2f2f39; color: #acacd3; }
.attention-dot { display: inline-block; width: 7px; height: 7px; background: var(--yellow); border-radius: 50%; margin-right: 6px; }

.toolbar { min-height: 44px; display: flex; gap: 10px; align-items: center; margin-bottom: 13px; }
.search-box { flex: 1; max-width: 480px; display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 0 11px; color: var(--dim); }
.search-box input { width: 100%; height: 36px; border: 0; background: transparent; color: var(--text); outline: none; }
select, input, textarea { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; }
.toolbar select { height: 38px; padding: 0 30px 0 10px; }
.result-count { color: var(--dim); margin-left: auto; font-size: 12px; }
.muted { color: var(--muted); }

.contractor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.contractor-register-panel { margin-bottom: 14px; }
.compact-form {
  display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px; align-items: end; padding: 17px 20px 20px;
}
.compact-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.compact-form input, .compact-form select { width: 100%; min-height: 38px; padding: 8px 10px; }
.compact-form label.wide { grid-column: span 2; }
.contractor-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px; padding: 18px; display: flex; gap: 14px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #333; color: #ddd; flex: 0 0 auto; }
.avatar.small { width: 28px; height: 28px; font-size: 11px; }
.contractor-main { min-width: 0; flex: 1; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title h3 { margin: 0; font-size: 14px; }
.card-title p { margin: 4px 0 0; color: var(--dim); font-size: 11px; }
.contractor-card dl, .integration-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 12px; }
dl div { display: flex; flex-direction: column; gap: 3px; }
dt { color: var(--dim); font-size: 10px; }
dd { margin: 0; font-size: 11px; word-break: break-word; }
.project-summary { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.planner-layout {
  display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - 146px);
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden;
}
.planner-projects { border-right: 1px solid var(--border-soft); min-width: 0; background: #1e1e1e; }
.planner-list-heading { padding: 18px 17px 13px; border-bottom: 1px solid var(--border-soft); position: relative; }
.planner-list-heading h2 { margin: 3px 0 0; font-size: 15px; }
.planner-list-heading > span { position: absolute; right: 17px; top: 23px; color: var(--dim); font-size: 11px; }
.planner-project-list { max-height: calc(100vh - 210px); overflow-y: auto; padding: 6px; }
.planner-project-item {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px;
  border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 12px 11px;
  text-align: left; cursor: pointer; color: var(--text);
}
.planner-project-item:hover { background: var(--hover); }
.planner-project-item.active { background: #302832; border-color: #513854; }
.planner-project-item > div:first-child { min-width: 0; display: grid; gap: 4px; }
.planner-project-item strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.planner-project-item small, .planner-project-item > span { color: var(--dim); font-size: 10px; font-style: normal; }
.planner-project-item > span { align-self: start; white-space: nowrap; }
.mini-progress { height: 4px; background: #343434; border-radius: 99px; overflow: hidden; align-self: center; }
.mini-progress i { display: block; height: 100%; background: var(--accent); }
.planner-project-item em { font-style: normal; font-size: 9px; color: var(--dim); text-align: right; }
.planner-detail { min-width: 0; padding: 25px 28px 36px; }
.planner-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.planner-heading h2 { margin: 5px 0 7px; font-size: 22px; letter-spacing: -.025em; }
.planner-heading p:last-child { color: var(--muted); margin: 0; font-size: 11px; }
.planner-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.progress-summary { margin: 23px 0 25px; display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; gap: 14px; align-items: center; }
.progress-copy { display: flex; align-items: baseline; gap: 7px; }
.progress-copy strong { font-size: 22px; }
.progress-copy span, .assigned-mini { color: var(--dim); font-size: 10px; }
.progress-track { height: 7px; background: #303030; border-radius: 99px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #76387e, #b153ba); border-radius: inherit; }
.schedule-timeline { display: grid; }
.schedule-block { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.schedule-rail { display: flex; flex-direction: column; align-items: center; }
.schedule-rail span {
  width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center;
  background: #323232; border: 1px solid #464646; color: var(--muted); font-size: 10px; z-index: 1;
}
.schedule-block.done .schedule-rail span { background: #274032; border-color: #416b50; color: #9fd2ad; }
.schedule-block.doing .schedule-rail span { background: var(--accent-soft); border-color: #75457a; color: #e0b3e4; }
.schedule-block.blocked .schedule-rail span { background: #422a2a; border-color: #714141; color: #e4a1a1; }
.schedule-rail i { width: 1px; flex: 1; min-height: 28px; background: #3a3a3a; }
.schedule-block:last-child .schedule-rail i { background: transparent; }
.schedule-card { margin-bottom: 11px; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2); }
.schedule-block.done .schedule-card { opacity: .68; }
.schedule-block.blocked .schedule-card { border-color: #653b3b; }
.schedule-card-top { display: flex; justify-content: space-between; gap: 10px; }
.schedule-card-top time { color: var(--muted); font-size: 10px; }
.schedule-type { color: #d2a5d8; background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; font-size: 9px; }
.schedule-card h3 { margin: 9px 0 5px; font-size: 13px; }
.schedule-card > p { margin: 0; color: var(--dim); font-size: 10px; }
.schedule-actions { display: flex; gap: 9px; align-items: center; margin-top: 11px; }
.schedule-actions select { min-height: 31px; padding: 4px 8px; font-size: 10px; }
.assignee-chip { color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 3px 8px; font-size: 9px; }
.text-button.danger { color: #d58b8b; margin-left: auto; }
.schedule-add-form {
  margin-top: 18px; display: grid; grid-template-columns: 1.3fr 1fr 140px 1fr 1.3fr auto;
  gap: 9px; align-items: end; padding: 16px; background: #1d1d1d; border: 1px dashed #454045; border-radius: 9px;
}
.schedule-add-form h3 { margin: 3px 0 0; font-size: 13px; }
.schedule-add-form input, .schedule-add-form select { min-height: 36px; padding: 7px 9px; min-width: 0; }
.loading-state.small { min-height: 260px; }

.message-list { display: grid; gap: 8px; }
.message-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px 16px; }
.source-logo, .integration-logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.source-logo.slack, .integration-logo.slack { background: #4a244d; color: #e3b4e6; }
.source-logo.chatwork, .integration-logo.chatwork { background: #562c2c; color: #efb7b7; }
.source-logo.line, .integration-logo.line { background: #20562b; color: #b4e8bb; }
.message-main { min-width: 0; flex: 1; }
.message-meta { display: flex; align-items: center; gap: 8px; }
.message-meta strong { font-size: 12px; }
.message-meta span, .message-meta time { color: var(--dim); font-size: 10px; }
.message-meta time { margin-left: auto; }
.message-main > p { white-space: pre-wrap; line-height: 1.65; color: #d1d1ce; margin: 9px 0; overflow-wrap: anywhere; }
.message-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 10px; }
.project-link { border: 0; background: transparent; color: #c6a0cb; cursor: pointer; padding: 0; }
.unlinked { color: var(--dim); }

.review-intro { display: flex; gap: 15px; align-items: center; padding: 18px 20px; border: 1px solid #503b54; background: #272129; border-radius: 9px; margin-bottom: 14px; }
.review-shield { width: 42px; height: 42px; display: grid; place-items: center; background: var(--accent); border-radius: 11px; font-size: 12px; font-weight: 700; }
.review-intro h2 { font-size: 15px; margin: 0 0 5px; }
.review-intro p { color: var(--muted); margin: 0; font-size: 12px; }
.review-list { display: grid; gap: 9px; }
.review-card { display: grid; grid-template-columns: 10px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; padding: 16px; }
.severity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.review-card.important .severity-dot { background: var(--red); }
.review-card.info .severity-dot { background: var(--blue); }
.review-card h3 { margin: 4px 0 5px; font-size: 13px; }
.review-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.review-card small { display: block; margin-top: 7px; color: var(--dim); font-size: 10px; }
.review-actions { display: flex; gap: 7px; }

.integration-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: linear-gradient(145deg, #2a212c, #212121); border: 1px solid #4b344e; border-radius: 10px; padding: 21px; margin-bottom: 14px; }
.integration-summary h2 { margin: 0 0 6px; font-size: 16px; }
.integration-summary p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; max-width: 780px; }
.integration-list { display: grid; gap: 10px; }
.integration-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 9px; padding: 18px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 15px; align-items: start; }
.integration-logo { width: 44px; height: 44px; border-radius: 11px; font-size: 18px; }
.integration-copy > p { color: var(--muted); margin: 5px 0 0; font-size: 11px; }
.integration-copy dl { grid-template-columns: repeat(3, minmax(0, 150px)); }
.connected, .not-connected { padding: 3px 7px; border-radius: 4px; font-size: 10px; }
.connected { background: #24392c; color: #88c59c; }
.not-connected { background: #3a2b2b; color: #d99a9a; }
.integration-card code { display: inline-block; background: #181818; border: 1px solid #303030; padding: 5px 7px; border-radius: 4px; color: var(--dim); font-size: 10px; word-break: break-all; }
.run-detail { color: var(--yellow) !important; }

.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; margin: 0 auto 11px; color: var(--dim); }
.empty-state h3 { color: #c8c8c5; margin: 0 0 5px; font-size: 13px; }
.empty-state p { margin: 0; font-size: 11px; }
.loading-state { min-height: 50vh; display: grid; place-content: center; gap: 10px; color: var(--muted); text-align: center; }
.loading-state span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #444; border-top-color: #b95fc3; animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 22px; bottom: 22px; background: #303030; border: 1px solid #4a4a4a; border-radius: 8px; padding: 10px 15px; color: white; box-shadow: 0 10px 35px #0008; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { transform: none; opacity: 1; }
.toast[data-type="error"] { border-color: #7d3e3e; }

.project-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: #202020; color: var(--text); box-shadow: 0 24px 80px #000b; }
.project-dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
.dialog-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; border: 0; background: #303030; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; z-index: 2; }
#project-detail { padding: 24px; }
.detail-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.detail-heading h2 { margin: 4px 0; font-size: 20px; }
.detail-heading > div:last-child > p:last-child { color: var(--muted); margin: 0; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 9px 10px; color: var(--text); }
.form-grid textarea { resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 15px; }
.confirm-check { margin-right: auto; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.confirmed { margin-right: auto; color: var(--green); font-size: 11px; }
.detail-section { border-top: 1px solid var(--border-soft); padding-top: 18px; margin-top: 22px; }
.detail-section > h3 { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; color: var(--muted); font-size: 12px; }
.section-heading > span { color: var(--dim); font-size: 10px; }
.assignment-list { display: grid; gap: 5px; }
.assignment-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 9px; background: #252525; border-radius: 7px; }
.assignment-row > div:nth-child(2) { display: grid; gap: 3px; }
.assignment-row strong { font-size: 11px; }
.assignment-row small { color: var(--dim); font-size: 9px; }
.assignment-form { margin-top: 12px; display: grid; grid-template-columns: 1.3fr 1.3fr .8fr 1fr auto; gap: 8px; }
.assignment-form input, .assignment-form select { min-height: 36px; padding: 7px 9px; min-width: 0; }
.form-hint { margin: 7px 0 0; color: var(--dim); font-size: 9px; }
.detail-schedule { display: grid; gap: 5px; }
.detail-schedule > div { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; padding: 7px 9px; border-radius: 6px; background: #252525; align-items: center; }
.detail-schedule time, .detail-schedule span { color: var(--dim); font-size: 9px; }
.detail-schedule strong { font-size: 10px; font-weight: 500; }
.detail-schedule .done strong { text-decoration: line-through; color: var(--muted); }
.person-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; }
.person-row div:last-child { display: flex; flex-direction: column; gap: 3px; }
.person-row small { color: var(--dim); }

.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, #2f2431 0, var(--bg) 42%); padding: 20px; }
.login-card { width: min(420px, 100%); background: #202020; border: 1px solid #363036; border-radius: 12px; padding: 35px; box-shadow: 0 24px 80px #0008; }
.login-card .brand-mark { margin-bottom: 22px; }
.login-card h1 { font-size: 22px; margin: 8px 0; }
.login-card > .muted { line-height: 1.7; font-size: 12px; }
.login-form { display: grid; gap: 9px; margin-top: 25px; }
.login-form label { font-size: 11px; color: var(--muted); }
.login-form input { height: 42px; padding: 0 11px; }
.login-form button { margin-top: 7px; }
.form-error { color: #e08e8e; margin: 0; font-size: 11px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .contractor-grid { grid-template-columns: 1fr 1fr; }
  .compact-form { grid-template-columns: 1fr 1fr; }
  .compact-form label.wide { grid-column: auto; }
  .schedule-add-form { grid-template-columns: 1fr 1fr; }
  .schedule-add-form > div { grid-column: 1 / -1; }
  .assignment-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -260px; width: 248px; transition: left .2s; box-shadow: 20px 0 50px #0008; }
  body.sidebar-open .sidebar { left: 0; }
  .topbar { padding: 14px 16px; min-height: 74px; }
  .menu-button { display: block; }
  #extract-button { display: none; }
  .content { padding: 18px 14px 45px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 14px; min-height: 105px; }
  .metric-card p { margin-bottom: 14px; }
  .metric-card strong { font-size: 19px; }
  .contractor-grid { grid-template-columns: 1fr; }
  .compact-form { grid-template-columns: 1fr; }
  .planner-layout { display: block; }
  .planner-projects { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .planner-project-list { max-height: 280px; }
  .planner-detail { padding: 19px 15px 28px; }
  .planner-heading { display: grid; }
  .planner-heading-actions { justify-content: flex-start; }
  .progress-summary { grid-template-columns: auto 1fr; }
  .assigned-mini { grid-column: 1 / -1; }
  .schedule-add-form, .assignment-form { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-box { max-width: none; flex-basis: 100%; }
  .result-count { margin-left: 0; }
  .review-card { grid-template-columns: 10px 1fr; }
  .review-actions { grid-column: 2; flex-wrap: wrap; }
  .integration-summary { align-items: flex-start; flex-direction: column; }
  .integration-card { grid-template-columns: 40px 1fr; }
  .integration-card > .secondary-button { grid-column: 2; justify-self: start; }
  .integration-copy dl { grid-template-columns: 1fr 1fr; }
  .message-meta { flex-wrap: wrap; }
  .message-meta time { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: auto; }
  .project-dialog { width: calc(100vw - 16px); }
  #project-detail { padding: 18px; }
}
