@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES  (adapted from panel-new + huawei)
   ============================================================ */

:root {
  --hn-primary: #004aad;
  --hn-primary-hover: #003d91;
  --hn-primary-gradient: linear-gradient(135deg, #004aad, #0062e3);

  --color-primary: var(--hn-primary);
  --color-primary-hover: var(--hn-primary-hover);
  --color-primary-light: #dbeafe;
  --color-primary-subtle: #eff6ff;
  --color-secondary: #7c3aed;

  --color-success: #16a34a;
  --color-success-light: #dcfce7;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-light: #fee2e2;
  --color-info: #0891b2;
  --color-info-light: #cffafe;

  /* Service colors from panel-new */
  --hn-service-internet: #d63031;
  --hn-service-tv: #0984e3;
  --hn-service-voip: #e67e22;
  --hn-service-gsm: #d35400;
  --hn-service-other: #6c5ce7;

  --hn-status-active-bg: #e8f5e9;
  --hn-status-active-text: #2e7d32;
  --hn-status-warning-bg: #fff9c4;
  --hn-status-warning-text: #fbc02d;
  --hn-status-danger-bg: #ffe0b2;
  --hn-status-danger-text: #e65100;

  --color-white: #ffffff;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  --bg-body: #f4f6f9;
  --bg-surface: var(--color-white);
  --bg-surface-raised: var(--color-white);
  --bg-sidebar: var(--color-white);
  --bg-sidebar-hover: rgba(0, 74, 173, 0.06);
  --bg-sidebar-active: var(--hn-primary);
  --bg-input: var(--color-white);

  --text-primary: #2d3436;
  --text-secondary: var(--color-gray-600);
  --text-muted: var(--color-gray-400);
  --text-inverse: var(--color-white);
  --text-sidebar: #111827;
  --text-sidebar-active: var(--color-white);

  --border-color: var(--color-gray-200);
  --border-color-strong: var(--color-gray-300);
  --border-radius: 4px;
  --border-radius-sm: 3px;
  --border-radius-lg: 4px;
  --border-radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --hn-card-shadow: 0 8px 20px rgba(0,0,0,0.12);
  --hn-topbar-shadow: 0 6px 15px rgba(0,0,0,0.25);

  --sidebar-width: 280px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 54px;
  --topbar-margin: 15px;
  --navbar-height: 44px;
  --fixed-top-offset: calc(var(--topbar-height) + var(--topbar-margin) * 2 + var(--navbar-height));
  --content-padding: 24px;
  --content-padding-right: 24px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-lg: 1rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  --hn-font-scale: 1;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: var(--color-gray-800);
  --bg-surface-raised: #263044;
  --bg-sidebar: #0b1120;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --bg-sidebar-active: var(--hn-primary);
  --bg-input: var(--color-gray-800);
  --text-primary: var(--color-gray-100);
  --text-secondary: var(--color-gray-400);
  --text-muted: var(--color-gray-500);
  --text-sidebar: rgba(255, 255, 255, 0.7);
  --text-sidebar-active: var(--color-white);
  --border-color: var(--color-gray-700);
  --border-color-strong: var(--color-gray-600);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35);
  --hn-card-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* High contrast mode from panel-new */
[data-hn-contrast="high"] {
  --hn-primary: #000 !important;
  --color-primary: #000 !important;
  --bg-body: #fff !important;
}
[data-hn-contrast="high"] .card {
  border: 2px solid #000 !important;
  box-shadow: none !important;
}
[data-hn-contrast="high"] .text-muted { color: #000 !important; font-weight: bold; }

@media (prefers-contrast: high) {
  :root {
    --hn-primary: #1947c1;
    --color-primary: #1947c1;
    --border-color: var(--color-gray-700);
    --text-secondary: var(--color-gray-700);
    --shadow-sm: 0 0 0 1px var(--color-gray-700);
  }
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  font-family: var(--font-family);
  font-size: calc(var(--font-size-base) * var(--hn-font-scale));
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: calc(var(--font-size-3xl) * var(--hn-font-scale)); }
h2 { font-size: calc(var(--font-size-2xl) * var(--hn-font-scale)); }
h3 { font-size: calc(var(--font-size-xl) * var(--hn-font-scale)); }
h4 { font-size: calc(var(--font-size-lg) * var(--hn-font-scale)); }

ul { list-style: none; }

/* ============================================================
   3. LAYOUT SHELL
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: calc(var(--topbar-height) + var(--topbar-margin) * 2);
  height: calc(100vh - var(--topbar-height) - var(--topbar-margin) * 2);
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left var(--transition-slow);
  min-width: 0;
}

.sidebar-collapsed .main-wrap {
  margin-left: var(--sidebar-collapsed-width);
}

.content {
  padding: var(--content-padding) var(--content-padding-right) var(--content-padding) var(--content-padding);
  animation: fadeIn var(--transition-slow) ease;
}

.page-header {
  margin-top: var(--topbar-height);
  padding: 6px 24px;
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.65rem; /* Zmniejszony font */
  color: var(--text-secondary);
}

.breadcrumb-item {
  color: #64748b;
  font-weight: 500;
  text-transform: lowercase; /* Małe litery zgodnie z prośbą */
}

[data-theme="dark"] .breadcrumb-item { color: #94a3b8; }

.breadcrumb-item:last-child {
  color: var(--hn-primary);
  font-weight: 700;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.6;
}

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

/* ============================================================
   4. SIDEBAR  (hybrid: huawei structure + panel-new colors)
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--transition-slow), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border-right: 1px solid rgba(0,0,0,0.05);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }

[data-theme="dark"] .sidebar {
  border-right-color: var(--color-gray-700);
}

.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  height: calc(var(--topbar-height) + var(--topbar-margin) * 2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  position: relative;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  height: var(--topbar-height);
  margin-top: var(--topbar-margin);
}

.sidebar-logo-img {
  height: 32px; /* Increased slightly as requested (20% more than original 24-27 range) */
  width: auto;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}
.sidebar-logo-img:hover { transform: scale(1.05); }

.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
  height: 64px;
}

.sidebar-collapsed .sidebar-toggle-btn {
  margin: 0;
}

.sidebar-collapsed .sidebar-logo {
  display: none !important;
}
[data-theme="dark"] .sidebar-collapsed .sidebar-toggle { background: rgba(255, 255, 255, 0.05); }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: background var(--transition-fast);
  flex-shrink: 0;
  position: absolute;
  right: 12px;
  top: 12px; /* Przycisk u góry nagłówka */
}
.sidebar-toggle:hover { background: var(--bg-sidebar-hover); }

/* Nav list */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 4px; }
[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }

.nav-list { padding: 0; }

.nav-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 6px 16px;
}
[data-theme="dark"] .nav-divider { background: rgba(255, 255, 255, 0.08); }

