/* 1С-Битрикс: Управление сайтом — визуальный стиль админки */
:root {
  --bx-top: #3a4048;
  --bx-top-dark: #2f343a;
  --bx-iconbar: #535c69;
  --bx-iconbar-active: #2fc6f6;
  --bx-submenu: #f5f7f8;
  --bx-workarea: #eef2f4;
  --bx-panel: #fff;
  --bx-border: #d5dde3;
  --bx-text: #535c69;
  --bx-text-dark: #333;
  --bx-link: #2067b0;
  --bx-warn-bg: #fff3cd;
  --bx-warn-text: #c0392b;
  --bx-btn: linear-gradient(#fff, #f3f6f8);
  --bx-btn-border: #c6cdd3;
  --bx-blue: #3bc8f5;
  --bx-green: #bbed21;
  --bx-orange: #f7a700;
  --bx-font: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.bx-admin {
  margin: 0;
  font: 13px/1.4 var(--bx-font);
  color: var(--bx-text);
  background: var(--bx-workarea);
}

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

/* ===== Top panel ===== */
.bx-top {
  height: 50px;
  background: linear-gradient(180deg, #454c55 0%, var(--bx-top) 100%);
  color: #fff;
  display: flex;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #23272c;
}
.bx-top a { color: #dfe3e8; text-decoration: none; }
.bx-top a:hover { color: #fff; text-decoration: none; }

.bx-top-tabs {
  display: flex;
  align-items: flex-end;
  padding-left: 8px;
  gap: 2px;
}
.bx-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  margin-bottom: 0;
  border-radius: 4px 4px 0 0;
  color: #d7dce2 !important;
  font-size: 13px;
  background: transparent;
}
.bx-tab.active {
  background: linear-gradient(#f7f9fa, #eef2f4);
  color: #333 !important;
  font-weight: 600;
  box-shadow: inset 0 1px 0 #fff;
}
.bx-tab .ico { opacity: .9; width: 16px; height: 16px; display: inline-block; }

.bx-top-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  font-size: 12px;
}
.bx-shield {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8fd14f;
  white-space: nowrap;
}
.bx-msg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bx-msg .badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #f44336;
  color: #fff;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.bx-top-search {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}
.bx-top-search form {
  width: min(420px, 100%);
  display: flex;
  background: #2b3036;
  border: 1px solid #22262b;
  border-radius: 2px;
  overflow: hidden;
}
.bx-top-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 7px 10px;
  font: inherit;
  outline: none;
}
.bx-top-search input::placeholder { color: #8a929c; }
.bx-top-search button {
  border: 0;
  background: transparent;
  color: #9aa3ad;
  padding: 0 10px;
  cursor: pointer;
}

.bx-top-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 8px;
  font-size: 12px;
  white-space: nowrap;
}
.bx-top-user .name { color: #fff; }
.bx-top-user form { display: inline; margin: 0; }
.bx-link-btn {
  background: none;
  border: 0;
  color: #9ec9f5;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.bx-link-btn:hover { color: #fff; text-decoration: underline; }
.bx-lang { color: #c5ccd4; }

/* ===== Shell ===== */
.bx-shell {
  display: grid;
  grid-template-columns: 66px 230px 1fr;
  min-height: calc(100vh - 50px);
}

/* Icon bar */
.bx-iconbar {
  background: var(--bx-iconbar);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bx-icon {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #d7dee5;
  font-size: 10px;
  text-align: center;
  line-height: 1.1;
  gap: 3px;
  text-decoration: none !important;
}
.bx-icon svg { width: 22px; height: 22px; fill: currentColor; }
.bx-icon:hover { background: rgba(255,255,255,.08); color: #fff; }
.bx-icon.active {
  background: var(--bx-iconbar-active);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.bx-icon-label { max-width: 48px; overflow: hidden; text-overflow: ellipsis; }
.bx-iconbar-bottom {
  margin-top: auto;
  padding: 10px 6px;
  text-align: center;
}
.bx-iconbar-bottom a {
  color: #b7c0c9;
  font-size: 10px;
  line-height: 1.2;
  display: block;
}

/* Submenu */
.bx-submenu {
  background: var(--bx-submenu);
  border-right: 1px solid var(--bx-border);
  padding: 14px 12px;
}
.bx-submenu-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--bx-text-dark);
  margin-bottom: 10px;
}
.bx-submenu-add {
  display: inline-block;
  font-size: 12px;
  color: var(--bx-link);
  margin-bottom: 16px;
}
.bx-menu-list { list-style: none; margin: 0; padding: 0; }
.bx-menu-list li { margin: 0 0 2px; }
.bx-menu-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 2px;
  color: #2067b0;
  font-size: 13px;
}
.bx-menu-list a:hover { background: #e8eef3; text-decoration: none; }
.bx-menu-list a.active {
  background: #dceef9;
  color: #135a96;
  font-weight: 600;
}
.bx-fav {
  margin-top: 22px;
  border-top: 1px solid #e1e6ea;
  padding-top: 14px;
}
.bx-fav h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #828b95;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bx-fav p {
  margin: 0;
  font-size: 12px;
  color: #9aa3ad;
  line-height: 1.45;
}

/* Workarea */
.bx-workarea {
  padding: 16px 18px 30px;
  min-width: 0;
}
.bx-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bx-page-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  color: #000;
}
.bx-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 12px;
  border: 1px solid var(--bx-btn-border);
  border-radius: 3px;
  background: var(--bx-btn);
  color: #535c69;
  font: 13px/1 var(--bx-font);
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.bx-btn:hover { background: linear-gradient(#fff, #e9eef2); color: #333; }
.bx-btn-primary {
  background: linear-gradient(#3dd0fa, #2fc6f6);
  border-color: #20b4e2;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.bx-btn-primary:hover { background: linear-gradient(#53d7fb, #39cdf8); color: #fff; }
.bx-btn-danger {
  background: linear-gradient(#ff8a80, #e57373);
  border-color: #e57373;
  color: #fff;
}
.bx-btn-sm { height: 25px; padding: 0 9px; font-size: 12px; }

.bx-alert {
  padding: 10px 12px;
  border-radius: 2px;
  margin: 0 0 12px;
  border: 1px solid transparent;
}
.bx-alert-success { background: #e7f6e7; border-color: #b7dfb9; color: #2e7d32; }
.bx-alert-error { background: #fdecea; border-color: #f5c6cb; color: #c62828; }
.bx-trial {
  background: var(--bx-warn-bg);
  border: 1px solid #ffe08a;
  color: var(--bx-warn-text);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* Gadgets */
.bx-gadgets {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 14px;
  align-items: start;
}
.bx-gadget-col { display: flex; flex-direction: column; gap: 14px; }
.bx-gadget {
  background: var(--bx-panel);
  border: 1px solid var(--bx-border);
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
.bx-gadget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  background: linear-gradient(#f8fafb, #eef2f4);
  border-bottom: 1px solid var(--bx-border);
  font-weight: 600;
  color: #525c69;
}
.bx-gadget-tabs {
  display: flex;
  gap: 0;
  margin: -1px 0 0;
}
.bx-gadget-tab {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  color: #2067b0;
  cursor: pointer;
  background: transparent;
  font: inherit;
}
.bx-gadget-tab.active {
  background: #fff;
  border-color: var(--bx-border);
  border-bottom-color: #fff;
  color: #333;
  font-weight: 600;
  border-radius: 3px 3px 0 0;
}
.bx-gadget-body { padding: 12px; }
.bx-gadget-body.hidden { display: none; }

.bx-chart-wrap { height: 220px; position: relative; }
.bx-chart-wrap canvas { width: 100%; height: 100%; display: block; }
.bx-chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}
.bx-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.bx-dot-total { background: #2067b0; }
.bx-dot-paid { background: #7ec8f5; }

.bx-table {
  width: 100%;
  border-collapse: collapse;
}
.bx-table th, .bx-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eceff1;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.bx-table th {
  color: #828b95;
  font-weight: 600;
  background: #fafbfc;
}
.bx-table tr:hover td { background: #f7fbfe; }

.bx-info-list { margin: 0; padding: 0; list-style: none; }
.bx-info-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f4;
  font-size: 13px;
}
.bx-info-list .k { color: #828b95; }
.bx-info-list .v { color: #333; }

.bx-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: #fff;
  min-height: 78px;
}
.bx-status-card .ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.bx-status-card .text { flex: 1; min-width: 0; }
.bx-status-card .title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.bx-status-card .desc { font-size: 12px; opacity: .92; }
.bx-status-card .bx-btn {
  background: rgba(255,255,255,.92);
  border-color: transparent;
  color: #333;
  font-weight: 600;
}
.bx-status-blue { background: linear-gradient(90deg, #3aa0e8, #4db8f5); }
.bx-status-green { background: linear-gradient(90deg, #8bc34a, #aed581); }
.bx-status-orange { background: linear-gradient(90deg, #f0a202, #f6c343); color: #3a2a00; }
.bx-status-orange .bx-btn { color: #5a4200; }

/* Forms / lists in admin */
.bx-panel {
  background: #fff;
  border: 1px solid var(--bx-border);
  border-radius: 2px;
  padding: 14px;
}
.bx-form-row { margin-bottom: 12px; }
.bx-form-row label {
  display: block;
  margin-bottom: 4px;
  color: #525c69;
  font-weight: 600;
}
.bx-form-row input,
.bx-form-row select,
.bx-form-row textarea {
  width: 100%;
  max-width: 560px;
  border: 1px solid #c6cdd3;
  border-radius: 2px;
  padding: 7px 9px;
  font: inherit;
  background: #fff;
  color: #333;
}
.bx-form-row textarea { min-height: 100px; }
.bx-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f4;
}
.bx-error-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #c62828;
}
.bx-inline-forms { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bx-inline-forms form { margin: 0; }

/* Login */
.bx-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #3a4048, #535c69 40%, #eef2f4 40%);
}
.bx-login-box {
  width: min(380px, calc(100% - 24px));
  background: #fff;
  border: 1px solid var(--bx-border);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 24px 26px 22px;
}
.bx-login-logo {
  text-align: center;
  margin-bottom: 16px;
  color: #535c69;
}
.bx-login-logo strong {
  display: block;
  font-size: 18px;
  color: #2fc6f6;
  margin-top: 4px;
}
.bx-login-box h1 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 400;
  color: #333;
  text-align: center;
}
.bx-login-hint {
  margin-top: 14px;
  font-size: 12px;
  color: #828b95;
  text-align: center;
}

@media (max-width: 1100px) {
  .bx-shell { grid-template-columns: 66px 1fr; }
  .bx-submenu { display: none; }
  .bx-gadgets { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bx-shell { grid-template-columns: 1fr; }
  .bx-iconbar { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 6px; }
  .bx-top-tools, .bx-top-search { display: none; }
  .bx-top { height: auto; flex-wrap: wrap; }
}

.bx-menu-arrow { color:#9aa3ad; margin-right:4px; font-size:11px; }
.bx-menu-list a.active .bx-menu-arrow { color:#2067b0; }
