:root {
  --bg:#0f172a;
  --card:#111827;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --accent:#38bdf8;
  --accent-dark:#0ea5e9;
  --ok:#10b981;
  --err:#ef4444;
  --warn:#f59e0b;
  --border:#1f2937;
}
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin:0;
  font-family:Arial,sans-serif;
  background:#020617;
  color:var(--text);
}

.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px 32px;
  background:#0f172a;
  border-bottom:1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin:0 0 6px;
}

.topbar p {
  margin:0;
  color:var(--muted);
}

.topbar nav {
  display:flex;
  gap:16px;
  align-items:center;
}

.topbar nav a {
  color:var(--text);
  text-decoration:none;
  padding:8px 10px;
  border-radius:10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar nav a:hover {
  background:#162033;
  color:#fff;
}

.container {
  padding:24px 32px;
}

.card, .table-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:20px;
  margin-bottom:20px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.narrow {
  max-width:520px;
}

.form-grid, .filter-grid {
  display:grid;
  gap:12px;
}

input, textarea, select, button {
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #334155;
  background:#0b1220;
  color:var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

input:focus, textarea:focus, select:focus {
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(56,189,248,.15);
}

button, .button {
  background:var(--accent);
  color:#00111a;
  font-weight:bold;
  text-decoration:none;
  display:inline-block;
  text-align:center;
  border:none;
  cursor:pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}

button:hover, .button:hover {
  background:var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(14,165,233,.18);
}

.button.secondary {
  background:#334155;
  color:var(--text);
}

.button.secondary:hover {
  background:#475569;
}

.button.danger {
  background:var(--err);
  color:#fff;
}

.button.danger:hover {
  background:#dc2626;
}

.button.warning {
  background:var(--warn);
  color:#111827;
}

.button.warning:hover {
  background:#d97706;
}

.button.small {
  padding:8px 10px;
  margin-right:8px;
  width:auto;
}

.table-card {
  overflow-x:auto;
}

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

th, td {
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

thead th {
  position: sticky;
  top: 0;
  background: #10192c;
  z-index: 5;
}

tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.badge {
  display:inline-block;
  margin:2px 6px 2px 0;
  padding:4px 8px;
  border-radius:999px;
  background:#1d4ed8;
  font-weight:600;
}

.flash-stack {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.flash {
  padding:12px 16px;
  border-radius:12px;
  border:1px solid transparent;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
}

.flash.success {
  background:rgba(16,185,129,.15);
  border-color:rgba(16,185,129,.5);
}

.flash.error {
  background:rgba(239,68,68,.15);
  border-color:rgba(239,68,68,.5);
}

.flash.warning {
  background:rgba(245,158,11,.15);
  border-color:rgba(245,158,11,.5);
}

.group-checkboxes {
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
}

.split {
  display:grid;
  grid-template-columns:1fr 2fr;
  gap:20px;
}

small {
  color:var(--muted);
}

.status-wrap {
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:bold;
}

.status-dot {
  width:12px;
  height:12px;
  border-radius:50%;
  display:inline-block;
}

.status-dot.online {
  background:var(--ok);
  box-shadow:0 0 0 3px rgba(16,185,129,.18);
}

.status-dot.offline {
  background:var(--err);
  box-shadow:0 0 0 3px rgba(239,68,68,.18);
}

.inline-form,
.inline-edit-form {
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:4px 8px 4px 0;
}

.inline-form button,
.inline-edit-form button {
  width:auto;
}

.inline-edit-form input,
.inline-edit-form select {
  width:auto;
  min-width:140px;
}

.actions-cell {
  min-width:260px;
}

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

  .topbar {
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .flash-stack {
    left: 16px;
    right: 16px;
    max-width: unset;
  }
}

.user-info {
  color: var(--muted);
  font-size: 13px;
  margin-right: 8px;
  padding: 8px 10px;
  border: 1px solid #1f2937;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}

.user-info {
  color: var(--muted);
  font-size: 13px;
  margin-right: 8px;
  padding: 8px 10px;
  border: 1px solid #1f2937;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}

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

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-form input {
  width: 140px;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions-row form {
  margin: 0;
}

.inline-user-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-user-edit-form input,
.inline-user-edit-form select {
  width: auto;
  min-width: 150px;
}

.actions-cell {
  min-width: 320px;
}

.users-split {
  grid-template-columns: 420px 1fr;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  min-width: 760px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.user-actions form {
  margin: 0;
}

.user-edit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.user-edit-line input,
.user-edit-line select {
  width: auto;
  min-width: 135px;
  max-width: 190px;
}

.user-edit-line input[type="password"] {
  min-width: 135px;
}

@media (max-width: 1300px) {
  .user-actions,
  .user-edit-line {
    flex-wrap: wrap;
  }

  .users-table th:nth-child(5),
  .users-table td:nth-child(5) {
    min-width: 520px;
  }
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-edit-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-edit-line input,
.user-edit-line select {
  min-width: 140px;
}

.user-buttons-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-buttons-row form {
  margin: 0;
}


/* USERS layout */

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-edit-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-edit-line input,
.user-edit-line select {
  min-width: 140px;
}

.user-buttons-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-buttons-row form {
  margin: 0;
}

.users-table td {
  vertical-align: top;
}


/* 🔥 fix rozciągania users */

.users-table {
  table-layout: fixed;
  width: 100%;
}

.users-table td,
.users-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* kontener akcji */
.user-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 500px; /* 🔥 KLUCZ */
}

/* linia edycji */
.user-edit-line {
  display: flex;
  gap: 6px;
  flex-wrap: wrap; /* 🔥 pozwala łamać zamiast rozciągać */
}

/* inputy */
.user-edit-line input,
.user-edit-line select {
  max-width: 140px; /* 🔥 ograniczenie */
  width: 100%;
}

/* przyciski */
.user-buttons-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap; /* 🔥 jak brak miejsca to zawija */
}

/* żeby tabela nie rosła */
.table-card {
  overflow-x: hidden; /* 🔥 usuwa scroll */
}


/* USERS compact 2-row layout */

.users-split {
  grid-template-columns: 420px 1fr;
}

.users-table {
  table-layout: fixed;
  width: 100%;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 120px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 210px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 80px;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 120px;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: auto;
}

.user-edit-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.user-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.user-edit-row input,
.user-edit-row select {
  width: 135px;
  min-width: 0;
}

.user-edit-row input[type="email"] {
  width: 180px;
}

.user-edit-row input[type="password"] {
  width: 135px;
}

.user-edit-row button {
  width: auto;
  white-space: nowrap;
}

.users-table td {
  vertical-align: top;
}

.users-table td,
.users-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1300px) {
  .user-edit-row {
    flex-wrap: wrap;
  }

  .user-edit-compact {
    max-width: 360px;
  }
}

/* USERS two-row layout */

.users-table-two-rows {
  table-layout: fixed;
  width: 100%;
}

.users-table-two-rows th,
.users-table-two-rows td {
  vertical-align: top;
}

.user-action-row td {
  padding-top: 0;
  padding-bottom: 18px;
}

.user-edit-full-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 0;
}

.user-edit-full-line input,
.user-edit-full-line select {
  width: auto;
  min-width: 145px;
  max-width: 190px;
}

.user-edit-full-line input[type="email"] {
  min-width: 220px;
}

.user-edit-full-line input[type="password"] {
  min-width: 150px;
}

.user-edit-full-line button {
  width: auto;
  white-space: nowrap;
}


.user-edit-full-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-edit-fields,
.user-edit-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-edit-fields input,
.user-edit-fields select {
  width: auto;
  min-width: 150px;
  max-width: 220px;
}

.user-edit-fields input[type="email"] {
  min-width: 220px;
}

.user-edit-buttons button {
  width: auto;
  white-space: nowrap;
}

.user-action-row td {
  padding-top: 0;
}

/* FINAL USERS UI polish */

.users-table-two-rows {
  table-layout: fixed;
  width: 100%;
}

.users-table-two-rows th,
.users-table-two-rows td {
  vertical-align: top;
}

.user-action-row td {
  padding-top: 0;
  padding-bottom: 18px;
}

.user-edit-full-line {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 0 8px 0;
}

.user-edit-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-edit-fields input,
.user-edit-fields select {
  width: 170px;
  min-width: 140px;
  max-width: 180px;
  height: 36px;
}

.user-edit-fields input[type="email"] {
  width: 210px;
  min-width: 190px;
  max-width: 220px;
}

.user-edit-fields input[type="password"] {
  width: 150px;
  min-width: 140px;
  max-width: 160px;
}

.user-edit-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 0;
}

.user-edit-buttons button {
  width: auto;
  min-width: 72px;
  height: 34px;
  white-space: nowrap;
}

.users-table-two-rows tbody tr:not(.user-action-row) td {
  padding-bottom: 8px;
}

.users-table-two-rows .user-action-row {
  border-bottom: 1px solid var(--border);
}

.users-table-two-rows .user-action-row td {
  border-bottom: none;
}


/* === CONSOLE LAYOUT === */

.console-layout {
    display: flex;
    height: 100vh;
    background: #0b1220;
    color: #e5e7eb;
    font-family: system-ui;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #0a0f1c;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1f2937;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 30px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    text-decoration: none;
    color: #cbd5f5;
}

.sidebar-menu a:hover {
    background: #1e293b;
}

/* MAIN */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */
.topbar {
    height: 60px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #1f2937;
}

.topbar-right a {
    margin-left: 15px;
    color: #60a5fa;
    text-decoration: none;
}

/* CONTENT */
.content {
    padding: 20px;
    overflow-y: visible;
}

/* TABLE CARD */
.card {
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 15px;
}


/* RUSTDESK CONSOLE-LIKE LAYOUT */

body.console-layout {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: #0b0b0c;
  color: #e5e7eb;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.console-sidebar {
  width: 250px;
  min-height: 100vh;
  background: #111111;
  border-right: 1px solid #27272a;
  padding: 18px 14px;
}

.console-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 22px;
  border-bottom: 1px solid #242424;
  margin-bottom: 18px;
}

.console-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.console-brand small {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  margin-top: 2px;
}

.console-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.console-menu a {
  color: #c7c7c7;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.console-menu a:hover {
  background: #1f1f1f;
  color: #fff;
}

.console-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.console-topbar {
  height: 64px;
  background: #151515;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.console-breadcrumb {
  font-size: 18px;
  font-weight: 700;
}

.console-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.console-user a {
  color: #3b82f6;
  text-decoration: none;
}

.console-content {
  padding: 28px;
  overflow: visible;
}

.console-content .card,
.console-content .table-card {
  background: #181818;
  border-color: #2b2b2b;
}


.user-inline-form input,
.user-inline-form select {
  width: 140px;
  min-width: 120px;
}

.user-inline-form input[type="email"] {
  width: 190px;
}

.user-inline-form input[type="password"] {
  width: 130px;
}


.inline-actions {
  display: flex;
  flex-wrap: nowrap;      /* KLUCZOWE */
  align-items: center;
  gap: 8px;
}

.inline-actions form {
  display: inline-flex;
  margin: 0;
}

.inline-actions button {
  white-space: nowrap;
}


/* OS badges */

.os-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.os-icon {
  font-size: 13px;
  font-weight: 900;
}

.os-windows {
  background: rgba(37, 99, 235, .18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, .35);
}

.os-linux {
  background: rgba(245, 158, 11, .18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .35);
}

.os-mac {
  background: rgba(148, 163, 184, .18);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, .35);
}

.os-other {
  background: rgba(34, 197, 94, .15);
  color: #86efac;
  border-color: rgba(34, 197, 94, .35);
}

/* PM Digital PRO devices UI */

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

.device-row {
  transition: background .18s ease, transform .18s ease;
}

.device-row:hover {
  background: rgba(59, 130, 246, 0.08);
  cursor: pointer;
}

.device-row:hover td:first-child {
  border-left: 3px solid #38bdf8;
}

.status-dot.online {
  box-shadow: 0 0 10px rgba(34, 197, 94, .9);
  animation: onlinePulse 1.8s infinite;
}

@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 rgba(34, 197, 94, .9); }
  50% { box-shadow: 0 0 12px rgba(34, 197, 94, .9); }
  100% { box-shadow: 0 0 0 rgba(34, 197, 94, .9); }
}

