:root {
    --primary: #C7A14A;
    --primary-hover: #d4b05e;
    --primary-glow: rgba(199, 161, 74, 0.2);
    --bg: #0F172A;
    --panel-bg: #111827;
    --card-bg: #1E293B;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #E5E7EB;
    --text-dim: #9CA3AF;
    --text-muted: #6B7280;
    --red: #DC2626;
    --red-bg: rgba(220, 38, 38, 0.15);
    --yellow: #F59E0B;
    --yellow-bg: rgba(245, 158, 11, 0.15);
    --orange: #EA580C;
    --orange-bg: rgba(234, 88, 12, 0.15);
    --green: #10B981;
    --green-bg: rgba(16, 185, 129, 0.15);
    --blue: #3B82F6;
    --black-risk: #000000;
    --black-risk-bg: rgba(0, 0, 0, 0.55);
    /* PODWÓJNY CZARNY — top band. Distinct deep-plum tint (echoes the PDF's
       purple DOUBLE_BLACK) so it is visibly separable from CZARNY (#000) in
       chart bars / dots, not just by banner icon+opacity. PROVISIONAL —
       final colour pending Ewelina's clinical sign-off. */
    --double-black: #3a0a26;
    --double-black-bg: rgba(58, 10, 38, 0.85);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Common Layout ── */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(16px, 4vw, 48px);
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.header .logo {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 1px;
}

.header .logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.header .logo span {
    color: var(--text-dim);
    font-weight: 300;
    font-size: 14px;
    margin-left: 6px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ── Buttons ── */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: none;
    color: var(--text-dim);
}

.btn-ghost:hover {
    color: var(--primary);
}

.btn-block { width: 100%; }

/* ── Cards ── */
.card {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── Footer ── */
.brand-footer {
    text-align: center;
    padding: 32px 16px;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
}

.brand-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.brand-footer .credit {
    margin-top: 8px;
    opacity: 0.6;
    font-size: 11px;
}

/* Compact in-app version of the landing footer link row. Mirrors the
   <div class="footer-links"> on /alerty/, /baza-wiedzy/, etc. — keeps the
   SPA "podobne" to the rest of the site without bloating the in-app chrome. */
.brand-footer .app-footer-links {
    margin-top: 10px;
    line-height: 2;
    font-size: 11.5px;
    opacity: 0.85;
}
.brand-footer .app-footer-links a {
    margin: 0 6px;
    font-weight: 500;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.05);
}

/* ── Risk Badges ── */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.risk-GREEN { background: var(--green-bg); color: var(--green); }
.risk-YELLOW { background: var(--yellow-bg); color: var(--yellow); }
.risk-ORANGE { background: var(--orange-bg); color: var(--orange); }
.risk-RED { background: var(--red-bg); color: var(--red); }
.risk-BLACK { background: var(--black-risk-bg); color: #fff; border: 1px solid var(--black-risk); }
.risk-DOUBLE_BLACK { background: var(--double-black-bg); color: #fff; border: 1px solid #fff; }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }
