:root {
  --bt-accent: #2f6f9f;
  --bt-accent-dark: #24587f;
  --bt-accent-soft: #e7f2f8;
  --bt-ink: #1f2933;
  --bt-muted: #6b7785;
  --bt-line: #e6ebf0;
  --bt-bg: #f3f6f9;
  --bt-sidebar: 268px;
  --bt-header: 74px;
  --bt-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
}

* { box-sizing: border-box; }

body.bt-app {
  margin: 0;
  min-height: 100vh;
  background: var(--bt-bg);
  color: var(--bt-ink);
  font-family: Outfit, "Segoe UI", sans-serif;
}

.bt-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bt-header);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--bt-line);
}

.bt-header-left,
.bt-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bt-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.bt-nav-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid var(--bt-line);
  background: #f8f9fa;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bt-nav-toggle:hover {
  background: var(--bt-accent-soft);
  border-color: var(--bt-accent);
  color: var(--bt-accent);
}

.bt-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.bt-brand-link img {
  height: 28px;
  width: auto;
}

.bt-datetime {
  font-size: 11px;
  line-height: 1.25;
  color: var(--bt-muted);
  white-space: nowrap;
}

.bt-datetime strong {
  display: block;
  color: #4b5563;
  font-size: 11px;
}

.bt-wordmark {
  text-decoration: none;
  color: var(--bt-accent);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.bt-classic-btn,
.bt-layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #d5e3ee;
  background: var(--bt-accent-soft);
  color: var(--bt-accent-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  white-space: nowrap;
}

.bt-classic-btn:hover,
.bt-layout-switch:hover {
  background: var(--bt-accent);
  color: #fff;
}

.bt-user { position: relative; }

.bt-user-btn {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--bt-ink);
  font: inherit;
  padding: 6px 4px;
}

.bt-user-copy {
  text-align: right;
  line-height: 1.2;
}

.bt-user-copy strong { display: block; font-size: 14px; font-weight: 600; }
.bt-user-copy span { display: block; font-size: 12px; color: var(--bt-muted); }

.bt-user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--bt-line);
  border-radius: 12px;
  box-shadow: var(--bt-shadow);
  overflow: hidden;
  z-index: 50;
}

.bt-user.open .bt-user-menu { display: block; }

.bt-user-menu h6 {
  margin: 0;
  padding: 12px 14px;
  background: var(--bt-accent-soft);
  color: var(--bt-accent-dark);
  font-size: 13px;
}

.bt-user-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--bt-ink);
  text-decoration: none;
}

.bt-user-menu a:hover { background: #f7fafc; }

.bt-sidebar {
  position: fixed;
  top: var(--bt-header);
  left: 0;
  bottom: 0;
  width: var(--bt-sidebar);
  background: #fff;
  border-right: 1px solid var(--bt-line);
  overflow: auto;
  z-index: 30;
  padding: 14px 0 28px;
  transition: transform 0.2s ease;
}

.bt-sidebar-label {
  margin: 4px 22px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bt-muted);
}

.bt-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 12px;
  padding: 13px 16px;
  min-height: 50px;
  border: 2px solid var(--bt-line);
  border-radius: 8px;
  background: #f8f9fa;
  color: var(--bt-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.bt-nav-link i,
.bt-nav-link img {
  width: 22px;
  text-align: center;
  color: var(--bt-accent);
  font-size: 18px;
}

.bt-nav-link img { height: 18px; width: 18px; object-fit: contain; }

.bt-nav-link:hover {
  background: var(--bt-accent-soft);
  border-color: var(--bt-accent);
  color: var(--bt-accent);
  transform: translateX(3px);
}

.bt-nav-link.active {
  background: var(--bt-accent);
  border-color: var(--bt-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 111, 159, 0.3);
}

.bt-nav-link.active i { color: #fff; }

.bt-main {
  margin-left: var(--bt-sidebar);
  min-height: calc(100vh - var(--bt-header));
  display: flex;
  flex-direction: column;
}

.bt-page {
  flex: 1;
  padding: 8px 22px 28px;
}

.bt-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 4px 8px;
}

.bt-title-row h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.bt-crumb {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--bt-muted);
  font-size: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-crumb a { color: var(--bt-accent); text-decoration: none; }

.bt-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 22px 18px;
}

.bt-footer img { height: 18px; width: auto; }

.bt-card {
  background: #fff;
  border: 1px solid var(--bt-line);
  border-radius: 14px;
  box-shadow: var(--bt-shadow);
}

