:root {
  --bg: #0e1621;
  --bg-soft: #121c29;
  --panel: #101a27;
  --panel-2: #0f1926;
  --elev: #0b1320;
  --stroke: #1f2a3a;
  --muted: #8aa0b6;
  --text: #e6f0ff;
  --text-2: #c6d4e3;
  --primary: #3b82f6;
  --green: #22c55e;
  --orange: #f59e0b;
  --indigo: #6366f1;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --radius: 14px;
  --ctl-h: 40px;
  --col-left: 280px;
  --col-right: 360px;
  --anim: 240ms cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  background: linear-gradient(180deg, #0b1320 0%, #0e1621 60%, #0a1220 100%);
  color: var(--text);
  font: 14px/1.4 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Global scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b3d55 #0b1626
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px
}

::-webkit-scrollbar-track {
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 8px
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1c2a40, #243651);
  border: 1px solid #2b3d55;
  border-radius: 8px
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #284364, #31527a);
  border-color: #3b5374
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  position: relative
}

/* Sidebar Menu */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border-right: 1px solid var(--stroke);
  z-index: 200;
  transition: left var(--anim);
  display: flex;
  flex-direction: column
}

.sidebar-menu--open {
  left: 0
}

.sidebar-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--stroke)
}

.sidebar-menu__brand {
  display: flex;
  align-items: center;
  gap: 12px
}

.sidebar-menu__title {
  font-weight: 600;
  color: #e6f0ff
}

.sidebar-menu__subtitle {
  font-size: 12px;
  color: var(--muted)
}

.sidebar-menu__close {
  background: transparent;
  border: 1px solid var(--stroke);
  color: #9db7d6
}

.sidebar-menu__close:hover {
  background: #0b1626;
  border-color: #2b3d55;
  color: #cfe5ff
}

.sidebar-menu__nav {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.sidebar-menu__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #9db7d6;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent
}

.sidebar-menu__link:hover {
  background: #0b1626;
  color: #cfe5ff;
  border-left-color: #3b82f6
}

.sidebar-menu__link--active {
  background: #0b1730;
  color: #cfe5ff;
  border-left-color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1)
}

.sidebar-menu__link span {
  font-size: 13px;
  line-height: 1.3;
  word-wrap: break-word;
  flex: 1
}

.sidebar-menu__link--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  color: #6b7280;
  position: relative
}

.sidebar-menu__link--disabled:hover {
  background: transparent;
  color: #6b7280;
  border-left-color: transparent
}

.sidebar-menu__link--disabled::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #6b7280, transparent);
  opacity: 0.6
}

.sidebar-menu__footer {
  padding: 20px;
  border-top: 1px solid var(--stroke)
}

.sidebar-menu__user {
  display: flex;
  align-items: center;
  gap: 12px
}

.sidebar-menu__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #031227
}

.sidebar-menu__user-name {
  font-weight: 600;
  font-size: 14px;
  color: #e6f0ff
}

.sidebar-menu__user-role {
  font-size: 12px;
  color: var(--muted)
}

/* Logout button */
.sidebar-menu__logout {
  width: 100%;
  height: 40px;
  margin-top: 12px;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  border: 1px solid #dc2626;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-menu__logout:hover {
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sidebar-menu__logout:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.sidebar-menu__logout svg {
  flex-shrink: 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 20, 0.6);
  backdrop-filter: blur(2px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all var(--anim)
}

.sidebar-overlay--visible {
  opacity: 1;
  visibility: visible
}

/* Header */
.header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10, 18, 32, .7);
  backdrop-filter: saturate(140%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 14px
}

.header__right {
  display: flex;
  align-items: center;
  gap: 12px
}

.datetime {
  font-size: 12px;
  color: #9db7d6;
  background: #0c1c36;
  border: 1px solid #1d3a64;
  padding: 4px 8px;
  border-radius: 999px
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px
}

.brand__logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1)
}

.brand__logo--header {
  width: 48px;
  height: 48px
}

.brand__title {
  font-weight: 600
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted)
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: 16px;
  flex-wrap: nowrap
}

.tab {
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0
}

.tab--active {
  background: #0b1730;
  color: #cfe5ff;
  box-shadow: inset 0 0 0 1px #1d3a64
}

