:root {
  --bg: #f4f7f2;
  --panel: #ffffff;
  --text: #172018;
  --muted: #657064;
  --line: #d9e2d5;
  --brand: #2f6b3f;
  --brand-dark: #255733;
  --accent: #e8b84b;
  --danger: #b73535;
  --ok: #27724b;
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost {
  background: #e7eee4;
  color: var(--brand-dark);
}

.danger {
  background: var(--danger);
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.forgot-card {
  display: none;
  margin-top: 12px;
}

.forgot-card.show {
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

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

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.summary {
  min-height: 78px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.summary strong {
  font-size: 26px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px;
}

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

.customer-picker {
  display: grid;
  gap: 6px;
}

.customer-search {
  min-height: 40px;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  font-weight: 700;
}

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

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

.chips .check {
  position: relative;
  justify-content: center;
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.15;
  cursor: pointer;
  border-radius: 999px;
}

.chips .check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chips .check:has(input:checked) {
  border-color: #2474c9;
  background: #2474c9;
  color: #fff;
}

.hourly-field {
  display: none;
}

.hourly-field.show {
  display: grid;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  min-height: 42px;
  white-space: nowrap;
  background: #e7eee4;
  color: var(--brand-dark);
  padding: 0 14px;
}

.tab.active {
  background: var(--brand);
  color: #fff;
}

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

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

.item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef1ed;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.badge.sent {
  background: #dff0e6;
  color: var(--ok);
}

.badge.wait {
  background: #fff3ce;
  color: #7b5a08;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f5;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-form button {
  min-height: 46px;
}

.job-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f5;
  color: var(--muted);
  padding: 5px 6px 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.job-list button {
  width: 22px;
  min-height: 22px;
  border-radius: 999px;
  padding: 0;
  background: #e5ece2;
  color: var(--danger);
  line-height: 1;
}

.muted {
  color: var(--muted);
}

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

.actions button,
.actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 700;
}

.actions a,
.whatsapp-btn {
  background: #25d366;
  color: #fff;
}

.notice {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 10px;
  display: none;
}

.notice.show {
  display: block;
}

.notice.ok {
  background: #dff0e6;
  color: #145533;
}

.notice.err {
  background: #f7dcdc;
  color: #7f1d1d;
}

.desktop-only {
  display: block;
}

@media (max-width: 760px) {
  .wrap {
    padding: 10px;
  }

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

  .admin-quick,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .desktop-only {
    display: none;
  }

  .topbar-inner {
    padding: 10px;
  }

  .panel {
    padding: 12px;
  }

  button {
    width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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