:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #f0eee7;
  --ink: #21201d;
  --muted: #6e6a61;
  --line: #ded8cd;
  --mint: #1f9d7a;
  --mint-soft: #dff4ec;
  --coral: #d95f59;
  --coral-soft: #fae1dc;
  --amber: #b88110;
  --amber-soft: #f8ebc7;
  --steel: #4c6874;
  --steel-soft: #dce8ec;
  --shadow: 0 18px 45px rgba(37, 34, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: #23231f;
  color: #f8f5ec;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f7cf5c;
  color: #23231f;
  font-weight: 800;
}

.brand span,
.sidebar-status {
  display: block;
  color: rgba(248, 245, 236, 0.68);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(248, 245, 236, 0.76);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-icon {
  width: 28px;
  color: #f7cf5c;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #52d19b;
  box-shadow: 0 0 0 6px rgba(82, 209, 155, 0.16);
}

.app-shell {
  min-width: 0;
  padding: 30px;
}

.topbar,
.section-heading,
.panel-heading,
.report-item,
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.topbar-actions,
.segmented,
.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-date,
.month-picker {
  min-width: 170px;
  align-self: stretch;
  display: grid;
  gap: 5px;
}

.topbar-date input,
.month-picker input {
  min-height: 42px;
}

.primary-button,
.ghost-button,
.segmented button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-button {
  background: var(--ink);
  color: #ffffff;
}

.ghost-button,
.segmented button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.small-button {
  min-height: 38px;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.segmented .selected {
  background: var(--ink);
  color: #fff;
}

.section-actions {
  align-items: center;
  justify-content: flex-end;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.summary-tile,
.panel,
.task-table,
.team-card,
.report-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-tile {
  min-height: 134px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.summary-tile span,
.summary-tile small,
.task-meta,
.report-meta,
.staff-role,
.task-status {
  color: var(--muted);
  font-size: 13px;
}

.summary-tile strong {
  display: block;
  font-size: 36px;
}

.accent-mint {
  background: linear-gradient(135deg, #ffffff, var(--mint-soft));
}

.accent-coral {
  background: linear-gradient(135deg, #ffffff, var(--coral-soft));
}

.accent-amber {
  background: linear-gradient(135deg, #ffffff, var(--amber-soft));
}

.accent-ink {
  background: linear-gradient(135deg, #ffffff, var(--steel-soft));
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.75fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.panel {
  padding: 20px;
}

.compact-heading {
  align-items: flex-start;
}

.status-pill,
.difficulty-pill,
.task-owner,
.task-status,
.problem-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  background: var(--mint-soft);
  color: #11684e;
}

.staff-load-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.staff-load {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr minmax(106px, auto);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.staff-load:first-child {
  border-top: 0;
}

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

.staff-name strong {
  font-size: 16px;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--amber), var(--coral));
}

.load-score {
  min-width: 72px;
  text-align: right;
  font-weight: 800;
}

.free-task-panel {
  align-self: start;
}

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

.motivation-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.motivation-top,
.motivation-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.motivation-bottom {
  color: var(--muted);
  font-size: 13px;
}

.money-plus {
  color: #11684e;
  font-weight: 900;
}

.money-minus {
  color: #8f2b25;
  font-weight: 900;
}

.money-neutral {
  color: var(--muted);
  font-weight: 900;
}

.employee-picker {
  margin-top: 16px;
}

.claim-status {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.free-task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.free-task-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.free-task-item strong {
  line-height: 1.3;
}

.free-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.claim-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.claim-button:disabled {
  cursor: not-allowed;
  background: var(--surface-soft);
  color: var(--muted);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.section-heading {
  margin-bottom: 16px;
}

.month-heading {
  margin-top: 22px;
}

.month-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.month-summary-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.month-summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.month-summary-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.task-table,
.report-list {
  overflow: hidden;
}

.task-row {
  min-height: 76px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.task-row:first-child {
  border-top: 0;
}

.task-main {
  min-width: 0;
}

.task-main strong,
.report-item strong {
  display: block;
  margin-bottom: 5px;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-actions,
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-actions button,
.card-actions button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.task-actions button:disabled {
  cursor: not-allowed;
  background: var(--surface-soft);
  color: var(--muted);
}

.task-actions button:first-child {
  background: var(--ink);
  color: #fff;
}

.difficulty-pill.easy {
  background: var(--mint-soft);
  color: #11684e;
}

.difficulty-pill.medium {
  background: var(--amber-soft);
  color: #805908;
}

.difficulty-pill.hard {
  background: var(--coral-soft);
  color: #8f2b25;
}

.task-owner,
.task-status,
.problem-tag {
  background: var(--surface-soft);
  color: var(--ink);
}

.danger-button {
  background: var(--coral-soft) !important;
  color: #8f2b25 !important;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-card {
  min-height: 190px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.muted-card {
  opacity: 0.68;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--steel-soft);
  color: #253f49;
  font-weight: 900;
}

.report-list {
  display: grid;
}

.report-item {
  min-height: 92px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.report-item:first-child {
  border-top: 0;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-actions button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.report-actions button:first-child {
  background: var(--ink);
  color: #fff;
}

.report-photo {
  width: min(260px, 100%);
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.tool-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-item strong,
.tool-item span {
  display: block;
}

.tool-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.tool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-actions button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(22, 22, 18, 0.5);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 4px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.form-grid.wide-left {
  grid-template-columns: 1fr 170px;
}

.check-field {
  min-height: 42px;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-self: end;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.check-field input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

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

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 520px;
  }

  .sidebar-status {
    margin-top: 0;
  }

  .summary-grid,
  .month-report-grid,
  .team-grid,
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .task-row,
  .report-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .month-report-grid,
  .team-grid,
  .tools-grid,
  .nav {
    grid-template-columns: 1fr;
  }

  .staff-load {
    grid-template-columns: 1fr;
  }

  .load-score {
    text-align: left;
  }

  .task-badges,
  .task-actions,
  .card-actions,
  .report-actions,
  .tool-actions,
  .section-actions,
  .modal-actions {
    justify-content: flex-start;
  }

  .tool-item {
    align-items: flex-start;
    flex-direction: column;
  }

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