:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #20231f;
  --muted: #62685f;
  --line: #dce2e5;
  --line-strong: #c9d2d7;
  --accent: #176f5d;
  --accent-dark: #0d4f44;
  --accent-2: #315c99;
  --warn: #9b6225;
  --danger: #b33f4a;
  --done: #357243;
  --shadow: 0 14px 38px rgba(36, 49, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eaf0f2 0, #f7f8f5 360px, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 104px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.lead {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

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

.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  box-shadow: 0 10px 24px rgba(36, 49, 58, 0.045);
}

.metric-primary {
  background: #163f46;
  border-color: #163f46;
  color: #fff;
}

.metric-primary .metric-label {
  color: rgba(255, 255, 255, 0.72);
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 25px;
  line-height: 1;
}

.panel {
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(36, 49, 58, 0.04);
}

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

.panel-header p {
  color: var(--muted);
  font-size: 13px;
}

.capacity-panel {
  border-color: #cdd9d4;
  background: linear-gradient(180deg, #ffffff 0, #f8fbf8 100%);
}

.progress-track {
  width: 100%;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebe7;
  box-shadow: inset 0 1px 2px rgba(24, 36, 31, 0.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease, background-color 180ms ease;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr 48px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--text);
  font-size: 14px;
}

.mini-track {
  height: 9px;
  border-radius: 999px;
  background: #e8ece5;
  overflow: hidden;
}

.mini-bar {
  height: 100%;
  background: var(--accent-2);
}

.task-header {
  align-items: center;
}

select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(23, 111, 93, 0.18);
  border-color: var(--accent);
}

.form-panel {
  background: #fbfcfb;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) 130px 150px 110px;
  gap: 14px;
  align-items: end;
}

.task-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-form .wide {
  grid-column: span 4;
}

.task-form button,
.row-button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.row-button {
  min-height: 32px;
  padding: 0 9px;
  border-color: var(--line);
  background: #fff;
  color: var(--danger);
}

.status-select {
  min-width: 110px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fbf9;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef1ec;
  font-size: 12px;
  font-weight: 700;
}

.priority-high {
  background: #f8dde1;
  color: var(--danger);
}

.priority-medium {
  background: #f5e8d9;
  color: var(--warn);
}

.priority-low {
  background: #dde9f7;
  color: var(--accent-2);
}

.status-done {
  color: var(--done);
}

.status-missed {
  color: var(--danger);
}

.status-next {
  color: var(--warn);
}

@media (max-width: 820px) {
  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 18px;
  }

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

  .file-button,
  .ghost-button {
    width: 100%;
  }

  .summary-grid,
  .content-grid,
  .task-form {
    grid-template-columns: 1fr;
  }

  .task-form .wide {
    grid-column: auto;
  }

  .metric strong {
    font-size: 22px;
  }
}
