:root {
  --bg: #16171b;
  --bg-sidebar: #1d1e22;
  --surface: #26272c;
  --surface-2: #2e3036;
  --border: #3a3c43;
  --text: #ececee;
  --muted: #9a9ca3;
  --primary: #4a8af4;
  --primary-hover: #3b7be6;
  --danger: #f2594b;
  --green: #2fd198;
  --radius: 8px;
  font-family: Roboto, Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.layout { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar { background: var(--bg-sidebar); padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; }
.sidebar__brand { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 30px; letter-spacing: -0.5px; color: #c9ccd3; }
.logo__deep { color: var(--primary); }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.nav-item { display: flex; gap: 12px; align-items: center; padding: 10px 4px; color: var(--text); text-decoration: none; font-size: 15px; }
.nav-ico { color: var(--primary); display: inline-flex; }
.sidebar__heading { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; padding: 4px 4px 10px; }
.sidebar__heading--link { border-top: 1px solid var(--border); padding-top: 16px; }
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; }
.ws-item:hover, .ws-item--active { background: #2a2b31; }
.ws-item__swatch { width: 28px; height: 28px; border-radius: 4px; }
.ws-item__text { flex: 1; display: flex; flex-direction: column; }
.ws-item__group { font-size: 11px; font-weight: 600; color: var(--muted); }
.ws-item__name { font-size: 14px; }
.smart-assist { margin-top: auto; background: transparent; border: 2px solid var(--green); border-radius: 8px; padding: 9px; font-weight: 500; cursor: pointer; }

/* Search */
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.search input { background: transparent; border: 0; outline: 0; width: 100%; }
.search input::placeholder { color: var(--muted); font-style: italic; }
.search__ico { color: var(--muted); }

/* Main */
.main { padding: 20px 48px 24px; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.btn { border-radius: var(--radius); border: 1px solid transparent; padding: 8px 20px; cursor: pointer; background: none; font-weight: 500; }
.btn--primary { background: var(--primary); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--primary:disabled { background: #34507f; color: #a9b6cc; cursor: not-allowed; }
.btn--ghost { background: #202126; border-color: var(--border); }
.btn--outline { border-color: var(--border); background: #202126; }
.btn--lg { min-width: 96px; padding: 10px 24px; }
.modal__actions .btn--outline { border-color: var(--primary); color: #8fb6ff; background: transparent; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--muted); position: relative; }
.bell .badge { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 5px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #c9905a; font-size: 11px; font-weight: 600; color: #222; }
.avatar--lg { width: 38px; height: 38px; border: 2px solid var(--primary); }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #202126; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; min-width: 230px; z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.menu__item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.menu__item:hover:not(:disabled) { background: var(--surface-2); }
.menu__item:disabled { color: var(--muted); cursor: default; }
.menu__sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.ws-header { margin-top: 4px; }
.ws-header__group { color: var(--primary); font-weight: 500; }
.ws-header__title { display: flex; align-items: center; gap: 14px; }
.ws-header__title h1 { font-size: 38px; margin: 4px 0; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: none; cursor: pointer; }
.ws-header__meta { display: flex; align-items: center; gap: 14px; margin: 12px 0 18px; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -6px; border: 2px solid var(--primary); }
.divider { width: 1px; height: 18px; background: var(--border); }
.accent { color: var(--primary); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; padding: 12px 14px; color: var(--muted); cursor: pointer; font-size: 15px; border-bottom: 2px solid transparent; }
.tab--active { color: var(--text); border-bottom-color: var(--primary); font-weight: 500; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; }
.toolbar .search { width: 260px; }
.toolbar__right { display: flex; gap: 10px; }
.select-pill { display: inline-flex; align-items: center; gap: 6px; background: #202126; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; }
.select-pill select { background: transparent; border: 0; outline: 0; }
.select-pill option { background: var(--surface); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.card__thumb { position: relative; height: 130px; display: grid; place-items: center; font-size: 34px; color: rgba(255, 255, 255, .35); }
.card__badge { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 20, 24, .85); border-radius: 14px; padding: 4px 10px; font-size: 12px; color: var(--text); }
.card__badge { display: inline-flex; align-items: center; gap: 4px; }
.card__badge svg { color: var(--primary); }
.card__ribbon { position: absolute; top: 18px; left: -30px; transform: rotate(-45deg); background: #3c3e45; color: #d8d8dc; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 3px 34px; }
.card__processing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); font-size: 13px; color: var(--text); }
.card__body { padding: 12px 14px 14px; }
.card__title { margin: 0 0 10px; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.card__meta-text { flex: 1; min-width: 0; }
.card__meta-text b { color: var(--text); font-weight: 500; }
.card__meta-text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); text-align: center; padding: 40px; }

.pager { margin-top: auto; display: flex; justify-content: flex-end; align-items: center; gap: 16px; background: #1f2025; border-radius: var(--radius); padding: 12px 18px; color: var(--muted); font-size: 13px; }
.grid + .empty + .pager, .grid { margin-bottom: 20px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 50; }
.modal__panel { position: relative; width: 480px; max-height: 92vh; overflow-y: auto; background: #1f2024; border-radius: 10px; padding: 40px 22px 22px; }
.modal__close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 18px; cursor: pointer; }
.dropzone { border: 1px dashed #55575e; border-radius: 4px; text-align: center; padding: 22px 16px; color: var(--muted); }
.dropzone--over { border-color: var(--primary); background: rgba(74, 138, 244, .08); }
.dropzone--error { border-color: var(--danger); }
.dropzone__ico { line-height: 0; }
.dropzone h2 { color: var(--text); margin: 8px 0 4px; font-size: 22px; font-weight: 500; }
.dropzone p { margin: 4px 0; }
.dropzone__file { color: var(--text); }
.link { color: var(--primary); font-weight: 600; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field label, .field__label { font-size: 14px; color: #cfd1d6; }
.req { color: var(--danger); }
.field input[type="text"], .field select, .combo__trigger { background: #18191d; border: 1px solid var(--border); border-radius: 6px; padding: 11px 12px; outline: 0; width: 100%; text-align: left; }
.field input:focus, .field select:focus, .combo__trigger:focus { border-color: var(--primary); }
.field input.invalid, .combo__trigger.invalid { border-color: var(--danger); }
.field select option { background: var(--surface); }
.field__foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.field-error { color: var(--danger); font-size: 12px; margin: 4px 0 0; min-height: 0; }

.combo { position: relative; }
.combo__trigger { cursor: pointer; display: flex; justify-content: space-between; min-height: 44px; }
.combo__trigger:disabled { cursor: not-allowed; opacity: .55; }
.combo__panel { margin-top: 6px; background: #18191d; border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.combo__panel .search { margin-bottom: 6px; }
.combo__list { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.combo__option { padding: 10px; border-radius: 4px; cursor: pointer; }
.combo__option:hover, .combo__option[aria-selected="true"] { background: var(--surface-2); }
.combo__empty { padding: 10px; color: var(--muted); }

.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: 15px; }
.toggle-row--card { background: #26272c; border-radius: 8px; padding: 14px 16px; }
.toggle-row--disabled { color: var(--muted); }
.info { color: var(--muted); cursor: help; }
.beta { background: #2a9fd8; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-left: 4px; }
.switch { position: relative; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d4d4d8; border-radius: 20px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #6b6d74; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); background: #fff; }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.modal__actions { display: flex; justify-content: center; gap: 16px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2e3036; border-left: 4px solid var(--green); padding: 12px 18px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); z-index: 60; }

[data-icon] { display: inline-flex; vertical-align: middle; }
.round-btn { display: inline-grid; place-items: center; color: var(--muted); }
.card__actions { display: inline-flex; gap: 6px; color: var(--muted); }
.card__thumb-play { color: rgba(255, 255, 255, .4); transform: scale(2.2); }