/* Nav item (direct link) */
.nav-item { list-style: none; }

.nav-item > .nav-link,
.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  gap: 12px;
  color: var(--text-sidebar);
  border-radius: var(--border-radius-sm);
  margin: 1px 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item > .nav-link:hover,
.sidebar-footer .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--hn-primary);
  border-left-color: var(--hn-primary);
}

.nav-item.active > .nav-link,
.sidebar-footer .nav-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 74, 173, 0.3);
  border-left-color: transparent;
}

.nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}

.nav-label {
  opacity: 1;
  transition: opacity var(--transition-base);
  white-space: nowrap;
}

.sidebar-collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar-collapsed .nav-item > .nav-link { justify-content: center; padding: 9px 0; margin: 1px 8px; }

/* Nav section (collapsible group) */
.nav-section { list-style: none; }

.nav-section-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 16px;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-sidebar);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  margin: 1px 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.nav-section-toggle:hover {
  background: var(--bg-sidebar-hover);
  color: var(--hn-primary);
  border-left-color: var(--hn-primary);
}

.nav-arrow {
  margin-left: auto;
  font-size: 1rem;
  transition: transform var(--transition-base);
  flex-shrink: 0;
  opacity: 0.5;
  display: flex; align-items: center;
}

.nav-section.open > .nav-section-toggle .nav-arrow {
  transform: rotate(90deg);
}

.sidebar-collapsed .nav-arrow { display: none; }

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.nav-section.open > .nav-submenu {
  max-height: 600px;
}

.nav-submenu li { list-style: none; }

.nav-submenu .nav-link {
  display: flex;
  align-items: center;
  padding: 7px 16px 7px 44px;
  gap: 8px;
  color: var(--color-gray-500);
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius-sm);
  margin: 1px 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-submenu .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--hn-primary);
}
.nav-submenu .nav-link.active {
  background: rgba(0, 74, 173, 0.08);
  color: var(--hn-primary);
  font-weight: 600;
}

[data-theme="dark"] .nav-submenu .nav-link { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .nav-submenu .nav-link:hover { color: var(--color-white); background: rgba(255,255,255,0.06); }
[data-theme="dark"] .nav-submenu .nav-link.active { color: var(--color-white); background: rgba(255,255,255,0.1); }

.sidebar-collapsed .nav-submenu .nav-link { padding-left: 0; justify-content: center; }

/* Nested groups inside submenu */
.nav-nested { padding: 0; }
.nav-nested-label {
  display: block;
  padding: 10px 16px 4px 48px;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-400);
}
.nav-nested ul { padding: 0; }
.nav-nested ul .nav-link { padding-left: 56px; }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-company-info {
  font-size: 0.65rem;
  color: var(--color-gray-500);
  line-height: 1.4;
  padding: 0 4px;
}

.sidebar-company-info .company-name {
  font-weight: 700;
  color: var(--text-sidebar);
  margin-bottom: 2px;
  text-transform: uppercase;
}

.sidebar-collapsed .sidebar-company-info {
  display: none;
}

[data-theme="dark"] .sidebar-footer { border-top-color: rgba(255, 255, 255, 0.08); }

.sidebar-logout-form {
  padding: 8px 12px;
  width: 100%;
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 70%;
  padding: 6px 12px;
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  margin-right: auto;
}

.btn-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: #ef4444;
}

.sidebar-collapsed .sidebar-logout-form {
  padding: 8px 6px;
}

.sidebar-collapsed .btn-sidebar-logout {
  padding: 8px;
  border-radius: 8px;
  width: 100%;
  margin: 0;
}

.sidebar-collapsed .btn-sidebar-logout .nav-label {
  display: none;
}

.sidebar-collapsed .btn-sidebar-logout .nav-icon {
  margin: 0;
}

/* Base Topbar Styles */

.topbar {
  position: fixed;
  top: var(--topbar-margin);
  right: var(--topbar-margin);
  left: calc(var(--sidebar-width) + var(--topbar-margin));
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 900;
  transition: left var(--transition-slow), background var(--transition-base), box-shadow var(--transition-base);
  border-radius: 4px;
}

.sidebar-collapsed .topbar { 
  left: calc(var(--sidebar-collapsed-width) + var(--topbar-margin)); 
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-left   { flex: 1; justify-content: flex-start; }
.topbar-right  { flex: 0 0 auto; justify-content: flex-end; gap: 16px; margin-left: auto; }

.topbar-hamburger {
  background: none;
  border: none;
  color: inherit;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.topbar-hamburger:hover { background: rgba(255,255,255,0.1); }
.topbar-c .topbar-hamburger:hover { background: var(--bg-body); }

.topbar-logo-wrap { display: flex; align-items: center; }
.topbar-logo-img { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar-btn {
  background: none;
  border: none;
  color: inherit;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding: 0;
}
.topbar-btn:hover { background: rgba(255,255,255,0.15); }
.topbar-c .topbar-btn:hover { background: var(--color-gray-100); }

.topbar-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1;
  border: 2px solid transparent;
}

.topbar-sep {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  margin: 0 16px;
}

/* Topbar User Profile */
.topbar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 12px;
  transition: all 0.2s;
  position: relative;
}
.topbar-user-profile:hover { background: rgba(255,255,255,0.1); }
.topbar-c .topbar-user-profile:hover { background: var(--bg-body); }

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: inherit; }
.user-sub { font-size: 0.7rem; opacity: 0.7; color: inherit; font-weight: 500; }

/* User dropdown */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.topbar-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}
.dropdown-header strong { display: block; font-size: var(--font-size-sm); color: var(--text-primary); }
.dropdown-header small { display: block; font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--color-gray-100); }
[data-theme="dark"] .dropdown-item:hover { background: rgba(255, 255, 255, 0.06); }

.dropdown-logout { color: var(--color-danger); }
.dropdown-logout:hover { background: var(--color-danger-light); }

/* (Topbar variant picker removed) */

/* ============================================================
   5. TOPBAR VARIANTS
   ============================================================ */

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

.topbar-hamburger {
  background: none; border: none; color: inherit;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  margin-right: 8px;
}
.topbar-hamburger:hover { background: rgba(255,255,255,0.1); }
.topbar-c .topbar-hamburger:hover { background: var(--bg-body); }

