/* ═══════════════════════════════════════════
   SPRAWOZDANIE ZARZĄDU — DESIGN SYSTEM
   ═══════════════════════════════════════════ */

:root {
    /* ── Colors ── */
    --navy: #0f3460;
    --navy-hover: #0a2848;
    --black: #0f172a;
    --gray: #64748b;
    --gray-light: #c5cdd8;
    --muted: #94a3b8;
    --red: #b91c1c;
    --green: #16a34a;
    --amber: #f59e0b;
    --light: #f1f5f9;
    --auto-bg: #f0f5ff;
    --auto-border: #bfd4f2;
    --manual-border: #d1d5db;
    --white: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* ── Typography ── */
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: 'Mulish', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    /* ── Font sizes ── */
    --fs-xs: 10px;
    --fs-sm: 12px;
    --fs-base: 14px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --fs-3xl: 28px;
    --fs-4xl: 32px;

    /* ── Spacing (4px base) ── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* ── Radii ── */
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-pill: 100px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px rgba(15,52,96,0.04);
    --shadow: 0 2px 8px rgba(15,52,96,0.06);
    --shadow-lg: 0 4px 16px rgba(15,52,96,0.10);

    /* ── Transitions ── */
    --transition: 0.15s ease;

    /* ── Z-index ── */
    --z-sticky: 100;
    --z-toast: 1000;
}

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

body {
    font-family: var(--sans);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--black);
    background: var(--light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── TOP BAR ── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-10);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.topbar-left img { height: 28px; }

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.topbar-title {
    font-family: var(--serif);
    font-size: var(--fs-2xl);
    color: var(--navy);
}

.badge-beta {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: var(--white);
    text-transform: uppercase;
}
.badge-beta-sup {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.5px;
    margin-left: 2px;
    vertical-align: super;
    align-self: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ── BUTTONS (Google Material 3 style) ── */
.btn {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: var(--radius-pill);
    padding: 9px 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s;
    background: currentColor;
    pointer-events: none;
}

.btn:hover::after { opacity: 0.08; }
.btn:active::after { opacity: 0.12; }

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(15,52,96,0.2), 0 1px 2px rgba(15,52,96,0.12);
}

.btn-primary:hover:not(:disabled) {
    background: var(--navy-hover);
    box-shadow: 0 2px 6px rgba(15,52,96,0.25), 0 2px 4px rgba(15,52,96,0.15);
}

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--navy); background: #f8fafc; }

.btn-ghost {
    background: transparent;
    color: var(--gray);
    padding: 9px 16px;
}

.btn-ghost:hover { color: var(--navy); background: var(--light); }

.btn-danger {
    background: transparent;
    color: var(--red);
    padding: 9px 16px;
}

.btn-danger:hover { background: #fef2f2; }

/* ── CUSTOM CHECKBOXES ── */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-light);
    border-radius: 5px;
    background: var(--white);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
    vertical-align: middle;
}

input[type="checkbox"]:hover {
    border-color: var(--navy);
}

input[type="checkbox"]:checked {
    background: var(--navy);
    border-color: var(--navy);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

/* ── ICONS (inline SVG helper) ── */
.icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── CONTAINER ── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6) var(--space-20);
}

/* ═══════════════════════════════════
   UPLOAD SCREEN
   ═══════════════════════════════════ */
.upload-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--space-20);
}

.upload-screen h1 {
    font-family: var(--serif);
    font-size: var(--fs-4xl);
    font-weight: 400;
    color: var(--navy);
    margin-bottom: var(--space-2);
}

.upload-screen .subtitle {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: var(--space-12);
}

.upload-area {
    width: 100%;
    max-width: 520px;
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-xl);
    padding: 56px 40px;
    text-align: center;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--navy);
    background: #fafbff;
}

.upload-area.dragover {
    border-style: solid;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: var(--radius-xl);
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 24px;
    height: 24px;
    color: var(--navy);
}