.tab--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  color: #6b7280;
  position: relative
}

.tab--disabled:hover {
  background: transparent;
  color: #6b7280
}

.tab--disabled::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 24px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #6b7280, transparent);
  opacity: 0.6
}

/* Test Data Notice */
.test-data-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 350px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.test-data-notice__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.test-data-notice__text {
  line-height: 1.4;
}


.icon-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  color: #bcd0ea;
  background: linear-gradient(180deg, #0f1b2b, #0b1625);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.icon-btn:hover {
  border-color: #2b3d55
}

.icon-btn--ghost {
  background: transparent
}

.icon-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #0a0f1a;
  color: #6b7280;
  border-color: #1a1f2e
}

.icon-btn.disabled:hover {
  border-color: #1a1f2e;
  background: #0a0f1a;
  color: #6b7280
}

.status {
  font-size: 12px;
  color: #9fc2ff;
  background: #0c1c36;
  border: 1px solid #1d3a64;
  padding: 4px 8px;
  border-radius: 999px
}

.status--online::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px
}

/* KPI Widgets */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px
}

.widget {
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow)
}

.widget--large {
  grid-column: span 2
}

.widget--medium {
  grid-column: span 1
}

.widget--small {
  grid-column: span 1;
  min-height: 200px
}

.widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke)
}

.widget__title {
  display: flex;
  align-items: center;
  gap: 8px
}

.widget__icon {
  font-size: 20px
}

.widget__name {
  font-weight: 600;
  color: #e6f0ff
}

.widget__actions {
  display: flex;
  gap: 8px
}

.widget__toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: #9db7d6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease
}

.widget__toggle:hover {
  background: #0b1626;
  color: #cfe5ff;
  border-color: #3b82f6
}

.widget__content {
  min-height: 200px
}

.widget__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #8aa0b6;
  text-align: center
}

.widget__placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px
}

.widget__placeholder-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #cfe5ff
}

.widget__placeholder-description {
  font-size: 14px;
  opacity: 0.8
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px)
}

.modal__content {
  position: relative;
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow)
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--stroke)
}

.modal__title {
  font-size: 18px;
  font-weight: 600;
  color: #e6f0ff;
  margin: 0;
  flex: 1
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: #9db7d6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease
}

.modal__close:hover {
  background: #0b1626;
  color: #cfe5ff;
  border-color: #3b82f6
}

.modal__body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto
}

.modal__footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--stroke);
  justify-content: flex-end
}

/* KPI Settings */
.kpi-settings__section {
  margin-bottom: 24px
}

.kpi-settings__title {
  font-size: 16px;
  font-weight: 600;
  color: #e6f0ff;
  margin-bottom: 16px
}

.kpi-settings__widgets {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.kpi-settings__widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease
}

.kpi-settings__widget:hover {
  background: #0b1626;
  border-color: #3b82f6
}

.kpi-settings__widget input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6
}

.kpi-settings__widget-icon {
  font-size: 20px
}

.kpi-settings__widget-name {
  font-weight: 500;
  color: #cfe5ff
}

/* Modal Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease
}

.btn--primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border: 1px solid #3b82f6
}

.btn--primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border-color: #2563eb
}

.btn--secondary {
  background: transparent;
  color: #9db7d6;
  border: 1px solid var(--stroke)
}

.btn--secondary:hover {
  background: #0b1626;
  color: #cfe5ff;
  border-color: #3b82f6
}

.btn--danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: 1px solid #ef4444
}

.btn--danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #dc2626
}

/* Logout Modal */
.modal__content--small {
  max-width: 400px
}

.modal__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #ffffff
}

.modal__message {
  font-size: 16px;
  font-weight: 500;
  color: #e6f0ff;
  margin-bottom: 8px;
  text-align: center
}

.modal__submessage {
  font-size: 14px;
  color: #8aa0b6;
  text-align: center;
  margin-bottom: 0
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px
}

.user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #041225
}

.user__name {
  font-weight: 600;
  font-size: 13px
}

.user__role {
  font-size: 11px;
  color: var(--muted)
}

/* Audit Logs Page */
.audit-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke)
}

