@font-face { font-family: "Gosha Sans"; src: url("fonts/GoshaSans-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Urbane"; src: url("fonts/urbane-medium.otf") format("opentype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Urbane"; src: url("fonts/urbane-demibold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Urbane"; src: url("fonts/urbane-bold.otf") format("opentype"); font-weight: 700 900; font-display: swap; }

:root {
  --bg: #f4f4f2; --card: #fff; --ink: #111; --muted: #5c5f66; --line: #111;
  --or: #ff7842; --or-soft: #ffe3d6; --graf: #25282d; --off: #e7e7e5;
  --ok: #1d7a46; --ok-soft: #dff3e7; --warn: #a14a00; --warn-soft: #fff0e0; --bad: #c62828;
  --head: "Gosha Sans", "Arial Black", system-ui, sans-serif;
  --body: "Urbane", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
h1, h2 { font-family: var(--head); font-weight: 700; margin: 0 0 6px; line-height: 1.15; }
h1 { font-size: 26px; } h2 { font-size: 19px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--or); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px 80px; }
.loading { color: var(--muted); padding: 30px 0; }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
hr { border: 0; border-top: 2px solid var(--line); margin: 24px 0; }

/* top */
.top { background: var(--graf); color: #fff; border-bottom: 4px solid var(--or); }
@media (min-width: 820px) { .top { position: sticky; top: 0; z-index: 10; } }
.top-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.logo { color: #fff; text-decoration: none; font-family: var(--head); font-size: 17px; white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; }
.logo img { height: 26px; width: auto; display: block; }
.logo span { border-left: 2px solid #6b6f76; padding-left: 12px; }
.chev { color: var(--or); }
.topnav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.topnav[hidden] { display: none; }
.tab { background: transparent; color: #cfd1d4; border: 2px solid transparent; font: 600 14px var(--body); padding: 6px 10px; cursor: pointer; }
.tab.on { color: #fff; border-color: var(--or); }
.topnav .btn.ghost { color: #fff; border-color: #6b6f76; padding: 6px 10px; font-size: 14px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 15px var(--body); color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: 0; padding: 10px 16px; cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:hover { box-shadow: 4px 4px 0 var(--line); transform: translate(-2px, -2px); }
.btn:active { box-shadow: none; transform: none; }
.btn.primary { background: var(--or); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 14px; }
.btn.sq { width: 42px; height: 42px; padding: 0; font-size: 22px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; transform: none; }
input, select, textarea { font: 16px var(--body); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 0; padding: 9px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--or); outline-offset: 0; }
label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
label > input, label > select { margin-top: 4px; }
.inrow { display: flex; gap: 6px; margin-top: 4px; align-items: stretch; }
.inrow input { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 16px 8px 0; }
.chk input { width: 20px; height: 20px; accent-color: var(--or); }

.card { background: var(--card); border: 2px solid var(--line); box-shadow: 6px 6px 0 var(--line); padding: 20px; margin-bottom: 22px; }
.auth { max-width: 420px; margin: 30px auto; }
.auth .switch { margin: 16px 0 4px; }
.auth a { color: var(--ink); font-weight: 700; text-decoration-color: var(--or); text-decoration-thickness: 2px; }
.narrow { max-width: 640px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; margin-top: 14px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } .grid4 { grid-template-columns: 2fr 1.5fr 1.5fr 1fr; } }

/* editor head */
.ehead { margin-bottom: 14px; }
.ehead-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.back { margin-bottom: 12px; }
.mnav { display: flex; align-items: center; gap: 8px; }
.mname { font-family: var(--head); font-size: 18px; min-width: 150px; text-align: center; text-transform: capitalize; }
.sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 760px) { .sum { grid-template-columns: 1.3fr repeat(5, 1fr); } }
.stat { background: #fff; border: 2px solid var(--line); padding: 8px 10px; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.stat b { font-family: var(--head); font-size: 19px; }
.stat.big { background: var(--or); grid-column: span 2; }
.stat.big span { color: var(--ink); }
.stat.big b { font-size: 24px; }
@media (min-width: 760px) { .stat.big { grid-column: auto; } }
.stat.warn { background: var(--warn-soft); } .stat.ok { background: var(--ok-soft); }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.save-st { font-size: 14px; color: var(--muted); }
.save-st.done::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* days */
.days { display: flex; flex-direction: column; gap: 6px; }
.day { display: grid; grid-template-columns: 52px 1fr; grid-template-areas: "dd typ" "dd h" "dd u"; gap: 6px 10px; align-items: center;
  background: #fff; border: 2px solid var(--line); padding: 8px 10px; position: relative; }
.day .dd { grid-area: dd; display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: stretch; border-right: 2px solid var(--off); padding-right: 8px; }
.day .dd b { font-family: var(--head); font-size: 22px; line-height: 1; }
.day .dd span { font-size: 13px; color: var(--muted); font-weight: 700; }
.f-typ { grid-area: typ; } .f-h { grid-area: h; display: flex; align-items: center; gap: 10px; } .f-u { grid-area: u; }
.f-typ select, .f-u input { padding: 7px 8px; }
.hl { display: flex; align-items: center; margin: 0; position: relative; width: 104px; flex: none; }
.hl input { padding: 7px 26px 7px 8px; font-weight: 700; font-size: 17px; text-align: right; margin: 0; }
.hl .unit { position: absolute; right: 8px; color: var(--muted); font-weight: 700; }
.hlab { font-size: 13px; color: var(--muted); }
.hin::placeholder { font-weight: 400; color: #a3a5a9; font-size: 15px; }
.day.filled { border-left: 8px solid var(--or); }
.day.today { box-shadow: 4px 4px 0 var(--or); }
.day.saving .dd b { opacity: .45; }
.day.saved::after { content: "✓"; position: absolute; top: 4px; right: 8px; color: var(--ok); font-weight: 800; }
.day.bad { border-color: var(--bad); }
.day.bad .hin { border-color: var(--bad); background: #fff3f3; }
.day.off { background: var(--off); border-color: #c9c9c6; grid-template-areas: "dd typ"; padding: 4px 10px; }
.day.off .dd { border-right-color: #d3d3d0; }
.day.off .dd b { font-size: 16px; color: var(--muted); }
.offtxt { font-size: 14px; color: var(--muted); }
@media (min-width: 820px) {
  .day { grid-template-columns: 56px minmax(220px, 1.3fr) 214px 1fr; grid-template-areas: "dd typ h u"; }
  .day.off { grid-template-columns: 56px 1fr; }
}

/* admin */
.subtabs { display: flex; gap: 0; margin-bottom: 18px; border: 2px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; }
.subtabs button { font: 700 15px var(--body); background: #fff; border: 0; border-right: 2px solid var(--line); padding: 9px 14px; cursor: pointer; }
.subtabs button:last-child { border-right: 0; }
.subtabs button.on { background: var(--ink); color: #fff; }
.tbl-wrap { margin-bottom: 16px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 2px solid var(--line); }
.tbl th { background: var(--graf); color: #fff; text-align: left; font-size: 13px; padding: 8px 10px; }
.tbl td { padding: 8px 10px; border-top: 1px solid #d5d5d2; vertical-align: middle; }
.tbl td input { padding: 6px 8px; }
.w-kod { max-width: 110px; } .w-n { max-width: 90px; }
.pill { display: inline-block; font-weight: 700; font-size: 13px; padding: 2px 8px; border: 2px solid var(--line); }
.pill.warn { background: var(--warn-soft); } .pill.ok { background: var(--ok-soft); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border: 1.5px solid var(--muted); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.tag.or { border-color: var(--line); background: var(--or); color: var(--ink); }
@media (max-width: 719px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 2px solid var(--line); padding: 6px 0; }
  .tbl td { border: 0; padding: 4px 10px; display: flex; gap: 10px; align-items: center; }
  .tbl td[data-l]::before { content: attr(data-l); flex: 0 0 110px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
  .tbl td:first-child { display: block; }
  .tbl td:first-child[data-l]::before { display: none; }
  .ztbl td:first-child { display: flex; }
  .ztbl td:first-child[data-l]::before { display: block; }
  .w-kod, .w-n { max-width: none; }
}
.add summary { font-family: var(--head); font-size: 18px; cursor: pointer; }
.person { padding: 16px; box-shadow: 4px 4px 0 var(--line); }
.person.inactive { opacity: .7; background: #f9f9f8; }
.ph { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 12px; }
.ph b { font-family: var(--head); font-size: 18px; }
.checks { margin: 0 0 8px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pwbox { margin-top: 10px; max-width: 420px; }
.invite { border-color: var(--line); background: var(--or-soft); }
.invite textarea { margin: 8px 0 12px; font-size: 14px; resize: vertical; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 150%); background: var(--graf); color: #fff; padding: 12px 18px;
  border: 2px solid var(--or); font-weight: 600; max-width: calc(100% - 32px); transition: transform .2s; z-index: 50; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.bad { border-color: var(--bad); background: #3a1414; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