.upload-area .main-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 4px;
}

.upload-area .hint {
    font-size: 13px;
    color: var(--gray);
}

.upload-area .format {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--gray);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ═══════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 120px;
}

.loading-steps {
    list-style: none;
    width: 320px;
}

.loading-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 14px;
    color: var(--gray);
}

.loading-steps li.done { color: var(--black); }
.loading-steps li.active { color: var(--navy); font-weight: 700; }
.loading-steps li.error { color: var(--red); }

.step-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.loading-steps li.done .step-dot {
    background: var(--navy);
    border-color: var(--navy);
}

.loading-steps li.active .step-dot { border-color: var(--navy); }
.loading-steps li.error .step-dot { border-color: var(--red); background: var(--red); }

.step-check { width: 10px; height: 10px; color: white; }

.step-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid var(--navy);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-error {
    margin-top: 24px;
    padding: 12px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--red);
    font-size: 13px;
    max-width: 400px;
    text-align: center;
}

.loading-error .btn {
    margin-top: 12px;
}

/* ═══════════════════════════════════
   FORM SCREEN
   ═══════════════════════════════════ */

/* ── STATUS BAR ── */
.status-bar {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: 14px var(--space-5);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-sm);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--amber); }
.status-dot.err { background: var(--red); }

.status-label { color: var(--gray); }
.status-val { font-weight: 700; color: var(--black); }

.status-spacer { flex: 1; }

.status-progress {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--gray);
}

/* ── LEGEND ── */
.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray);
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-swatch.auto {
    background: var(--auto-bg);
    border: 1px solid var(--auto-border);
}

.legend-swatch.manual {
    background: var(--white);
    border: 1px solid var(--manual-border);
}

/* ── SECTION CARD ── */
.form-sec {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.form-sec-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5) 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    user-select: none;
}

.form-sec-head:hover { background: #fafbfc; }

.form-sec-num {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--navy);
    background: var(--light);
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-sec-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--black);
}

.form-sec-title-en {
    font-size: 13px;
    color: var(--gray);
    font-weight: 400;
}