.audit-title {
  font-size: 24px;
  font-weight: 600;
  color: #e6f0ff;
  margin: 0
}

.audit-actions {
  display: flex;
  gap: 12px
}

.audit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px
}

.stat-card {
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px;
  text-align: center
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 8px
}

.stat-label {
  font-size: 14px;
  color: #8aa0b6
}

.audit-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  flex-wrap: wrap
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px
}

.filter-group label {
  font-size: 12px;
  color: #8aa0b6;
  font-weight: 500
}

.filter-group select,
.filter-group input {
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #0b1626;
  color: #cfe5ff;
  font-size: 14px
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #3b82f6
}

.audit-logs {
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden
}

.logs-table {
  width: 100%;
  border-collapse: collapse
}

.logs-table th {
  background: #0b1626;
  color: #cfe5ff;
  font-weight: 600;
  font-size: 14px;
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--stroke)
}

.logs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--stroke);
  color: #9db7d6;
  font-size: 13px
}

.log-row:hover {
  background: #0b1626
}

.log-time {
  white-space: nowrap;
  color: #8aa0b6
}

.log-user {
  font-weight: 500;
  color: #cfe5ff
}

.log-event {
  white-space: nowrap
}

.event-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase
}

.event-badge--login_success {
  background: #10b981;
  color: #ffffff
}

.event-badge--login_failed {
  background: #ef4444;
  color: #ffffff
}

.event-badge--logout {
  background: #6b7280;
  color: #ffffff
}

.event-badge--kpi_settings_change {
  background: #3b82f6;
  color: #ffffff
}

.event-badge--page_navigation {
  background: #8b5cf6;
  color: #ffffff
}

.event-badge--error {
  background: #f59e0b;
  color: #ffffff
}

.event-badge--page_load {
  background: #06b6d4;
  color: #ffffff
}

.log-ip {
  font-family: monospace;
  color: #8aa0b6
}

.log-browser {
  color: #8aa0b6
}

.log-device {
  color: #8aa0b6;
  font-size: 12px
}

.log-details {
  text-align: center
}

.btn--small {
  padding: 4px 8px;
  font-size: 12px
}

.no-logs {
  text-align: center;
  color: #8aa0b6;
  font-style: italic;
  padding: 40px
}

/* KPI */
.kpi-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3d55 #0b1626
}

.kpi-row::-webkit-scrollbar {
  height: 6px
}

.kpi-row::-webkit-scrollbar-track {
  background: #0b1626;
  border-radius: 3px
}

.kpi-row::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1c2a40, #243651);
  border-radius: 3px
}

.kpi-row::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #284364, #31527a)
}

.kpi-card {
  display: grid;
  grid-template-columns: 36px 1fr 72px;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #0f1a29, #0c1726);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  min-width: 200px
}

.kpi-card--small {
  grid-template-columns: 36px 1fr;
  gap: 10px
}

.kpi-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white
}

.kpi-card__icon--blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa)
}

.kpi-card__icon--green {
  background: linear-gradient(135deg, #10b981, #22d3ee)
}

.kpi-card__icon--orange {
  background: linear-gradient(135deg, #f59e0b, #f97316)
}

.kpi-card__icon--indigo {
  background: linear-gradient(135deg, #6366f1, #22d3ee)
}

.kpi-card__icon--gray {
  background: linear-gradient(135deg, #6b7280, #9ca3af)
}

.kpi-card__icon--purple {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa)
}

.kpi-card__icon--teal {
  background: linear-gradient(135deg, #06b6d4, #22d3ee)
}

.kpi-card__icon--red {
  background: linear-gradient(135deg, #ef4444, #f87171)
}

.kpi-card__label {
  font-size: 11px;
  color: #99b0c6
}

.kpi-card__value {
  font-size: 18px;
  font-weight: 700
}

.kpi-card__sparkline {
  height: 24px;
  border-left: 1px solid var(--stroke)
}

/* KPI config button */
.kpi-card--action {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 72px;
  height: 72px;
  margin-left: auto;
  flex-shrink: 0
}

.kpi-card--action:hover {
  border-color: #2b3d55
}

.kpi-card--action svg {
  color: #ffffff
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100
}

.modal--open {
  display: block
}

.modal[aria-hidden="false"] {
  display: block
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, .8);
  backdrop-filter: blur(4px)
}

.modal__dialog {
  position: relative;
  margin: 40px auto 0;
  width: min(800px, 90vw);
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 80vh
}

.modal__header,
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke)
}

.modal__footer {
  border-top: 1px solid var(--stroke);
  border-bottom: 0
}

.modal__title {
  font-weight: 600;
  font-size: 18px;
  color: #e6f0ff
}

.modal__content {
  padding: 20px;
  overflow: auto;
  width: 100%;
  flex: 1
}

.kpi-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%
}

.kpi-config__title {
  font-size: 13px;
  color: #9db7d6;
  margin-bottom: 8px;
  font-weight: 500
}

.search input {
  width: 100%;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe5ff;
  font-size: 13px
}

.search input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2)
}

