/* «Помощник» — the app of Azur Sofa Clean (ТЗ 07 §4): colours of the site's logo and the bot's
   avatar (mint, peach, brown), the phone's own font, the dark theme with the phone (or with
   Telegram, which tells us its scheme). The layout follows the mock-up Ed approved 15.10. */
:root {
  --bg: #F3F7F6; --card: #FFFFFF; --ink: #1F2B2A; --ink2: #5F6F6D; --ink3: #8C9A98; --line: #E3EAE8;
  --teal: #2C7A75; --teal-ink: #FFFFFF; --teal-soft: #E2F0EE; --mint: #9CCBC6;
  --peach: #E2AE85; --peach-soft: #FBEEE3; --brown: #4A3424;
  --green: #23784A; --green-soft: #E2F2E8; --red: #B83A2E; --red-soft: #FAE7E4;
  --amber: #9A6210; --amber-soft: #FBF0DC;
  --shadow: 0 1px 2px rgba(20,40,38,.06), 0 6px 18px rgba(20,40,38,.07);
  --scrim: rgba(10,20,18,.38); --toast: #1E2928; --toast-ink: #FFFFFF; --toast-act: #8FE0D6;
  --hero: linear-gradient(135deg, #2C7A75, #4E9C95 60%, #7FB9B2);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1514; --card: #18211F; --ink: #E8F0EE; --ink2: #9AABA8; --ink3: #6F807D; --line: #25312F;
    --teal: #5BB8AF; --teal-ink: #06201D; --teal-soft: #1A2E2B; --mint: #6FA9A3;
    --peach: #D99D71; --peach-soft: #2E231B; --brown: #E9D7C7;
    --green: #5BC48A; --green-soft: #16281E; --red: #F07C70; --red-soft: #2E1917;
    --amber: #E5AE55; --amber-soft: #2C2314;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --hero: linear-gradient(135deg, #1F5A56, #2C7A75 60%, #3F8F88);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1514; --card: #18211F; --ink: #E8F0EE; --ink2: #9AABA8; --ink3: #6F807D; --line: #25312F;
  --teal: #5BB8AF; --teal-ink: #06201D; --teal-soft: #1A2E2B; --mint: #6FA9A3;
  --peach: #D99D71; --peach-soft: #2E231B; --brown: #E9D7C7;
  --green: #5BC48A; --green-soft: #16281E; --red: #F07C70; --red-soft: #2E1917;
  --amber: #E5AE55; --amber-soft: #2C2314;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --hero: linear-gradient(135deg, #1F5A56, #2C7A75 60%, #3F8F88);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.view { padding: calc(14px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom)); }
.ro { position: sticky; top: 0; z-index: 30; background: var(--amber-soft); color: var(--amber);
  font-weight: 600; font-size: 13px; text-align: center; padding: 7px 12px; }

/* --- the bottom bar: Сегодня · Заказы · ＋ · Клиенты · Деньги (ТЗ §4) --- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-around; align-items: flex-start;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tab { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--ink3); font-weight: 500; min-height: 44px; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--teal); }
.tab.plus { margin-top: -16px; }
.tab.plus .b { width: 54px; height: 54px; border-radius: 27px; background: var(--teal); color: var(--teal-ink);
  display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--teal) 45%, transparent); }
.tab.plus svg { stroke-width: 2.4; }

/* --- common --- */
.center { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 24px; }
.center h1 { margin: 6px 0 0; font-size: 26px; }
.center p { color: var(--ink2); margin: 4px 0 14px; max-width: 300px; }
.logo { width: 96px; height: 96px; border-radius: 50%; box-shadow: var(--shadow); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 2px 16px; }
.h-date { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.h-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 0; line-height: 1.2; }
.ava { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
.sec { font-size: 13px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em;
  margin: 22px 4px 8px; display: flex; justify-content: space-between; gap: 8px; }
.sec small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink3); }
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.group { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line);
  width: 100%; text-align: left; min-height: 48px; }
.li:last-child { border-bottom: 0; }
.li .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: none;
  background: var(--teal-soft); }
