/* Добрый Хостинг — оформление bill.dobry.host в стиле кабинета dobry.host (подключается из brand_head).
   Две темы: светлая и тёмная. Тёмная — встроенная тема BILLmanager (html[dark=true]), поверх — наши цвета.
   Переключатель ☀/🌙 в шапке добавляет скрипт из brand_head (dobry-theme.js); по умолчанию светлая.
   Меняем только переменные --isp-* и внешние оболочки компонентов — вёрстку не ломаем. */

/* ---------- общие переменные ---------- */
html {
  --dh-grad: linear-gradient(135deg, #2563eb 0%, #4f7bf7 100%);
  --dh-radius: 18px;
  --isp-font-family-default: Onest, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- светлая ---------- */
html:not([dark=true]) {
  --dh-border: #e6ebf5;
  --dh-border-soft: #eef2fb;
  --dh-card: #ffffff;
  --dh-page: #f4f7ff;
  --dh-hover: #edf2ff;
  --dh-muted: #64748b;
  --dh-glass: rgba(255, 255, 255, .78);
  --dh-glass-side: rgba(255, 255, 255, .72);
  --dh-glow-1: rgba(37, 99, 235, .14);
  --dh-glow-2: rgba(79, 123, 247, .08);
  --dh-shadow: 0 10px 30px rgba(37, 99, 235, .07);
  --dh-shadow-hover: 0 16px 40px rgba(37, 99, 235, .12);
  --isp-border-default: var(--dh-border);
  --isp-shadow-base: 0 10px 30px rgba(37, 99, 235, .07);
  --isp-shadow-base_float: 0 18px 44px rgba(37, 99, 235, .16);
  --isp-shadow-base_dialog: 0 30px 80px rgba(15, 23, 42, .22);
  --isp-table-background-hover: #f1f5ff;
}

/* ---------- тёмная (мягкая: сине-серые карточки на тёмном фоне) ---------- */
html[dark=true] {
  color-scheme: dark;
  --dh-border: #2f3b58;
  --dh-border-soft: #283450;
  --dh-card: #1a2336;
  --dh-page: #121a2a;
  --dh-hover: #243150;
  --dh-muted: #9aa8c7;
  --dh-glass: rgba(18, 26, 42, .82);
  --dh-glass-side: rgba(21, 30, 48, .86);
  --dh-glow-1: rgba(37, 99, 235, .18);
  --dh-glow-2: rgba(99, 102, 241, .10);
  --dh-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  --dh-shadow-hover: 0 14px 36px rgba(37, 99, 235, .16);

  --isp-background-main-basis: 222deg, 40%;
  --isp-background-main-lightness: 11.8%;
  --isp-background-additional-basis: 220deg, 35%;
  --isp-background-additional-lightness: 15.7%;
  --isp-background-list: #212c44;
  --isp-background-list__hover: var(--dh-hover);
  --isp-background-list__active: #2a3a62;
  --isp-background-component: #212c44;
  --isp-background-component__hover: var(--dh-hover);
  --isp-background-component__active: #2a3a62;
  --isp-background-primary: #2563eb;
  --isp-background-primary__hover: #3b74f0;
  --isp-background-primary__active: #1d4fd0;
  --isp-text-interactive: #7aa7ff;
  --isp-text-interactive__hover: #a3c2ff;
  --isp-icon-primary: #7aa7ff;
  --isp-border-default: var(--dh-border);
  --isp-shadow-base: var(--dh-shadow);
  --isp-shadow-base_float: 0 18px 44px rgba(0, 0, 0, .4);
  --isp-shadow-base_dialog: 0 30px 80px rgba(0, 0, 0, .5);
  --isp-table-background: var(--dh-card);
  --isp-table-background-odd: #1d273c;
  --isp-table-background-hover: var(--dh-hover);
}
html[dark=true] input:-webkit-autofill,
html[dark=true] input:-webkit-autofill:hover,
html[dark=true] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #eaf0fb !important;
  -webkit-box-shadow: 0 0 0 1000px #212c44 inset !important;
}

/* ---------- фон страницы — мягкое синее свечение ---------- */
html body {
  background:
    radial-gradient(1100px 520px at 78% -180px, var(--dh-glow-1), transparent 70%),
    radial-gradient(900px 480px at -10% 110%, var(--dh-glow-2), transparent 70%),
    var(--dh-page) !important;
  background-attachment: fixed !important;
}
.layout, .layout-wrapper, .layout__main-page, .tab-item__outlet-container, isp-tabs.layout__main-page { background: transparent !important; }

/* шапка и левое меню — матовое стекло */
.isp-context__top-header, .isp-context__sub-header {
  background: var(--dh-glass) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--dh-border) !important;
}
isp-panel.isp-side-bar, .isp-side-bar.isp-panel {
  background: var(--dh-glass-side) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-right: 1px solid var(--dh-border) !important;
}

