/* TSL Services — Portal dla Przewoźnika — redesign */

/* ═══════════════════════════════════════════════
   CSS Variables (design tokens)
   ═══════════════════════════════════════════════ */
:root {
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-foreground: #ffffff;
    --secondary: #eef4ff;
    --secondary-foreground: #1e3a8a;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #e0edff;
    --border: #dbe4f0;
    --input-border: #cbd5e1;
    --ring: #2563eb;
    --destructive: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.125rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
    --section-bg: #f8fbff;
    --section-border: #dbe7f5;
    --page-tint: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
}

/* ═══════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════ */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--page-tint);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════ */
h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 0;
    color: var(--foreground);
}

h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--primary);
}

p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    line-height: 1.6;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    color: var(--foreground);
}

/* ═══════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════ */
.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.5;
}

.btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-foreground);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--input-border);
    border-color: var(--border);
    color: var(--muted-foreground);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.btn-outline-primary {
    border: 1px solid var(--border);
    color: var(--foreground);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--accent);
    border-color: var(--input-border);
    color: var(--foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--border);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background-color: var(--accent);
}

.btn-info {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius-md);
}

.btn-info:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-light {
    background-color: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
}

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

.btn-outline-secondary {
    border: 1px solid var(--border);
    color: var(--secondary-foreground);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary);
    border-color: var(--input-border);
}

/* ═══════════════════════════════════════════════
   Form Controls
   ═══════════════════════════════════════════════ */
.form-control,
.form-select {
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--card);
    color: var(--foreground);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--destructive);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

.form-text {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.form-check-input {
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    width: 1.125em;
    height: 1.125em;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    border-color: var(--ring);
}

.invalid-feedback {
    font-size: 0.8rem;
    color: var(--destructive);
}

/* ═══════════════════════════════════════════════
   File Upload Inputs
   ═══════════════════════════════════════════════ */
.upload-field {
    background: #fbfdff;
    border: 1px dashed #93c5fd;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    transition: all 0.2s ease;
}

.upload-field:hover {
    background: #f0f6ff;
    border-color: #60a5fa;
}

.upload-field .form-label {
    font-weight: 600;
    color: var(--secondary-foreground);
    margin-bottom: 0.5rem;
}

.upload-field .form-control {
    border: 1px solid var(--border);
    background: var(--card);
}

.upload-field .form-control:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.upload-field .form-text {
    margin-top: 0.375rem;
}

/* ═══════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: var(--card);
    overflow: hidden;
}

.card-body {
    padding: 1.75rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary);
}

/* ═══════════════════════════════════════════════
   Alerts
   ═══════════════════════════════════════════════ */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 1rem 1.25rem;
}

.alert p {
    font-size: 0.875rem;
    padding-top: 0;
    padding-bottom: 0.25rem;
}

.alert-primary {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    border-left: 4px solid var(--primary);
    color: #1e40af;
}

.alert-info {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    border-left: 4px solid #0284c7;
    color: #075985;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    border-left: 4px solid var(--success);
    color: #166534;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    border-left: 4px solid var(--destructive);
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    border-left: 4px solid var(--warning);
    color: #92400e;
}

/* ═══════════════════════════════════════════════
   Navbar (top)
   ═══════════════════════════════════════════════ */
.navbar {
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.navbar-light {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar .navbar-brand a {
    text-decoration: none;
}

.navbar .nav-link-manual {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 0.15s ease;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

.navbar .nav-link-manual:hover {
    color: var(--primary);
    background-color: var(--secondary);
}

.navbar .lang-flag {
    transition: opacity 0.15s ease, transform 0.15s ease;
    border-radius: 4px;
}

.navbar .lang-flag:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════
   Bottom Navbar
   ═══════════════════════════════════════════════ */
.lower-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    z-index: 1000;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.04);
}

/* ═══════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════ */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    background-color: var(--card);
}

.modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem;
    font-size: 0.875rem;
    color: var(--foreground);
}

.modal-body p {
    font-size: 0.875rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background-color: var(--muted);
}

.modal-header .alert {
    margin-bottom: 0;
}

.modal-header.bg-success {
    background-color: var(--success) !important;
    border-bottom-color: var(--success);
}

