:root {
  --sidebar-bg: #303641;
  --sidebar-width: 240px;
  --sidebar-item-active: rgba(231, 76, 60, 0.2);
  --sidebar-item-active-border: #e74c3c;
  --topbar-bg: #f0f2f5;
  --topbar-height: 56px;
  --content-bg: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body.dashboard-body {
  margin: 0;
  background: var(--content-bg);
  color: #1f2937;
  min-height: 100vh;
}

/* Sidebar (Sufee Admin – ciemny) */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: #fff;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, margin 0.2s;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  font-size: 1.5rem;
  color: #e74c3c;
}

.sidebar-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.sidebar-nav {
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item i {
  font-size: 1.1rem;
  opacity: 0.9;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-item.active {
  background: var(--sidebar-item-active);
  color: #fff;
  border-left-color: var(--sidebar-item-active-border);
}

/* Główny wrapper (obok sidebaru) */
.main-wrap {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-wrap {
    margin-left: 0;
  }
}

/* Górny pasek */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-shrink: 0;
}

.topbar-btn {
  border: none;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  color: #374151;
  font-size: 1.25rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-icon {
  position: relative;
  font-size: 1.2rem;
  color: #6b7280;
  padding: 0.35rem;
  cursor: pointer;
}

.topbar-icon:hover {
  color: #374151;
}

.badge-notif, .badge-msg {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.65rem;
  min-width: 1rem;
  padding: 0.15em 0.4em;
  border-radius: 10px;
}

.badge-notif {
  background: #e74c3c;
  color: #fff;
}

.badge-msg {
  background: #3498db;
  color: #fff;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.topbar-page-title {
  font-weight: 600;
  color: #111827;
}

.topbar-lang {
  display: flex;
  align-items: center;
}

.topbar-select {
  width: auto;
  min-width: 4rem;
}

.topbar-user {
  font-size: 0.9rem;
  color: #374151;
}

/* Treść */
.content {
  flex: 1;
  padding: 1.5rem;
}

/* Karty metryk (4 kolory jak na rysunku) */
.metric-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.metric-card-1 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.metric-card-2 {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.metric-card-3 {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.metric-card-4 {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.metric-value {
  font-weight: 700;
  font-size: 1.5rem;
}

/* Karty treści */
.card {
  border: 0;
  border-radius: 12px;
}

.card-header {
  border-bottom: 1px solid #e5e7eb;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 10px;
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
}

.hidden {
  display: none !important;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #ffffff;
}

.history-item button {
  white-space: nowrap;
}

/* Login page – ukryty blok błędu */
.login-card .hidden {
  display: none !important;
}
