/* Magic Mayo's Cleaning Service - app styles (demo design port) */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light dark;
  --bg: #faf9f6; --surface: #ffffff; --surface2: #f0efe9;
  --text: #1c1917; --dim: #78716c; --border: #e7e5e4;
  --accent: #14532d; --accent-text: #ffffff;
  --amber: #b45309; --amber-bg: #fef3c7;
  --green: #15803d; --green-bg: #dcfce7;
  --red: #b91c1c; --red-bg: #fee2e2;
  --blue: #1e40af; --blue-bg: #dbeafe;
  --ava-bg: #dcfce7; --ava-text: #14532d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 6px 18px rgba(28, 25, 23, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09; --surface: #1c1917; --surface2: #292524;
    --text: #fafaf9; --dim: #a8a29e; --border: #292524;
    --accent: #22c55e; --accent-text: #052e16;
    --amber: #fbbf24; --amber-bg: #451a03;
    --green: #4ade80; --green-bg: #052e16;
    --red: #f87171; --red-bg: #450a0a;
    --blue: #93c5fd; --blue-bg: #172554;
    --ava-bg: #052e16; --ava-text: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
h2 { font-family: "Archivo", system-ui, sans-serif; font-size: 20px; font-weight: 700; margin: 22px 0 10px; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px 64px; }
main { min-height: 50vh; }

/* ---------- header ---------- */
header.top {
  padding: 22px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 4.5vw, 34px);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.userinfo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--dim); padding-top: 8px; }

/* ---------- tabs (segmented bar) ---------- */
nav.tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0 18px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 5px;
}
nav.tabs button {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-weight: 700;
  font-size: 14.5px;
  padding: 10px 8px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}
nav.tabs button:hover { background: transparent; color: var(--text); box-shadow: none; }
nav.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (max-width: 560px) { nav.tabs button { font-size: 13px; padding: 9px 3px; } }

/* ---------- controls ---------- */
button {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: default; }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--surface2); filter: none; }
button.danger { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { button.danger { color: #450a0a; } }
button.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
input, select, textarea {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  width: 100%;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ava-bg);
}
label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { margin: 0; }
.spread { justify-content: space-between; }
.boardnav { margin-bottom: 14px; }
.boardnav strong { font-size: 14.5px; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.stat .v { font-family: "Archivo", system-ui, sans-serif; font-size: 26px; font-weight: 800; line-height: 1; }
.stat .l { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); margin-top: 5px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- week day-strip (day view) ---------- */
.daystrip { display: flex; gap: 6px; margin-bottom: 16px; }
.daystrip button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dim);
  border-radius: 10px;
  padding: 8px 2px;
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.25;
  box-shadow: none;
}
.daystrip button:hover { filter: none; border-color: var(--dim); }
.daystrip button .dow { display: block; }
.daystrip button .d { display: block; font-size: 16px; color: var(--text); font-weight: 800; }
.daystrip button .has { display: block; font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.daystrip button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.daystrip button[aria-pressed="true"] .d { color: var(--accent-text); }

/* ---------- day heading ---------- */
.dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.dayhead h2 { font-size: 21px; margin: 0; font-weight: 800; }
.dayhead .sub { color: var(--dim); font-size: 13.5px; font-weight: 600; }

/* ---------- job cards ---------- */
.jobs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .jobs { grid-template-columns: 1fr; } }
.job {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.job .r1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job .jprop { font-weight: 800; font-size: 17.5px; letter-spacing: .01em; }
.job .jclient { font-size: 12.5px; color: var(--dim); font-weight: 700; }
.job .time { font-weight: 700; font-size: 13.5px; color: var(--dim); white-space: nowrap; }
.job .who { display: flex; align-items: center; gap: 9px; }
.ava {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ava-bg); color: var(--ava-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px; flex: none;
}
.ava-none { background: var(--surface2); color: var(--dim); }
.who .nm { font-weight: 700; font-size: 14.5px; }
.who .rl { font-size: 12px; color: var(--dim); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.in { background: var(--blue-bg); color: var(--blue); }
.badge.wait { background: var(--surface2); color: var(--dim); }
.badge.done { background: var(--green-bg); color: var(--green); }
.badge.cancel { background: var(--red-bg); color: var(--red); }
.jobmoney { display: flex; gap: 8px; flex-wrap: wrap; }
.jobmoney span { background: var(--surface2); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 700; }
.jobmoney span b { font-weight: 800; }
.jobmoney .deep { background: var(--amber-bg); color: var(--amber); }
.job .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.job .assignrow { margin-top: 2px; }
.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  color: var(--dim);
  font-weight: 600;
}
.empty b { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }

/* ---------- generic cards, chips, alerts ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 5px; font-size: 16px; font-weight: 800; font-family: "Archivo", system-ui, sans-serif; }
.meta { color: var(--dim); font-size: 13px; font-weight: 600; }
.alert {
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: var(--radius);
  padding: 12px 15px;
  margin: 12px 0;
  font-weight: 700;
  font-size: 14px;
}
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface2); color: var(--dim); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.gray { background: var(--surface2); color: var(--dim); }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- tables ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 14.5px;
}
th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 11px 16px 7px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}
td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.paynote { margin-top: 13px; color: var(--dim); font-size: 13.5px; font-weight: 600; }

/* ---------- week grid view ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week .day { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px; box-shadow: var(--shadow); }
.week .day h4 { margin: 2px 2px 9px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); }
.week .job { padding: 10px; margin: 8px 0; box-shadow: none; gap: 7px; }
.week .job .jprop { font-size: 13.5px; }
.week .job .time { font-size: 12px; }
.week .job .jobmoney span { font-size: 12px; padding: 4px 7px; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
details summary { cursor: pointer; font-weight: 700; margin: 12px 0; color: var(--accent); }

/* ---------- auth ---------- */
.auth-wrap {
  max-width: 420px;
  margin: 56px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
}
.auth-wrap h1 { font-size: 24px; margin: 0 0 6px; font-weight: 800; font-family: "Archivo", system-ui, sans-serif; letter-spacing: -.01em; }
.error { background: var(--red-bg); color: var(--red); border-radius: 9px; padding: 10px 13px; font-size: 14px; margin: 10px 0; font-weight: 600; }
.ok { background: var(--green-bg); color: var(--green); border-radius: 9px; padding: 10px 13px; font-size: 14px; margin: 10px 0; font-weight: 600; }
@media (max-width: 640px) { .auth-wrap { margin: 28px 14px; } }
