:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --text: #15171b;
  --muted: #727985;
  --line: #e3e7ed;
  --accent: #6c5ce7;
  --good: #159b63;
  --warn: #c77a0a;
  --bad: #d34f4f;
  --shadow: 0 14px 34px rgba(26, 31, 44, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
.app {
  display: grid;
  grid-template-columns: 235px 1fr;
  min-height: 100vh;
}
aside {
  background: #151821;
  color: #fff;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-size: 24px;
  font-weight: 850;
  margin: 0 0 25px;
}
.brand span {
  color: #9586ff;
}
.roles {
  display: flex;
  background: #222631;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.roles button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #aeb4c0;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
}
.roles .active {
  background: #fff;
  color: #111;
  font-weight: 750;
}
nav {
  display: grid;
  gap: 6px;
}
.nav {
  border: 0;
  background: transparent;
  color: #b9c0cc;
  text-align: left;
  padding: 13px;
  border-radius: 12px;
  cursor: pointer;
}
.nav:hover,
.nav.active {
  background: #282d39;
  color: #fff;
}
.bottom-nav {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 92px;
}
.bottom-nav .nav {
  width: 100%;
}
.access-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.access-pill {
  font-size: 11px;
  background: #f0edff;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.password-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.password-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.user {
  position: absolute;
  bottom: 18px;
  left: 14px;
  right: 14px;
  background: #222631;
  padding: 13px;
  border-radius: 13px;
}
.user small {
  color: #9fa6b3;
}
.user b {
  display: block;
  margin-top: 4px;
}
main {
  padding: 25px 28px 50px;
  min-width: 0;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}
.top h1 {
  margin: 0;
  font-size: 28px;
}
.top p {
  margin: 5px 0 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 10px;
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
}
.hidden {
  display: none !important;
}
.grid {
  display: grid;
  gap: 16px;
}
.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow);
}
.stat {
  padding: 18px;
}
.label {
  font-size: 13px;
  color: var(--muted);
}
.value {
  font-size: 29px;
  font-weight: 850;
  margin: 8px 0 3px;
}
.delta {
  font-size: 12px;
}
.good-t {
  color: var(--good);
}
.warn-t {
  color: var(--warn);
}
.section {
  padding: 20px;
}
.section + .section {
  margin-top: 16px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.filters input,
.filters select,
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
}
.field textarea {
  min-height: 105px;
  resize: vertical;
}
.filters input {
  min-width: 230px;
  flex: 1;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-weight: 650;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.click-row {
  cursor: pointer;
}
.click-row:hover td {
  background: #fafaff;
}
.person {
  display: flex;
  gap: 9px;
  align-items: center;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: linear-gradient(135deg, #cfc8ff, #7665ea);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 850;
}
.sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.good {
  background: #e5f7ef;
  color: var(--good);
}
.badge.warn {
  background: #fff1d9;
  color: var(--warn);
}
.badge.muted {
  background: #edf0f4;
  color: #67707d;
}
.badge.bad {
  background: #fde8e8;
  color: var(--bad);
}
.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.blogger {
  padding: 16px;
}
.blog-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.blog-top .avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}
.social-link {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.chip {
  font-size: 11px;
  background: #f0f2f5;
  border-radius: 999px;
  padding: 6px 8px;
  color: #5f6670;
}
.prices {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.price {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 12px;
}
.price b {
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}
.blog-actions {
  margin-left: auto;
}
.edit-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}
.platform-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.platform-tab {
  border: 0;
  background: #f0f2f5;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 750;
}
.platform-tab.active {
  background: #ede9ff;
  color: var(--accent);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.5);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}
.modal-box {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 22px 16px;
}
.modal-head h3 {
  margin: 0;
}
.close {
  border: 0;
  background: #f1f2f5;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 17px;
}
.form.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}
.form.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-size: 12px;
  font-weight: 750;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.modal-actions {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.modal-actions:empty {
  display: none;
}
.modal-actions .modal-foot {
  margin-top: 0;
}
#modalBody {
  min-height: 0;
  overflow: auto;
  padding: 0 22px 22px;
  overscroll-behavior: contain;
}
.advertiser-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.advertiser-details > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 12px;
}
.advertiser-details .full {
  grid-column: 1 / -1;
}
.advertiser-details span {
  overflow-wrap: anywhere;
}
.inline-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.table-wrap td .inline-links {
  flex-wrap: nowrap;
}
.mini-link {
  color: var(--accent);
  text-decoration: none;
  background: #f0edff;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}
.file-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.file-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
}
.file-icon:hover {
  background: #f5f2ff;
  border-color: #cfc7ff;
}
.file-count {
  font-size: 11px;
  color: var(--muted);
}
.debt {
  font-weight: 850;
  color: var(--warn);
}
.pack-row td {
  padding: 0;
  background: #fafbff;
}
.pack-panel {
  padding: 10px 18px 16px 48px;
  border-bottom: 1px solid var(--line);
}
.pack-panel table {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.pack-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  border-radius: 7px;
  background: #f0edff;
  color: var(--accent);
  font-weight: 900;
  transition: 0.18s;
}
.pack-toggle.open {
  transform: rotate(45deg);
}
.table-wrap {
  overflow: auto;
}
@media (max-width: 1050px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }
  aside {
    display: none;
  }
  main {
    padding: 18px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .form,
  .form.three,
  .form.four {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .advertiser-details {
    grid-template-columns: 1fr;
  }
  .advertiser-details .full {
    grid-column: auto;
  }
}
@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .top {
    align-items: flex-start;
  }
  .top h1 {
    font-size: 23px;
  }
}

