/* Gluoon Copilot — дизайн-токени з Penpot UI Kit */
:root {
  --bg: #12141E;
  --surface-sidebar: #171A28;
  --surface-panel: #1F2332;
  --surface-panel-hi: #262B3D;
  --border: #2B3046;
  --accent: #5B53FF;
  --accent-soft: #2A2860;
  --text: #E9EAF2;
  --text-2: #9AA0B5;
  --text-3: #6B7189;
  --green: #3DDC84;
  --yellow: #F5B944;
  --orange: #F5A855;
  --red: #FF5C5C;
  --blue: #4EA1FF;
  --muted-av: #2E3347;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-height: 100vh;
  display: flex;
}

/* ── Сайдбар ── */
.sidebar {
  width: 232px; min-width: 232px;
  background: var(--surface-sidebar);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 100vh;
}
.sidebar__logo { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 16px; }
.sidebar__logo-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.sidebar__logo-text { font-size: 15px; font-weight: 600; }
.sidebar__section { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; color: var(--text-3); padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none;
}
.nav-item:hover { background: rgba(38, 43, 61, .5); }
.nav-item--active { background: var(--surface-panel-hi); color: var(--text); font-weight: 600; }
.nav-item__icon { width: 16px; height: 16px; border-radius: 4px; background: var(--text-3); flex-shrink: 0; }
.nav-item--active .nav-item__icon { background: var(--accent); }

/* ── Макет ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; gap: 8px; color: var(--text-3); }
.crumbs b { color: var(--text); font-weight: 600; }
.content { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; }
.page-head h1 { font-size: 20px; font-weight: 700; }

/* ── Компоненты ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; border: none;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #6C64FF; }
.btn--secondary { background: var(--surface-panel-hi); color: var(--text-2); border: 1px solid var(--border); }

.chips { display: flex; gap: 8px; }
.chip {
  padding: 5px 14px; border-radius: 14px; font-size: 12px;
  background: var(--surface-panel); border: 1px solid var(--border);
  color: var(--text-2); text-decoration: none;
}
.chip--active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }

.panel { background: var(--surface-panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3);
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 10px 16px; border-bottom: 1px solid rgba(43, 48, 70, .6); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(38, 43, 61, .3); }

.file-name { font-weight: 500; margin-bottom: 4px; }

/* GVP-контекст в строке */
.gvp-ctx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 10px;
  background: var(--surface-panel-hi);
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
}
.pill--platform { color: var(--text-2); }
.dir-badge {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-panel-hi); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: var(--text-2);
}
.avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted-av);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: var(--text-2);
}
.deadline { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--text-3); }
.deadline--soon { color: var(--yellow); }
.deadline--today { color: var(--red); }

/* Статус-бейджи */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 11px;
  font-size: 11px; font-weight: 500; background: #232838; color: var(--text-2);
  white-space: nowrap;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; }