.topbar-title-wrap { display: flex; flex-direction: column; }
.topbar-title { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar-sep {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  margin: 0 16px;
}

/* Variant-specific separator colors */
.topbar-c .topbar-sep { background: var(--border-color); }
.topbar-d .topbar-sep { background: rgba(255,255,255,0.1); }

.topbar-right { display: flex; align-items: center; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-avatar-box {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.85rem;
  margin-right: 8px;
}

.user-profile-icon {
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.topbar-user-profile.active .user-profile-icon { transform: rotate(180deg); }

.topbar-lang-btn {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Variant A: Business Blue (MATCHED TO SCREEN) --- */
.topbar-a {
  background: #004aad; color: #fff;
  box-shadow: 0 4px 15px rgba(0,74,173,0.3);
}
.topbar-a .user-sub { color: #60a5fa; }
.topbar-a .topbar-badge { border-color: #004aad; }

/* --- Variant B: Modern Gradient --- */
.topbar-b {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.25);
}
.topbar-b .topbar-btn:hover { background: rgba(255,255,255,0.2); }

/* --- Variant C: Minimal Clean --- */
.topbar-c {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
.topbar-c .topbar-btn { color: var(--text-secondary); }
.topbar-c .topbar-btn:hover { background: var(--bg-body); }
.topbar-c .topbar-sep { background: var(--border-color); }
.topbar-c .user-avatar-box { background: var(--bg-body); border-color: var(--border-color); color: var(--hn-primary); }
.topbar-c .user-sub { color: var(--text-muted); }

/* --- Variant D: Dark Pro --- */
.topbar-d {
  background: #0f172a; color: #f8fafc;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.topbar-d .user-avatar-box { background: rgba(59,130,246,0.1); border-color: #3b82f6; color: #3b82f6; }

/* --- Variant E: Compact --- */
.topbar-e {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

/* --- Page Nav Bar (Breadcrumbs) --- */
.page-nav-bar {
  position: sticky;
  top: 0;
  padding: 8px 24px;
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--navbar-height);
  z-index: 100;
}

.page-nav-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.page-nav-bar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.page-title-main {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hn-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title-main::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--hn-primary);
  border-radius: 4px;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; }
.breadcrumb-item { color: var(--text-secondary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }

.page-title-mini {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* --- Ogólny silnik wyszukiwania (w nagłówku / na kartach) --- */
.hn-search {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hn-search-input {
  padding: 5px 10px 5px 32px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  min-width: 180px;
  max-width: 320px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hn-search-input:focus {
  outline: none;
  border-color: var(--hn-primary);
  box-shadow: 0 0 0 2px rgba(0, 74, 173, 0.15);
}
.hn-search-input::placeholder {
  color: var(--text-muted);
}
.hn-search-wrap {
  position: relative;
  display: inline-block;
}
.hn-search-wrap .hn-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.hn-search-wrap .hn-search-icon svg {
  width: 14px;
  height: 14px;
}
.hn-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: none;
  border-radius: 4px;
}
.hn-search-clear:hover { color: var(--text-primary); }
.hn-search-wrap.has-value .hn-search-clear { display: block; }
.hn-search-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Adjust content top margin */
.app-layout .content {
  padding-top: var(--content-padding);
}

/* (Topbar B-E removed — single Business Blue topbar) */

/* ============================================================
   6. CARDS  (from panel-new: 3D shadows, service borders)
   ============================================================ */

.card {
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--hn-card-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.card:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.15); }

[data-theme="dark"] .card {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

@media (max-width: 991px) {
  .card {
    border: 1px solid rgba(0,0,0,0.15) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
  }
  [data-theme="dark"] .card { border-color: rgba(255,255,255,0.15) !important; }
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); }

/* Service cards with colored left border (from panel-new) */
.card-service { border-left: 5px solid transparent !important; margin-bottom: 0.75rem; }
.card-service-internet { border-left-color: var(--hn-service-internet) !important; }
.card-service-tv { border-left-color: var(--hn-service-tv) !important; }
.card-service-voip { border-left-color: var(--hn-service-voip) !important; }
.card-service-gsm { border-left-color: var(--hn-service-gsm) !important; }
.card-service-other { border-left-color: var(--hn-service-other) !important; }

.card-service:hover .service-icon-box {
  transform: scale(1.1) rotate(5deg);
}

.service-icon-box {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid currentColor;
  background: transparent !important;
  border-radius: 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  transition: transform var(--transition-base);
}

/* Service color utility classes */
.text-internet { color: var(--hn-service-internet) !important; }
.text-tv { color: var(--hn-service-tv) !important; }
.text-voip { color: var(--hn-service-voip) !important; }
.text-gsm { color: var(--hn-service-gsm) !important; }
.text-other { color: var(--hn-service-other) !important; }

.bg-internet-light { background-color: rgba(214, 48, 49, 0.1) !important; }
.bg-tv-light { background-color: rgba(9, 132, 227, 0.1) !important; }
.bg-voip-light { background-color: rgba(230, 126, 34, 0.1) !important; }
.bg-gsm-light { background-color: rgba(211, 84, 0, 0.1) !important; }
.bg-other-light { background-color: rgba(108, 92, 231, 0.1) !important; }

/* Status colors */
.bg-status-active { background: var(--hn-status-active-bg) !important; color: var(--hn-status-active-text) !important; }
.bg-status-warning { background: var(--hn-status-warning-bg) !important; color: var(--hn-status-warning-text) !important; }
.bg-status-danger { background: var(--hn-status-danger-bg) !important; color: var(--hn-status-danger-text) !important; }

/* Stat Card */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  box-shadow: var(--hn-card-shadow);
  display: flex; align-items: flex-start; justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.stat-card:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.15); transform: translateY(-2px); }

.stat-card-value { font-size: var(--font-size-2xl); font-weight: 700; line-height: 1.2; }
.stat-card-label { font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 4px; }

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--border-radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ============================================================
   7. DATA TABLE  (hover effect from panel-new)
   ============================================================ */

.data-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }

.data-table thead th {
  position: sticky; top: 0;
  background: var(--bg-surface-raised);
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.data-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.data-table tbody tr:nth-child(even) { background: var(--color-gray-50); }
[data-theme="dark"] .data-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.data-table tbody tr:hover {
  background: rgba(0, 74, 173, 0.03);
  border-left-color: var(--hn-primary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
[data-theme="dark"] .data-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

/* Row status gradients from panel-new */
.row-status-pending {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.08), transparent) !important;
  border-left: 4px solid #ff9800 !important;
}
.row-status-completed {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.08), transparent) !important;
  border-left: 4px solid #2ecc71 !important;
}
.row-status-debt {
  background: linear-gradient(90deg, rgba(214, 48, 49, 0.08), transparent) !important;
  border-left: 4px solid #d63031 !important;
}

/* ============================================================
   8. BUTTONS  (with primary-hn gradient from panel-new)
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px;
  font-size: var(--font-size-sm); font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--color-gray-100); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn-primary {
  background: var(--hn-primary-gradient);
  color: var(--color-white);
  border: none;
  box-shadow: 0 4px 6px rgba(0, 74, 173, 0.3);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 74, 173, 0.4);
  filter: brightness(1.1);
  background: var(--hn-primary-gradient);
  color: var(--color-white);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0, 74, 173, 0.4); }

.btn-success { background: var(--color-success); color: var(--color-white); border-color: var(--color-success); }
.btn-success:hover { background: #15803d; border-color: #15803d; }

.btn-danger { background: var(--color-danger); color: var(--color-white); border-color: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-subtle); }

.btn-link { background: none; border: none; color: var(--color-primary); padding: 4px 8px; }
.btn-link:hover { color: var(--color-primary-hover); text-decoration: underline; }

.btn-block { display: flex; width: 100%; }

.btn-sm { padding: 5px 10px; font-size: var(--font-size-xs); }
.btn-lg { padding: 11px 24px; font-size: var(--font-size-lg); }

/* ============================================================
   9. FORMS
   ============================================================ */

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: var(--font-size-sm); font-weight: 500;
  margin-bottom: 6px; color: var(--text-primary);
}

.form-control, .form-select,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  display: block; width: 100%;
  padding: 8px 12px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none; line-height: 1.5;
}

.form-control:focus, .form-select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--hn-primary);
  box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.15);
}