.li .tx { flex: 1; min-width: 0; }
.li .tx b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.li .tx span { display: block; color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { color: var(--ink3); font-size: 20px; line-height: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 13px;
  border-radius: 12px; background: var(--bg); font-weight: 600; font-size: 14px; border: 1px solid var(--line);
  white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn.pri { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.btn.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.btn.full { width: 100%; min-height: 50px; border-radius: 14px; font-size: 16px; }
.btn[disabled] { opacity: .5; }
.free { color: var(--ink3); font-size: 14px; padding: 12px 14px; }
.note { color: var(--ink2); font-size: 14px; margin: 10px 4px; }
.empty { color: var(--ink2); text-align: center; padding: 28px 16px; }
.err { text-align: center; padding: 40px 18px; }
.err p { color: var(--ink2); margin: 0 0 16px; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--teal-soft); border-top-color: var(--teal);
  animation: sp 1s linear infinite; margin: 60px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }

/* --- «Сегодня» (П4) --- */
.hero { padding: 16px 18px; border-radius: 20px; color: #fff; background: var(--hero); }
.hero .k { font-size: 13px; opacity: .88; font-weight: 600; }
.hero .big { font-size: 28px; font-weight: 700; margin: 2px 0 10px; letter-spacing: -.01em; }
.hero .bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.28); overflow: hidden; }
.hero .bar i { display: block; height: 100%; background: #fff; border-radius: 4px; transition: width .4s; }
.hero .sub { font-size: 13px; margin-top: 9px; opacity: .94; }
.job { padding: 13px 14px 14px; margin-bottom: 10px; }
.job .jtop { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.job .jt { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.job .jd { font-size: 12px; color: var(--ink3); }
.job .price { margin-left: auto; font-weight: 700; font-size: 17px; }
.job .who { font-weight: 700; font-size: 16px; text-align: left; }
.job .who em { font-style: normal; font-weight: 500; color: var(--ink2); }
.job .what { color: var(--ink2); margin: 1px 0 11px; }
.job .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.job .acts .grow { flex: 1; }
.job .doneline { font-weight: 600; color: var(--green); font-size: 14px; }
.job.done { opacity: .78; }
.goalrow { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.goalrow p { margin: 0; font-size: 14px; color: var(--ink2); }
.goalrow p b { color: var(--ink); font-size: 15px; }
.ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--teal-soft) 0); }
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; }

/* --- «Заказы» (П6) --- */
.seg { display: flex; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 11px; padding: 3px;
  gap: 2px; margin-bottom: 14px; }
.seg button { flex: 1; min-height: 34px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.pager b { font-size: 16px; text-align: center; flex: 1; }
.pager button { width: 40px; height: 40px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow);
  font-size: 20px; color: var(--teal); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: 12px;
  font-size: 12px; color: var(--ink2); }
.wd b { font-size: 17px; color: var(--ink); }
.wd i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.wd i.y { background: var(--teal); }
.wd.on { background: var(--teal); color: var(--teal-ink); }
.wd.on b { color: var(--teal-ink); }
.wd.on i.y { background: var(--teal-ink); }
.dayh { display: flex; justify-content: space-between; font-weight: 700; margin: 18px 4px 8px; gap: 8px; }
.dayh span { font-weight: 500; color: var(--ink2); font-size: 13px; }
.ol { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center;
  width: 100%; text-align: left; }
.ol:last-child { border-bottom: 0; }
.ol .t { width: 48px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.ol .x { flex: 1; min-width: 0; }
.ol .x b { display: block; font-weight: 600; }
.ol .x span { font-size: 13px; color: var(--ink2); }
.ol .p { font-weight: 600; white-space: nowrap; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month .dn { text-align: center; font-size: 11px; color: var(--ink3); font-weight: 600; padding-bottom: 4px; }
.month .c { aspect-ratio: 1 / 1.08; border-radius: 10px; background: var(--card); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.month .c.e { background: transparent; box-shadow: none; }
.month .c small { font-size: 10px; font-weight: 700; color: var(--teal); height: 12px; }
.month .c.today { background: var(--teal); color: var(--teal-ink); }
.month .c.today small { color: var(--teal-ink); }
.month .c.past { color: var(--ink3); }
.lead { padding: 14px; margin-bottom: 10px; }
.lead .top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; align-items: baseline; }
.lead .top b { font-size: 16px; text-align: left; }
.lead .q { color: var(--ink2); font-size: 14px; margin: 4px 0 10px; }
.lead .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- «Клиенты» и карточка (П7, П8) --- */
.search { display: flex; align-items: center; gap: 8px; min-height: 42px; border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 0 12px; margin-bottom: 10px; color: var(--ink3); }
.search input { border: 0; background: transparent; flex: 1; outline: none; min-width: 0; font-size: 16px; padding: 10px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chips button span { color: var(--ink3); font-weight: 500; margin-left: 3px; }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button.on span { color: inherit; opacity: .7; }
.init { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  flex: none; background: var(--peach-soft); color: var(--brown); }
.back { color: var(--teal); font-weight: 600; font-size: 16px; margin: 0 0 10px; display: inline-flex; align-items: center;
  gap: 2px; min-height: 40px; }
.chead { text-align: center; margin-bottom: 14px; }
.chead .init { width: 76px; height: 76px; font-size: 26px; margin: 0 auto 10px; }
.chead h2 { margin: 0; font-size: 23px; }
.chead p { margin: 4px 0 0; color: var(--ink2); }
.qa { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 14px; }
.qa > * { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 4px 8px; display: flex;
  flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--teal);
  text-decoration: none; min-height: 58px; }
.qa i { font-style: normal; font-size: 20px; }
.debt { background: var(--amber-soft); border-radius: 16px; padding: 13px 14px; margin-bottom: 12px; }
.debt b { color: var(--amber); }
.debt .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.debt .one { border-top: 1px solid color-mix(in srgb, var(--amber) 20%, transparent); margin-top: 10px; padding-top: 10px; }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px; }
.photos .day { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--ink2); margin-top: 2px; }
.ph { aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden; background: var(--teal-soft); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.55);
  color: #fff; padding: 1px 6px; border-radius: 6px; }

/* --- «Деньги» (П9) --- */
.mtop { padding: 16px; }
.mrow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.mrow div { background: var(--bg); border-radius: 12px; padding: 9px 10px; min-width: 0; }
.mrow small { display: block; font-size: 12px; color: var(--ink2); font-weight: 600; }
.mrow b { font-size: 16px; white-space: nowrap; }
.mrow .in b { color: var(--green); }
.mrow .out b { color: var(--red); }
.mrow .loss b { color: var(--red); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding: 14px 14px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px;
  height: 100%; min-width: 0; }
.bars .stack { width: 100%; display: flex; flex-direction: column; }
.bars .b i { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--teal); display: block; }
.bars .b i.plan { background: repeating-linear-gradient(135deg, var(--teal-soft) 0 5px,
  color-mix(in srgb, var(--teal) 28%, transparent) 5px 8px); border-radius: 6px 6px 0 0; }
