/* InSoft theme overrides */
:root {
  --insoft-primary: #2A4A8C;
  --insoft-accent: #06B6D4;
  --bs-primary: var(--insoft-primary);
  --bs-link-color: var(--insoft-primary);
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0F172A;
  --bs-body-color: #E2E8F0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
}

.monospace { font-family: 'JetBrains Mono', 'Consolas', monospace; }

.sidebar {
  width: 240px;
  min-height: calc(100vh - 56px);
  background: var(--bs-tertiary-bg);
  border-right: 1px solid var(--bs-border-color);
  transition: width 0.2s ease;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-label { display: none; }

.sidebar .nav-link {
  color: var(--bs-body-color);
  padding: 0.5rem 1rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link.active {
  color: var(--insoft-primary);
  border-left-color: var(--insoft-primary);
  background: rgba(42, 74, 140, 0.08);
}

.topbar {
  height: 56px;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
}

.logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--insoft-primary);
}

.kpi-card {
  border-left: 4px solid var(--insoft-primary);
  transition: transform 0.15s ease;
}
.kpi-card:hover { transform: translateY(-2px); }

.status-ok       { color: #10B981; }
.status-degraded { color: #F59E0B; }
.status-failed   { color: #EF4444; }
.status-predicted{ color: #8B5CF6; }

.badge-status-ok        { background: #10B981; color: white; }
.badge-status-degraded  { background: #F59E0B; color: white; }
.badge-status-failed    { background: #EF4444; color: white; }
.badge-status-predicted { background: #8B5CF6; color: white; }
.badge-status-unknown   { background: #6B7280; color: white; }
.badge-status-unreachable { background: #64748B; color: white; }
.badge-status-present   { background: #6B7280; color: white; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #FFFFFF;
  color: #0F172A;
}

.login-container {
  width: 100%;
  max-width: 960px;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  border: 1px solid #E2E8F0;
}

@media (max-width: 768px) {
  .login-card-split { grid-template-columns: 1fr; }
}

/* Ляв branding панел с gradient */
.login-brand-panel {
  position: relative;
  background: linear-gradient(135deg, #2A4A8C 0%, #1E3A8A 50%, #0F172A 100%);
  padding: 3rem 2.5rem;
  color: white;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.login-brand-content { position: relative; z-index: 2; }

.login-logo-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.login-features li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.75rem;
  color: rgba(255,255,255,0.9);
}
.login-features i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.25);
  color: #67E8F9;
  flex-shrink: 0;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.deco-1 { width: 240px; height: 240px; top: -80px; right: -80px; }
.deco-2 { width: 160px; height: 160px; bottom: -40px; left: -40px; }
.deco-3 { width: 80px; height: 80px; top: 40%; right: 20%; background: rgba(6, 182, 212, 0.15); }

/* Дясна форма */
.login-form-panel {
  padding: 3rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}
.login-form-inner { width: 100%; max-width: 360px; }

.login-form .form-control,
.login-form .input-group-text {
  padding: 0.625rem 0.75rem;
  border-color: #E2E8F0;
}
.login-form .input-group-text { background: #F8FAFC; }
.login-form .form-control:focus {
  border-color: #2A4A8C;
  box-shadow: 0 0 0 3px rgba(42, 74, 140, 0.1);
}
.login-form .btn-primary {
  background: linear-gradient(135deg, #2A4A8C 0%, #1E3A8A 100%);
  border: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.login-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(42, 74, 140, 0.3);
}

/* EU banner (на login) */
.login-eu-banner {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.eu-banner {
  background: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .eu-banner { background: #0F172A; }

.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover { background: var(--bs-tertiary-bg); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bs-secondary-color);
}
.empty-state .bi { font-size: 3rem; opacity: 0.4; }

.debug-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  color: #0F0;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  z-index: 9999;
}

[data-bs-theme="dark"] .card { background: #1E293B; }
[data-bs-theme="dark"] .card-header { background: #0F172A; border-color: #334155; }
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-hover-bg: #334155; }
[data-bs-theme="dark"] pre { background: #0F172A !important; color: #E2E8F0; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
    background: #0F172A; color: #E2E8F0; border-color: #334155;
}
[data-bs-theme="dark"] .breadcrumb a { color: #06B6D4; }
