@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #12141c;
  --navy: #171b2e;
  --muted: #6b7280;
  --soft: #eceef3;
  --soft-2: #f5f6fa;
  --line: #e2e4ea;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --danger: #b42318;
  --pill: 999px;
  --radius: 18px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft-2);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.admin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.admin-side {
  background: var(--navy);
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-brand {
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  font-size: 1.05rem;
}

.admin-brand small {
  display: block;
  margin-top: 4px;
  opacity: 0.65;
  font-weight: 600;
  letter-spacing: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 650;
}

.admin-nav button.is-active,
.admin-nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-side__foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.admin-side__foot a,
.admin-side__foot button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  border-radius: var(--pill);
  padding: 10px 14px;
  font-weight: 700;
  text-align: center;
}

.admin-main {
  padding: 28px 32px 48px;
  min-width: 0;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-top h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-top p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.panel { display: none; }
.panel.is-active { display: block; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.kpi strong {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ok);
  font-weight: 600;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  background: var(--soft);
  border-radius: var(--pill);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: var(--pill);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 160px;
}

.week-col {
  display: grid;
  gap: 6px;
  align-content: end;
  text-align: center;
}

.week-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  height: 120px;
  justify-content: flex-start;
}

.week-b2c,
.week-b2b {
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
}

.week-b2c { background: var(--navy); }
.week-b2b { background: #7b849c; }

.week-col span {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--pill);
  padding: 11px 18px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1;
}

.btn--navy { background: var(--navy); color: #fff; }
.btn--outline { background: #fff; border-color: var(--navy); color: var(--navy); }
.btn--ghost { background: var(--soft); color: var(--ink); border: 0; }
.btn--danger { background: #fde8e6; color: var(--danger); border: 0; }
.btn--sm { padding: 8px 12px; font-size: 0.85rem; }

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.textarea { min-height: 88px; resize: vertical; }

.search {
  min-width: 220px;
  flex: 1;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 0;
  background: var(--soft);
  border-radius: var(--pill);
  padding: 8px 14px;
  font-weight: 700;
  color: var(--ink);
}

.chip.is-active {
  background: var(--navy);
  color: #fff;
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.prod-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.prod-cell img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--soft);
}

.badge--b2c { background: #e8eefc; color: #1e3a8a; }
.badge--b2b { background: #ece8fc; color: #3b1e8a; }
.badge--admin { background: #111; color: #fff; }
.badge--on { background: #e5f6ee; color: var(--ok); }
.badge--off { background: #f3f3f3; color: var(--muted); }

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-bottom: 8px;
}

.pipeline-col {
  background: var(--soft);
  border-radius: 18px;
  padding: 12px;
  min-height: 320px;
}

.pipeline-col h3 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
}

.project-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.project-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.project-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.project-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 28, 0.5);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.modal__dialog h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}
.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side {
    position: relative;
    height: auto;
    border-radius: 0 0 22px 22px;
  }
  .admin-nav {
    grid-template-columns: 1fr 1fr;
  }
  .admin-main { padding: 20px 16px 40px; }
  .pipeline { grid-template-columns: repeat(5, minmax(160px, 1fr)); }
}