.form-sec-badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.badge-auto { background: var(--auto-bg); color: #2563eb; }
.badge-manual { background: #fef3c7; color: #92400e; }
.badge-mixed { background: #f0fdf4; color: #166534; }

.form-sec-chevron {
    width: 16px;
    height: 16px;
    color: var(--gray-light);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.form-sec.collapsed .form-sec-chevron { transform: rotate(-90deg); }
.form-sec.collapsed .form-sec-body { display: none; }

/* ── SECTION BODY ── */
.form-sec-body {
    padding: var(--space-4) var(--space-5) var(--space-5);
}

/* ── FIELD ROW ── */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.field-row:last-child { margin-bottom: 0; }

.field-row.col-headers {
    margin-bottom: 4px;
}

.col-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
}

.field-label .lang {
    font-weight: 400;
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

/* ── INPUTS ── */
.field-input {
    font-family: var(--sans);
    font-size: 14px;
    padding: 9px 14px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--black);
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(15,52,96,0.08);
}

.field-input.auto {
    background: var(--auto-bg);
    border-color: var(--auto-border);
}

.field-input.auto:focus {
    border-color: var(--navy);
    background: var(--white);
}

.field-input.amt {
    font-family: var(--mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.field-input.amt.neg { color: var(--red); }

/* ── TEXTAREA ── */
.field-textarea {
    font-family: var(--sans);
    font-size: 14px;
    padding: 9px 14px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--black);
    width: 100%;
    min-height: 88px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(15,52,96,0.08);
}
.field-textarea::placeholder { color: var(--gray-light); }

.field-textarea.auto {
    background: var(--auto-bg);
    border-color: var(--auto-border);
}

/* ── QUICK-FILL BUTTON ── */
.quick-fill {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--gray);
    background: none;
    border: 1px dashed var(--gray-light);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    margin-top: 4px;
    align-self: flex-start;
    transition: all var(--transition);
}

.quick-fill:hover {
    border-color: var(--navy);
    color: var(--navy);
}

/* ── SUB-SECTION LABEL ── */
.subsec-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--navy);
    margin-top: 12px;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.subsec-label:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.subsec-label-en {
    font-weight: 400;
    color: var(--gray);
    margin-left: 4px;
}

/* ── FINANCE CARDS ── */
.fin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fin-card {
    padding: 14px 16px;
    background: var(--auto-bg);
    border-radius: var(--radius);
}

.fin-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    margin-bottom: 4px;
}

.fin-card-val {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.fin-card-val.neg { color: var(--red); }

.fin-card-sub {
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
}

/* ── PERSON TABLE ── */
.person-table {
    width: 100%;
    border-collapse: collapse;
}

.person-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.person-table td {
    font-size: 14px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
}

.person-table td input {
    font-family: var(--sans);
    font-size: 14px;
    border: none;
    background: transparent;
    color: var(--black);
    width: 100%;
    outline: none;
    padding: 0;
}

.person-table td input.auto {
    background: var(--auto-bg);
    border-radius: 4px;
    padding: 4px 6px;
    margin: -4px -6px;
}

.person-table td input::placeholder { color: var(--gray-light); }

.warn-icon {
    color: var(--amber);
    font-size: 12px;
    margin-left: 4px;
    cursor: help;
}

/* ── EXPORT SECTION ── */
.export-sec {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.export-sec .label {
    font-weight: 700;
    font-size: 14px;
    color: var(--black);
}

.export-sec .hint {
    font-size: 13px;
    color: var(--gray);
}

.export-spacer { flex: 1; }

/* ── TOAST / NOTIFICATION ── */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    padding: var(--space-3) var(--space-5);
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    opacity: 0;
    transform: translateY(var(--space-2));
    transition: all 0.3s;
    pointer-events: none;
}

/* ── Cookie consent ── */
.cookie-consent {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    max-width: 360px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(15,52,96,0.18), 0 2px 8px rgba(15,52,96,0.08);
    padding: var(--space-5) var(--space-6);
    z-index: var(--z-toast);
    animation: cookieSlideUp 0.4s ease-out;
    border: 1px solid var(--border-light);
}
@keyframes cookieSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cookie-consent h4 {
    margin: 0 0 var(--space-2);
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--navy);
}
.cookie-consent p {
    margin: 0 0 var(--space-4);
    font-size: var(--fs-sm);
    color: var(--gray);
    line-height: 1.5;
}
.cookie-consent a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-consent-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}
.cookie-consent .btn-accept {
    background: var(--navy);
    color: var(--white);
    border: none;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-consent .btn-accept:hover { background: var(--navy-light); }
@media (max-width: 480px) {
    .cookie-consent { bottom: var(--space-3); right: var(--space-3); left: var(--space-3); max-width: none; }
}

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

.toast.error {
    background: var(--red);
}

/* ── CONFIRM MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.15s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(15, 52, 96, 0.18);
    padding: var(--space-6);
    max-width: 420px;
    width: calc(100% - 32px);
    animation: modalSlideIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-body {
    font-size: var(--fs-base);
    color: var(--black);
    line-height: 1.6;
    margin-bottom: var(--space-5);
    white-space: pre-line;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}
.modal-actions .btn-danger-fill {
    background: var(--red);
    color: var(--white);
    border: none;
}
.modal-actions .btn-danger-fill:hover { opacity: 0.9; }

/* ── HIDDEN STATE CLASSES ── */
.hidden { display: none !important; }

/* ── LINK-SHARE BANNER ── */
.share-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    font-size: 13px;
    color: #92400e;
}

