:root {
    --bg: #0f172a; --panel: #1e293b; --panel-2: #263449;
    --text: #e2e8f0; --muted: #94a3b8; --border: #334155; --accent: #f97316;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent); }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--border);
    padding: 20px 12px; flex-shrink: 0; }
.sidebar h1 { font-size: 16px; margin: 0 8px 20px; }
.nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text);
    text-decoration: none; margin-bottom: 4px; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--accent); color: #1a1a1a; font-weight: 600; }
.nav a.logout { margin-top: 20px; color: var(--muted); }

.content { flex: 1; padding: 24px 28px; overflow-x: auto; }
.content h2 { margin-top: 0; }

/* Bento — kafelki podsumowania */
.bento { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; margin: 4px 0 22px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px 18px; position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border); }
.tile.ok::after { background: #4ade80; }
.tile.bad::after { background: #ef4444; }
.tile.warn::after { background: #f59e0b; }
.tile.accent::after { background: var(--accent); }
.tile-value { font-size: 30px; font-weight: 700; line-height: 1; }
.tile-label { color: var(--muted); font-size: 12px; margin-top: 8px; text-transform: uppercase; letter-spacing: .03em; }

.toolbar { margin-bottom: 16px; }
.badge.accent { background: rgba(249,115,22,.2); color: #fdba74; }
.toolbar select, textarea, input[type=password] {
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 10px; font-family: inherit; }
textarea { width: 100%; font-family: monospace; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: var(--panel); }
.right { text-align: right; }
.pre { white-space: pre-line; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.info { background: rgba(59,130,246,.2); color: #93c5fd; }
.badge.warning { background: rgba(245,158,11,.2); color: #fcd34d; }
.badge.critical { background: rgba(239,68,68,.2); color: #fca5a5; }
.badge.ok { background: rgba(74,222,128,.2); color: #86efac; }
.badge.off { background: rgba(148,163,184,.2); color: #cbd5e1; }

.status-ACTIVE { color: #4ade80; }
.status-ENDED, .status-INACTIVE, .status-SUSPENDED { color: #fca5a5; }
.ok-text { color: #4ade80; } .bad-text { color: #fca5a5; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.params-form label { display: block; margin-bottom: 4px; }
.params-form button { margin-top: 6px; }

.btn { background: var(--accent); color: #1a1a1a; border: 0; border-radius: 8px;
    padding: 8px 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.secondary { background: var(--panel-2); color: var(--text); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 40px; text-align: center; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    padding: 28px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 18px; margin: 0 0 8px; text-align: center; }
.login-card .error { color: #fca5a5; margin: 0; }
.login-card input { width: 100%; }