.badge--queued .badge__dot { background: var(--text-3); }
.badge--uploading .badge__dot, .badge--share .badge__dot { background: var(--blue); }
.badge--uploading, .badge--share { background: #1A2334; color: var(--blue); }
.badge--premod .badge__dot { background: var(--yellow); }
.badge--premod { background: #2E2617; color: var(--yellow); }
.badge--sent .badge__dot { background: var(--green); }
.badge--sent { background: #16281E; color: var(--green); }
.badge--error .badge__dot { background: var(--red); }
.badge--error { background: #2E1A1E; color: var(--red); }
/* статуси бота */
.badge--bot-awaiting .badge__dot { background: var(--red); }
.badge--bot-corrections .badge__dot { background: var(--orange); }
.badge--bot-approved .badge__dot { background: var(--green); }
.badge--bot-uploaded .badge__dot { background: var(--blue); }
.badge--bot-skipped .badge__dot { background: #8A8FA3; }

.share-link { color: var(--blue); text-decoration: none; font-weight: 500; }
.share-link:hover { text-decoration: underline; }
.text-muted { color: var(--text-3); }
.text-sub { font-size: 10.5px; color: var(--text-3); }

.progress { height: 4px; border-radius: 2px; background: var(--surface-panel-hi); overflow: hidden; margin-top: 6px; max-width: 140px; }
.progress__fill { height: 100%; background: var(--accent); border-radius: 2px; }

.comment-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 10.5px; font-weight: 600; }
.comment-badge__bubble { width: 12px; height: 10px; border: 1.2px solid var(--text-3); border-radius: 3px; }

.empty-state { padding: 48px; text-align: center; color: var(--text-3); }

/* ── Двоколонковий макет (список + редактор) ── */
.split { display: grid; grid-template-columns: 1fr 400px; gap: 20px; align-items: start; }
.card-editor { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-editor h2 { font-size: 16px; font-weight: 700; }
.row--selected td { background: var(--surface-panel-hi); }
.row-link { color: var(--text); text-decoration: none; font-weight: 500; }
.row-link:hover { color: var(--accent); }

/* ── Форми ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field--nested { margin-top: 8px; padding-left: 24px; }
.field--inline { flex: 1; }
.field__label { font-size: 11px; font-weight: 600; color: var(--text-3); }
.input, .field input[type="text"], .field input[type="number"], .field select, .card-editor input, .card-editor select {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: 12.5px; font-family: inherit; width: 100%;
}
.card-editor input[type="checkbox"], .card-editor input[type="radio"] { width: auto; }
.input:focus, .card-editor input:focus, .card-editor select:focus { outline: none; border-color: var(--accent); }
.radio, .checkbox { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.radio input, .checkbox input { accent-color: var(--accent); }
.row-2 { display: flex; gap: 16px; align-items: flex-end; }
.actions { display: flex; gap: 10px; margin-top: 4px; }
.actions .btn { flex: 1; justify-content: center; }
.btn--danger { background: var(--surface-panel-hi); color: var(--red); border: 1px solid var(--border); }
.form-error { color: var(--red); font-size: 11px; }

.note {
  display: flex; gap: 10px; padding: 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 11px; color: var(--text-2); line-height: 1.5;
}
.note__icon {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}

/* ── Тумблер ── */
.toggle {
  width: 34px; height: 20px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--surface-panel-hi); padding: 2px; display: flex; justify-content: flex-start;
}
.toggle--on { background: var(--accent); justify-content: flex-end; }
.toggle__knob { width: 16px; height: 16px; border-radius: 50%; background: #fff; display: block; }

/* ── Повідомлення ── */
.messages { display: flex; flex-direction: column; gap: 8px; }
.message { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; background: var(--surface-panel); border: 1px solid var(--border); }
.message--success { border-color: var(--green); color: var(--green); }
.message--error { border-color: var(--red); color: var(--red); }

/* ── Премодерація ── */
.premod-layout { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; }
.queue-item {
  display: block; padding: 12px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid rgba(43, 48, 70, .6);
}
.queue-item:hover { background: rgba(38, 43, 61, .35); }
.queue-item--active { background: var(--surface-panel-hi); }
.queue-item__name { font-weight: 500; margin-bottom: 6px; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.queue-count { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.player-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.player-frame {
  background: #0A0C14; border: 1px solid var(--border); border-radius: 12px;
  height: 420px; display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.player-frame a { color: var(--blue); text-decoration: none; }
.dest-note { font-size: 11.5px; color: var(--text-3); }
.dest-note b { color: var(--text-2); }

/* ── Frame.io / Налаштування ── */
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.card { background: var(--surface-panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 15px; font-weight: 700; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-line__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-line__dot--ok { background: var(--green); }
.status-line__dot--bad { background: var(--red); }
.status-line__label { color: var(--text-3); }
.status-line__value { color: var(--text); font-weight: 500; }
.fio-icon {
  width: 24px; height: 24px; border-radius: 6px; background: var(--surface-panel-hi);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); margin-right: 10px;
}