.share-banner .share-url {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--white);
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 4px 10px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── DASHBOARD ── */
.dashboard-screen {
    max-width: 900px;
    margin: var(--space-10) auto;
    padding: 0 var(--space-6);
}
/* ── Dashboard tabs ── */
.dash-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0;
}
.dash-tab {
    padding: var(--space-3) var(--space-5);
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--gray);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.dash-tab:hover { color: var(--navy); }
.dash-tab.active {
    color: var(--navy);
    border-bottom-color: var(--gold);
}
.tab-content.hidden { display: none; }

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}
.dashboard-header h1 {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--navy);
    margin: 0;
}
.rpt-table { width: 100%; }
.rpt-head {
    display: flex;
    align-items: center;
    padding: 0 0 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2px;
}
.rpt-head span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.rpt-head span:hover { color: var(--navy); }
.rpt-head .sorted { color: var(--navy); font-weight: 600; }
.rpt-head .sorted::after { margin-left: 4px; }
.rpt-head .sorted.asc::after { content: '▴'; }
.rpt-head .sorted.desc::after { content: '▾'; }

.rpt-row {
    display: flex;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .1s;
}
.rpt-row:hover { background: #f8f9fa; }
.rpt-row.selected { background: #eef2ff; }

/* ── Dashboard search ── */
.dashboard-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    transition: border-color 0.2s;
    flex: 1;
    max-width: 320px;
}
.dashboard-search:focus-within { border-color: var(--navy); }
.dashboard-search svg { color: var(--muted); flex-shrink: 0; }
.dashboard-search input {
    font-family: var(--sans);
    font-size: 13px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    width: 100%;
}
.dashboard-search input::placeholder { color: var(--gray-light); }
.search-clear {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.search-clear:hover { color: var(--navy); }

.rpt-col-check { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: default; }
.rpt-col-check input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; }
.rpt-col-name { flex: 1; font-size: 14px; color: var(--navy); }
.rpt-col-year { width: 70px; font-size: 13px; color: var(--muted); text-align: center; flex-shrink: 0; }
.rpt-col-pipeline { width: 180px; display: flex; align-items: center; gap: 0; flex-shrink: 0; padding: 0 var(--space-3); }
.rpt-col-updated { width: 130px; font-size: 11px; text-align: right; flex-shrink: 0; }
.rpt-col-actions { width: 40px; flex-shrink: 0; text-align: center; }
.btn-icon, .btn-icon-edit { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-pill); background: transparent; text-decoration: none; font-size: 16px; transition: all var(--transition); color: var(--gray); }
.btn-icon:hover, .btn-icon-edit:hover { background: var(--bg-alt); color: var(--navy); }

/* ── Pipeline dots (status steps) ── */
.pipeline {
    display: flex;
    align-items: center;
    gap: 3px;
}
.pipeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}
.pipeline-dot.reached { background: var(--navy); }
.pipeline-dot.current { background: var(--navy); box-shadow: 0 0 0 3px rgba(15,52,96,0.18); transform: scale(1.2); }
.pipeline-line {
    width: 10px; height: 2px;
    background: var(--border);
    transition: background 0.2s;
    flex-shrink: 0;
}
.pipeline-line.reached { background: var(--navy); }
.pipeline-label {
    font-size: 11px;
    color: var(--gray);
    margin-left: 8px;
    white-space: nowrap;
    font-weight: 500;
}

/* ── Updated by indicator ── */
.rpt-updated-by {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    margin-left: 4px;
}
.rpt-updated-by.by-client {
    background: #dbeafe;
    color: #2563eb;
}
.rpt-updated-by.by-biuro {
    background: var(--light);
    color: var(--gray);
}

.rpt-actions {
    display: none;
    padding: 12px 0;
    text-align: right;
}
.rpt-actions.visible { display: block; }
.rpt-actions button {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 20px;
    border: 1.5px solid var(--red);
    background: var(--white);
    color: var(--red);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.rpt-actions button:hover { background: var(--red); color: var(--white); }

.reports-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 15px;
}
.reports-loading {
    text-align: center;
    padding: var(--space-10);
    color: var(--muted);
}