.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-filters button {
  width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #2b3a55;
  background: #0f172a;
  color: #dbeafe;
  cursor: pointer;
}

.quick-filters button:hover {
  background: #1e3a8a;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #111827;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.action-menu-content {
  display: none;
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 150px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0,0,0,.45);
  z-index: 50;
  overflow: hidden;
}

.action-menu:hover .action-menu-content {
  display: block;
}

.action-menu-content a,
.action-menu-content button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}

.action-menu-content a:hover,
.action-menu-content button:hover {
  background: #1e293b;
}

.action-menu-content form {
  margin: 0;
}

.action-menu-content button {
  color: #f87171;
}

.relative-time {
  color: #cbd5e1;
  font-weight: 600;
}


/* PRO compact search/filter layout */

.pro-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pro-filter .filter-search {
  width: 100%;
}

.filter-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.filter-scope {
  width: 100%;
}

.filter-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-two-cols select {
  width: 100%;
}

.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-filters button {
  width: auto;
  min-width: 78px;
}

.group-checkboxes {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.group-checkboxes label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 1100px) {
  .filter-row,
  .filter-two-cols {
    grid-template-columns: 1fr;
  }
}

.seen-online {
  color: #86efac;
}

.seen-offline {
  color: #fca5a5;
}


.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-green {
  background: rgba(0, 255, 150, 0.15);
  color: #00ffa0;
}

.badge-red {
  background: rgba(255, 80, 80, 0.15);
  color: #ff5050;
}

.badge-blue {
  background: rgba(80, 150, 255, 0.15);
  color: #5096ff;
}

.badge-default {
  background: rgba(255,255,255,0.08);
  color: #ccc;
}


.badge-green {
  background: rgba(34, 197, 94, .18) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, .35) !important;
}

.badge-red {
  background: rgba(239, 68, 68, .18) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, .35) !important;
}

.badge-blue {
  background: rgba(59, 130, 246, .18) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .35) !important;
}

.badge-default {
  background: rgba(148, 163, 184, .14) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, .25) !important;
}