.kpi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto
}

.kpi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe5ff;
  cursor: grab;
  transition: all 0.2s ease
}

.kpi-item:hover {
  border-color: #2b3d55;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2)
}

.kpi-item__grip {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #29425f 0 2px, transparent 2px 4px);
  flex-shrink: 0
}

.kpi-item.dragging {
  opacity: .6;
  transform: rotate(2deg)
}

/* KPI Configuration Styles */
.kpi-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%
}

.kpi-config__title {
  font-size: 13px;
  color: #9db7d6;
  margin-bottom: 8px;
  font-weight: 500
}

.kpi-config__column {
  display: flex;
  flex-direction: column
}

.search {
  width: 100%;
  margin-bottom: 12px
}

.search input {
  width: 100%;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe5ff;
  font-size: 13px
}

.search input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2)
}

.kpi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto
}

.kpi-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe5ff;
  transition: all 0.2s ease
}

.kpi-list-item:hover {
  border-color: #2b3d55;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2)
}

.kpi-list-item__content {
  flex: 1;
  min-width: 0
}

.kpi-list-item__label {
  font-weight: 600;
  font-size: 13px;
  color: #e6f0ff;
  margin-bottom: 4px
}

.kpi-list-item__description {
  font-size: 11px;
  color: #9db7d6;
  line-height: 1.3
}

.kpi-list-item__category {
  font-size: 10px;
  color: #6b7280;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px
}

.kpi-list-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0
}

.kpi-list-item__move-up,
.kpi-list-item__move-down,
.kpi-list-item__remove,
.kpi-list-item__add {
  background: #0b1626;
  border: 1px solid var(--stroke);
  color: #9db7d6;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 600
}

.kpi-list-item__move-up:hover,
.kpi-list-item__move-down:hover {
  background: #1d3a64;
  border-color: #3b82f6;
  color: #cfe5ff
}

.kpi-list-item__remove:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff
}

.kpi-list-item__add:hover {
  background: #16a34a;
  border-color: #22c55e;
  color: #ffffff
}

.kpi-list-item__move-up:disabled,
.kpi-list-item__move-down:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #0b1626;
  border-color: var(--stroke);
  color: #6b7280
}

/* Modal buttons */
.modal__footer .icon-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: #9db7d6;
  padding: 10px 16px;
  font-size: 14px
}

.modal__footer .icon-btn:hover {
  background: #0b1626;
  border-color: #2b3d55;
  color: #cfe5ff
}

.modal__footer .primary-btn {
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border: 0;
  color: #031227;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease
}

.modal__footer .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3)
}

/* Notifications Popup */
.notifications-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 80px 20px 0 0;
  pointer-events: none
}

.notifications-popup--open {
  display: flex;
  pointer-events: auto
}

.notifications-popup__content {
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 320px;
  max-height: 400px;
  overflow: hidden;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease
}

.notifications-popup--open .notifications-popup__content {
  transform: translateY(0);
  opacity: 1
}

.notifications-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke)
}

.notifications-popup__title {
  font-size: 16px;
  font-weight: 600;
  color: #e6f0ff
}

.notifications-popup__close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: #9db7d6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease
}

.notifications-popup__close:hover {
  background: #0b1626;
  color: #cfe5ff;
  border-color: #3b82f6
}

.notifications-popup__body {
  padding: 20px
}