/* ── Loading skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius);
}

.skeleton-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.skeleton-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-line-sm { width: 60px; }
.skeleton-line-md { width: 120px; }
.skeleton-line-lg { flex: 1; max-width: 300px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.back-btn {
    margin-bottom: 16px;
    font-size: 14px;
}

/* ═══════════════════════════════════
   ADMIN PANELS
   ═══════════════════════════════════ */
.admin-panel {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}
.admin-panel + .admin-panel { margin-top: var(--space-3); }
.admin-panels-wrap { margin-top: var(--space-8); }

.admin-panel-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    user-select: none;
}
.admin-panel-head:hover { background: var(--light); border-radius: var(--radius); }
.panel-chevron { transition: transform 0.2s ease; }

.admin-panel-body {
    display: none;
    padding: var(--space-4) var(--space-6) var(--space-5);
    border-top: 1px solid var(--border-light);
}
.admin-panel-body.open { display: block; }

.panel-title {
    font-weight: 700;
    color: var(--navy);
    font-size: var(--fs-base);
}

.panel-subtitle {
    font-size: var(--fs-sm);
    color: var(--muted);
}

.panel-spacer { flex: 1; }

/* ── Badges ── */
.badge {
    font-size: 11px;
    padding: 1px var(--space-2);
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
}
.badge-default { background: var(--border); color: #475569; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #2563eb; }

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
}

.btn-filter {
    font-size: 11px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
}

.filter-label {
    font-size: var(--fs-xs);
    color: var(--muted);
    padding: var(--space-1) 0;
    margin-right: var(--space-1);
}

/* ── Form stack (vertical form fields) ── */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

/* ── Inline form (horizontal, wrapping) ── */
.form-inline {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

/* Compact inline controls — replaces repeated font-size:13px;padding:8px 12px */
.field-sm { font-size: var(--fs-sm); padding: var(--space-2) var(--space-3); }
.btn-sm   { font-size: var(--fs-sm); padding: var(--space-2) var(--space-4); white-space: nowrap; }

/* ── Chat FAB + Drawer ── */
.chat-fab {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--navy);
    background: var(--white);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(15,52,96,0.15);
    z-index: 900;
    transition: all 0.2s cubic-bezier(0.2,0,0,1);
}
.chat-fab:hover {
    background: var(--navy);
    color: var(--white);
    transform: scale(1.08);
}
.chat-fab.open { background: var(--navy); color: var(--white); }
.chat-fab-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.chat-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.3);
    z-index: 950;
    backdrop-filter: blur(1px);
}
.chat-drawer {
    position: fixed;
    top: 0;
    left: -460px;
    width: 440px;
    height: 100vh;
    background: var(--white);
    box-shadow: 4px 0 24px rgba(15,52,96,0.12);
    z-index: 960;
    display: flex;
    flex-direction: column;
    transition: left 0.25s cubic-bezier(0.2,0,0,1);
}
.chat-drawer.open { left: 0; }

.chat-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-drawer-title {
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--navy);
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.chat-empty {
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
    margin-top: var(--space-10);
}

/* Chat bubbles */
.chat-msg {
    max-width: 85%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg.biuro {
    align-self: flex-end;
    background: var(--navy);
    color: var(--white);
    border-bottom-right-radius: 4px;
}
.chat-msg.admin {
    align-self: flex-start;
    background: var(--light);
    color: var(--black);
    border-bottom-left-radius: 4px;
}
.chat-msg-meta {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}
.chat-msg.biuro .chat-msg-meta { color: rgba(255,255,255,0.6); }
.chat-msg-sender {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray);
    margin-bottom: 1px;
}

/* Chat input bar */
.chat-input-bar {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    font-family: var(--sans);
    font-size: 13px;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--navy); }
.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.chat-send-btn:hover { background: var(--navy-hover); transform: scale(1.05); }