.status.idle {
  color: #facc15;
}


/* Poprawka formularza grup */
.card textarea,
.card input,
.card select {
  margin-bottom: 10px;
}

.card label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
}


/* PRO Users page */

.users-table td {
  vertical-align: middle;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-edit-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.user-edit-inline input,
.user-edit-inline select {
  width: 160px;
  min-width: 140px;
  margin-bottom: 0 !important;
}

.user-edit-inline input[type="password"] {
  width: 130px;
}

.user-row-actions form {
  margin: 0;
}

@media (max-width: 1300px) {
  .user-row-actions,
  .user-edit-inline {
    align-items: flex-start;
  }

  .user-edit-inline input,
  .user-edit-inline select {
    width: 140px;
  }
}

/* Pagination footer like RustDesk */
.pm-table-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: #cbd5e1;
  font-size: 13px;
}

.pm-table-pager button {
  width: auto;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e5e7eb;
  cursor: pointer;
}

.pm-table-pager button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.pm-table-pager .page-number {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  border-radius: 7px;
}

.pm-table-pager select {
  width: auto;
  margin-bottom: 0 !important;
  padding: 5px 8px;
}

/* Clean table actions like Audit Log */
.row-actions-clean {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions-clean form {
  margin: 0;
}

.row-edit-clean {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-edit-clean input,
.row-edit-clean select {
  width: 150px;
  min-width: 120px;
  margin-bottom: 0 !important;
}

.row-edit-clean input[type="password"] {
  width: 125px;
}

.group-edit-clean input {
  width: 170px;
}

.table-card h2 {
  margin-bottom: 18px;
}

.table-card table td {
  vertical-align: middle;
}

@media (max-width: 1300px) {
  .row-edit-clean input,
  .row-edit-clean select {
    width: 130px;
  }
}

/* Clean table actions like Audit Log */
.row-actions-clean {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions-clean form {
  margin: 0;
}

.row-edit-clean {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-edit-clean input,
.row-edit-clean select {
  width: 150px;
  min-width: 120px;
  margin-bottom: 0 !important;
}

.row-edit-clean input[type="password"] {
  width: 125px;
}

.group-edit-clean input {
  width: 170px;
}

.table-card h2 {
  margin-bottom: 18px;
}

.table-card table td {
  vertical-align: middle;
}

@media (max-width: 1300px) {
  .row-edit-clean input,
  .row-edit-clean select {
    width: 130px;
  }
}

/* Header PRO */
.user-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37,99,235,.22), rgba(124,58,237,.18));
  border: 1px solid rgba(96,165,250,.25);
  color: #dbeafe;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(37,99,235,.14);
}

nav a[href*="logout"] {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .14);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #fca5a5 !important;
  font-weight: 700;
  text-decoration: none;
}

nav a[href*="logout"]:hover {
  background: rgba(239, 68, 68, .24);
  color: #fecaca !important;
}

/* Users clean two-line actions */
.user-actions-two-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-edit-line {
  display: grid;
  grid-template-columns: 1fr 1.15fr 150px 140px;
  gap: 8px;
  margin: 0;
  align-items: center;
}

.user-edit-line input,
.user-edit-line select {
  width: 100%;
  min-width: 0;
  margin-bottom: 0 !important;
}

.user-buttons-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-buttons-line form {
  margin: 0;
}

/* Same compact style for add cards */
.device-filters h2 {
  margin-bottom: 18px;
}

.device-filters .pro-filter input,
.device-filters .pro-filter select {
  margin-bottom: 0 !important;
}

@media (max-width: 1300px) {
  .user-edit-line {
    grid-template-columns: 1fr 1fr;
  }
}

.quick-filters button.active {
  border-color: #38bdf8;
  color: #7dd3fc;
  box-shadow: 0 0 0 1px rgba(56,189,248,.35), 0 0 18px rgba(56,189,248,.12);
}

/* ACTIVE FILTER BUTTON */
.quick-filters button.active {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56,189,248,0.5);
}


/* Logout button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .16);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fca5a5 !important;
  font-weight: 700;
  text-decoration: none !important;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, .28);
  color: #fecaca !important;
  box-shadow: 0 0 16px rgba(239,68,68,.25);
}

/* RustDesk ID */
.rd-id {
  color: #7dd3fc;
  font-weight: 800;
  letter-spacing: .4px;
  text-shadow: 0 0 12px rgba(56,189,248,.22);
}

/* Active OS filter */
.quick-filters button.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56,189,248,.35);
}


/* Logout button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .16);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fca5a5 !important;
  font-weight: 700;
  text-decoration: none !important;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, .28);
  color: #fecaca !important;
  box-shadow: 0 0 16px rgba(239,68,68,.25);
}

/* RustDesk ID */
.rd-id {
  color: #7dd3fc;
  font-weight: 800;
  letter-spacing: .4px;
  text-shadow: 0 0 12px rgba(56,189,248,.22);
}

/* Active OS filter */
.quick-filters button.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56,189,248,.35);
}


/* Dziennik - większe odstępy i lepszy układ */
.audit-filter-pro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.audit-filter-pro input,
.audit-filter-pro select {
  min-height: 40px;
}

.audit-filter-pro button[type="submit"] {
  width: 50%;
  min-width: 220px;
}

.audit-extra-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.audit-extra-filters input[type="date"] {
  max-width: 170px;
}

.table-card table td,
.card table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.table-card table th,
.card table th {
  padding-top: 13px;
  padding-bottom: 13px;
}