.notifications-empty {
  text-align: center;
  color: #8aa0b6
}

.notifications-empty__icon {
  margin-bottom: 12px;
  opacity: 0.6;
  color: #8aa0b6;
  display: flex;
  align-items: center;
  justify-content: center
}

.notifications-empty__text {
  font-size: 16px;
  font-weight: 500;
  color: #cfe5ff;
  margin-bottom: 8px
}

.notifications-empty__subtext {
  font-size: 14px;
  color: #8aa0b6
}

/* Layout */
.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--col-left) 1fr var(--col-right);
  gap: 12px;
  padding: 16px 16px 16px;
  overflow: hidden;
  transition: grid-template-columns var(--anim)
}

/* Edge reopen flags */
.reopen-btn {
  position: absolute;
  top: 180px;
  z-index: 3;
  background: rgba(13, 23, 38, .9);
  border: 1px solid var(--stroke);
  color: #cfe5ff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: none
}

.reopen-btn--left {
  left: 8px
}

.reopen-btn--right {
  right: 8px
}

.sidebar {
  background: linear-gradient(180deg, #0f1928, #0e1826);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  transition: width var(--anim), opacity var(--anim), margin var(--anim)
}

.panel {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.panel__title {
  font-weight: 600
}

.section {
  border-top: 1px solid var(--stroke);
  padding-top: 12px
}

.section__title {
  font-size: 12px;
  color: #8fb0d1;
  margin-bottom: 10px
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 8px;
  color: #cfe5ff;
  cursor: pointer
}

.action-btn__icon {
  font-size: 18px
}

.filter-label {
  display: block;
  margin: 12px 0 6px;
  color: #9bb3cc;
  font-size: 12px
}

.select select {
  width: 100%;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe5ff
}

.checkbox {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #c1d4ea
}

.checkbox input {
  accent-color: #3b82f6
}

/* Center */
.center {
  position: relative;
  background: linear-gradient(180deg, #0e1826, #0a1422);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 16px
}

.divider {
  width: 1px;
  background: var(--stroke)
}

.map-container {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3)
}

.map-container .ol-viewport {
  border-radius: 16px
}

/* Layer Search */
.layer-search {
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
  color: #6b7280;
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #cfe5ff;
  font-size: 13px;
  outline: none;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: #6b7280;
}

.clear-search-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.clear-search-btn:hover {
  color: #cfe5ff;
}

/* MapLibre GL JS styles */
.map-container .maplibregl-canvas {
  border-radius: 16px !important;
}

.map-container .maplibregl-canvas-container {
  border-radius: 16px !important;
}

/* Улучшенные стили для карты */
.maplibregl-map {
  border-radius: 16px !important;
  overflow: hidden !important;
}

.maplibregl-canvas {
  border-radius: 16px !important;
}

/* Принудительно применяем закругления ко всем элементам карты */
.maplibregl-canvas-container canvas {
  border-radius: 16px !important;
}

.maplibregl-canvas-container .maplibregl-canvas {
  border-radius: 16px !important;
}

/* Дополнительные стили для всех элементов карты */
.maplibregl-map .maplibregl-canvas-container {
  border-radius: 16px !important;
}

.maplibregl-map .maplibregl-canvas {
  border-radius: 16px !important;
}

/* Универсальные стили для всех элементов карты */
.maplibregl-map * {
  border-radius: 16px !important;
}

/* Специальные стили для canvas элементов */
canvas.maplibregl-canvas {
  border-radius: 16px !important;
}

/* Стили для всех дочерних элементов контейнера карты */
.map-container * {
  border-radius: 16px !important;
}

/* Принудительное закругление для всех элементов MapLibre */
.maplibregl-canvas-container,
.maplibregl-canvas-container *,
.maplibregl-map * {
  border-radius: 16px !important;
}

/* Ensure map is visible */
#map {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  display: block !important;
}

.maplibregl-map {
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

.ol-control {
  background: rgba(11, 22, 38, .9);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 4px
}

.ol-control button {
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  color: #cfe5ff;
  font-size: 14px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  margin: 2px;
  transition: all .2s ease
}

.ol-control button:hover {
  background: #0f1a2a;
  border-color: #2b3d55;
  color: #60a5fa
}

.ol-control button:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .2)
}