/* ── Bug FAB (floating action button) ── */
.bug-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--navy);
    background: var(--white);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(15,52,96,0.15);
    z-index: 900;
    transition: all 0.2s cubic-bezier(0.2,0,0,1);
    animation: fabPulse 3s ease-in-out infinite;
}
.bug-fab:hover {
    background: var(--navy);
    color: var(--white);
    transform: scale(1.08);
    animation: none;
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(15,52,96,0.15); }
    50% { box-shadow: 0 2px 12px rgba(15,52,96,0.15), 0 0 0 6px rgba(15,52,96,0.08); }
}
.bug-fab.open {
    background: var(--navy);
    color: var(--white);
    animation: none;
}

.qa-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    padding: 0 4px;
}

/* ── Bug drawer ── */
.bug-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.3);
    z-index: 950;
    backdrop-filter: blur(1px);
}
.bug-drawer {
    position: fixed;
    top: 0;
    right: -460px;
    width: 440px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 24px rgba(15,52,96,0.12);
    z-index: 960;
    display: flex;
    flex-direction: column;
    transition: right 0.25s cubic-bezier(0.2,0,0,1);
}
.bug-drawer.open { right: 0; }

.bug-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.bug-drawer-title {
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--navy);
}
.bug-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.bug-drawer-close:hover { color: var(--navy); }

.bug-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-5) var(--space-6);
}

/* ── Bug report panel (legacy, kept for admin list) ── */

/* ── Bugs toolbar (superadmin) ── */
.bugs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.bugs-tabs {
    display: flex;
    gap: 2px;
    background: var(--light);
    border-radius: var(--radius-pill);
    padding: 2px;
}
.bugs-tab {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.bugs-tab:hover { color: var(--navy); }
.bugs-tab.active {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(15,52,96,0.2);
}
.bugs-select {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 28px 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--gray);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s;
}
.bugs-select:focus { border-color: var(--navy); }

/* ── Bug table ── */
.bugs-table-head {
    display: flex;
    align-items: center;
    padding: 0 0 var(--space-2);
    border-bottom: 2px solid var(--border);
    margin-bottom: 2px;
}
.bugs-table-head span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.bugs-table-head span:hover { color: var(--navy); }
.bugs-table-head .sorted { color: var(--navy); }
.bugs-table-head .sorted.asc::after { content: ' ▴'; }
.bugs-table-head .sorted.desc::after { content: ' ▾'; }
.bugs-col-status { width: 10px; flex-shrink: 0; }
.bugs-col-title { flex: 1; min-width: 0; }
.bugs-col-cat { width: 70px; text-align: center; }
.bugs-col-who { width: 140px; }
.bugs-col-date { width: 80px; text-align: right; }