@media (max-width: 1100px) {
  .audit-filter-pro {
    grid-template-columns: 1fr;
  }

  .audit-filter-pro button[type="submit"] {
    width: 100%;
  }

  .audit-extra-filters {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .audit-extra-filters input,
  .audit-extra-filters a,
  .audit-extra-filters button {
    flex: 1;
  }
}


.audit-export-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.audit-export-tools input[type="date"] {
  max-width: 170px;
}

.audit-export-tools .button.secondary {
  width: auto;
  min-width: 160px;
}

.audit-filter-pro button[type="submit"] {
  max-width: 50%;
}


.audit-filter-pro {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
}

.audit-filter-pro button[type="submit"] {
  max-width: 50% !important;
  min-width: 220px;
}

.audit-export-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.audit-export-tools input[type="date"] {
  max-width: 170px;
}

.audit-export-tools .button.secondary {
  width: auto;
  min-width: 170px;
}

.card table td,
.table-card table td {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

.card table th,
.table-card table th {
  padding-top: 13px !important;
  padding-bottom: 13px !important;
}

@media (max-width: 1100px) {
  .audit-filter-pro {
    grid-template-columns: 1fr !important;
  }

  .audit-filter-pro button[type="submit"] {
    max-width: 100% !important;
  }

  .audit-export-tools {
    flex-wrap: wrap;
  }
}


.audit-export-tools input[type="datetime-local"] {
  max-width: 220px;
  min-width: 210px;
}


.audit-export-tools .button.secondary {
  min-width: 150px;
}


/* 🔧 więcej miejsca od góry (navbar) */
.topbar,
.navbar,
.header {
  margin-top: 10px !important;
  padding-top: 10px !important;
}

/* jeśli masz wrapper główny */
.main-content,
.container {
  padding-top: 15px !important;
}

/* konkretnie przycisk Wyloguj */
.topbar .logout-btn,
.header .logout-btn {
  margin-top: 6px !important;
}


/* 🔥 GLOBALNY odstęp pod headerem */
.main-content,
.content,
.page-content,
.container {
  padding-top: 25px !important;
}

/* karty (żeby Dziennik nie był przyklejony) */
.card,
.table-card {
  margin-top: 15px !important;
}

/* formularze filtrów */
.filter-box,
.filters,
.audit-filter-pro {
  margin-top: 10px !important;
}


/* 📄 DZIENNIK – dodatkowy odstęp */
.audit-log-page,
.audit-container {
  margin-top: 10px !important;
}

/* tabela żeby nie była przyklejona */
.audit-log-page table {
  margin-top: 15px !important;
}


/* Jednolity odstęp treści od górnego paska na wszystkich zakładkach */
.console-content {
  padding-top: 34px !important;
}

/* Dziennik miał optycznie za mały odstęp */
.console-content > .card:first-child,
.console-content > .table-card:first-child {
  margin-top: 0 !important;
}

/* Górny pasek stabilnie niżej od krawędzi okna */
.console-topbar {
  min-height: 66px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  box-sizing: border-box;
}

/* Żeby użytkownik + Wyloguj nie dotykały góry */
.console-user {
  align-items: center !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}


/* Sortowanie tabeli urządzeń */
.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.sortable-th:hover {
  color: #7dd3fc;
}

.sortable-th.sort-asc::after {
  content: " ▲";
  color: #38bdf8;
  font-size: 11px;
}

.sortable-th.sort-desc::after {
  content: " ▼";
  color: #38bdf8;
  font-size: 11px;
}


.badge-green {
  background: rgba(34,197,94,.18);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.35);
}

.badge-default {
  background: rgba(148,163,184,.16);
  color: #cbd5e1;
  border: 1px solid rgba(148,163,184,.25);
}

.button.small {
  padding: 7px 10px;
  font-size: 12px;
  margin-left: 6px;
}


/* Zalogowany użytkownik w tabeli urządzeń */
.logged-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 130px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(59, 130, 246, .35);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logged-user-badge::before {
  content: "👤";
  font-size: 12px;
}

.logged-user-empty {
  color: #64748b;
  font-size: 13px;
}

.devices-table th:nth-child(3),
.devices-table td:nth-child(3) {
  width: 140px;
  max-width: 140px;
}


/* Urządzenia po usunięciu kolumny Firma */
.devices-table {
  width: 100%;
  table-layout: fixed;
}

.devices-table th:nth-child(1),
.devices-table td:nth-child(1) {
  width: 90px;
}

.devices-table th:nth-child(2),
.devices-table td:nth-child(2) {
  width: 150px;
}

.devices-table th:nth-child(3),
.devices-table td:nth-child(3) {
  width: 145px;
}

.devices-table th:nth-child(4),
.devices-table td:nth-child(4) {
  width: 190px;
}

.devices-table th:nth-child(5),
.devices-table td:nth-child(5) {
  width: 170px;
}

.devices-table th:nth-child(6),
.devices-table td:nth-child(6) {
  width: 120px;
}

.devices-table th:nth-child(7),
.devices-table td:nth-child(7) {
  width: 155px;
}

.devices-table th:nth-child(8),
.devices-table td:nth-child(8) {
  width: 70px;
  text-align: center;
}

/* lepszy wygląd użytkownika */
.logged-user-badge {
  max-width: 125px;
}

/* mniej rozpychania w IP / ID */
.rd-id {
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: .3px;
}

.devices-table small {
  font-size: 12px;
  line-height: 1.45;
}


/* Globalne sortowanie tabel */
.sortable-th {
  cursor: pointer;
  user-select: none;
}

.sortable-th:hover {
  color: #7dd3fc;
}

.sortable-th.sort-asc::after {
  content: " ▲";
  color: #38bdf8;
  font-size: 11px;
}

.sortable-th.sort-desc::after {
  content: " ▼";
  color: #38bdf8;
  font-size: 11px;
}


/* Filtry użytkowników */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.filters-bar input,
.filters-bar select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 9px 11px;
  border-radius: 8px;
}

.filters-bar input {
  min-width: 280px;
  flex: 1;
}

.filters-bar input:focus,
.filters-bar select:focus {
  outline: none;
  border-color: #38bdf8;
}


/* Filtry użytkowników - 2 kolumny */
.filters-bar {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.filters-bar input,
.filters-bar select {
  width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .filters-bar {
    grid-template-columns: 1fr;
  }
}


/* Historia użytkowników */
.table-card h2 {
  margin-bottom: 16px;
}

.logged-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(59, 130, 246, .35);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logged-user-empty {
  color: #64748b;
  font-size: 13px;
}


/* Grafana-like metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.grafana-panel {
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(51, 65, 85, .9);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
}

.metric-card span {
  color: #94a3b8;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  color: #e5e7eb;
}

.metric-card.good strong { color: #86efac; }
.metric-card.bad strong { color: #fca5a5; }
.metric-card.info strong { color: #7dd3fc; }

.grafana-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grafana-panel h3 {
  margin-bottom: 14px;
  color: #e5e7eb;
}

.grafana-panel.wide {
  grid-column: 1 / -1;
}

.grafana-panel canvas {
  max-height: none;
}

@media (max-width: 1100px) {
  .metrics-grid,
  .grafana-grid {
    grid-template-columns: 1fr;
  }
}

/* Metrics polish */
.metrics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.metrics-head h2 {
  margin: 0 0 6px;
}

.metrics-refresh {
  min-width: 210px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(51, 65, 85, .9);
  text-align: right;
}

.metrics-refresh span,
.metrics-refresh small {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.metrics-refresh strong {
  display: block;
  margin: 4px 0;
  color: #7dd3fc;
  font-size: 18px;
}

.metric-card {
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, .55);
  box-shadow: 0 18px 48px rgba(14, 165, 233, .12);
}

.status-panel {
  position: relative;
}

.donut-wrap {
  position: relative;
  height: 320px;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
}

.donut-center strong {
  font-size: 42px;
  color: #86efac;
  line-height: 1;
}

.donut-center span {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.grafana-panel canvas {
  min-height: 280px;
}

@media (max-width: 900px) {
  .metrics-head {
    flex-direction: column;
  }

  .metrics-refresh {
    width: 100%;
    text-align: left;
  }
}


/* Alerty */
.alert-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin-left: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .18);
  border: 1px solid rgba(248, 113, 113, .45);
  color: #fecaca;
  font-size: 13px;
  font-weight: 900;
}

.alert-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.alert-badge.danger {
  background: rgba(239, 68, 68, .16);
  border: 1px solid rgba(248, 113, 113, .42);
  color: #fecaca;
}


/* Badge alertów w menu */
.console-menu a {
  position: relative;
}

.menu-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.menu-alert-badge.zero {
  background: rgba(100, 116, 139, .18);
  border: 1px solid rgba(148, 163, 184, .28);
  color: #94a3b8;
}

