:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1a2233;
  --muted: #5b6577;
  --line: #e3e7ef;
  --accent: #2c5fb3;
  --accent-ink: #ffffff;
  --ok: #1f8a4c;
  --ok-bg: #e5f5ec;
  --err: #b3261e;
  --err-bg: #fbeaea;
  --shadow: 0 2px 14px rgba(20, 28, 50, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100%;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 18px;
}
.brand .dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.brand h1 {
  font-size: 17px;
  margin: 0;
  letter-spacing: 0.2px;
}
.brand h1 small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}
.brand h1 { flex: 1; min-width: 0; }

.brand-link,
.brand-link:link,
.brand-link:visited,
.brand-link:hover,
.brand-link:active,
.brand-link:focus {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: 8px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.brand-link h1,
.brand-link h1 small { color: inherit; text-decoration: none; }
.brand-link:hover .dot { transform: scale(1.06); transition: transform .12s; }
.brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lang-switch {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfe;
}
.lang-btn {
  border: 0;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font: 700 12px/1 inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  min-width: 36px;
  min-height: 32px;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
.lang-btn:hover { color: var(--accent); }
.lang-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}
.lang-btn.active:hover { color: var(--accent-ink); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.card p.lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 6px;
  color: var(--ink);
}
label .req { color: var(--err); margin-left: 2px; }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="email"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  min-height: 46px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 95, 179, 0.15);
}
select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235b6577' d='M6 8L0 0h12z'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.cleaner-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.cleaner-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 10px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
}
.cleaner-list label:hover { background: #f5f7fb; }
.cleaner-list input[type="checkbox"],
.cleaner-list input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }

.cleaner-row { padding: 2px 0; }
.cleaner-row + .cleaner-row { border-top: 1px dashed var(--line); }
.cleaner-info {
  padding: 0 10px 10px 38px;
  font-size: 13px;
  color: var(--muted);
}
.cleaner-info-line { display: inline-block; }
.cleaner-info-line.missing { color: var(--err); }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  font: inherit;
  font-size: 14px;
}
input[type="file"]:focus { outline: none; border-color: var(--accent); }

.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.photo-thumb {
  position: relative;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f1f5;
}
.photo-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo-thumb .rm {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font: 700 15px/1 sans-serif;
  cursor: pointer;
}
.photo-thumb .rm:hover { background: rgba(0, 0, 0, 0.8); }
.photo-thumb .video-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 6px;
  color: var(--ink); background: #eaeef7;
  font: 600 11px/1.3 inherit;
}
.photo-thumb .video-badge small { font-weight: 400; color: var(--muted); font-size: 10px; word-break: break-all; }

.radio-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 4px;
}
.radio-pill {
  flex: 1 1 120px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  cursor: pointer;
  font: 600 15px/1 inherit;
  transition: border-color .12s, background .12s;
}
.radio-pill input[type="radio"] { accent-color: var(--accent); }
.radio-pill:hover { border-color: var(--accent); }
.radio-pill:has(input:checked) { border-color: var(--accent); background: #eaf0fb; color: var(--accent); }

.upload-block { margin-top: 4px; }

button.primary {
  margin-top: 18px;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: 14px 16px;
  font: 600 16px/1 inherit;
  border-radius: 12px;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary:active { transform: translateY(1px); }

.ghost {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 10px;
  font: 600 14px/1 inherit;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
}
.ghost:hover { background: #f5f7fb; }
a.ghost { line-height: 1.2; }

.totals {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #f0f4fb;
  color: var(--ink);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.totals strong { font-size: 18px; }

.banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 14px;
}
.banner.ok  { background: var(--ok-bg);  color: var(--ok);  }
.banner.err { background: var(--err-bg); color: var(--err); }

.id-card {
  text-align: center;
  padding: 24px 16px;
}
.id-card .label { color: var(--muted); font-size: 13px; }
.id-card .id {
  font: 700 42px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 2px;
  margin: 6px 0 14px;
  color: var(--accent);
}
.id-card .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.recent {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  margin-bottom: 14px;
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
}
.recent-head strong { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0.2px; text-transform: uppercase; }
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.recent-list li { margin: 0; }
.recent-item {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.recent-item:hover { background: #f0f4fb; border-color: var(--accent); }
.recent-item .qlk-inv {
  font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  letter-spacing: 1px;
}
.recent-item .qlk-sep { color: var(--line); font-size: 12px; }
.recent-item .qlk-date,
.recent-item .qlk-add,
.recent-item .qlk-client {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .qlk-date { white-space: nowrap; }
.link {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--accent);
  font: 600 12px/1 inherit;
  cursor: pointer;
  border-radius: 6px;
}
.link:hover { background: #eef2fa; }

.new-cleaner-list {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 4px;
  margin-top: 6px;
}
.new-cleaner-row { padding: 6px 4px; }
.new-cleaner-row + .new-cleaner-row { border-top: 1px dashed var(--line); }
.new-cleaner-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
}
.new-cleaner-head input[type="text"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
.new-cleaner-head .rm-newcleaner {
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted);
  font: 700 20px/1 sans-serif;
  cursor: pointer;
}
.new-cleaner-head .rm-newcleaner:hover { background: #f0f4fb; color: var(--err); }
.new-cleaner-row .cleaner-contact { padding: 0 8px 6px 8px; }
.add-new-cleaner {
  display: inline-block;
  margin-top: 8px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  font: 600 13px/1 inherit;
  cursor: pointer;
}
.add-new-cleaner:hover { border-color: var(--accent); background: #eef2fa; }

.home-buttons {
  display: grid;
  gap: 14px;
}
.home-buttons a {
  display: block;
  padding: 22px 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
}
.home-buttons a .num {
  display: inline-block;
  width: 32px; height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: 700;
  margin-right: 12px;
}
.home-buttons a strong { font-size: 17px; }
.home-buttons a small { display: block; color: var(--muted); margin: 4px 0 0 44px; font-size: 13px; }