.bug-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.1s;
}
.bug-row:hover { background: #f8f9fa; }
.bug-row-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bug-row-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bug-row-prio {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: #fee2e2;
    color: #dc2626;
    flex-shrink: 0;
}
.bug-row-cat {
    width: 70px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.bug-row-who {
    width: 140px;
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.bug-row-date {
    width: 80px;
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    flex-shrink: 0;
}

/* Bug detail (expanded) */
.bug-detail {
    padding: var(--space-3) 0 var(--space-3) 18px;
    border-bottom: 1px solid var(--border-light);
}
.bug-detail-files {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.bug-detail-files a {
    font-size: 11px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}
.bug-detail-files a:hover { text-decoration: underline; }
.bug-detail-notes {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: #f0fdf4;
    border-radius: var(--radius);
    font-size: 12px;
    color: #166534;
}
.bug-detail-controls {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

/* ── Bug paste zone (clipboard screenshot) ── */
.bug-paste-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    background: var(--light);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    min-height: 56px;
    display: flex;
    align-items: center;
}
.bug-paste-zone:hover,
.bug-paste-zone:focus-within {
    border-color: var(--navy);
    background: #fafbff;
}
.bug-paste-zone.dragover {
    border-color: var(--navy);
    border-style: solid;
    background: #eef2ff;
}
.bug-paste-placeholder {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray);
    font-size: var(--fs-sm);
    width: 100%;
}
.bug-paste-placeholder svg { flex-shrink: 0; color: var(--muted); }
.bug-paste-link {
    color: var(--navy);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.bug-paste-link:hover { color: var(--navy-hover); }
.bug-paste-preview {
    position: relative;
    display: inline-block;
}
.bug-paste-preview img {
    max-height: 120px;
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    object-fit: contain;
}
.bug-paste-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: var(--red);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    padding: 0;
    transition: transform 0.15s;
}
.bug-paste-remove:hover { transform: scale(1.15); }

/* ── File attachment row ── */
.bug-file-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.bug-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--sans);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    padding: 6px 14px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-pill);
    transition: all 0.15s;
}
.bug-file-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}
.bug-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 8px 4px 10px;
    max-width: 100%;
}
.bug-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.bug-file-chip svg { flex-shrink: 0; color: var(--muted); }
.bug-file-chip button {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.bug-file-chip button:hover { color: var(--red); }

/* ═══════════════════════════════════
   RESPONSIVE — TABLET (≤768px)
   ═══════════════════════════════════ */
@media (max-width: 768px) {
    .container { padding: var(--space-5) var(--space-4) 60px; }
    .field-row { grid-template-columns: 1fr; }
    .topbar { padding: 0 var(--space-4); }
    .topbar-title { font-size: var(--fs-lg); }
    .fin-grid { grid-template-columns: 1fr; }
    .status-bar { flex-wrap: wrap; gap: var(--space-3); }
    .export-sec { flex-wrap: wrap; }
    .upload-screen { padding-top: var(--space-10); }
    .upload-screen h1 { font-size: var(--fs-3xl); }
    .dashboard-screen { margin: var(--space-6) auto; }
    .dashboard-header { margin-bottom: var(--space-6); }

    /* Admin panels */
    .admin-panel-head { padding: var(--space-3) var(--space-4); }
    .admin-panel-body { padding: 0 var(--space-4) var(--space-4); }
    .filter-bar { gap: var(--space-1); }
    .form-inline { flex-wrap: wrap; }

    /* Dashboard header */
    .dashboard-header { flex-wrap: wrap; gap: var(--space-3); }
    .dashboard-search { max-width: 100%; order: 2; }

    /* Dashboard table → stacked */
    .rpt-head { display: none; }
    .rpt-row {
        flex-wrap: wrap;
        padding: var(--space-3) 0;
        gap: var(--space-1);
    }
    .rpt-col-check { width: auto; }
    .rpt-col-name { flex: 1 1 100%; font-size: 13px; }
    .rpt-col-year { width: auto; font-size: var(--fs-sm); }
    .rpt-col-pipeline { width: auto; }
    .pipeline-label { display: none; }
    .rpt-col-updated { min-width: auto; text-align: left; }

    /* Bugs toolbar */
    .bugs-toolbar { flex-direction: column; align-items: stretch; }
    .bugs-tabs { overflow-x: auto; }

    /* Drawers full-width on tablet */
    .bug-drawer { width: 100%; right: -100%; }
    .chat-drawer { width: 100%; left: -100%; }
    .bug-fab { bottom: 20px; right: 20px; width: 44px; height: 44px; }
    .chat-fab { bottom: 20px; left: 20px; width: 44px; height: 44px; }
}

/* ═══════════════════════════════════
   RESPONSIVE — MOBILE (≤480px)
   ═══════════════════════════════════ */
@media (max-width: 480px) {
    .topbar {
        height: 48px;
    }
    .topbar-left img { height: 22px; }
    .topbar-title { font-size: var(--fs-base); }
    .topbar-right .btn { font-size: var(--fs-sm); padding: 6px var(--space-3); }

    .upload-screen h1 { font-size: var(--fs-2xl); }
    .upload-area { padding: var(--space-8) var(--space-5); }

    .toast {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }
}