.menu-alert-badge.warn {
  background: rgba(245, 158, 11, .18);
  border: 1px solid rgba(251, 191, 36, .45);
  color: #fde68a;
}

.menu-alert-badge.danger {
  background: rgba(239, 68, 68, .20);
  border: 1px solid rgba(248, 113, 113, .55);
  color: #fecaca;
  animation: alertPulse 1.5s infinite;
}

@keyframes alertPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}


/* Toast alert */
.pm-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  z-index: 9999;
}

.pm-toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* Timeline ONLINE/OFFLINE + SLA */
#timelineChart {
  min-height: 340px;
}

.sla-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.sla-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(51, 65, 85, .7);
  border-radius: 10px;
  padding: 9px 12px;
}

.sla-row span {
  color: #cbd5e1;
  font-weight: 700;
}

.sla-row strong.ok { color: #86efac; }
.sla-row strong.warn { color: #fde68a; }
.sla-row strong.bad { color: #fca5a5; }


/* Timeline ONLINE/OFFLINE + SLA */
#timelineChart {
  min-height: 340px;
}

.sla-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.sla-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(51, 65, 85, .7);
  border-radius: 10px;
  padding: 9px 12px;
}

.sla-row span {
  color: #cbd5e1;
  font-weight: 700;
}

.sla-row strong.ok { color: #86efac; }
.sla-row strong.warn { color: #fde68a; }
.sla-row strong.bad { color: #fca5a5; }


/* Inwentaryzacja */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.inventory-card {
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(51, 65, 85, .9);
  border-radius: 16px;
  padding: 16px;
}

.inventory-card h3 {
  margin-bottom: 12px;
  color: #e5e7eb;
}

.inventory-card p {
  margin: 7px 0;
  color: #cbd5e1;
}

@media (max-width: 1200px) {
  .inventory-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}


/* SLA heatmap */
.sla-legend {
  display: flex;
  gap: 18px;
  margin: 10px 0 18px;
  color: #cbd5e1;
  font-size: 13px;
}

.sla-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.sla-dot.online { background: #22c55e; }
.sla-dot.offline { background: #ef4444; }

.sla-heatmap {
  display: grid;
  gap: 12px;
}

.sla-host-row {
  display: grid;
  grid-template-columns: 160px 1fr 70px;
  gap: 12px;
  align-items: center;
}

.sla-host-name {
  font-weight: 800;
  color: #e5e7eb;
}

.sla-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
}

.sla-cell {
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
}

.sla-cell.online {
  background: linear-gradient(180deg, #22c55e, #15803d);
}

.sla-cell.offline {
  background: linear-gradient(180deg, #ef4444, #991b1b);
}

.sla-percent {
  font-weight: 900;
  text-align: right;
}

.sla-percent.ok { color: #86efac; }
.sla-percent.warn { color: #fde68a; }
.sla-percent.bad { color: #fca5a5; }


/* SLA heatmap time axis + tooltip */
.sla-axis-wrap {
  display: grid;
  grid-template-columns: 160px 1fr 70px;
  gap: 12px;
  margin-bottom: 8px;
}

.sla-axis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  font-size: 10px;
  color: #64748b;
}

.sla-axis span {
  text-align: center;
  white-space: nowrap;
}

.sla-tooltip {
  position: absolute;
  background: #020617;
  border: 1px solid rgba(56, 189, 248, .45);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  color: #e5e7eb;
  pointer-events: none;
  z-index: 9999;
  display: none;
  line-height: 1.45;
}

.sla-tooltip b {
  color: #38bdf8;
}


/* OS cards */
.os-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.os-card {
  background: linear-gradient(180deg, #020617, #020617);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 14px;
}

.os-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.os-name {
  font-weight: 700;
  color: #e5e7eb;
}

.os-count {
  font-weight: 800;
  color: #38bdf8;
}

.os-bar {
  height: 8px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.os-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.os-percent {
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
}


/* OS cards + versions + trend */
.os-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.os-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 16px;
  padding: 15px;
}

.os-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(56, 189, 248, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.os-content {
  width: 100%;
}

.os-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.os-name {
  font-weight: 800;
  color: #e5e7eb;
}

.os-count {
  font-weight: 900;
  color: #38bdf8;
}

.os-bar {
  height: 9px;
  background: #020617;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.os-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.os-percent {
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
}

.os-version-section,
.os-trend-section {
  margin-top: 22px;
}

.os-version-section h4,
.os-trend-section h4 {
  color: #e5e7eb;
  margin-bottom: 12px;
}

.os-version-list {
  display: grid;
  gap: 8px;
}

.os-version-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 12px;
  align-items: center;
  background: rgba(2, 6, 23, .55);
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 12px;
  padding: 10px 12px;
}

.os-version-row span {
  color: #e5e7eb;
  font-weight: 700;
}

.os-version-row b {
  color: #38bdf8;
  text-align: right;
}

.os-version-row small {
  color: #94a3b8;
  text-align: right;
}


/* OS dashboard fixed layout */
.os-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 16px;
  margin-top: 14px;
}

.os-box {
  background: rgba(15, 23, 42, .62);
  border: 1px solid rgba(56, 189, 248, .20);
  border-radius: 16px;
  padding: 16px;
  min-height: 210px;
}

.os-box h4 {
  margin: 0 0 14px 0;
  color: #e5e7eb;
  font-size: 15px;
}

.os-list {
  display: grid;
  gap: 11px;
}

.os-row {
  display: grid;
  grid-template-columns: 1fr 42px 54px;
  gap: 10px;
  align-items: center;
}

.os-row-name {
  color: #e5e7eb;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-mini-icon {
  display: inline-block;
  width: 26px;
  margin-right: 8px;
  text-align: center;
}

.os-row-count {
  color: #38bdf8;
  font-weight: 900;
  text-align: right;
}

.os-row-percent {
  color: #e5e7eb;
  font-weight: 800;
  text-align: right;
}

.os-row-bar {
  grid-column: 2 / 4;
  height: 7px;
  background: rgba(148, 163, 184, .14);
  border-radius: 999px;
  overflow: hidden;
}

.os-row-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

#osTrendChart {
  height: 160px !important;
}

@media (max-width: 1200px) {
  .os-dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* FIX OS dashboard layout */
.grafana-panel,
.grafana-panel.wide {
  max-width: 100%;
  overflow: hidden;
}

.os-dashboard-grid-simple {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  width: 100%;
  max-width: 100%;
}

.os-dashboard-grid-simple .os-box {
  min-width: 0;
  width: 100%;
}

.os-list,
.os-row,
.os-row-name {
  min-width: 0;
}

.os-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .os-dashboard-grid-simple {
    grid-template-columns: 1fr !important;
  }
}


/* FINAL METRICS LAYOUT */
.metrics-page {
  max-width: 1320px;
  margin: 0 auto;
}

.metrics-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.metrics-top h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
}

.metrics-top p {
  margin: 0;
  color: #cbd5e1;
}

.metrics-clock-card {
  min-width: 210px;
  background: rgba(15, 23, 42, .92);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: right;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}

.metrics-clock-card span,
.metrics-clock-card small {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.metrics-clock-card strong {
  display: block;
  color: #67e8f9;
  font-size: 20px;
  margin: 5px 0;
}

.metrics-cards-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 92px;
  background: rgba(15, 23, 42, .92);
  border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 14px;
  padding: 16px;
}

.metric-card span {
  color: #94a3b8;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  color: #e5e7eb;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  color: #94a3b8;
  margin-top: 8px;
}

.metric-card-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
}

.metric-card-row b {
  font-size: 18px;
  color: #38bdf8;
}

.metric-card-row b.ok {
  color: #86efac;
}

.metric-card-row b.bad {
  color: #f87171;
}

.metrics-grid.two-cols {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
  margin-bottom: 14px;
}

.grafana-panel {
  background: rgba(15, 23, 42, .92);
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 14px;
  padding: 16px;
  overflow: hidden;
}

.grafana-panel h3 {
  margin: 0 0 12px 0;
  color: #e5e7eb;
  font-size: 17px;
}

.grafana-panel canvas {
  width: 100% !important;
  max-height: 260px;
}

.grafana-panel.wide {
  margin-bottom: 14px;
}

.os-dashboard-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1.35fr !important;
  gap: 16px !important;
}

.os-box {
  background: rgba(2, 6, 23, .26);
  border: 1px solid rgba(56, 189, 248, .20);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  min-height: 175px;
}

.os-box h4 {
  margin: 0 0 14px 0;
  font-size: 14px;
  color: #e5e7eb;
}

.os-list {
  display: grid;
  gap: 10px;
}

.os-row {
  display: grid;
  grid-template-columns: 1fr 42px 54px;
  gap: 10px;
  align-items: center;
}

.os-row-name {
  color: #e5e7eb;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-mini-icon {
  display: inline-block;
  width: 26px;
  margin-right: 8px;
  text-align: center;
}

.os-row-count {
  color: #38bdf8;
  font-weight: 900;
  text-align: right;
}

.os-row-percent {
  color: #e5e7eb;
  font-weight: 800;
  text-align: right;
}

.os-row-bar {
  grid-column: 2 / 4;
  height: 7px;
  background: rgba(148, 163, 184, .16);
  border-radius: 999px;
  overflow: hidden;
}

.os-row-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

#osTrendChart {
  height: 160px !important;
}

@media (max-width: 1200px) {
  .metrics-cards-4,
  .metrics-grid.two-cols,
  .os-dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .metrics-top {
    flex-direction: column;
  }

  .metrics-clock-card {
    width: 100%;
    text-align: left;
  }
}


/* FIX: jeden scrollbar na stronie, bez dodatkowego scrolla w tabeli urządzeń */
.table-wrap,
.devices-table-wrap,
.clients-table-wrap,
.panel-table-wrap,
.table-container,
.device-table-container {
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
}

.table-wrap,
.devices-table-wrap,
.clients-table-wrap,
.panel-table-wrap,
.table-container,
.device-table-container {
  overflow-x: auto !important;
}

/* jeżeli scroll siedzi bezpośrednio na karcie/listingu */
.card,
.panel,
.grafana-panel,
.list-panel {
  max-height: none !important;
}

/* bezpieczne dopasowanie szerokości */
.content,
.main-content,
.page-content {
  max-width: 100%;
  overflow-x: hidden;
}

/* tabela ma się mieścić w karcie */
table {
  max-width: 100%;
}


/* GLOBAL FIX: jeden główny scrollbar dla całego panelu */
html, body {
  min-height: 100%;
  overflow-x: hidden !important;
}

main,
.content,
.main,
.main-content,
.page,
.page-content,
.container,
.container-fluid {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Wyłącz pionowe scrollbary wewnątrz kart/paneli/tabel */
.card,
.panel,
.grafana-panel,
.list-panel,
.table-card,
.table-panel,
.table-wrap,
.table-wrapper,
.table-container,
.devices-table-wrap,
.clients-table-wrap,
.panel-table-wrap,
.audit-table-wrap,
.history-table-wrap,
.users-table-wrap,
.groups-table-wrap,
.backup-panel,
.restore-panel {
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
}

/* Poziomy scroll zostaje tylko gdy tabela naprawdę jest za szeroka */
.table-wrap,
.table-wrapper,
.table-container,
.devices-table-wrap,
.clients-table-wrap,
.panel-table-wrap,
.audit-table-wrap,
.history-table-wrap,
.users-table-wrap,
.groups-table-wrap {
  overflow-x: auto !important;
}

/* Tabele nie powinny rozpychać layoutu */
table {
  max-width: 100% !important;
}

/* Przyciski / akcje niech się nie łamią brzydko */
td,
th {
  vertical-align: middle;
}


/* HARD FIX: usuń wewnętrzne pionowe scrollbary */
body,
.app,
.layout,
.content,
.main-content,
.page-content {
  overflow-y: auto !important;
}

.table-responsive,
.table-scroll,
.scroll-table,
.data-table,
.devices-table,
.clients-table,
.clients-list,
.devices-list,
.client-list,
.list-card,
.table-card,
.card-body,
.panel-body {
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
}

/* Najczęstszy winowajca: wrapper tabeli z wysokością */
div[style*="overflow-y"],
div[style*="overflow: auto"],
div[style*="max-height"] {
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
}

/* Zostawiamy tylko poziomy scroll, gdy tabela jest za szeroka */
.table-responsive,
.table-scroll,
.scroll-table,
.data-table,
.devices-table,
.clients-table,
.clients-list,
.devices-list,
.client-list {
  overflow-x: auto !important;
}

/* Menu akcji ma być widoczne, nie ucinane przez kontener */
.dropdown-menu,
.action-menu,
.actions-menu {
  z-index: 9999 !important;
}


/* FINAL SCROLL FIX - tylko jeden scrollbar strony */
html,
body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body > *,
.main,
.content,
.main-content,
.page-content,
.container,
.container-fluid {
  overflow-y: visible !important;
  max-height: none !important;
}

/* Tabele/listy nie robią własnego pionowego scrolla */
.table-wrapper,
.table-wrap,
.table-responsive,
.table-container,
.clients-table,
.devices-table,
.clients-list,
.devices-list,
.data-table,
.list-panel,
.table-card,
.card-body,
.panel-body,
.content-card {
  overflow-y: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Ten selektor łapie inline style typu overflow-y:auto */
.main *[style*="overflow-y"],
.content *[style*="overflow-y"],
.main-content *[style*="overflow-y"],
.page-content *[style*="overflow-y"],
.main *[style*="max-height"],
.content *[style*="max-height"],
.main-content *[style*="max-height"],
.page-content *[style*="max-height"] {
  overflow-y: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Zostawiamy poziomy scroll tylko dla szerokich tabel */
.table-wrapper,
.table-wrap,
.table-responsive,
.table-container {
  overflow-x: auto !important;
}

/* Menu z trzema kropkami nie może być ucinane */
.dropdown-menu,
.action-menu,
.actions-menu,
.client-actions-menu {
  z-index: 99999 !important;
}


/* FINAL OVERRIDE - remove inner vertical scrollbars */
.content,
.console-content {
  overflow-y: visible !important;
  overflow-x: hidden !important;
  height: auto !important;
  max-height: none !important;
}

.console-main {
  overflow-y: visible !important;
  overflow-x: hidden !important;
}

.console-layout {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}


/* FIX dashboard devices table - bez osobnego pionowego scrolla */
.devices-table-card {
  overflow-y: visible !important;
  overflow-x: visible !important;
  max-height: none !important;
  height: auto !important;
}

.devices-table-card table.devices-table {
  width: 100%;
  table-layout: fixed;
}

.devices-table-card .action-menu,
.devices-table-card .action-menu-content {
  overflow: visible !important;
  z-index: 99999 !important;
}

/* menu akcji może wychodzić poza tabelę */
.devices-table-card td {
  overflow: visible !important;
}

.devices-table-card th,
.devices-table-card td {
  word-break: normal;
}

/* usuń pionowy scroll z głównego contentu */
.console-content,
.content {
  overflow-y: visible !important;
  overflow-x: hidden !important;
  max-height: none !important;
  height: auto !important;
}


/* OS icons in devices table */
.os-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.os-logo {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.windows-logo {
  position: relative;
}

.windows-logo::before {
  content: "";
  width: 30px;
  height: 30px;
  display: block;
  background:
    linear-gradient(#38bdf8 0 0) left top / 13px 13px no-repeat,
    linear-gradient(#38bdf8 0 0) right top / 13px 13px no-repeat,
    linear-gradient(#38bdf8 0 0) left bottom / 13px 13px no-repeat,
    linear-gradient(#38bdf8 0 0) right bottom / 13px 13px no-repeat;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.45));
}

.linux-logo {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(250,204,21,.35));
}

.macos-logo {
  font-size: 34px;
  color: #e5e7eb;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.25));
}


/* Modern OS icons in devices list */
.os-badge-modern {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 13px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

.os-real-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.os-windows .os-real-icon {
  color: #38bdf8;
  font-size: 22px;
}

.os-linux .os-real-icon {
  font-size: 21px;
}

.os-macos .os-real-icon {
  color: #f8fafc;
  font-size: 22px;
}

.os-other .os-real-icon {
  color: #94a3b8;
}


/* Modern OS icons in devices list */
.os-badge-modern {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 13px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

.os-real-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.os-windows .os-real-icon {
  color: #38bdf8;
  font-size: 22px;
}

.os-linux .os-real-icon {
  font-size: 21px;
}

.os-macos .os-real-icon {
  color: #f8fafc;
  font-size: 22px;
}

.os-other .os-real-icon {
  color: #94a3b8;
}


/* METRICS BLUE GRAFANA THEME */
.metrics-page .metric-card,
.metrics-page .grafana-panel,
.metrics-page .os-card,
.metrics-page .timeline-panel {
  background: linear-gradient(180deg, #0f1b33 0%, #0b1324 100%) !important;
  border: 1px solid rgba(56,189,248,.28) !important;
  box-shadow: 0 0 0 1px rgba(14,165,233,.06), 0 18px 45px rgba(0,0,0,.35) !important;
}

.metrics-page .metric-card strong,
.metrics-page .metric-value,
.metrics-page .rd-id {
  color: #38bdf8 !important;
}

.metrics-page .metric-card .good,
.metrics-page .online,
.metrics-page .seen-online {
  color: #7dd3fc !important;
}

.metrics-page .grafana-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}

.metrics-page .grafana-panel.wide,
.metrics-page .timeline-panel,
.metrics-page .os-section {
  grid-column: 1 / -1 !important;
}

.metrics-page canvas {
  max-height: 280px !important;
}

/* OS section like old layout, blue theme */
.os-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.45fr;
  gap: 14px;
}

.os-box {
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(56,189,248,.22);
  border-radius: 14px;
  padding: 16px;
  min-height: 210px;
}

.os-row {
  display: grid;
  grid-template-columns: 34px 1fr 42px 58px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #e5e7eb;
  font-weight: 800;
}

.os-row .bar {
  grid-column: 2 / 5;
  height: 7px;
  background: rgba(148,163,184,.16);
  border-radius: 999px;
  overflow: hidden;
}

.os-row .bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.os-icon-blue {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.3));
}

/* Timeline per host */
.sla-timeline {
  margin-top: 12px;
}

.sla-row {
  display: grid;
  grid-template-columns: 140px 1fr 64px;
  gap: 12px;
  align-items: center;
  margin: 9px 0;
}

.sla-host {
  font-weight: 900;
  color: #e5e7eb;
}

.sla-percent {
  text-align: right;
  font-weight: 900;
  color: #38bdf8;
}

.sla-blocks {
  display: grid;
  grid-template-columns: repeat(24, minmax(12px, 1fr));
  gap: 4px;
}

.sla-block {
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #38bdf8, #0369a1);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.25);
}

.sla-block.offline {
  background: linear-gradient(180deg, #fb7185, #b91c1c);
}

.sla-time-axis {
  display: grid;
  grid-template-columns: 140px 1fr 64px;
  gap: 12px;
  margin-bottom: 5px;
}

.sla-time-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  color: #94a3b8;
  font-size: 11px;
}

@media (max-width: 1200px) {
  .metrics-page .grafana-grid,
  .os-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .sla-row,
  .sla-time-axis {
    grid-template-columns: 110px 1fr 54px;
  }
}


/* PM DIGITAL BLUE METRICS THEME */
.metrics-page .metric-card,
.metrics-page .grafana-panel,
.metrics-page .os-card,
.metrics-page .timeline-panel,
.metrics-page .os-box {
  background: linear-gradient(180deg, #071a33 0%, #07111f 100%) !important;
  border: 1px solid rgba(14, 165, 233, .45) !important;
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, .08),
    0 0 24px rgba(14, 165, 233, .10),
    0 18px 42px rgba(0,0,0,.38) !important;
}

.metrics-page .metric-card strong,
.metrics-page .metric-card b,
.metrics-page #lastUpdate,
.metrics-page .sla-percent {
  color: #38bdf8 !important;
  text-shadow: 0 0 12px rgba(56,189,248,.35);
}

.metrics-page .bad {
  color: #fb7185 !important;
}

.metrics-page .ok {
  color: #38bdf8 !important;
}

.metrics-page .grafana-panel h3,
.metrics-page .timeline-panel h3,
.metrics-page h1,
.metrics-page h2 {
  color: #e0f2fe !important;
}

/* OS section cleaner */
.os-metrics-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1.45fr !important;
  gap: 14px !important;
}

.os-box {
  border-radius: 16px !important;
  padding: 18px !important;
  min-height: 210px !important;
}

.os-row {
  display: grid !important;
  grid-template-columns: 34px 1fr 42px 58px !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 13px 0 !important;
  font-weight: 800 !important;
  color: #e5e7eb !important;
}

.os-row .bar {
  grid-column: 2 / 5 !important;
  height: 8px !important;
  background: rgba(15, 23, 42, .9) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.08);
}

.os-row .bar span {
  display: block !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #0284c7, #38bdf8) !important;
  box-shadow: 0 0 12px rgba(56,189,248,.45);
}

.os-icon-blue {
  font-size: 22px !important;
}

/* Charts blue */
.metrics-page canvas {
  max-height: 280px !important;
}

/* Timeline blue blocks */
.sla-block {
  background: linear-gradient(180deg, #38bdf8, #0284c7) !important;
  box-shadow: 0 0 10px rgba(56,189,248,.28), inset 0 -2px 0 rgba(0,0,0,.28) !important;
}

.sla-block.offline {
  background: linear-gradient(180deg, #fb7185, #be123c) !important;
  box-shadow: 0 0 10px rgba(251,113,133,.25), inset 0 -2px 0 rgba(0,0,0,.28) !important;
}

.sla-host {
  color: #e0f2fe !important;
}

.sla-percent {
  color: #38bdf8 !important;
}

@media (max-width: 1200px) {
  .os-metrics-grid {
    grid-template-columns: 1fr !important;
  }
}


/* METRICS DONUT FIX - okrągłe kółko + procent na środku */
.metrics-page .grafana-panel:has(#statusChart) {
  position: relative !important;
  min-height: 300px !important;
}

.metrics-page #statusChart {
  display: block !important;
  width: 260px !important;
  height: 260px !important;
  max-width: 260px !important;
  max-height: 260px !important;
  margin: 10px auto 0 auto !important;
}

.metrics-page .status-donut-center,
.metrics-page .donut-center,
.metrics-page .chart-center {
  position: absolute !important;
  left: 50% !important;
  top: 52% !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
  pointer-events: none !important;
}

.metrics-page .status-donut-center strong,
.metrics-page .donut-center strong,
.metrics-page .chart-center strong {
  display: block !important;
  font-size: 38px !important;
  line-height: 1 !important;
  color: #7dd3fc !important;
  text-shadow: 0 0 14px rgba(56,189,248,.45) !important;
}

.metrics-page .status-donut-center span,
.metrics-page .donut-center span,
.metrics-page .chart-center span {
  display: block !important;
  margin-top: 6px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 1.8px !important;
  color: #cbd5e1 !important;
}


.metrics-page .status-chart-wrap {
  position: relative !important;
  width: 100% !important;
  min-height: 270px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.metrics-page .status-chart-wrap #statusChart {
  margin: 0 auto !important;
}


/* FINAL BLUE METRICS LOOK */
.metrics-page #statusChart,
.metrics-page #heartbeatChart,
.metrics-page #osTrendChart {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.metrics-page .grafana-panel:has(#statusChart) {
  min-height: 300px !important;
}

.metrics-page #statusChart {
  width: 260px !important;
  height: 260px !important;
  max-width: 260px !important;
  max-height: 260px !important;
  margin: 0 auto !important;
}

.metrics-page .status-chart-wrap {
  position: relative !important;
  min-height: 270px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.metrics-page .status-donut-center {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
  pointer-events: none !important;
}

.metrics-page .status-donut-center strong {
  display: block !important;
  font-size: 38px !important;
  line-height: 1 !important;
  color: #7dd3fc !important;
  text-shadow: 0 0 14px rgba(56,189,248,.55) !important;
}

.metrics-page .status-donut-center span {
  display: block !important;
  margin-top: 6px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 1.8px !important;
  color: #cbd5e1 !important;
}

.metrics-page .sla-block {
  background: linear-gradient(180deg, #38bdf8, #0284c7) !important;
}

.metrics-page .sla-block.offline {
  background: linear-gradient(180deg, #fb7185, #be123c) !important;
}


/* MFA / LOGIN polish */
.auth-page,
.login-page,
.mfa-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card,
.login-card,
.mfa-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #071a33 0%, #07111f 100%);
  border: 1px solid rgba(14, 165, 233, .45);
  border-radius: 18px;
  padding: 28px;
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, .08),
    0 0 24px rgba(14, 165, 233, .12),
    0 18px 42px rgba(0,0,0,.42);
}

.auth-card h1,
.auth-card h2,
.login-card h1,
.login-card h2,
.mfa-card h1,
.mfa-card h2 {
  margin-top: 0;
  color: #e0f2fe;
}

.auth-card input,
.login-card input,
.mfa-card input {
  width: 100%;
  box-sizing: border-box;
  background: #071426;
  color: #e5e7eb;
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 14px;
}

.auth-card button,
.login-card button,
.mfa-card button,
.auth-card .btn,
.login-card .btn,
.mfa-card .btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  color: #00111f;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  cursor: pointer;
}

.auth-card img,
.mfa-card img {
  display: block;
  max-width: 220px;
  margin: 18px auto;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}


/* AUTH CLEAN LAYOUT - Login / MFA */
body.auth-clean {
  background: #050608 !important;
}

body.auth-clean .console-sidebar {
  display: none !important;
}

body.auth-clean .console-topbar {
  display: none !important;
}

body.auth-clean .console-main {
  width: 100% !important;
  min-height: 100vh !important;
}

body.auth-clean .console-content,
body.auth-clean .content,
body.auth-clean .main-content {
  padding: 0 !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(14,165,233,.18), transparent 38%),
    linear-gradient(180deg, #050608 0%, #020617 100%);
}

.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 30px;
  border-radius: 20px;
  background: linear-gradient(180deg, #071a33 0%, #07111f 100%);
  border: 1px solid rgba(56,189,248,.40);
  box-shadow:
    0 0 32px rgba(56,189,248,.16),
    0 24px 60px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #e0f2fe;
  font-weight: 900;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 0 22px rgba(56,189,248,.35);
}

.auth-card h2 {
  margin: 0 0 8px;
  color: #e0f2fe;
  font-size: 26px;
}

.auth-muted {
  margin: 0 0 24px;
  color: #94a3b8;
  font-size: 14px;
}

.auth-card label {
  display: block;
  margin: 14px 0 7px;
  color: #e5e7eb;
  font-weight: 700;
  font-size: 13px;
}

.auth-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(56,189,248,.45);
  background: #061426;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}

.auth-card input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,.18);
}

.auth-card button {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 900;
  color: #00111f;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  cursor: pointer;
}

.auth-card button:hover {
  filter: brightness(1.08);
}


/* FINAL SCROLL FIX - tylko jeden scrollbar strony */
html,
body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body > *,
.main,
.content,
.main-content,
.page-content,
.container,
.container-fluid {
  overflow-y: visible !important;
  max-height: none !important;
}

/* Tabele/listy nie robią własnego pionowego scrolla */
.table-wrapper,
.table-wrap,
.table-responsive,
.table-container,
.clients-table,
.devices-table,
.clients-list,
.devices-list,
.data-table,
.list-panel,
.table-card,
.card-body,
.panel-body,
.content-card {
  overflow-y: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Ten selektor łapie inline style typu overflow-y:auto */
.main *[style*="overflow-y"],
.content *[style*="overflow-y"],
.main-content *[style*="overflow-y"],
.page-content *[style*="overflow-y"],
.main *[style*="max-height"],
.content *[style*="max-height"],
.main-content *[style*="max-height"],
.page-content *[style*="max-height"] {
  overflow-y: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Zostawiamy poziomy scroll tylko dla szerokich tabel */
.table-wrapper,
.table-wrap,
.table-responsive,
.table-container {
  overflow-x: auto !important;
}

/* Menu z trzema kropkami nie może być ucinane */
.dropdown-menu,
.action-menu,
.actions-menu,
.client-actions-menu {
  z-index: 99999 !important;
}