/* карточки/виджеты */
isp-widget-wrap.isp-widget, .isp-widget {
  display: block;
  background: var(--dh-card) !important;
  border: 1px solid var(--dh-border) !important;
  border-radius: var(--dh-radius) !important;
  box-shadow: var(--dh-shadow) !important;
  overflow: hidden;
  transition: box-shadow .2s ease;
}
isp-widget-wrap.isp-widget:hover { box-shadow: var(--dh-shadow-hover) !important; }
.isp-widget-wrap__header { border-bottom: 1px solid var(--dh-border-soft) !important; }
.isp-widget-wrap__title-text { font-weight: 700 !important; letter-spacing: -.01em; }

/* левое меню — пункты-«пилюли» */
.isp-menu-item-container {
  border-radius: 12px !important;
  margin: 2px 8px !important;
  transition: background .15s ease;
}
.isp-menu-item-container:hover { background: var(--dh-hover) !important; }
.isp-menu-item-container__label { font-weight: 500; }

/* кнопки — градиент и скругление */
ispui-button, .ispui-button { --ispui-button__border-radius: 12px; border-radius: 12px; }
.ispui-button_theme_primary, ispui-button[theme="primary"] {
  background: var(--dh-grad) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
  border-radius: 12px !important;
}
.ispui-button_theme_secondary, ispui-button[theme="secondary"] { border-radius: 12px !important; }

/* таблицы */
.table { border-radius: 14px; }
table.ispui-table { background-color: transparent !important; }
.table__cell_header { font-weight: 600 !important; color: var(--dh-muted) !important; }
.table__row { transition: background .12s ease; }
isp-table, .isp-table {
  display: block;
  background: var(--dh-card) !important;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--dh-border);
  box-shadow: var(--dh-shadow);
}

/* вкладки, уведомления */
.isp-tab-bar-item__content-wrapper_selected { font-weight: 600; }
.isp-notification-item, .notification-group > * { border-radius: 14px !important; }

/* формы заказа и карточки тарифов (группа строк list-table__row_start … _end) */
.isp-df__header, .isp-dynamic-form-header { background: transparent !important; }
table.list-table__table { border-collapse: separate !important; border-spacing: 0 !important; }
tr.list-table__row_gap, tr.list-table__row_gap > td { background: transparent !important; }
tr.list-table__row_separated { background: transparent !important; }
tr.list-table__row_separated > td { background: var(--dh-card) !important; }
tr.list-table__row_separated > td:first-child { border-left: 1px solid var(--dh-border) !important; }
tr.list-table__row_separated > td:last-child { border-right: 1px solid var(--dh-border) !important; }
tr.list-table__row_start > td { border-top: 1px solid var(--dh-border) !important; }
tr.list-table__row_start > td:first-child { border-top-left-radius: 16px !important; }
tr.list-table__row_start > td:last-child { border-top-right-radius: 16px !important; }
tr.list-table__row_end > td { border-bottom: 1px solid var(--dh-border) !important; }
tr.list-table__row_end > td:first-child { border-bottom-left-radius: 16px !important; }
tr.list-table__row_end > td:last-child { border-bottom-right-radius: 16px !important; }
.toolbar-button { border-radius: 10px; }
.toolbar-button:hover { background: var(--dh-hover) !important; }

/* страница входа — карточка */
section.isp-page.isp-page_shadow {
  background: var(--dh-card) !important;
  border: 1px solid var(--dh-border) !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25) !important;
}

/* переключатель темы ☀/🌙 */
.dh-theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0 14px 0 4px; padding: 0;
  border: 1px solid var(--dh-border); border-radius: 50%;
  background: var(--dh-card); color: inherit; cursor: pointer;
  font-size: 16px; line-height: 1; transition: background .15s ease, transform .15s ease;
}
.dh-theme-btn:hover { background: var(--dh-hover); transform: rotate(-12deg); }
.dh-theme-btn_float { position: fixed; top: 16px; right: 16px; z-index: 1000; margin: 0; width: 40px; height: 40px; box-shadow: var(--dh-shadow); }

/* в светлой теме — светлые логотипы и фон входа (в брендинге BILLmanager стоят тёмные) */
html:not([dark=true]) img.isp-logo-image { content: url(/manimg/userdata/dh-logo-login-light.png); }
html:not([dark=true]) isp-brand-logo img { content: url(/manimg/userdata/dh-logo-48-light.png); }
html:not([dark=true]) .isp-background_image { background-image: url(/manimg/userdata/dh-login-bg-light.png) !important; }