.bt-stat {
  height: 100%;
  border: 1px solid var(--bt-line);
  border-radius: 14px;
  box-shadow: var(--bt-shadow);
}

.bt-stat .card-body { padding: 20px; }

.bt-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bt-accent-soft);
  color: var(--bt-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.bt-stat h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}

.bt-meta, .bt-issue {
  margin: 0 0 6px;
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-issue { color: #8a5a12; }

.bt-stat .btn { margin-top: 12px; }

.bt-panel { padding: 22px; }

.bt-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.bt-steps {
  margin: 0 0 22px;
  padding-left: 18px;
  color: #3d4854;
}

.bt-steps li { margin: 4px 0; }

.bt-form {
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.bt-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.bt-app .btn-primary,
.auth-body .btn-primary,
.auth-body .btn-default,
.bt-app .btn-default {
  background: var(--bt-accent);
  border-color: var(--bt-accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}

.bt-app .btn-primary:hover,
.auth-body .btn-primary:hover,
.auth-body .btn-default:hover,
.bt-app .btn-default:hover {
  background: var(--bt-accent-dark);
  border-color: var(--bt-accent-dark);
  color: #fff;
}

.bt-table-wrap { overflow: auto; }

.bt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.bt-table th,
.bt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bt-line);
  text-align: right;
}

.bt-table th:first-child,
.bt-table td:first-child,
.bt-table th:nth-child(2),
.bt-table td:nth-child(2) { text-align: left; }

.bt-table th {
  font-size: 12px;
  color: var(--bt-muted);
  font-weight: 650;
  background: #f8fafc;
}

.bt-org-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bt-org-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--bt-line);
}

.bt-overlay {
  display: none;
  position: fixed;
  inset: var(--bt-header) 0 0 0;
  background: rgba(17, 24, 32, 0.35);
  z-index: 25;
}

body.nav-open .bt-overlay { display: block; }

body.sidebar-collapsed .bt-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .bt-main { margin-left: 0; }

@media (max-width: 991px) {
  .bt-sidebar { transform: translateX(-100%); }
  body.nav-open .bt-sidebar { transform: none; }
  .bt-main, body.sidebar-collapsed .bt-main { margin-left: 0; }
  .bt-header-center, .bt-datetime, .bt-user-copy span { display: none; }
  .bt-brand-link img { height: 22px; max-width: 168px; object-fit: contain; object-position: left center; }
  .bt-header { gap: 8px; padding: 0 10px; }
  .bt-classic-btn { padding: 8px 10px; }
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: Outfit, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #2f6f9f 0%, #526b7c 100%);
  color: var(--bt-ink);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 72px;
}

.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 18px 50px rgba(16, 32, 48, 0.22);
}

.bt-brand-link img.bt-global-logo,
.bt-footer img.bt-global-logo,
.auth-logo.bt-global-logo {
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.bt-brand-link img.bt-global-logo {
  height: 46px;
  width: 46px;
  max-width: 46px;
}

.bt-footer img.bt-global-logo {
  height: 32px;
  width: 32px;
}

.auth-logo {
  display: block;
  height: 84px;
  width: 84px;
  margin: 0 auto 18px;
}

.bt-kpis { margin-bottom: 4px; }

.bt-kpi {
  background: #fff;
  border: 1px solid var(--bt-line);
  border-radius: 14px;
  box-shadow: var(--bt-shadow);
  padding: 16px 18px;
  height: 100%;
}

.bt-kpi span {
  display: block;
  color: var(--bt-muted);
  font-size: 13px;
  font-weight: 600;
}

.bt-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.bt-chart-card { padding: 18px 18px 8px; height: 100%; }
.bt-chart-card h2 { margin: 0 0 12px; font-size: 16px; }
.bt-chart-card canvas { max-height: 320px; }

.bt-period {
  margin: 0 0 12px;
  color: var(--bt-muted);
  font-weight: 600;
}

.bt-people th,
.bt-people td { text-align: left; }

.auth-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--bt-accent);
}

.auth-card .lede {
  text-align: center;
  color: var(--bt-muted);
  margin: 0 0 18px;
}

.auth-card .form-group { margin-bottom: 8px; }

.auth-card .control-label,
.auth-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-card .form-control {
  width: 100%;
  border: 1px solid #d7dee6;
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-card .btn,
.auth-card input[type="submit"] {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
}

.auth-links {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--bt-muted);
}

.auth-card .auth-links + .auth-links {
  margin-top: 6px;
}

.help-block, .error {
  color: #b42318;
  font-size: 13px;
  margin: 4px 0 0;
}
