:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #eef5f1;
  --ink: #182027;
  --muted: #69747f;
  --line: #dbe2e8;
  --primary: #176a5f;
  --primary-strong: #104c46;
  --blue: #2f65b0;
  --amber: #a45d13;
  --red: #a83b3b;
  --green: #2b7d4f;
  --focus: #8bc5bc;
  --shadow: 0 18px 45px rgba(31, 43, 54, 0.09);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  padding: 24px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3a4650;
  padding: 8px 10px;
  text-align: left;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #edf3f5;
  outline: 2px solid transparent;
}

.nav-link.active {
  background: #dceeea;
  color: var(--primary-strong);
  font-weight: 700;
}

.nav-icon {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 22px;
  max-width: 1240px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.role-switcher {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--primary);
  outline: 3px solid var(--focus);
}

.view {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1240px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters select,
.filters input {
  min-width: 190px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 9px 14px;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button.warning {
  border-color: #bd7d25;
  background: #fff7ed;
  color: #7c470b;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metric {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: 2rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 18px;
}

.panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.table-panel {
  overflow: hidden;
  padding: 0;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f6f8;
  color: #51606c;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.person-name {
  display: grid;
  gap: 3px;
}

.person-name small,
.muted {
  color: var(--muted);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #edf3f5;
  color: #40505d;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.green {
  background: #e1f3e8;
  color: var(--green);
}

.badge.blue {
  background: #e6eef9;
  color: var(--blue);
}

.badge.amber {
  background: #fff0d7;
  color: var(--amber);
}

.badge.red {
  background: #fae7e7;
  color: var(--red);
}

.timeline,
.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li,
.list li {
  border-left: 3px solid var(--primary);
  background: #f7faf9;
  padding: 11px 12px;
}

.timeline strong,
.list strong {
  display: block;
  margin-bottom: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: #43515d;
}

.check-item input {
  width: 16px;
  min-height: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fa;
  padding: 12px;
}

.kanban-column h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.task-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.task-card + .task-card {
  margin-top: 10px;
}

.task-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8edf0;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  border: 1px solid #badbd4;
  border-radius: 8px;
  background: #eaf6f3;
  color: #194b44;
  padding: 14px 16px;
}

.app-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 14px;
}

.app-link-box span,
.app-link-box strong {
  display: block;
}

.app-link-box strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.route-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.route-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.route-item code {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-strong);
  font-weight: 800;
}

.empty-state {
  border: 1px dashed #b7c5ce;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 22px;
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .panel-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .route-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .main-nav,
  .metric-grid,
  .route-list {
    grid-template-columns: 1fr;
  }

  .role-switcher,
  .app-link-box,
  .filters select,
  .filters input {
    min-width: 100%;
  }

  .app-link-box {
    align-items: stretch;
    flex-direction: column;
  }
}