.auth-locked > .app,
.auth-locked > #modal {
  visibility: hidden;
}
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top left, #39325f, #12141b 60%);
}
.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 15px;
  padding: 30px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}
.auth-card h1,
.auth-card p {
  margin: 0;
}
.auth-card p {
  color: var(--muted);
  line-height: 1.5;
}
.auth-card label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}
.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
}
.auth-card .brand {
  margin: 0;
  color: #171923;
}
.auth-loading {
  justify-items: center;
  text-align: center;
}
.auth-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e4e1ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
}
@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
.auth-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fde8e8;
  color: var(--bad);
}
.auth-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.logout-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8c2ff;
  cursor: pointer;
  font-size: 12px;
}
.app-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1100;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 12px;
  background: #18241f;
  color: #fff;
  box-shadow: var(--shadow);
}
.app-toast.error {
  background: #7c2929;
}
.user small {
  display: block;
  margin-top: 3px;
}
.mobile-nav {
  display: none;
}
@media (max-width: 760px) {
  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    gap: 7px;
    margin: -18px -18px 18px;
    padding: 10px 18px;
    overflow-x: auto;
    background: #151821;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  }
  .mobile-nav button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    padding: 9px 11px;
    background: #282d39;
    color: #bec4ce;
    cursor: pointer;
    white-space: nowrap;
  }
  .mobile-nav button.active {
    background: #fff;
    color: #171923;
    font-weight: 750;
  }
}
.combo {
  position: relative;
  min-width: 230px;
  flex: 1;
}
.combo input {
  width: 100%;
  padding-right: 38px;
}
.combo-arrow {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #222;
}
.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(26, 31, 44, 0.15);
  max-height: 220px;
  overflow: auto;
  padding: 5px;
}
.combo-option {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.combo-option:hover {
  background: #f3f0ff;
}
.combo-empty {
  padding: 10px 11px;
  color: var(--muted);
  font-size: 12px;
}
.release-editor {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.release-grid {
  display: grid;
  grid-template-columns: 52px 145px minmax(220px, 1fr) 170px 95px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.release-grid.head {
  font-size: 11px;
  color: var(--muted);
  font-weight: 750;
}
.release-grid input,
.release-grid select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 9px;
}
.release-number {
  font-weight: 800;
  color: var(--muted);
}
.tax-value {
  font-weight: 800;
  color: var(--bad);
}
.profit-value {
  font-weight: 850;
}
.export-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.catalog-client-select {
  min-width: 210px;
}
.selection-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.selection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
}
.selection-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.selection-row input {
  width: 18px;
  height: 18px;
}
.catalog-summary {
  background: #f4f1ff;
  color: var(--accent);
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 14px;
}
@media (max-width: 760px) {
  .release-grid {
    grid-template-columns: 1fr;
  }
  .release-grid.head {
    display: none;
  }
  .release-number:before {
    content: "Размещение ";
  }
}
.dashboard-period {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  margin-bottom: 16px;
}
.dashboard-period .field {
  min-width: 170px;
}
.dashboard-period .field label {
  margin-bottom: 6px;
}
.dashboard-period input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
}
.period-caption {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  padding-bottom: 10px;
}
.finance-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.finance-tabs .btn {
  min-width: 100px;
}
@media (max-width: 760px) {
  .finance-tabs {
    width: 100%;
  }
  .finance-tabs .btn {
    flex: 1;
  }
}
.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}
.task-column {
  background: #eef1f5;
  border-radius: 16px;
  padding: 12px;
  min-height: 240px;
}
.task-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 850;
}
.task-count {
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
}
.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(26, 31, 44, 0.06);
}
.task-card:hover {
  border-color: #c8c0ff;
  transform: translateY(-1px);
}
.task-title {
  font-weight: 850;
  margin-bottom: 7px;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.priority {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 850;
}
.priority.Высокий {
  background: #fde8e8;
  color: var(--bad);
}
.priority.Средний {
  background: #fff1d9;
  color: var(--warn);
}
.priority.Низкий {
  background: #e5f7ef;
  color: var(--good);
}
.task-report {
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.task-report p {
  white-space: pre-wrap;
  margin: 7px 0;
}
.task-file {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  margin: 3px;
}
.task-overdue {
  color: var(--bad);
  font-weight: 800;
}
.task-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.task-toolbar input,
.task-toolbar select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
}
.task-toolbar input {
  min-width: 220px;
  flex: 1;
}
@media (max-width: 1100px) {
  .task-board {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
}
@media (max-width: 760px) {
  .task-board {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    bottom: 92px;
  }
}
