/* Clap Crew admin workspace. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --ink: #211A23;
  --ink-2: #35283B;
  --muted: #615866;
  --faint: #8A8AA3;
  --mist: #F8F6F0;
  --surface: #FFFFFF;
  --lilac: #E8DEF0;
  --line: #DCD4DC;
  --line-2: #EEECF5;
  --violet: #674082;
  --violet-deep: #4D2C65;
  --coral: #FF5A5F;
  --green: #0E9F75;
  --green-bg: #E3F6EF;
  --amber: #B26A00;
  --amber-bg: #FFF2DC;
  --red: #D63B40;
  --red-bg: #FFE8E8;
  --blue: #2B5BD9;
  --blue-bg: #E6EEFF;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --radius: 18px;
  --radius-s: 12px;
  --sidebar: 248px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico--star { fill: #FFB020; stroke: none; width: 15px; height: 15px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; }
.brand img { width: 40px; height: auto; }
.brand b { color: var(--violet); font-weight: 800; }
.brand__tag { font-size: .72rem; font-weight: 700; letter-spacing: 0; color: var(--violet-deep); background: var(--lilac); padding: 2px 8px; border-radius: 999px; }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: .93rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--violet-deep); }
.btn--quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--quiet:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px #CFCBE2; background: #FCFBFF; }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #B92F34; }
.btn--danger-quiet { background: var(--surface); color: var(--red); box-shadow: inset 0 0 0 1.5px #F3C5C7; }
.btn--danger-quiet:hover:not(:disabled) { background: var(--red-bg); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn--sm .ico { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn--danger:hover { background: var(--red-bg); color: var(--red); }
.link { color: var(--violet-deep); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link--small { font-size: .85rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--violet-deep); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: grid; gap: 6px; }
.field__label { font-weight: 700; font-size: .88rem; }
.field-error { color: var(--red); font-size: .88rem; font-weight: 600; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-s); border: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s;
}
.input:hover { box-shadow: inset 0 0 0 1.5px #CFCBE2; }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--violet); }
.input:disabled { background: var(--mist); color: var(--faint); }
textarea.input { resize: vertical; min-height: 96px; }
.input--sm { min-height: 38px; padding: 7px 10px; font-size: .9rem; border-radius: 10px; }
.input--select { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D5D78' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }
select.input--sm { appearance: none; padding-right: 26px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D5D78' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 6px center / 15px; }
.search { position: relative; display: block; flex: 1 1 240px; min-width: 0; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input--search { padding-left: 40px; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 110% -10%, rgba(108,59,255,.10), transparent 60%),
  radial-gradient(900px 500px at -20% 110%, rgba(255,90,95,.07), transparent 60%), var(--mist); }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 26px; padding: 30px 28px 28px; box-shadow: 0 30px 70px -40px rgba(20,20,43,.35), inset 0 0 0 1px var(--line-2); display: grid; gap: 26px; }
.auth__form { display: grid; gap: 16px; }
.auth__title { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
.auth__lede { color: var(--muted); margin-top: -6px; }
.auth__msg { font-size: .9rem; font-weight: 600; color: var(--red); background: var(--red-bg); padding: 10px 12px; border-radius: 10px; }
.auth__msg[data-tone="ok"] { color: #0B6E52; background: var(--green-bg); }
.auth .link-btn { justify-self: center; margin-top: 2px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 22px 16px 18px; background: var(--surface); border-right: 1px solid var(--line-2);
}
.sidebar > .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; font-weight: 600; color: var(--muted);
}
.nav__link:hover { background: var(--mist); color: var(--ink); }
.nav__link[aria-current="page"] { background: var(--lilac); color: var(--violet-deep); }
.nav__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--coral); color: #fff; font-size: .74rem; font-weight: 800; display: grid; place-items: center; }
.sidebar__foot { margin-top: auto; display: grid; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line-2); justify-items: start; }
.sidebar__user { font-size: .84rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emu-flag { font-size: .76rem; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 3px 9px; border-radius: 999px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  min-height: 68px; padding: 0 32px; background: rgba(247,247,251,.86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar__title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.035em; }
.brand--compact, .topbar__out { display: none; }
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(14,159,117,.15); }
.main { padding: 8px 32px 48px; outline: none; }
.view { display: grid; gap: 20px; max-width: 1280px; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; min-height: 60px; gap: 10px; }
  .topbar__title { font-size: 1.3rem; }
  .brand--compact { display: inline-flex; }
  .brand--compact img { width: 32px; }
  .topbar__out { display: grid; }
  .live { margin-left: auto; }
  .main { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line-2);
  }
  .tabbar__link { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 2px; border-radius: 12px; text-decoration: none; font-size: .72rem; font-weight: 700; color: var(--muted); }
  .tabbar__link .ico { width: 22px; height: 22px; }
  .tabbar__link[aria-current="page"] { color: var(--violet-deep); background: var(--lilac); }
  .tabbar__link .nav__badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: .66rem; padding: 0 5px; margin: 0; }
}

/* ---------- Panels, tiles ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-2); padding: 20px; min-width: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__head--tools { flex-wrap: wrap; align-items: center; }
.panel__titles { display: flex; align-items: baseline; gap: 12px; }
.panel__title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.panel__meta { font-size: .85rem; color: var(--muted); font-weight: 500; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; flex: 1 1 420px; justify-content: flex-end; min-width: 0; }
.toolbar .input--select { flex: 0 1 220px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles--attention { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles--attention { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles--attention { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles--attention > :first-child { grid-column: 1 / -1; } }
.tile {
  display: grid; gap: 4px; align-content: start; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none; min-width: 0;
}
.tile__label { font-weight: 600; color: var(--muted); font-size: .9rem; }
.tile__value { font-size: 2.6rem; line-height: 1.05; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tile__hint { font-size: .82rem; color: var(--faint); }
.tile--link { transition: box-shadow .15s, transform .15s var(--ease); }
.tile--link:hover { box-shadow: inset 0 0 0 1.5px #CFCBE2; transform: translateY(-1px); }
.tile--hot { background: var(--lilac); box-shadow: inset 0 0 0 1px #DCD0FF; }
.tile--hot .tile__value { color: var(--violet-deep); }
.tile--hot .tile__hint { color: var(--violet-deep); opacity: .8; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
  .tiles, .tiles--attention { gap: 10px; }
  .tile { padding: 14px; }
  .tile__value { font-size: 2rem; }
  .tile__label { font-size: .82rem; }
}

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .overview-grid { grid-template-columns: 1fr; } }

.stagebars { display: grid; gap: 10px; }
.stagebars li { display: grid; grid-template-columns: minmax(120px, 15.5em) minmax(0, 1fr) 3ch; align-items: center; gap: 12px; font-size: .9rem; }
.stagebars__label { color: var(--ink); font-weight: 500; }
.stagebars__track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.stagebars__fill { display: block; height: 100%; border-radius: 999px; background: var(--violet); min-width: 0; }
.stagebars__value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stagebars li.is-zero .stagebars__label, .stagebars li.is-zero .stagebars__value { color: var(--faint); }
@media (max-width: 480px) { .stagebars li { grid-template-columns: minmax(0, 1fr) 70px 3ch; } }

.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line-2); stroke-width: 1; }
.chart__axis { stroke: #D9D6E6; stroke-width: 1; }
.chart__tick { font: 500 11px var(--font); fill: var(--faint); }
.chart__day { font: 600 12px var(--font); fill: var(--muted); }
.chart__day.is-today { fill: var(--ink); font-weight: 800; }
.chart__value { font: 800 13px var(--font); fill: var(--ink); }
.chart__bar { fill: #B9A5FF; }
.chart__bar.is-today { fill: var(--violet); }
.chart__hit { fill: transparent; }
.chart__col { cursor: default; outline: none; }
.chart__col:hover .chart__hit, .chart__col:focus .chart__hit { fill: rgba(108,59,255,.06); }
.chart__tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 8px;
}

/* ---------- States ---------- */
.state { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 36px 16px; color: var(--muted); text-align: center; }
.state--empty { flex-direction: column; gap: 4px; }
.state__title { font-weight: 800; color: var(--ink); font-size: 1rem; }
.state--error { justify-content: flex-start; align-items: flex-start; text-align: left; background: var(--red-bg); border-radius: var(--radius-s); padding: 16px; color: #7A1F23; }
.state--error .ico { color: var(--red); margin-top: 2px; }
.state--error .state__title { color: #7A1F23; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--lilac); border-top-color: var(--violet); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--violet { background: var(--lilac); color: var(--violet-deep); }
.chip--green { background: var(--green-bg); color: #0B6E52; }
.chip--amber { background: var(--amber-bg); color: #8A5200; }
.chip--red { background: var(--red-bg); color: #A82E32; }
.chip--blue { background: var(--blue-bg); color: #1F46B0; }
.presence { display: block; font-size: .76rem; color: var(--faint); font-weight: 600; }
.presence.is-on { color: var(--green); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rating--big { font-weight: 700; font-size: 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; border-top: 1px solid var(--line-2); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 10px 14px; background: #FBFAFE; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover td { background: #FBFAFF; }
.table tr.is-clickable:focus-visible { outline: 3px solid var(--violet); outline-offset: -3px; }
.cell-strong { font-weight: 700; }
.cell-wrap { max-width: 280px; color: var(--muted); }
.more { display: flex; justify-content: center; padding: 16px 0 4px; }

@media (max-width: 760px) {
  .table-wrap { margin: 0; border-top: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); margin-bottom: 10px; }
  .table td, .table td:first-child, .table td:last-child { border: 0; padding: 3px 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; align-items: center; }
  .table td::before { content: attr(data-label); font-size: .78rem; font-weight: 700; color: var(--faint); }
  .table td > .chip { justify-self: start; white-space: normal; }
  .table td:first-child { grid-template-columns: 1fr; font-size: 1rem; padding-bottom: 6px; }
  .table td:first-child::before { display: none; }
  .cell-wrap { max-width: none; }
  .panel { padding: 16px; }
}

/* ---------- Cards (expert queue) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.card { display: grid; gap: 14px; padding: 18px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); align-content: start; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card__title { font-weight: 800; font-size: 1.08rem; letter-spacing: -.015em; }
.card__meta { font-size: .84rem; color: var(--muted); }
.card__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.card__actions .btn { flex: 1 1 120px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.facts dt { font-size: .76rem; font-weight: 700; color: var(--faint); }
.facts dd { font-weight: 600; }
.facts--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .facts--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills li { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line-2); }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line-2); flex: none; }
.segmented__btn { border: 0; background: transparent; padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: .84rem; color: var(--muted); cursor: pointer; }
.segmented__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,20,43,.12); }
@media (max-width: 560px) { .segmented { width: 100%; } .segmented__btn { flex: 1; padding: 7px 4px; } }

/* ---------- Request detail blocks ---------- */
.detail-block { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line-2); }
.detail-block:first-child { border-top: 0; padding-top: 0; }
.detail-block__title { font-size: .95rem; font-weight: 800; letter-spacing: -.01em; }
.callout { background: var(--amber-bg); color: #6B4100; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.callout--soft { background: var(--lilac); color: #3A1BA0; }
.contact { display: grid; gap: 6px; }
.contact__name { font-weight: 800; font-size: 1.05rem; }
.contact__row { display: flex; gap: 8px; align-items: flex-start; }
.contact__row .ico { margin-top: 2px; color: var(--faint); }
.items { display: grid; gap: 10px; }
.items li { padding: 12px 14px; border-radius: 12px; background: var(--mist); display: grid; gap: 3px; }
.items__name { font-weight: 700; }
.items__subs { font-size: .88rem; color: var(--muted); }
.items__note { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--violet); background: var(--surface); border-radius: 0 8px 8px 0; font-size: .9rem; }
.timeline { display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; align-items: center; position: relative; padding: 6px 0; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 50%; bottom: -50%; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--violet); position: relative; box-shadow: 0 0 0 3px var(--surface); }
.timeline li.is-now .timeline__dot { background: var(--green); box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px rgba(14,159,117,.18); }
.timeline__time { color: var(--muted); font-size: .84rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.qtable th, .qtable td { padding: 7px 0; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.qtable thead th { font-size: .76rem; color: var(--faint); font-weight: 700; }
.qtable tbody th { font-weight: 600; }
.qtable small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.qtable td.num, .qtable th.num { text-align: right; padding-left: 12px; white-space: nowrap; }
.qtable tfoot th { font-weight: 500; color: var(--muted); }
.qtable__total th, .qtable__total td { font-weight: 800 !important; color: var(--ink) !important; font-size: 1rem; border-bottom: 0; }

/* ---------- Drawer and modal ---------- */
.drawer, .modal { position: fixed; inset: 0; z-index: 100; }
.drawer__scrim, .modal__scrim { position: absolute; inset: 0; background: rgba(20,20,43,.38); animation: fade .2s var(--ease); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface);
  display: flex; flex-direction: column; outline: none; box-shadow: -30px 0 60px -30px rgba(20,20,43,.4);
  animation: slide-in .28s var(--ease);
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line-2); }
.drawer__title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; }
.drawer__body { overflow-y: auto; padding: 20px 24px 40px; overscroll-behavior: contain; }
body.has-drawer { overflow: hidden; }
@media (max-width: 700px) {
  .drawer__panel { top: auto; height: 92vh; height: 92dvh; width: 100%; border-radius: 22px 22px 0 0; animation: slide-up .3s var(--ease); }
  .drawer__body { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
  .drawer__head { padding: 12px 10px 10px 16px; }
}
.modal { display: grid; place-items: center; padding: 16px; }
.modal__panel { position: relative; width: min(460px, 100%); background: var(--surface); border-radius: 22px; padding: 24px; display: grid; gap: 14px; box-shadow: 0 30px 80px -30px rgba(20,20,43,.5); animation: pop .2s var(--ease); }
.modal__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.025em; }
.modal__text { color: var(--muted); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-up { from { transform: translateY(60px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 150; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .92rem;
  box-shadow: 0 20px 40px -20px rgba(20,20,43,.6);
}
.toast[data-tone="error"] { background: var(--red); }
@media (max-width: 900px) { .toast { bottom: calc(88px + env(safe-area-inset-bottom)); } }

/* ---------- Quotations ---------- */
.view--split { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; max-width: 1400px; }
.panel--queue { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.queue__list { display: grid; gap: 8px; }
.queue__item { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.queue__item:hover { box-shadow: inset 0 0 0 1.5px #CFCBE2; }
.queue__item.is-selected { background: var(--lilac); box-shadow: inset 0 0 0 1.5px var(--violet); }
.queue__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.queue__age { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.queue__age .ico { width: 14px; height: 14px; }
.queue__meta { font-size: .86rem; }
.queue__works { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue__badge { justify-self: start; margin-top: 3px; font-size: .74rem; font-weight: 700; color: #8A5200; background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; }
.back-link { display: none; align-items: center; gap: 6px; font-weight: 700; color: var(--violet-deep); text-decoration: none; margin-bottom: 12px; }
.review__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.review__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.review__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 8px; }

.lines { display: grid; gap: 8px; }
.lines__head, .lines__row { display: grid; grid-template-columns: minmax(160px, 1fr) 84px 118px 98px 96px 38px; gap: 8px; align-items: center; }
.lines__head { font-size: .76rem; font-weight: 700; color: var(--faint); padding: 0 2px; }
.lines__row { padding: 8px; border-radius: 12px; background: var(--mist); }
.lines__name { display: grid; gap: 3px; min-width: 0; }
.lines__name small { font-size: .76rem; color: var(--muted); padding-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines__cell { display: block; min-width: 0; }
.lines__mlabel { display: none; }
.lines__amount { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.editor__foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.totals { display: grid; gap: 4px; min-width: 240px; margin-left: auto; }
.totals div { display: flex; justify-content: space-between; gap: 24px; font-size: .92rem; }
.totals dt { color: var(--muted); }
.totals dd { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__total { padding-top: 6px; border-top: 1px solid var(--line); margin-top: 2px; }
.totals__total dt, .totals__total dd { color: var(--ink); font-weight: 800; font-size: 1.08rem; }

@media (max-width: 1180px) {
  .lines__head { display: none; }
  .lines__row { grid-template-columns: repeat(4, minmax(0, 1fr)) 38px; grid-template-areas: "name name name name del" "qty unit rate amount amount"; }
  .lines__name { grid-area: name; }
  .lines__row > :nth-child(2) { grid-area: qty; }
  .lines__row > :nth-child(3) { grid-area: unit; }
  .lines__row > :nth-child(4) { grid-area: rate; }
  .lines__row > :nth-child(5) { grid-area: amount; }
  .lines__row > :nth-child(6) { grid-area: del; }
  .lines__mlabel { display: block; font-size: .72rem; font-weight: 700; color: var(--faint); margin-bottom: 3px; }
  .lines__cell--amount { text-align: right; }
}
@media (max-width: 900px) {
  .view--split { grid-template-columns: 1fr; }
  .panel--queue { position: static; max-height: none; }
  .view--split.has-selection .panel--queue { display: none; }
  .view--split:not(.has-selection) .panel--review { display: none; }
  .back-link { display: inline-flex; }
}
@media (max-width: 480px) {
  .lines__row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr) minmax(0, 1fr) 38px; grid-template-areas: "name name name del" "qty unit rate rate" "amount amount amount amount"; }
  .lines__cell--amount { display: flex; justify-content: space-between; align-items: baseline; }
  .totals { min-width: 0; width: 100%; }
  .review__actions .btn { flex: 1 1 140px; }
}

[data-emulator="true"] .topbar::after { content: "Emulator"; font-size: .72rem; font-weight: 800; color: var(--amber); background: var(--amber-bg); padding: 3px 8px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Work timeline ---------- */
.timeline-edit { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--mist); margin-top: 6px; }
.timeline-edit__title { font-weight: 800; font-size: .92rem; }
.timeline-edit__fields { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.field--inline { display: grid; gap: 4px; }
.input-suffix { display: inline-flex; align-items: center; gap: 8px; }
.input-suffix .input { width: 96px; }
.input-suffix span { color: var(--muted); font-size: .88rem; }
.timeline-edit .input:invalid { box-shadow: inset 0 0 0 1.5px var(--red); }
.plan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; }
.plan .ico { color: var(--violet); }
.plan__now { font-weight: 700; color: #0B6E52; background: var(--green-bg); padding: 2px 9px; border-radius: 999px; font-size: .8rem; }

/* ---------- Feedback and complaints ---------- */
.fb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.fb { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.fb--hot { box-shadow: inset 0 0 0 1.5px #F3C5C7; background: #FFFBFB; }
.fb__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fb__when { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.fb__when .ico { width: 14px; height: 14px; }
.fb__text { font-size: 1rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb__photos { font-size: .85rem; color: var(--muted); }
.fb__facts { font-size: .9rem; padding-top: 12px; border-top: 1px solid var(--line-2); }
.fb__resolved, .fb-mini__resolved { font-size: .88rem; color: #0B6E52; background: var(--green-bg); padding: 9px 12px; border-radius: 10px; }
.fb-list { display: grid; gap: 10px; }
.fb-mini { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--mist); }
.fb-mini__head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fb-mini__head .small { margin-left: auto; }
@media (max-width: 900px) { .tabbar__link { font-size: .66rem; } }
.fb-grid { align-items: start; }
.fb .card__actions .btn { flex: 0 0 auto; }