/* ═══════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════ */
.table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background-color: var(--muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table-light,
.table-light td,
.table-light tr {
    background-color: var(--card) !important;
}

table.table-light tr td:nth-child(2) {
    text-align: right;
    font-weight: 500;
}

.table-bordered {
    border: 1px solid var(--border);
}

.table-secondary {
    background-color: var(--muted) !important;
}

/* ═══════════════════════════════════════════════
   Progress Bar
   ═══════════════════════════════════════════════ */
.progress {
    height: 12px;
    border-radius: 999px;
    background-color: #e8eef8;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%);
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%) !important;
}

/* ═══════════════════════════════════════════════
   Tooltips
   ═══════════════════════════════════════════════ */
.tooltip-inner {
    max-width: 350px;
    width: 350px;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
}

.bi-info-circle {
    color: var(--muted-foreground);
    transition: color 0.15s ease;
}

.bi-info-circle:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════
   Layout Utilities
   ═══════════════════════════════════════════════ */
.half-width {
    width: 50%;
}

.desktop {
    display: block;
}

.mobile {
    display: none;
}

/* ═══════════════════════════════════════════════
   Page Shell — main card wrapper
   ═══════════════════════════════════════════════ */
.page-shell {
    max-width: 960px;
    width: 100%;
    margin: 2rem auto 6rem;
    padding: 0 1rem;
}

.main-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 32px 36px;
}

/* ═══════════════════════════════════════════════
   Form Sections — inner grouping
   ═══════════════════════════════════════════════ */
.form-section {
    background: var(--section-bg);
    border: 1px solid var(--section-border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--section-border);
}

/* ═══════════════════════════════════════════════
   File Upload Section (legacy class compat)
   ═══════════════════════════════════════════════ */
.file-upload-section {
    background-color: var(--muted);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   Page-specific: Description Banner
   ═══════════════════════════════════════════════ */
.description-banner {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.description-banner p {
    color: var(--foreground);
    font-size: 0.9rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* ═══════════════════════════════════════════════
   Page-specific: CTA Card
   ═══════════════════════════════════════════════ */
.cta-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-card);
}

/* ═══════════════════════════════════════════════
   Page-specific: Payment Status Colors
   ═══════════════════════════════════════════════ */
.status-value {
    color: var(--primary);
    font-weight: 500;
}

.status-paid {
    color: var(--success) !important;
    font-weight: 700 !important;
}

.status-error {
    color: var(--destructive) !important;
}

.status-pending {
    color: var(--muted-foreground);
}

.status-label {
    color: var(--success);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   Sync Time Info
   ═══════════════════════════════════════════════ */
.sync-info {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: 1.5rem;
    padding: 0;
}

.sync-info img {
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   IT Help Button (floating)
   ═══════════════════════════════════════════════ */
.it-help-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.25);
}

/* ═══════════════════════════════════════════════
   Error Pages
   ═══════════════════════════════════════════════ */
#page {
    background-color: var(--card);
    width: 60%;
    margin: 24px auto;
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

#header {
    padding: 6px;
    text-align: center;
    border-radius: var(--radius-md);
}

