:root {
  --paper: #fff; --bg: #f6f7f5; --line: #e4e7e3; --line-strong: #cfd5ce;
  --text: #121814; --text-2: #36403a; --muted: #637068;
  --accent: #12813d; --accent-deep: #0c6630; --accent-soft: #e9f4ec;
  --warn: #b25e09; --warn-soft: #fdf3e6; --bad: #c0362c; --bad-soft: #fcecea;
  --info: #2f6db5; --info-soft: #e9f1fb;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

.gate { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand small { font-weight: 600; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; letter-spacing: .02em; }

.welcome { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.welcome__box { width: 100%; max-width: 560px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 30px 32px; display: grid; gap: 14px; }
.welcome__box h1 { margin: 10px 0 0; font-size: 26px; letter-spacing: -.025em; }
.welcome__box > p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.welcome__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.welcome__list { margin: 6px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; display: grid; gap: 10px; color: var(--text-2); }
.welcome__list b { color: var(--text); }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.side > .brand { padding: 0 8px; }
.team-pick select { width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--paper); font-weight: 600; }
.team-pick .team-one { display: block; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-pick { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.team-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.team-pick .team-one { padding: 0; background: none; font-size: 15px; }
.team-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-foot small { color: var(--muted); font-size: 12px; }
.team-foot .link { font-size: 12px; }
.stars { display: inline-flex; gap: 1px; }
.stars i { font-style: normal; color: #d5dae2; }
.stars i.on { color: #e3a008; }
.reviews { list-style: none; margin: 0; padding: 0; }
.reviews li { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.reviews li:last-child { border-bottom: 0; }
.review__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review__head time { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.reviews p { margin: 8px 0 0; white-space: pre-line; }
.review__reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 8px; }
.review__reply b { font-size: 12.5px; color: var(--accent-deep); }
.review__reply p { margin-top: 4px; }
.review__btns { margin-top: 8px; }
.field textarea { min-height: 100px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav a.on svg { color: var(--accent); }
.side__foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); word-break: break-all; }
.side__foot a { display: block; margin-top: 6px; text-decoration: none; font-weight: 600; }

.main { padding: 28px 32px 56px; min-width: 0; max-width: 1180px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.head p { margin: 4px 0 0; color: var(--muted); }
.head__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-weight: 600; font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-deep); }
.btn--danger { color: var(--bad); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; }
.link--danger { color: var(--bad); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.panel__head h2 { margin: 0; font-size: 15px; }
.panel__body { padding: 14px 20px 20px; }
.panel__body > p:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { padding: 16px 20px; }
.kpi__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi__meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #fbfcfb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-cell { display: flex; align-items: center; gap: 12px; }
.app-cell b { display: block; }
.app-cell span { color: var(--muted); font-size: 12.5px; }
.ico { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--bg); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--accent-deep); }
.ico--lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--text-2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag--ok { background: var(--accent-soft); color: var(--accent-deep); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--bad { background: var(--bad-soft); color: var(--bad); }
.tag--info { background: var(--info-soft); color: var(--info); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.note { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; line-height: 1.5; }
.note--warn { background: var(--warn-soft); color: #7a4605; }
.note--bad { background: var(--bad-soft); color: #8f241c; }
.note--info { background: var(--info-soft); color: #234f84; }
.note--ok { background: var(--accent-soft); color: var(--accent-deep); }
.note b { display: block; margin-bottom: 2px; }

.app-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.app-head__text { flex: 1 1 auto; min-width: 0; }
.app-head__text h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--accent-deep); border-color: var(--accent); }

.form { display: grid; gap: 14px; }
.form-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.field { display: grid; gap: 5px; align-content: start; }
.field label, .field .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--paper); }
.field input, .field select { height: 38px; }
.field textarea { padding: 9px 10px; min-height: 160px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form__foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.counter { color: var(--muted); font-size: 12px; text-align: right; }

.uploader { display: flex; gap: 14px; align-items: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shot { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot__btns { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }
.shot__btns button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(18, 24, 20, .72); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.shot--add { display: grid; place-items: center; border-style: dashed; border-color: var(--line-strong); color: var(--accent); font-weight: 600; cursor: pointer; background: var(--paper); }
.shot--add:hover { background: var(--accent-soft); }

.preview { position: sticky; top: 20px; }
.preview__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mk-card { border: 1px solid #e6ebf2; border-radius: 16px; background: #fff; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 178px; }
.mk-card__head { display: flex; gap: 12px; align-items: center; }
.mk-card__head b { display: block; font-size: 15.5px; }
.mk-card__head small { color: #6b7484; font-size: 12.5px; }
.mk-card__text { flex: 1; color: #4a5560; font-size: 13.5px; line-height: 1.45; }
.mk-card__foot { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid #eef1f5; font-size: 13.5px; }
.mk-card__foot small { color: #6b7484; font-size: 12.5px; }

.scopes { display: grid; gap: 8px; }
.scope { display: grid; grid-template-columns: 22px minmax(0, 1fr) 150px; gap: 6px 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.scope.on { border-color: #bfe0c9; background: #f8fcf9; }
.scope input[type=checkbox] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.scope b { display: block; }
.scope small { color: var(--muted); }
.scope select { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--paper); }
.scope__why { grid-column: 2 / -1; }
.scope__why input { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; }

.keybox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.keybox code { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; word-break: break-all; }
.secret { font-family: var(--mono); font-size: 13px; background: #111512; color: #d9f2df; border-radius: 10px; padding: 12px 14px; word-break: break-all; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.chart i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .9; }
.chart i.zero { background: var(--line); }
.chart__axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: 0; }
.log-list time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.log-list b { font-weight: 600; }
.log-list span { color: var(--text-2); }
.log-list small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.more { padding: 12px 20px; border-top: 1px solid var(--line); text-align: center; }

.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.roles div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12.5px; color: var(--text-2); }
.roles b { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.add-member { display: flex; gap: 8px; flex-wrap: wrap; }
.add-member input { flex: 1 1 240px; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; }
.add-member select, td select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--paper); }

.modal { position: fixed; inset: 0; background: rgba(18,24,20,.36); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal__box { background: var(--paper); border-radius: 14px; width: 460px; max-width: 100%; box-shadow: 0 24px 64px -12px rgba(0,0,0,.3); padding: 20px 22px 18px; display: grid; gap: 12px; }
.modal__box h3 { margin: 0; font-size: 17px; }
.modal__box p { margin: 0; color: var(--text-2); }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100vw - 40px); }
.toast.bad { background: var(--bad); }

@media (max-width: 1080px) { .form-cols { grid-template-columns: 1fr; } .preview { position: static; } .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px; gap: 10px; }
  .side__foot { display: none; }
  .nav { display: flex; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .main { padding: 18px 16px 40px; }
  .kpis, .row2 { grid-template-columns: 1fr; }
  .scope { grid-template-columns: 22px minmax(0, 1fr); }
  .scope select { grid-column: 2; justify-self: start; }
  .log-list li { grid-template-columns: 1fr; gap: 2px; padding: 10px 16px; }
  .welcome__box { padding: 22px 18px; }
  .roles { grid-template-columns: 1fr; }
}
.plans { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.plans label { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.plans input { accent-color: var(--accent); width: 16px; height: 16px; }
