/* ===== Тема админки Хидаи: изумрудная oklch-палитра приложения =====
   Переопределяем CSS-переменные Django-админки. Нейтрали (фон/текст) —
   оставляем родные под каждую тему, меняем только бренд/акцент/ссылки/кнопки,
   чтобы серый дефолт превратился в консоль в стиле приложения. */

:root, html[data-theme="light"] {
  --primary: #0f9067;
  --secondary: #0c815b;
  --accent: #12a877;
  --primary-fg: #ffffff;

  --header-color: #d8f0e5;
  --header-branding-color: #ffffff;
  --header-bg: #0c815b;
  --header-link-color: #ffffff;

  --breadcrumbs-fg: #d6ede2;
  --breadcrumbs-link-fg: #ffffff;
  --breadcrumbs-bg: #0f9067;

  --link-fg: #0b7a58;
  --link-hover-color: #0a6a4d;
  --link-selected-fg: #0c815b;

  --button-bg: #0f9067;
  --button-hover-bg: #0c815b;
  --default-button-bg: #12a877;
  --default-button-hover-bg: #0b7a58;
  --close-button-bg: #6b7a70;
  --close-button-hover-bg: #4b584f;
  --object-tools-bg: #0f9067;
  --object-tools-hover-bg: #0b7a58;

  --selected-row: #e6f6ef;
  --selected-bg: #eef3ef;
  --message-success-bg: #e3f2ea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #2fae82;
    --secondary: #1f8d66;
    --accent: #3fbf90;
    --header-bg: #14231d;
    --header-color: #cdeadd;
    --header-branding-color: #eafaf3;
    --breadcrumbs-bg: #17241f;
    --breadcrumbs-fg: #b6cfc4;
    --link-fg: #57c79c;
    --link-hover-color: #7ad9b7;
    --link-selected-fg: #7ad9b7;
    --button-bg: #2fae82;
    --button-hover-bg: #1f8d66;
    --default-button-bg: #38b98b;
    --default-button-hover-bg: #279a72;
    --object-tools-bg: #2fae82;
    --object-tools-hover-bg: #1f8d66;
    --selected-row: #17342a;
    --selected-bg: #16211c;
    --message-success-bg: #17342a;
  }
}

html[data-theme="dark"] {
  --primary: #2fae82;
  --secondary: #1f8d66;
  --accent: #3fbf90;
  --header-bg: #14231d;
  --header-color: #cdeadd;
  --header-branding-color: #eafaf3;
  --breadcrumbs-bg: #17241f;
  --breadcrumbs-fg: #b6cfc4;
  --link-fg: #57c79c;
  --link-hover-color: #7ad9b7;
  --link-selected-fg: #7ad9b7;
  --button-bg: #2fae82;
  --button-hover-bg: #1f8d66;
  --default-button-bg: #38b98b;
  --default-button-hover-bg: #279a72;
  --object-tools-bg: #2fae82;
  --object-tools-hover-bg: #1f8d66;
  --selected-row: #17342a;
  --selected-bg: #16211c;
  --message-success-bg: #17342a;
}

/* ---- Брендинг в шапке ---- */
#branding #site-name { margin: 0; font-weight: 700; }
#site-name a { display: inline-flex; align-items: center; gap: 11px; color: var(--header-branding-color) !important; }
#site-name a:hover { opacity: .92; }
.hid-logo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(145deg, #16b98a, #0c815b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.hid-logo svg { width: 20px; height: 20px; }
.hid-brand { display: inline-flex; flex-direction: column; line-height: 1.1; }
.hid-brand { font-family: "Manrope", system-ui, sans-serif; font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.hid-brand small { font-size: 11px; font-weight: 500; letter-spacing: .02em; opacity: .78; }

/* ---- KPI-дашборд на индексе ---- */
.hidaya-kpi {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 4px 0 26px;
}
.hidaya-kpi .hk {
  background: var(--body-bg); border: 1px solid var(--hairline-color); border-radius: 12px;
  padding: 16px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.hidaya-kpi .hk-n {
  font-family: "Manrope", system-ui, sans-serif; font-weight: 800; font-size: 26px;
  line-height: 1; letter-spacing: -.02em; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.hidaya-kpi .hk-l { font-size: 12px; color: var(--body-quiet-color); margin-top: 8px; }
@media (max-width: 1024px) { .hidaya-kpi { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .hidaya-kpi { grid-template-columns: repeat(2, 1fr); } }

/* ---- Немного мягче углы у модулей/кнопок (в духе приложения) ---- */
.module { border-radius: 12px; overflow: hidden; }
.button, input[type=submit], input[type=button], .submit-row input, a.button {
  border-radius: 8px;
}
#content-main .module caption a.section:hover { color: var(--primary); }