.status3xx { background-color: #475076; color: #FFFFFF; border-radius: var(--radius-md); }
.status4xx { background-color: var(--destructive); color: #FFFFFF; border-radius: var(--radius-md); }
.status5xx { background-color: #fbbf24; color: #000000; border-radius: var(--radius-md); }

#content { padding: 1rem 0 1.5rem 0; }

#footer {
    color: var(--muted-foreground);
    background: var(--muted);
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

#footer a { color: var(--muted-foreground); }

/* ═══════════════════════════════════════════════
   Help Form Card Wrapper
   ═══════════════════════════════════════════════ */
.help-form-wrapper {
    max-width: 640px;
    width: 100%;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

/* ═══════════════════════════════════════════════
   Success Page Card
   ═══════════════════════════════════════════════ */
.success-card {
    max-width: 580px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ═══════════════════════════════════════════════
   Content Card (for main form area)
   ═══════════════════════════════════════════════ */
.content-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 2.5rem 2rem;
    width: 100%;
}

/* ═══════════════════════════════════════════════
   Success Icon (checkmark circle)
   ═══════════════════════════════════════════════ */
.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: hsl(142, 71%, 95%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(142, 71%, 40%);
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════
   Separator
   ═══════════════════════════════════════════════ */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* ═══════════════════════════════════════════════
   Info Panel — for info banners inside cards
   ═══════════════════════════════════════════════ */
.info-panel {
    background: var(--secondary);
    border: 1px solid var(--section-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--secondary-foreground);
}

.info-panel p {
    padding-top: 0;
    padding-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--secondary-foreground);
}

.info-panel p:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.info-panel a {
    color: var(--primary);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   Action Footer inside card
   ═══════════════════════════════════════════════ */
.action-footer {
    background: var(--muted);
    border-top: 1px solid var(--border);
    margin: 1.5rem -2rem -2.5rem;
    padding: 1.25rem 2rem;
    border-radius: 0 0 24px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ═══════════════════════════════════════════════
   Payment status card wrapper
   ═══════════════════════════════════════════════ */
.payment-result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 28px 32px;
    margin-bottom: 2rem;
}

.payment-result-card .table {
    border: none;
    margin-bottom: 0;
}

.payment-result-card .table td {
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1rem;
}

.payment-result-card .table tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .half-width {
        width: 100%;
    }

    .desktop {
        display: none;
    }

    .mobile {
        display: block;
    }

    .lower-navbar {
        flex-direction: column;
        align-items: center;
    }

    .content-card {
        margin: 0 0.5rem;
        padding: 1.5rem 1.25rem;
        border-radius: 18px;
    }

    .help-form-wrapper {
        width: 100% !important;
        margin: 0 0.5rem;
    }

    .page-shell {
        margin: 1rem auto 5rem;
        padding: 0 0.5rem;
    }

    .main-card {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .form-section {
        padding: 16px;
        border-radius: 14px;
    }

    .upload-field {
        padding: 12px 14px;
    }

    .action-footer {
        margin: 1.5rem -1.25rem -1.5rem;
        padding: 1rem 1.25rem;
        border-radius: 0 0 18px 18px;
        flex-direction: column;
    }

    .payment-result-card {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .cta-card {
        border-radius: 18px;
        min-height: 200px;
        padding: 1.5rem;
    }
}

/* Sekcja wszystkich faktur dla NIP */
.nip-invoices-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   Pagination
   ═══════════════════════════════════════════════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.625rem 1rem;
    background: var(--secondary);
    border: 1px solid var(--section-border);
    border-radius: var(--radius-md);
}

.pagination-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--foreground);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-btn:hover {
    background: var(--accent);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
    cursor: default;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.pagination-btn-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   Responsive Card Table (mobile: rows become cards)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .responsive-card-table thead {
        display: none;
    }

    .responsive-card-table tbody tr {
        display: block;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        margin-bottom: 0.75rem;
        padding: 0.75rem 1rem;
        box-shadow: var(--shadow-sm);
    }

    .responsive-card-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.375rem 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.85rem;
    }

    .responsive-card-table tbody td:last-child {
        border-bottom: none;
    }

    .responsive-card-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted-foreground);
        flex-shrink: 0;
        margin-right: 1rem;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }

    .pagination-buttons {
        justify-content: center;
    }
}

/* ============================================================================
   Modal sukcesu + ankieta po wyslaniu dokumentow
   ============================================================================ */

.success-modal-header {
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 1rem 1.25rem;
}

.success-modal-header .modal-title {
    color: var(--primary-foreground);
    font-weight: 600;
}

.success-modal-body {
    padding: 1rem 1.25rem;
}

.success-modal-body .success-line {
    margin: 0;
    line-height: 1.3;
}

/* Ankieta */

.survey-container {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

.survey-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-foreground);
    margin: 0 0 0.5rem 0;
}

.survey-options {
    list-style: none;
    padding: 0;
    margin: 0 0 0.4rem 0;
}

.survey-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    color: var(--foreground);
}

.survey-option:hover {
    background-color: var(--accent);
}

.survey-option.is-selected {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    font-weight: 600;
}

.survey-radio {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--input-border);
    border-radius: 50%;
    flex-shrink: 0;
    background-color: var(--card);
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.survey-option.is-selected .survey-radio {
    border-color: var(--primary);
    background-color: var(--primary);
    box-shadow: inset 0 0 0 3px var(--card);
}

.survey-label {
    font-size: 0.95rem;
}

.survey-explanation-wrapper {
    margin-top: 0.5rem;
}

.survey-explanation-label {
    display: block;
    font-weight: 600;
    color: var(--secondary-foreground);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.survey-explanation-input {
    width: 100%;
    resize: vertical;
}

.survey-submit-btn {
    margin-top: 0.55rem;
    width: 100%;
}

.survey-thanks {
    margin: 0.75rem 0 0 0;
    padding: 0.65rem 0.85rem;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
}

