/* --- Marketing AC custom styles atop Tailwind CDN ---
   ВНИМАНИЕ: цвета/шрифт берутся из brand.css (load first).
   Здесь — только layout/structure/spacing. --- */

html, body {
  font-family: var(--ac-font);
  background: var(--ac-surface);
  color: var(--ac-text);
  -webkit-font-smoothing: antialiased;
}

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

.sidebar {
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-size: 18px;
  letter-spacing: -0.01em;
  padding: 4px 8px 16px;
  margin-bottom: 10px;
}

.sidebar .who {
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.sidebar .who .name { font-weight: 700; font-size: 14px; }
.sidebar .who .role { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  font-size: 13.5px;
  transition: background .15s ease;
}
.sidebar nav a .emoji { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }

.sidebar .footer { margin-top: auto; padding-top: 12px; }
.sidebar .footer button, .sidebar .footer a {
  width: 100%; display: block; text-align: left;
  padding: 9px 12px;
  font-size: 13.5px;
  background: transparent; border: none; cursor: pointer;
}

.main {
  flex: 1;
  padding: 28px 36px;
  max-width: 100%;
}

.card {
  background: #fff;
  margin-bottom: 20px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.kpi {
  background: var(--brand-light);
  border-radius: 12px;
  padding: 14px 16px;
}
.kpi .label { font-size: 12px; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .value { font-size: 24px; font-weight: 700; color: #0f172a; margin-top: 4px; }
.kpi .sub  { font-size: 11px; color: #64748b; margin-top: 2px; }

.section-ads    { border-left: 4px solid var(--ads); }
.section-social { border-left: 4px solid var(--social); }
.section-sites  { border-left: 4px solid var(--sites); }
.section-brand  { border-left: 4px solid var(--brand); }

label.field { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }

.input, select.input, textarea.input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  color: #0f172a;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29,58,138,0.12);
}

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s ease, transform .05s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: #f1f5f9; color: #0f172a; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  background: #f8fafc; color: #475569; font-weight: 600; text-align: left;
  padding: 9px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}
.tbl tbody td {
  padding: 9px 10px; border-bottom: 1px solid #f1f5f9; color: #0f172a;
}
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-partners    { background: #dbeafe; color: #1e40af; }
.badge-subscribers { background: #cffafe; color: #155e75; }
.badge-drugomans   { background: #ede9fe; color: #5b21b6; }

.pct-ok    { color: var(--ok);    font-weight: 700; }
.pct-warn  { color: var(--warn);  font-weight: 700; }
.pct-bad   { color: var(--danger);font-weight: 700; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.quick-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-btns a {
  padding: 5px 12px; font-size: 12px; border-radius: 999px;
  background: #f1f5f9; color: #334155;
}
.quick-btns a:hover { background: #e2e8f0; }
.quick-btns a.active { background: var(--brand); color: #fff; }

.form-grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-4 { grid-column: span 4; }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .form-grid .col-2 { grid-column: span 2; } }

.plan-grid input { padding: 5px 8px; font-size: 12.5px; text-align: right; }
.plan-grid th, .plan-grid td { padding: 6px 8px; }

.empty {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 13px;
}