.bars .b em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink2); white-space: nowrap;
  line-height: 1.2; text-align: center; }
.blabels { display: flex; gap: 6px; padding: 6px 14px 14px; }
.blabels span { flex: 1; text-align: center; font-size: 11px; color: var(--ink3); min-width: 0; overflow: hidden; }

/* --- sheet, viewer, toast --- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; animation: up .25s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 12px; font-size: 19px; }
.sheet .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.sheet .stack { display: flex; flex-direction: column; gap: 10px; }
.sheet .say { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--teal);
  color: var(--teal-ink); border-radius: 18px; padding: 14px 16px; }
.sheet .say i { font-style: normal; font-size: 26px; }
.sheet .say b { display: block; font-size: 17px; }
.sheet .say span { display: block; font-size: 13px; opacity: .9; }
.sheet .opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg);
  border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; }
.sheet .opt i { font-style: normal; font-size: 22px; }
.sheet .opt b { display: block; }
.sheet .opt span { display: block; font-size: 13px; color: var(--ink2); }
.field { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--teal); border-radius: 14px;
  padding: 4px 12px; margin-bottom: 12px; }
.field input { border: 0; outline: none; background: transparent; flex: 1; font-size: 20px; padding: 10px 0; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink2); }
.kv b { text-align: right; font-weight: 600; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px;
  border-radius: 22px; background: rgba(255,255,255,.18); color: #fff; font-size: 22px; }
.viewer .nav { position: absolute; top: 50%; width: 44px; height: 64px; margin-top: -32px; color: #fff; font-size: 30px; }
.viewer .nav.l { left: 4px; } .viewer .nav.r { right: 4px; }
.viewer .cap { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  color: #fff; font-size: 13px; }
.toast { position: fixed; left: 14px; right: 14px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 532px; margin: 0 auto; background: var(--toast); color: var(--toast-ink); border-radius: 14px; padding: 12px 14px;
  font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast button { margin-left: auto; color: var(--toast-act); font-weight: 700; white-space: nowrap; min-height: 32px; }
.undobar { font-size: 13px; padding: 8px 12px; opacity: .96; }
.undobar .x { margin-left: 4px; color: var(--toast-ink); opacity: .7; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .spin { animation-duration: 3s; } }
