:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #edf3f0;
  --ink: #1d2523;
  --muted: #66736f;
  --line: #dbe4e0;
  --green: #1f7a5b;
  --teal: #087f8c;
  --amber: #bc7b12;
  --red: #b5473d;
  --blue: #2d67a3;
  --shadow: 0 18px 45px rgba(36, 51, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
}

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

.sidebar {
  background: #17211e;
  color: #eef7f3;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #42b883;
  color: #10201b;
  font-weight: 800;
}

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

.brand span {
  color: #a9b9b4;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  color: #c7d6d1;
  background: transparent;
  text-align: left;
  width: 100%;
}

.nav-item.active,
.nav-item:hover {
  background: #22322e;
  color: #ffffff;
}

main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

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

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid,
.content-grid,
.module-grid,
.insight-grid,
.split-layout {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric,
.panel,
.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.metric em,
.insight-card span,
.profile-card span {
  color: var(--muted);
  font-style: normal;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin: 8px 0;
}

.metric.risk strong {
  color: var(--amber);
}

.content-grid {
  grid-template-columns: 2fr 1fr;
}

.module-grid {
  grid-template-columns: 1fr 1.6fr;
}

.split-layout {
  grid-template-columns: minmax(0, 1.6fr) 360px;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.wide {
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin-bottom: 0;
}

.panel-header input,
label input,
label select {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  padding: 0 12px;
  width: 100%;
}

.task-list,
.permission-stack,
.timeline,
.okr-board,
.payroll-summary {
  display: grid;
  gap: 12px;
}

.task-row,
.approval-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.approval-row {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.task-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.status {
  width: 10px;
  height: 34px;
  border-radius: 8px;
}

.urgent {
  background: var(--red);
}

.normal {
  background: var(--amber);
}

.calm {
  background: var(--teal);
}

.permission-stack div,
.okr-board div,
.payroll-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
}

.profile-panel {
  align-self: start;
}

.profile-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 8px;
  margin-bottom: 16px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.timeline {
  padding-left: 20px;
}

.timeline li {
  margin-bottom: 8px;
}

.timeline strong {
  display: block;
  color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.okr-board,
.payroll-summary,
.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.okr-board div,
.payroll-summary div {
  min-height: 92px;
  flex-direction: column;
}

.okr-board strong,
.payroll-summary strong {
  font-size: 26px;
}

.clock-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 8px;
  margin-bottom: 16px;
}

.clock-card strong {
  font-size: 42px;
}

.check-item {
  padding: 11px 12px;
  border-radius: 7px;
  background: #fff4df;
  margin-bottom: 8px;
}

.check-item.done {
  background: #e0f4e9;
}

.insight-card {
  padding: 22px;
  min-height: 180px;
}

.insight-card strong {
  display: block;
  font-size: 28px;
  margin: 10px 0;
}

.insight-card.high {
  border-top: 5px solid var(--red);
}

.insight-card.medium {
  border-top: 5px solid var(--amber);
}

.insight-card.calm {
  border-top: 5px solid var(--blue);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .metric-grid,
  .content-grid,
  .module-grid,
  .split-layout,
  .okr-board,
  .payroll-summary,
  .insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: space-between;
  }

  nav {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .task-row,
  .approval-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 14px;
  }
}
