:root {
  color-scheme: light;
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --border: #d8e7e3;
  --text: #063331;
  --muted: #657371;
  --brand: #0b4a45;
  --brand-strong: #073936;
  --ok: #20b7a6;
  --danger: #d94d45;
  --warn: #f2b43d;
  --shadow: 0 10px 30px rgb(5 39 36 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.topbar,
.manager-card,
.date-row,
.task-card,
.status-panel,
.dialog-card,
.empty-state {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--ok);
  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: 26px;
  line-height: 1.1;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  color: #fff;
  background: var(--brand);
  font-size: 24px;
}

.manager-card,
.date-row,
.status-panel {
  margin-top: 10px;
  padding: 12px 14px;
}

.manager-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.manager-name {
  font-size: 18px;
  font-weight: 900;
}

.muted {
  color: var(--muted);
  font-weight: 700;
}

.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.date-row input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

.counter {
  border-radius: 999px;
  padding: 9px 12px;
  background: #fae9e8;
  color: #a72c2b;
  font-weight: 900;
  white-space: nowrap;
}

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

.task-card {
  padding: 14px;
}

.task-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.client-name {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 900;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  border-radius: 999px;
  padding: 6px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pill.group {
  color: var(--brand);
  background: #dff5ef;
}

.status {
  color: var(--brand);
  background: #e8f3f1;
}

.status.done {
  color: #08786e;
  background: #dff8f3;
}

.status.failed,
.status.overdue {
  color: #a72c2b;
  background: #fae9e8;
}

.money-line,
.contacts-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.task-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.secondary-button {
  color: var(--brand);
  background: #dff5ef;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.status-panel.error {
  border-color: #f0b8b4;
  color: #8d2420;
  background: #fff0ef;
  font-weight: 800;
}

.status-panel.ok {
  border-color: #b8e7dd;
  color: #08786e;
  background: #edf9f6;
  font-weight: 800;
}

.empty-state {
  margin-top: 10px;
  padding: 24px 16px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.task-dialog {
  width: min(640px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.task-dialog::backdrop {
  background: rgb(3 27 25 / 48%);
}

.dialog-card {
  position: relative;
  padding: 18px;
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.dialog-title {
  max-width: calc(100% - 44px);
  margin-bottom: 12px;
  font-size: 22px;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 430px) {
  h1 {
    font-size: 23px;
  }

  .task-head,
  .task-actions,
  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