.ol-attribution {
  background: rgba(11, 22, 38, .9);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  color: #9db7d6;
  font-size: 11px;
  padding: 4px 8px
}

.ol-attribution a {
  color: #60a5fa;
  text-decoration: none
}

.ol-attribution a:hover {
  text-decoration: underline
}

/* Right panel */
.chat-card {
  background: linear-gradient(180deg, #0f1a29, #0c1726);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0
}

.chat-card__header {
  display: flex;
  gap: 10px;
  align-items: center
}

.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center
}

.chat-card__title {
  font-weight: 600
}

.chat-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto
}

.msg {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 100%;
  font-size: 13px
}

.msg--bot {
  background: #0d1d33;
  border: 1px solid #1d3150;
  color: #d4e6ff
}

.chat-card__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  transition: opacity 0.3s ease, transform 0.3s ease
}

.chip {
  border: 1px solid #1f3a60;
  background: #0a1930;
  color: #c7e2ff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer
}

.chat-card__input {
  display: flex;
  gap: 8px
}

.chat-card__input input {
  flex: 1;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0 12px;
  color: #cfe5ff;
  height: var(--ctl-h)
}

.primary-btn {
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border: 0;
  color: #031227;
  border-radius: 10px;
  padding: 0 16px;
  min-width: 48px;
  font-weight: 700;
  cursor: pointer;
  height: var(--ctl-h)
}

.mic-btn {
  min-width: 40px
}

.chat-card__input .icon-btn {
  height: var(--ctl-h)
}

.mic-btn.is-recording {
  color: #ffb4b4;
  border-color: #5a2a2a;
  background: linear-gradient(180deg, #2a0f14, #1a0b0f)
}

/* Typing indicator */
.msg--typing {
  background: #0d1d33;
  border: 1px solid #1d3150;
  color: #d4e6ff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.typing-text {
  font-size: 12px;
  color: #9db7d6;
  font-style: italic;
}

/* Responsive */
@media (max-width:1400px) {
  :root {
    --col-left: 240px;
    --col-right: 320px
  }
}

@media (max-width:768px) {
  .sidebar-menu {
    width: 280px
  }

  .sidebar-menu__header {
    padding: 16px
  }

  .sidebar-menu__nav {
    padding: 12px 0
  }

  .sidebar-menu__link {
    padding: 10px 16px
  }

  .sidebar-menu__footer {
    padding: 16px
  }
}

@media (max-width:1200px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr)
  }

  .layout {
    grid-template-columns: 1fr
  }

  .sidebar--left,
  .sidebar--right {
    order: 2
  }

  .center {
    order: 1;
    min-height: 520px
  }
}

/* Dashboards list */
.dash-search {
  max-width: 920px;
  margin: 0 auto 12px
}

.dash-search input {
  width: 100%;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  color: #cfe5ff
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 920px;
  margin: 0 auto
}