.form-control::placeholder,
.form-group input::placeholder { color: var(--text-muted); }

.form-select, .form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================================
   10. BADGES
   ============================================================ */

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: var(--font-size-xs); font-weight: 600;
  border-radius: var(--border-radius-full);
  background: var(--color-gray-200); color: var(--color-gray-700);
  line-height: 1.5;
}
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-info    { background: var(--color-info-light);    color: var(--color-info);    }

/* ============================================================
   11. ALERTS
   ============================================================ */

.alert {
  padding: 12px 16px; border-radius: var(--border-radius);
  font-size: var(--font-size-sm); border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
}
.alert-info    { background: var(--color-info-light);    border-color: rgba(8, 145, 178, 0.2);   color: #0e7490; }
.alert-success { background: var(--color-success-light); border-color: rgba(22, 163, 74, 0.2);   color: #15803d; }
.alert-danger  { background: var(--color-danger-light);  border-color: rgba(220, 38, 38, 0.2);   color: #b91c1c; }
.alert-warning { background: var(--color-warning-light); border-color: rgba(217, 119, 6, 0.2);   color: #92400e; }

/* ============================================================
   12. TOAST NOTIFICATIONS
   ============================================================ */

.toast-container,
.hn-toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 99999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.hn-toast {
  pointer-events: auto;
  position: relative;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  min-width: 280px; max-width: 450px;
  display: flex; align-items: flex-start; gap: 12px;
  font-size: var(--font-size-sm);
  opacity: 0;
  transform: translateX(100%);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}
.hn-toast--visible { opacity: 1; transform: translateX(0); }

.hn-toast--success { border-left: 4px solid var(--color-success); }
.hn-toast--error   { border-left: 4px solid var(--color-danger); }
.hn-toast--warning { border-left: 4px solid var(--color-warning); }
.hn-toast--info    { border-left: 4px solid var(--color-info); }

.hn-toast__icon { font-size: 1.25rem; flex-shrink: 0; padding-top: 2px; }
.hn-toast__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hn-toast__msg  { line-height: 1.4; word-break: break-word; }
.hn-toast__timer { 
  font-size: 0.7rem; 
  font-weight: 700; 
  color: var(--text-muted); 
  text-transform: uppercase;
  background: var(--color-gray-100);
  padding: 2px 6px;
  border-radius: 10px;
  align-self: flex-start;
}
[data-theme="dark"] .hn-toast__timer { background: rgba(255,255,255,0.1); }

.hn-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.05);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  overflow: hidden;
}
.hn-toast__progress-bar {
  width: 100%;
  height: 100%;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}
.hn-toast--success .hn-toast__progress-bar { background: var(--color-success); }
.hn-toast--error .hn-toast__progress-bar   { background: var(--color-danger); }
.hn-toast--warning .hn-toast__progress-bar { background: var(--color-warning); }
.hn-toast--info .hn-toast__progress-bar    { background: var(--color-info); }

.hn-toast__close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.4rem;
  padding: 0 4px; cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}
.hn-toast__close:hover { color: var(--text-primary); }

/* ============================================================
   13. MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto;
  transform: translateY(12px) scale(0.97);
  transition: transform var(--transition-base);
}
.modal-backdrop.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-color);
  font-weight: 600; font-size: var(--font-size-lg);
}
.modal-close {
  background: none; border: none; font-size: 1.25rem;
  color: var(--text-muted); padding: 4px; line-height: 1;
  transition: color var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border-color);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============================================================
   14. TABS
   ============================================================ */

.tabs {
  display: flex; border-bottom: 2px solid var(--border-color); gap: 0;
}
.tab-item {
  padding: 10px 18px; font-size: var(--font-size-sm); font-weight: 500;
  color: var(--text-secondary); border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--hn-primary); border-bottom-color: var(--hn-primary); }

.tab-content { display: none; padding: 20px 0; animation: fadeIn var(--transition-base) ease; }
.tab-content.active { display: block; }

/* ============================================================
   15. PROGRESS BAR
   ============================================================ */

.progress {
  height: 8px; background: var(--color-gray-200);
  border-radius: var(--border-radius-full); overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--hn-primary);
  border-radius: var(--border-radius-full);
  transition: width var(--transition-slow);
}
.progress-bar.success { background: var(--color-success); }
.progress-bar.danger  { background: var(--color-danger);  }
.progress-bar.warning { background: var(--color-warning); }

/* ============================================================
   16. AVATAR
   ============================================================ */

.avatar {
  width: 36px; height: 36px;
  border-radius: var(--border-radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--font-size-sm); font-weight: 600;
  color: var(--color-white); background: var(--hn-primary);
  flex-shrink: 0; overflow: hidden; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: var(--font-size-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--font-size-lg); }

/* ============================================================
   17. LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; /* Jaśniejsze, stonowane tło zgodnie z obrazkiem */
  font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .login-page {
  background: #0f172a;
}

.login-wrapper {
  width: 100%; max-width: 440px; padding: 24px;
}

.login-card {
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 40px 36px;
}

[data-theme="dark"] .login-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.login-logo {
  text-align: center; margin-bottom: 24px; display: flex; justify-content: center;
}
.login-logo-img {
  height: 46px;
  display: block;
}

