/* SMM-студия: спокойный светлый интерфейс, без внешних библиотек и CDN. */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1c1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #4f6ef7;
  --accent-soft: #eef1ff;
  --ok: #1f8a57;
  --warn: #a86a12;
  --danger: #c0392b;
  --sidebar: #15171b;
  --sidebar-ink: #d6d9e0;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; font-weight: 650; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }

.shell { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------- сайдбар */

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
  padding: 4px 8px 10px;
  display: block;
}
.logo:hover { text-decoration: none; }

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #7b8290;
  padding: 10px 8px 4px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: var(--sidebar-ink);
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 14px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar nav a:hover { background: #22262d; text-decoration: none; }
.sidebar nav a.active { background: #2b3140; color: #fff; }
.sidebar nav a.paused { opacity: .55; }
.nav-add { color: #8ea2ff !important; }

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #262b33;
  padding-top: 10px;
  font-size: 12px;
  color: #8b93a1;
}
.who { padding: 0 8px 6px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot form { margin: 0; padding: 0 8px; }
.link {
  background: none; border: 0; padding: 0; color: #8b93a1;
  font-size: 12px; cursor: pointer;
}
.link:hover { color: #fff; }

/* ---------------------------------------------------------- контент */

.main { flex: 1; padding: 24px 30px 60px; max-width: 1180px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .sub { color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card.tight { padding: 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 18px; }
}

/* ---------------------------------------------------------- формы */

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="time"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.field { margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin: 6px 0; }
.checkbox input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 9px;
  font: inherit; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #c9cdd4; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #415fd9; border-color: #415fd9; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #f0c9c4; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------- мелочи */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.right { text-align: right; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #eef0f4; color: #4b5563;
}
.badge-ok { background: #e6f5ec; color: var(--ok); }
.badge-warn { background: #fdf2e0; color: var(--warn); }
.badge-err { background: #fbe9e7; color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.flashes { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px; border-radius: 10px; font-size: 14px;
  background: #eef1ff; color: #33406b; border: 1px solid #dbe1ff;
}
.flash.ok { background: #e8f5ee; color: #1d6b45; border-color: #cfe9db; }
.flash.error { background: #fbeae8; color: #8f2f24; border-color: #f3d0cb; }
.flash.warn { background: #fdf4e3; color: #8a5c11; border-color: #f3e0ba; }

.empty {
  border: 1px dashed #cfd4dc; border-radius: 10px; padding: 18px;
  color: var(--muted); font-size: 14px; text-align: center;
}

.kpi { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- календарь */

.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head div { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-left: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  min-height: 96px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.day.out { background: #fafbfc; color: #b3b8c1; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.day-num { font-size: 12px; color: var(--muted); }
.chip {
  display: block; font-size: 11px; line-height: 1.3; padding: 3px 6px;
  border-radius: 6px; background: #eff1f6; color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .p { color: #7b8290; font-size: 10px; }
.chip:hover { text-decoration: none; background: #e6e9f2; }

/* ---------------------------------------------------------- вкладки */

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin-bottom: 18px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab-count {
  font-size: 11px; background: #eef0f4; color: #5b6270;
  border-radius: 999px; padding: 1px 7px; font-weight: 600;
}
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------- вход */

.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #eef1ff, #f5f6f8 60%);
}
.auth-card {
  width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 26px; box-shadow: 0 10px 30px rgba(20, 24, 40, .07);
}
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.variant { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.variant textarea { min-height: 120px; border: 0; padding: 0; }
.variant textarea:focus { outline: none; }

/* ---------------------------------------------------------- плитки моделей */

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.preset {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.preset[open] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.preset:hover { border-color: #c9cdd4; }

.preset summary { cursor: pointer; list-style: none; }
.preset summary::-webkit-details-marker { display: none; }
.preset-name { font-weight: 650; font-size: 15px; }
.preset-tag { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.preset form { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

.advanced { margin-top: 10px; }
.advanced summary {
  cursor: pointer; font-size: 12px; color: var(--muted);
  padding: 4px 0;
}
.advanced summary:hover { color: var(--ink); }

/* ---------------------------------------------------------- опасная зона */

.danger-zone { border-color: #f0c9c4; background: #fffbfa; }
.danger-zone h2 { color: var(--danger); }

/* ---------------------------------------------------------- очередь публикации */

.ready-item { border-top: 1px solid var(--line); padding: 12px 0; }
.ready-item:first-of-type { border-top: 0; padding-top: 0; }
.ready-text {
  white-space: pre-wrap;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------------------------------------------------------- обзор бренда */

.progress {
  height: 8px; background: #eceef3; border-radius: 999px;
  overflow: hidden; margin-bottom: 14px;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.check-mark {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; background: #eef0f4; color: #8a909c; margin-top: 1px;
}
.checklist li.done .check-mark { background: #e6f5ec; color: var(--ok); }
.checklist li.done a { color: var(--muted); }
.checklist a { font-size: 14px; }

.row-line {
  display: flex; justify-content: space-between; gap: 10px;
  align-items: flex-start; padding: 9px 0; border-bottom: 1px solid #f0f2f5;
}
.row-line:last-child { border-bottom: 0; padding-bottom: 0; }

.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-links a {
  display: block; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink);
}
.quick-links a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.quick-links b { display: block; font-size: 14px; }
.quick-links span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

@media (max-width: 700px) {
  .quick-links { grid-template-columns: 1fr; }
}