.dash-item {
  background: linear-gradient(180deg, #0f1a29, #0c1726);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between
}

.dash-item__meta {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.dash-item__title {
  font-weight: 600
}

.dash-item__desc {
  color: #a9c3df
}

.btn-small {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #0f1b2b, #0b1625);
  color: #cfe5ff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center
}

.btn-small:hover {
  border-color: #2b3d55
}

.btn-small--disabled {
  background: #374151;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
  border-color: #4b5563
}

/* Map Filters Styles - Analytics Inspired */
.tools-section {
  margin-bottom: 24px;
}

.tools-section__title {
  font-size: 12px;
  color: #8fb0d1;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Template Selector */
.template-selector {
  margin-bottom: 8px;
}

.template-select {
  width: 100%;
  padding: 10px 12px;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: #cfe5ff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.template-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.template-select option {
  background: #0b1626;
  color: #cfe5ff;
}

.template-select.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #0a0f1a;
  color: #6b7280;
}

.coming-soon-text {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

/* Стили для сообщения о пустых категориях */
.empty-category-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  text-align: center;
  color: #8aa0b6;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
  background: rgba(139, 160, 182, 0.05);
  border: 1px dashed rgba(139, 160, 182, 0.2);
  margin: 8px 0;
}

.empty-category-message svg {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  opacity: 0.6;
  color: #8aa0b6;
}

.empty-category-message span {
  font-weight: 500;
  color: #9db7d6;
}

/* District Selector */
.district-selector {
  margin-bottom: 8px;
}

.district-select {
  width: 100%;
  padding: 10px 12px;
  background: #0b1626;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: #cfe5ff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.district-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.district-select option {
  background: #0b1626;
  color: #cfe5ff;
}

/* Collapsible Layers */
.collapsible-layers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collapsible-category {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #0b1626;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: #0f1a2a;
  border: none;
  color: #cfe5ff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
}

.category-header:hover {
  background: #1a2a3a;
}

.category-header.active {
  background: #1a2a3a;
  border-bottom: 1px solid var(--stroke);
}

.category-title {
  flex: 1;
}

.category-count {
  background: #3b82f6;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-right: 8px;
  min-width: 16px;
  text-align: center;
}

.category-count:empty {
  display: none;
}

.category-arrow {
  color: #9db7d6;
  transition: transform 0.2s ease;
}

.category-header.active .category-arrow {
  transform: rotate(180deg);
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.category-content.active {
  max-height: 300px;
}

.layer-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #cfe5ff;
  font-size: 13px;
  min-height: 32px;
  border-radius: 4px;
  margin: 2px 0;
}

.layer-checkbox:hover {
  background: #0f1a2a;
}

.layer-checkbox input[type="checkbox"] {
  display: inline-block;
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.layer-name {
  flex: 1;
  font-size: 13px;
  color: #e6f0ff;
  line-height: 1.3;
  word-wrap: break-word;
}

/* Period Selector */
.period-selector {
  display: flex;
  gap: 6px;
}

.period-btn {
  flex: 1;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 12px;
  color: #cfe5ff;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.period-btn:hover {
  border-color: #2b3d55;
}

.period-btn.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: #cfe5ff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 36px;
}

.action-btn:hover {
  background: #0f1a2a;
  border-color: #2b3d55;
}

.action-btn--primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  font-weight: 600;
  grid-column: 1 / -1;
}

.action-btn--primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.action-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.action-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #0a0f1a;
  color: #6b7280;
  border-color: #1a1f2e;
}

.action-btn.disabled:hover {
  background: #0a0f1a;
  border-color: #1a1f2e;
  color: #6b7280;
}

/* Collapsible Categories */
.collapsible-category {
  margin-bottom: 8px;
}

.category-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #0f1a2a, #0b1522);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #cfe5ff;
  font-size: 13px;
  font-weight: 500;
}

.category-header:hover {
  border-color: #2b3d55;
}

.category-header.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.category-title {
  flex: 1;
  text-align: left;
}

.category-count {
  background: #3b82f6;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  margin-right: 8px;
}

.category-arrow {
  transition: transform 0.2s ease;
  color: #6b7280;
}

.category-header.active .category-arrow {
  transform: rotate(180deg);
  color: #3b82f6;
}