.login-title {
  text-align: center; font-size: 1.05rem; font-weight: 700; color: #1e293b; margin-bottom: 6px;
}
[data-theme="dark"] .login-title { color: #f8fafc; }

.login-subtitle {
  text-align: center; color: #64748b; font-size: 0.82rem; margin-bottom: 28px;
}

.form-label-caps {
  display: block; font-size: 0.68rem; font-weight: 700; color: #475569; margin-bottom: 6px; letter-spacing: 0.025em;
}
[data-theme="dark"] .form-label-caps { color: #94a3b8; }

.form-control-login {
  width: 100%;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.84rem;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
}
[data-theme="dark"] .form-control-login {
  background: #0f172a; border-color: #334155; color: #f8fafc;
}
.form-control-login:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-login {
  display: block; width: 100%;
  padding: 10px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}
.btn-login:hover { background: #2563eb; }

.login-footer-ip {
  text-align: center; margin-top: 24px; font-size: 0.68rem; color: #94a3b8;
}

.mfa-cancel {
  text-align: center; margin-top: 20px;
}
.mfa-cancel .btn-link { font-size: 0.875rem; color: #64748b; text-decoration: none; }
.mfa-cancel .btn-link:hover { color: #3b82f6; }

/* ============================================================
   18. GLOBAL LOADER
   ============================================================ */

.global-loader {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9000;
  pointer-events: none;
}
.global-loader.hidden { display: none; }

.loader-backdrop {
  position: absolute; inset: 0;
  background: var(--hn-primary, #004aad);
  animation: loaderSlide 1.2s ease-in-out infinite;
  transform-origin: left;
}
[data-theme="dark"] .loader-backdrop { background: #60a5fa; }

@keyframes loaderSlide {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(0.7); transform-origin: left; }
  51%  { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.loader-spinner { display: none; }

body.hn-loading { cursor: wait; }
body.hn-loading * { cursor: wait !important; }

/* ============================================================
   19. SIDEBAR BACKDROP (mobile)
   ============================================================ */

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.sidebar-backdrop.active { opacity: 1; pointer-events: auto; }

/* ============================================================
   20. PLACEHOLDER PAGES
   ============================================================ */

.placeholder-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 50vh; text-align: center;
  color: var(--text-muted);
}
.placeholder-icon { font-size: 3rem; margin-bottom: 16px; }
.placeholder-page h2 { font-size: var(--font-size-xl); margin-bottom: 8px; color: var(--text-secondary); }
.placeholder-page p { font-size: var(--font-size-sm); }

/* ============================================================
   21. UTILITY CLASSES
   ============================================================ */

.text-center { text-align: center; }
.text-right  { text-align: right;  }
.text-muted  { color: var(--text-muted); }

.mt-1 { margin-top: 4px;  } .mb-1 { margin-bottom: 4px;  }
.mt-2 { margin-top: 8px;  } .mb-2 { margin-bottom: 8px;  }
.mt-3 { margin-top: 16px; } .mb-3 { margin-bottom: 16px; }
.mt-4 { margin-top: 24px; } .mb-4 { margin-bottom: 24px; }
.mt-5 { margin-top: 32px; } .mb-5 { margin-bottom: 32px; }

.d-flex { display: flex; }
.gap-1 { gap: 4px;  }
.gap-2 { gap: 8px;  }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.hidden { display: none !important; }

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

/* ============================================================
   22. MENU STYLE VARIANTS  (5 distinct looks, data-menu="1"-"5")
   ============================================================ */

/* --- M1: Corporate Light (white, blue active pill, left-border hover) --- */
[data-menu="1"] .sidebar { background: #fff; border-right: 1px solid rgba(0,0,0,0.06); box-shadow: 2px 0 20px rgba(0,0,0,0.05); }
[data-menu="1"] .sidebar .nav-item > .nav-link,
[data-menu="1"] .sidebar .nav-section-toggle,
[data-menu="1"] .sidebar .sidebar-footer .nav-link { color: #475569; border-left: 3px solid transparent; }
[data-menu="1"] .sidebar .nav-item > .nav-link:hover,
[data-menu="1"] .sidebar .nav-section-toggle:hover,
[data-menu="1"] .sidebar .sidebar-footer .nav-link:hover { background: rgba(0,74,173,0.05); color: var(--hn-primary); border-left-color: var(--hn-primary); }
[data-menu="1"] .sidebar .nav-item.active > .nav-link,
[data-menu="1"] .sidebar .sidebar-footer .nav-link.active { background: var(--hn-primary); color: #fff; border-left-color: transparent; box-shadow: 0 4px 12px rgba(0,74,173,0.3); transform: scale(1.02); }
[data-menu="1"] .sidebar .nav-submenu .nav-link { color: #94a3b8; }
[data-menu="1"] .sidebar .nav-submenu .nav-link:hover { background: rgba(0,74,173,0.04); color: var(--hn-primary); }
[data-menu="1"] .sidebar .nav-submenu .nav-link.active { background: rgba(0,74,173,0.08); color: var(--hn-primary); font-weight: 600; }
[data-menu="1"] .sidebar .nav-divider { background: #e2e8f0; }
[data-menu="1"] .sidebar .sidebar-footer { border-top-color: #e2e8f0; }
[data-menu="1"] .sidebar .sidebar-header { border-bottom-color: #e2e8f0; }
[data-menu="1"] .sidebar .sidebar-logo-text { color: #1e293b; }
[data-menu="1"] .sidebar .nav-tree > li::before,
[data-menu="1"] .sidebar .nav-tree > li::after { border-color: #cbd5e1; }

/* --- M2: Huawei Dark (dark bg, section labels, left+right accent bar) --- */
[data-menu="2"] .sidebar { background: #0f1f3d; border-right: 1px solid rgba(255,255,255,0.06); }
[data-menu="2"] .sidebar .sidebar-logo-text { color: #fff; }
[data-menu="2"] .sidebar .sidebar-toggle { color: rgba(255,255,255,0.5); }
[data-menu="2"] .sidebar .nav-item > .nav-link,
[data-menu="2"] .sidebar .nav-section-toggle,
[data-menu="2"] .sidebar .sidebar-footer .nav-link { color: rgba(255,255,255,0.6); border-left: 3px solid transparent; }
[data-menu="2"] .sidebar .nav-item > .nav-link:hover,
[data-menu="2"] .sidebar .nav-section-toggle:hover,
[data-menu="2"] .sidebar .sidebar-footer .nav-link:hover { color: #fff; background: rgba(255,255,255,0.04); border-left-color: #3b82f6; }
[data-menu="2"] .sidebar .nav-item.active > .nav-link,
[data-menu="2"] .sidebar .sidebar-footer .nav-link.active {
  color: #3b82f6; background: rgba(59,130,246,0.08); border-left-color: #3b82f6;
  box-shadow: inset -3px 0 0 #3b82f6;
}
[data-menu="2"] .sidebar .nav-submenu .nav-link { color: rgba(255,255,255,0.4); }
[data-menu="2"] .sidebar .nav-submenu .nav-link:hover { color: #fff; background: rgba(255,255,255,0.04); }
[data-menu="2"] .sidebar .nav-submenu .nav-link.active { color: #3b82f6; background: rgba(59,130,246,0.1); }
[data-menu="2"] .sidebar .nav-divider { background: rgba(255,255,255,0.06); }
[data-menu="2"] .sidebar .sidebar-footer,
[data-menu="2"] .sidebar .sidebar-header { border-color: rgba(255,255,255,0.06); }
[data-menu="2"] .sidebar .nav-tree > li::before,
[data-menu="2"] .sidebar .nav-tree > li::after { border-color: rgba(255,255,255,0.1); }
[data-menu="2"] .sidebar .nav-nested-label { color: rgba(255,255,255,0.3); }
[data-menu="2"] .sidebar .nav-arrow { opacity: 0.3; }

/* --- M3: Minimal Clean (no shadows, thin underlines, airy spacing) --- */
[data-menu="3"] .sidebar { background: #fafbfc; border-right: 1px solid #eef1f6; box-shadow: none; }
[data-menu="3"] .sidebar .sidebar-header { border-bottom: none; padding-bottom: 12px; }
[data-menu="3"] .sidebar .sidebar-logo-text { color: #334155; font-weight: 500; }
[data-menu="3"] .sidebar .nav-item > .nav-link,
[data-menu="3"] .sidebar .nav-section-toggle,
[data-menu="3"] .sidebar .sidebar-footer .nav-link { color: #64748b; border-radius: 0; margin: 0 16px; padding: 10px 0; border-bottom: 1px solid transparent; border-left: none; }
[data-menu="3"] .sidebar .nav-item > .nav-link:hover,
[data-menu="3"] .sidebar .nav-section-toggle:hover,
[data-menu="3"] .sidebar .sidebar-footer .nav-link:hover { background: none; color: var(--hn-primary); border-bottom-color: var(--hn-primary); }
[data-menu="3"] .sidebar .nav-item.active > .nav-link,
[data-menu="3"] .sidebar .sidebar-footer .nav-link.active { background: none; color: var(--hn-primary); font-weight: 700; border-bottom: 2px solid var(--hn-primary); box-shadow: none; transform: none; }
[data-menu="3"] .sidebar .nav-submenu .nav-link { color: #94a3b8; border-bottom: none; padding: 6px 0 6px 28px; margin: 0 16px; }
[data-menu="3"] .sidebar .nav-submenu .nav-link:hover { color: var(--hn-primary); background: none; }
[data-menu="3"] .sidebar .nav-submenu .nav-link.active { color: var(--hn-primary); font-weight: 600; background: none; }
[data-menu="3"] .sidebar .nav-divider { display: none; }
[data-menu="3"] .sidebar .sidebar-footer { border-top: 1px solid #eef1f6; }
[data-menu="3"] .sidebar .nav-tree > li::before,
[data-menu="3"] .sidebar .nav-tree > li::after { display: none; }
[data-menu="3"] .sidebar .nav-tree > li { padding-left: 0; }

/* --- M4: Rounded Pill (floating pill items, gradient active, soft shadows) --- */
[data-menu="4"] .sidebar { background: #fff; border-right: none; box-shadow: 4px 0 30px rgba(0,0,0,0.06); }
[data-menu="4"] .sidebar .sidebar-header { border-bottom-color: transparent; }
[data-menu="4"] .sidebar .sidebar-logo-text { color: #1e293b; }
[data-menu="4"] .sidebar .nav-item > .nav-link,
[data-menu="4"] .sidebar .nav-section-toggle,
[data-menu="4"] .sidebar .sidebar-footer .nav-link { color: #64748b; border-radius: 50px; margin: 2px 12px; padding: 9px 18px; border-left: none; }
[data-menu="4"] .sidebar .nav-item > .nav-link:hover,
[data-menu="4"] .sidebar .nav-section-toggle:hover,
[data-menu="4"] .sidebar .sidebar-footer .nav-link:hover { background: #f1f5f9; color: #334155; }
[data-menu="4"] .sidebar .nav-item.active > .nav-link,
[data-menu="4"] .sidebar .sidebar-footer .nav-link.active {
  background: var(--hn-primary-gradient); color: #fff;
  box-shadow: 0 4px 15px rgba(0,74,173,0.35); transform: none;
}
[data-menu="4"] .sidebar .nav-submenu .nav-link { color: #94a3b8; border-radius: 50px; margin: 1px 20px; padding: 7px 16px 7px 36px; }
[data-menu="4"] .sidebar .nav-submenu .nav-link:hover { background: #f8fafc; color: #334155; }
[data-menu="4"] .sidebar .nav-submenu .nav-link.active { background: rgba(0,74,173,0.06); color: var(--hn-primary); font-weight: 600; }
[data-menu="4"] .sidebar .nav-divider { background: transparent; height: 4px; }
[data-menu="4"] .sidebar .sidebar-footer { border-top-color: #f1f5f9; }
[data-menu="4"] .sidebar .nav-tree > li::before,
[data-menu="4"] .sidebar .nav-tree > li::after { display: none; }
[data-menu="4"] .sidebar .nav-tree > li { padding-left: 0; }
[data-menu="4"] .sidebar .nav-arrow { opacity: 0.4; }

/* --- M5: Navy Gradient Pro (gradient bg, icon circles, neon accent) --- */
[data-menu="5"] .sidebar { background: linear-gradient(180deg, #0c1929 0%, #152238 50%, #1a2d4a 100%); border-right: none; }
[data-menu="5"] .sidebar .sidebar-logo-text { color: #e2e8f0; }
[data-menu="5"] .sidebar .sidebar-toggle { color: rgba(255,255,255,0.4); }
[data-menu="5"] .sidebar .nav-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,0.05); transition: all 0.2s ease; }
[data-menu="5"] .sidebar .nav-item > .nav-link,
[data-menu="5"] .sidebar .nav-section-toggle,
[data-menu="5"] .sidebar .sidebar-footer .nav-link { color: rgba(255,255,255,0.55); border-left: none; gap: 14px; }
[data-menu="5"] .sidebar .nav-item > .nav-link:hover,
[data-menu="5"] .sidebar .nav-section-toggle:hover,
[data-menu="5"] .sidebar .sidebar-footer .nav-link:hover { color: #fff; background: rgba(255,255,255,0.04); }
[data-menu="5"] .sidebar .nav-item > .nav-link:hover .nav-icon,
[data-menu="5"] .sidebar .nav-section-toggle:hover .nav-icon { background: rgba(59,130,246,0.15); color: #60a5fa; }
[data-menu="5"] .sidebar .nav-item.active > .nav-link { color: #fff; background: rgba(59,130,246,0.12); box-shadow: inset 3px 0 0 #3b82f6; transform: none; }
[data-menu="5"] .sidebar .nav-item.active > .nav-link .nav-icon { background: #3b82f6; color: #fff; box-shadow: 0 0 12px rgba(59,130,246,0.4); }
[data-menu="5"] .sidebar .sidebar-footer .nav-link.active { color: #fff; background: rgba(59,130,246,0.12); box-shadow: inset 3px 0 0 #3b82f6; }
[data-menu="5"] .sidebar .nav-submenu .nav-link { color: rgba(255,255,255,0.35); }
[data-menu="5"] .sidebar .nav-submenu .nav-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.03); }
[data-menu="5"] .sidebar .nav-submenu .nav-link.active { color: #60a5fa; background: rgba(59,130,246,0.08); }
[data-menu="5"] .sidebar .nav-divider { background: rgba(255,255,255,0.04); }
[data-menu="5"] .sidebar .sidebar-footer,
[data-menu="5"] .sidebar .sidebar-header { border-color: rgba(255,255,255,0.06); }
[data-menu="5"] .sidebar .nav-tree > li::before,
[data-menu="5"] .sidebar .nav-tree > li::after { border-color: rgba(255,255,255,0.06); }
[data-menu="5"] .sidebar .nav-nested-label { color: rgba(255,255,255,0.25); }

/* Dark-theme overrides for light-base menu styles (M1, M3, M4) */
[data-theme="dark"][data-menu="1"] .sidebar,
[data-theme="dark"][data-menu="3"] .sidebar,
[data-theme="dark"][data-menu="4"] .sidebar { background: #0f172a; border-right-color: rgba(255,255,255,0.06); box-shadow: 2px 0 20px rgba(0,0,0,0.3); }
[data-theme="dark"][data-menu="1"] .sidebar .sidebar-logo-text,
[data-theme="dark"][data-menu="3"] .sidebar .sidebar-logo-text,
[data-theme="dark"][data-menu="4"] .sidebar .sidebar-logo-text { color: #e2e8f0; }
[data-theme="dark"][data-menu="1"] .sidebar .nav-item > .nav-link,
[data-theme="dark"][data-menu="1"] .sidebar .nav-section-toggle,
[data-theme="dark"][data-menu="1"] .sidebar .sidebar-footer .nav-link,
[data-theme="dark"][data-menu="3"] .sidebar .nav-item > .nav-link,
[data-theme="dark"][data-menu="3"] .sidebar .nav-section-toggle,
[data-theme="dark"][data-menu="3"] .sidebar .sidebar-footer .nav-link,
[data-theme="dark"][data-menu="4"] .sidebar .nav-item > .nav-link,
[data-theme="dark"][data-menu="4"] .sidebar .nav-section-toggle,
[data-theme="dark"][data-menu="4"] .sidebar .sidebar-footer .nav-link { color: rgba(255,255,255,0.6); }
[data-theme="dark"][data-menu="1"] .sidebar .nav-item > .nav-link:hover,
[data-theme="dark"][data-menu="1"] .sidebar .nav-section-toggle:hover,
[data-theme="dark"][data-menu="3"] .sidebar .nav-item > .nav-link:hover,
[data-theme="dark"][data-menu="3"] .sidebar .nav-section-toggle:hover,
[data-theme="dark"][data-menu="4"] .sidebar .nav-item > .nav-link:hover,
[data-theme="dark"][data-menu="4"] .sidebar .nav-section-toggle:hover { color: #fff; background: rgba(255,255,255,0.06); }
[data-theme="dark"][data-menu="1"] .sidebar .nav-submenu .nav-link,
[data-theme="dark"][data-menu="3"] .sidebar .nav-submenu .nav-link,
[data-theme="dark"][data-menu="4"] .sidebar .nav-submenu .nav-link { color: rgba(255,255,255,0.4); }
[data-theme="dark"][data-menu="1"] .sidebar .nav-divider,
[data-theme="dark"][data-menu="3"] .sidebar .nav-divider,
[data-theme="dark"][data-menu="4"] .sidebar .nav-divider { background: rgba(255,255,255,0.06); }
[data-theme="dark"][data-menu="1"] .sidebar .sidebar-footer,
[data-theme="dark"][data-menu="1"] .sidebar .sidebar-header,
[data-theme="dark"][data-menu="3"] .sidebar .sidebar-footer,
[data-theme="dark"][data-menu="3"] .sidebar .sidebar-header,
[data-theme="dark"][data-menu="4"] .sidebar .sidebar-footer,
[data-theme="dark"][data-menu="4"] .sidebar .sidebar-header { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"][data-menu="1"] .sidebar .nav-tree > li::before,
[data-theme="dark"][data-menu="1"] .sidebar .nav-tree > li::after { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"][data-menu="1"] .menu-style-btn,
[data-theme="dark"][data-menu="3"] .menu-style-btn,
[data-theme="dark"][data-menu="4"] .menu-style-btn {
  border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
}
[data-theme="dark"][data-menu="1"] .menu-style-btn:hover,
[data-theme="dark"][data-menu="3"] .menu-style-btn:hover,
[data-theme="dark"][data-menu="4"] .menu-style-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
[data-theme="dark"][data-menu="1"] .menu-style-picker,
[data-theme="dark"][data-menu="3"] .menu-style-picker,
[data-theme="dark"][data-menu="4"] .menu-style-picker { border-top-color: rgba(255,255,255,0.06); }

/* Menu style picker at bottom of sidebar */
.sidebar-footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg-sidebar);
}
[data-theme="dark"] .sidebar-footer-controls { border-top-color: rgba(255, 255, 255, 0.08); }

.menu-style-picker {
  display: flex;
  gap: 4px;
}

.menu-style-btn {
  width: 24px; height: 24px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-gray-300);
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  font-size: 0.6rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.menu-style-btn:hover { background: var(--color-gray-200); color: var(--color-gray-700); }
.menu-style-btn.active { background: var(--hn-primary); border-color: var(--hn-primary); color: #fff; }

.sidebar-collapsed .sidebar-footer-controls {
  flex-direction: column;
  padding: 10px 0;
}
.sidebar-collapsed .menu-style-picker { display: none; }
.sidebar-collapsed .sidebar-toggle { margin: 0 auto; }

[data-menu="2"] .sidebar-footer-controls,
[data-menu="5"] .sidebar-footer-controls { border-top-color: rgba(255,255,255,0.06); }
[data-menu="2"] .menu-style-btn,
[data-menu="5"] .menu-style-btn {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
}
[data-menu="2"] .menu-style-btn.active,
[data-menu="5"] .menu-style-btn.active { background: #3b82f6; border-color: #3b82f6; }

/* ============================================================
   23. TREE-STYLE SUBMENU  (from huawei nav-section style)
   ============================================================ */

.nav-tree {
  position: relative;
}

.nav-sub-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6;
}
.nav-submenu .nav-link:hover .nav-sub-icon,
.nav-submenu .nav-link.active .nav-sub-icon {
  opacity: 1;
}

.nav-tree > li {
  position: relative;
  padding-left: 20px;
}

.nav-tree > li::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 50%;
  width: 0;
  border-left: 1px solid rgba(0,0,0,0.12);
}
.nav-tree > li::after {
  content: '';
  position: absolute;
  left: 32px;
  top: 50%;
  width: 10px;
  height: 0;
  border-top: 1px solid rgba(0,0,0,0.12);
}
.nav-tree > li:first-child::before { top: 0; }
.nav-tree > li:last-child::before { bottom: 50%; }
.nav-tree > li:not(:last-child)::before { bottom: 0; }

[data-theme="dark"] .nav-tree > li::before,
[data-theme="dark"] .nav-tree > li::after {
  border-color: rgba(255,255,255,0.15);
}

/* ============================================================
   24. ACCESSIBILITY TOOLBAR  (from panel-new footer)
   ============================================================ */

/* Accessibility buttons in topbar */
.topbar-acc-btn { opacity: 0.65; }
.topbar-acc-btn:hover { opacity: 1; }
.topbar-sep-sm { width: 1px; height: 22px; background: rgba(255,255,255,0.12); flex-shrink: 0; }
.topbar-c .topbar-sep-sm { background: var(--border-color); }
.topbar-actions-left { margin-right: auto; }

/* Theme toggle — moon visible in light mode, sun visible in dark mode */
.topbar-theme-btn .theme-icon-dark  { display: none; }
.topbar-theme-btn .theme-icon-light { display: inline; }
[data-theme="dark"] .topbar-theme-btn .theme-icon-dark  { display: inline; }
[data-theme="dark"] .topbar-theme-btn .theme-icon-light { display: none; }

/* Language flag SVG */
.topbar-flag { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); vertical-align: middle; }
.topbar-lang-btn { gap: 4px; }

/* ============================================================
   25. MOBILE BOTTOM NAVIGATION  (elevated burger from panel-new)
   ============================================================ */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
  z-index: 1100;
  justify-content: space-around;
  align-items: center;
  padding: 0 5px;
  border-radius: 20px 20px 0 0;
  max-width: 100%;
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(30, 41, 59, 0.95);
  border-top-color: var(--color-gray-700);
}

.mobile-nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-xs);
  border: none; background: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 56px;
  opacity: 0.7;
  flex: 1;
}
.mobile-nav-item:hover { color: var(--hn-primary); opacity: 1; }
.mobile-nav-item.active { color: var(--hn-primary); opacity: 1; }

.mobile-nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
}
.mobile-nav-icon svg { width: 20px; height: 20px; }

.mobile-nav-label {
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.65rem;
}

/* Elevated center burger (from panel-new) */
.mobile-nav-menu {
  position: relative;
  flex: 0 0 70px !important;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mobile-nav-menu .mobile-nav-icon {
  width: 56px; height: 56px;
  background: var(--hn-primary-gradient);
  border-radius: var(--border-radius-full);
  color: var(--color-white);
  box-shadow: 0 8px 25px rgba(0, 74, 173, 0.4), inset 0 -4px 0 rgba(0,0,0,0.2);
  position: relative;
  top: -14px;
  border: 5px solid var(--bg-body);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mobile-nav-menu .mobile-nav-icon svg { stroke: var(--color-white); width: 22px; height: 22px; }
.mobile-nav-menu:hover .mobile-nav-icon { transform: scale(1.1); }
.mobile-nav-menu .mobile-nav-label { color: var(--hn-primary); font-weight: 700; }

/* Menu Editor */
.menu-editor-list { display: flex; flex-direction: column; gap: 8px; }
.menu-editor-item { border: 1px solid var(--border-color); border-radius: var(--border-radius-md); background: var(--bg-surface); }
.menu-item-handle { cursor: grab; padding: 10px; color: var(--text-muted); display: flex; align-items: center; border-right: 1px solid var(--border-color); }
.menu-item-content { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; }
.menu-item-main { display: flex; flex-direction: column; gap: 2px; }
.menu-item-label { font-weight: 600; font-size: var(--font-size-sm); }
.menu-item-actions { display: flex; gap: 6px; }
.menu-editor-item { display: flex; flex-wrap: wrap; align-items: stretch; }
.menu-item-children { width: 100%; padding-left: 40px; border-top: 1px dashed var(--border-color); background: rgba(0,0,0,0.02); min-height: 10px; }
[data-theme="dark"] .menu-item-children { background: rgba(255,255,255,0.02); }
.menu-editor-item.sortable-ghost { opacity: 0.4; border: 2px dashed var(--color-primary); }

/* ============================================================
   26. RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
  .topbar-hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
    border-radius: 0 24px 24px 0;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 15px 0 40px rgba(0,0,0,0.15);
  }

  .main-wrap { margin-left: 0 !important; }
  .topbar { left: 0 !important; }

  .topbar-actions-left { display: none; }
  .topbar-actions-left + .topbar-sep { display: none; }
  body { padding-bottom: 70px; }
}

@media (max-width: 768px) {
  :root { --content-padding: 16px; }

  .mobile-bottom-nav { display: flex; }
  .content { padding-bottom: 90px; }
  .topbar-search { display: none; }
  .topbar-username { display: none; }
  .topbar-variant-picker { display: none; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
  .mobile-nav-label { font-size: 0.6rem; }
}

/* ============================================================
   DEBUG PANEL (tryb debugowania)
   ============================================================ */
.hn-debug-panel {
  position: fixed; bottom: 12px; right: 12px;
  width: 420px; max-width: calc(100vw - 24px); max-height: 280px;
  z-index: 9998;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.hn-debug-panel.collapsed .hn-debug-body { display: none; }
.hn-debug-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.05);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
}
[data-theme="dark"] .hn-debug-header { background: rgba(255,255,255,0.06); }
.hn-debug-title { font-weight: 600; flex-shrink: 0; }
.hn-debug-tabs { display: flex; gap: 2px; }
.hn-debug-tab {
  padding: 2px 8px; font-size: 10px;
  background: none; border: none; border-radius: 4px;
  color: var(--text-secondary); cursor: pointer;
}
.hn-debug-tab:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }
.hn-debug-tab.active { background: var(--hn-primary); color: #fff; }
.hn-debug-toggle {
  margin-left: auto; width: 24px; height: 24px;
  background: none; border: none; border-radius: 4px;
  font-size: 14px; cursor: pointer; color: var(--text-muted);
}
.hn-debug-toggle:hover { background: rgba(0,0,0,0.08); color: var(--text-primary); }
.hn-debug-body { flex: 1; overflow: hidden; display: flex; }
.hn-debug-content { display: none; flex: 1; overflow: auto; padding: 8px; }
.hn-debug-content.active { display: block; }
.hn-debug-content pre {
  margin: 0; white-space: pre-wrap; word-break: break-all;
  font-size: 10px; line-height: 1.35; color: var(--text-primary);
  user-select: all; -webkit-user-select: all;
}
.hn-debug-content[data-content="tech"] pre { max-height: 200px; overflow-y: auto; }