.category-content {
  display: none;
  background: #0b1626;
  border-radius: 0 0 8px 8px;
  margin-top: -1px;
  border: 1px solid var(--stroke);
  border-top: none;
  padding: 8px 0;
  max-height: none;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.category-content.active {
  display: block;
}

/* Убираем ограничения высоты для слоев */
.collapsible-layers {
  max-height: none;
  overflow: visible;
}

/* Исправляем перекрытие категорий */
.collapsible-category {
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.collapsible-category+.collapsible-category {
  margin-top: 8px;
}

.layer-checkbox:hover {
  background: #0f1a2a;
}

/* Подсветка результатов поиска */
.layer-checkbox.search-result {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== НОВЫЕ СТИЛИ ДЛЯ ФИЛЬТРОВ КАРТЫ ===== */

/* Список слоев */
.layers-list {
  margin-top: 12px;
}

/* Категория слоев */
.layer-category {
  margin-bottom: 8px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

/* Заголовок категории */
.layer-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--stroke);
  min-height: 44px;
}

.layer-category__header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layer-category__title {
  font-size: 13px;
  font-weight: 500;
  color: #cfe5ff;
  flex: 1;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.layer-category__count {
  background: #3b82f6;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  text-align: center;
  margin-left: 6px;
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.layer-category__count:not(:empty) {
  display: flex;
}

.layer-category__arrow {
  color: #6b7280;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* Активное состояние заголовка */
.layer-category.active .layer-category__header {
  background: rgba(59, 130, 246, 0.1);
  border-bottom-color: #3b82f6;
}

.layer-category.active .layer-category__arrow {
  transform: rotate(180deg);
  color: #3b82f6;
}

/* Контент категории */
.layer-category__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.1);
}

.layer-category.active .layer-category__content {
  max-height: 500px;
}

/* Элемент слоя */
.layer-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.layer-item:last-child {
  border-bottom: none;
}

.layer-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Чекбокс */
.layer-item__checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Кастомный чекбокс */
.layer-item__checkmark {
  width: 16px;
  height: 16px;
  border: 2px solid #6b7280;
  border-radius: 4px;
  background: #0b1626;
  margin-right: 12px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Состояние чекбокса */
.layer-item__checkbox:checked+.layer-item__checkmark {
  background: #3b82f6;
  border-color: #3b82f6;
}

.layer-item__checkbox:checked+.layer-item__checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

/* Название слоя */
.layer-item__name {
  font-size: 13px;
  color: #cfe5ff;
  line-height: 1.4;
  flex: 1;
}

/* Активное состояние элемента */
.layer-item.active {
  background: rgba(59, 130, 246, 0.1);
}

.layer-item.active .layer-item__name {
  color: #3b82f6;
}

/* Поиск слоев */
.layer-search {
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #6b7280;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: #cfe5ff;
  font-size: 13px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

.search-input::placeholder {
  color: #6b7280;
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.clear-search-btn:hover {
  color: #cfe5ff;
}

/* Результаты поиска */
.layer-item.search-result {
  background: rgba(59, 130, 246, 0.15);
  border-left: 3px solid #3b82f6;
}

.layer-item.search-result .layer-item__name {
  color: #3b82f6;
  font-weight: 500;
}

/* Скрытые элементы при поиске */
.layer-item.hidden {
  display: none;
}

.layer-category.hidden {
  display: none;
}

/* Стили для деталей логов */
.log-details-content {
  color: #e2e8f0;
}

.detail-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #0f1419;
  border-radius: 6px;
  border: 1px solid #2d3748;
}

.detail-section h4 {
  margin: 0 0 12px 0;
  color: #9db7d6;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-section p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

.detail-section strong {
  color: #e2e8f0;
  font-weight: 600;
}

.detail-section pre {
  background: #0a0e13;
  border: 1px solid #2d3748;
  border-radius: 4px;
  padding: 12px;
  margin: 8px 0;
  font-size: 12px;
  color: #9db7d6;
  overflow-x: auto;
  white-space: pre-wrap;
}

.json-details {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

/* Стили для адаптивных popup окон MapLibre */
.maplibregl-popup {
  max-width: 90vw !important;
  max-height: 80vh !important;
}

.maplibregl-popup-content {
  max-width: none !important;
  max-height: none !important;
  overflow: auto !important;
  word-wrap: break-word !important;
  white-space: normal !important;
}

.maplibregl-popup-content-wrapper {
  max-width: 90vw !important;
  max-height: 80vh !important;
  overflow: auto !important;
}

/* Адаптивные стили для содержимого popup */
.maplibregl-popup-content div {
  max-width: 100% !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Стили для длинного текста в popup */
.maplibregl-popup-content strong {
  display: inline-block;
  min-width: 80px;
  margin-right: 8px;
}

.maplibregl-popup-content div {
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .maplibregl-popup {
    max-width: 95vw !important;
    max-height: 70vh !important;
  }

  .maplibregl-popup-content {
    font-size: 14px !important;
    padding: 12px !important;
  }

  .maplibregl-popup-content strong {
    min-width: 70px;
    font-size: 13px;
  }
}

/* Header Button for ИИ агенты */
.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  color: #031227;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.header-btn:active {
  transform: translateY(0);
}

.header-btn svg {
  flex-shrink: 0;
}

/* DataHub Iframe Container */
.datahub-container {
  width: 100%;
  height: calc(100vh - 64px);
  margin: 0;
  background: #0b1626;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.datahub-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}