/* ============================================
   ImportPanel v5.0 - Components
   ============================================ */

/* ---- Card ---- */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: cardFadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered card entrance animation */
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 50ms; }
.card:nth-child(3) { animation-delay: 100ms; }
.card:nth-child(4) { animation-delay: 150ms; }
.card:nth-child(5) { animation-delay: 200ms; }
.card:nth-child(6) { animation-delay: 250ms; }
.card:nth-child(7) { animation-delay: 300ms; }
.card:nth-child(8) { animation-delay: 350ms; }

@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Prevent hover lift on static cards (charts, sections) */
.chart-card:hover,
.recent-imports:hover {
    transform: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    /* default padding handled by .card */
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* CSS-only ripple effect on click */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    border-radius: inherit;
}

.btn:active:not(:disabled)::after {
    opacity: 1;
    transition: opacity 0s;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

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

.btn-primary {
    background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border-color: var(--color-primary-hover);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn-primary:active:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: 8px;
}

.btn-secondary:hover {
    background-color: var(--color-primary-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-secondary:active:not(:disabled) {
    background-color: rgba(var(--color-primary-rgb), 0.12);
}

.btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, var(--color-danger) 100%);
    color: var(--color-text-light);
    border-color: var(--color-danger);
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(180deg, var(--color-danger) 0%, var(--color-danger-hover) 100%);
    border-color: var(--color-danger-hover);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

.btn-danger:active:not(:disabled) {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: linear-gradient(180deg, #10b981 0%, var(--color-success) 100%);
    color: var(--color-text-light);
    border-color: var(--color-success);
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.1);
}

.btn-success:hover {
    background: linear-gradient(180deg, var(--color-success) 0%, var(--color-success-hover) 100%);
    border-color: var(--color-success-hover);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.15);
}

.btn-success:active:not(:disabled) {
    background: var(--color-success-hover);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
}

.btn-ghost:active:not(:disabled) {
    background-color: var(--color-border-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-secondary);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
}

.btn-outline:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.btn-outline:active:not(:disabled) {
    background-color: var(--color-border-light);
}

.sp-duplicate-btn {
    margin-right: auto;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ---- Icon Button (circular) ---- */
.btn-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.btn-icon-circle:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-text-muted);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-icon-circle:active:not(:disabled) {
    transform: scale(0.95);
    background-color: var(--color-border-light);
}

.btn-icon-circle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon-circle.btn-icon-circle-primary {
    background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
    color: var(--color-text-light);
    border-color: var(--color-primary);
}

.btn-icon-circle.btn-icon-circle-primary:hover {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
}

.btn-icon-circle.btn-icon-circle-danger {
    background: linear-gradient(180deg, #ef4444 0%, var(--color-danger) 100%);
    color: var(--color-text-light);
    border-color: var(--color-danger);
}

.btn-icon-circle.btn-icon-circle-danger:hover {
    background: linear-gradient(180deg, var(--color-danger) 0%, var(--color-danger-hover) 100%);
}

/* ---- Button Group ---- */
.btn-group {
    display: inline-flex;
    align-items: center;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
    position: relative;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
    margin-left: 0;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

.btn-group .btn:only-child {
    border-radius: 8px;
}

.btn-group .btn:hover,
.btn-group .btn:focus-visible {
    z-index: 1;
}

.btn-group .btn.active {
    z-index: 2;
}

/* ---- Inputs ---- */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.input-group label {
    font-weight: 500;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
input[type="tel"],
select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

textarea {
    width: 100%;
    height: auto;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    padding-right: 36px;
    border-radius: 8px;
    cursor: pointer;
}

select:hover:not(:disabled):not(:focus-visible) {
    border-color: var(--color-text-muted);
}

/* ---- Checkboxes & Toggles ---- */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    border-radius: 3px;
}

input[type="checkbox"]:checked {
    animation: checkboxPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkboxPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Toggle switch styling */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.toggle-switch input[type="checkbox"] {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

.toggle-slider {
    transition: background-color 0.3s ease, box-shadow 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-slider::before {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: box-shadow 0.15s ease;
}

.badge-success {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.badge-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

.badge-info {
    background-color: var(--color-info-light);
    color: var(--color-info);
}

.badge-default {
    background-color: var(--color-surface-alt);
    color: var(--color-text-secondary);
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFadeIn 250ms ease forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background-color: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    width: 100%;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }

/* Mobile-first modal improvements */
@media (max-width: 768px) {
    .modal-backdrop {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .modal {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
        max-height: 90vh !important;
        animation: modalSlideUp 320ms cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
        margin: 0 !important;
    }

    @keyframes modalSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .modal-sm,
    .modal-md,
    .modal-lg {
        max-width: 100% !important;
        width: 100% !important;
    }

    .modal-header {
        padding: 18px 20px;
        position: relative;
    }

    /* Drag handle indicator on modal top */
    .modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--color-border);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 18px 20px;
        max-height: calc(90vh - 140px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 14px 20px;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
        background: var(--color-surface);
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
        z-index: 10;
    }

    /* Larger close button touch target */
    .modal-close {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    /* Stack footer buttons on very small screens */
    .modal-footer {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 16px 18px;
    }

    .modal-body {
        padding: 16px 18px;
    }

    .modal-footer {
        padding: 12px 18px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        gap: 8px;
    }

    .modal-footer .btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-light);
    background-color: rgba(0, 0, 0, 0.015);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-size: 18px;
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    transform: scale(1.05);
}

.modal-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border-light);
}

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background-color: var(--color-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 14px 16px 14px 14px;
    min-width: 300px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid var(--color-border);
    animation: toastSlideIn 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
}

.toast-removing {
    animation: toastSlideOut 250ms ease forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text);
    padding-top: 5px;
}

.toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-fast);
    padding: 0;
    margin-top: 3px;
    font-size: 12px;
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: var(--color-text);
    transform: scale(1.1);
}

/* Toast type variants */
.toast-success {
    border-left-color: var(--color-success);
    background-color: rgba(5, 150, 105, 0.04);
}
.toast-success .toast-icon {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-danger);
    background-color: rgba(220, 38, 38, 0.04);
}
.toast-error .toast-icon {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

.toast-warning {
    border-left-color: var(--color-warning);
    background-color: rgba(217, 119, 6, 0.04);
}
.toast-warning .toast-icon {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
}

.toast-info {
    border-left-color: var(--color-info);
    background-color: rgba(2, 132, 199, 0.04);
}
.toast-info .toast-icon {
    background-color: var(--color-info-light);
    color: var(--color-info);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-success .toast-progress { background: var(--color-success); }
.toast-error .toast-progress { background: var(--color-danger); }
.toast-warning .toast-progress { background: var(--color-warning); }
.toast-info .toast-progress { background: var(--color-info); }

/* Toast action button (custom action button, e.g., "Spróbuj ponownie") */
.toast-action {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.1s ease;
    text-transform: uppercase;
}

.toast-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toast-action:active:not(:disabled) {
    transform: translateY(0);
}

.toast-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toast-success .toast-action {
    background: var(--color-success);
    color: #fff;
}
.toast-success .toast-action:hover {
    background: var(--color-success-hover);
}

.toast-error .toast-action {
    background: var(--color-danger);
    color: #fff;
}
.toast-error .toast-action:hover {
    background: var(--color-danger-hover);
}

.toast-warning .toast-action {
    background: var(--color-warning);
    color: #fff;
}
.toast-warning .toast-action:hover {
    background: #b45309;
}

.toast-info .toast-action {
    background: var(--color-info);
    color: #fff;
}
.toast-info .toast-action:hover {
    background: #0369a1;
}

/* ---- Offline Banner (network error) ---- */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: var(--z-modal);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: offlineBannerSlideIn 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.offline-banner-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offline-banner-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.offline-banner-text {
    font-weight: 600;
    letter-spacing: 0.01em;
}

@keyframes offlineBannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Connectivity Dot (topbar indicator) ---- */
.connectivity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.connectivity-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.connectivity-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    animation: connectivityPulse 2s ease-in-out infinite;
}

@keyframes connectivityPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ---- Dropdown ---- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    min-width: 180px;
    z-index: 250;
    padding: 4px 0;
    display: none;
    animation: dropdownSlideDown 180ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transform-origin: top center;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scaleY(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: var(--color-surface-alt);
}

.dropdown-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    background-color: var(--color-surface-alt);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-secondary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-border-light);
    margin: 4px 0;
}

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    background-image: radial-gradient(circle, var(--color-border-light) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center;
    border-radius: var(--radius-lg);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 16px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
}

/* ---- Table ---- */
.table-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 75vh;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background-color: var(--color-surface);
    font-weight: 600;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Shadow on sticky header when table is scrolled */
.table-wrapper.table-scrolled thead th {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Column resize indicator (item 13) */
thead th:not(:last-child) {
    border-right: 2px solid transparent;
}

thead th:not(:last-child):hover {
    border-right-color: var(--color-border-light);
}

/* ---- Multi-column Sort Indicators ---- */
thead th[aria-sort] .sort-header-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

thead th.sort-active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb, 59, 130, 246), 0.05);
    position: relative;
}

thead th.sort-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    opacity: 0.4;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}

.sort-arrow {
    font-size: 10px;
    line-height: 1;
    opacity: 0.85;
    color: var(--color-primary);
}

.sort-priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Sort header hover hint */
thead th[aria-sort]:hover .sort-header-label::after {
    content: '\25B2\25BC';
    font-size: 8px;
    opacity: 0.3;
    margin-left: 2px;
    letter-spacing: -1px;
}

thead th.sort-active:hover .sort-header-label::after {
    display: none;
}

/* Clear sort bar */
.sort-clear-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    background: var(--color-primary-light, rgba(59, 130, 246, 0.06));
    border: 1px solid var(--color-border-light);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-size: 12px;
}

.sort-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sort-clear-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.sort-clear-btn svg {
    flex-shrink: 0;
}

.sort-clear-summary {
    color: var(--color-text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* When sort bar is present, remove top border-radius from table wrapper */
.sort-clear-bar + .table-wrapper {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    transition: background-color 0.15s ease;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Zebra striping (item 11) */
tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Table row hover highlight animation (enhanced) */
tbody tr {
    transition: background-color 0.15s ease, border-left-color 0.15s ease, transform 0.15s ease;
    border-left: 3px solid transparent;
}

tbody tr:hover {
    background-color: rgba(30, 58, 95, 0.04);
    border-left-color: var(--color-primary);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    gap: 0;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover {
    color: var(--color-text);
}

.tab:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ---- Stat Card (Clean Depth) ---- */
.stat-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    border-left: 4px solid var(--color-primary);
    transition: all 0.2s ease;
}

.stat-card:nth-child(1) { border-left-color: #3b82f6; }
.stat-card:nth-child(2) { border-left-color: #059669; }
.stat-card:nth-child(3) { border-left-color: #d97706; }
.stat-card:nth-child(4) { border-left-color: #dc2626; }
.stat-card:nth-child(5) { border-left-color: #8b5cf6; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.stat-card-top > div:first-child {
    min-width: 0;
    flex: 1;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg {
    width: 20px;
    height: 20px;
}

/* Stat icon color variants */
.stat-icon-blue { background: #eff6ff; color: #3b82f6; }
.stat-icon-green { background: #ecfdf5; color: #059669; }
.stat-icon-orange { background: #fffbeb; color: #d97706; }
.stat-icon-navy { background: #eef2ff; color: #1e3a5f; }
.stat-icon-red { background: #fef2f2; color: #dc2626; }

[data-theme="dark"] .stat-icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
[data-theme="dark"] .stat-icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="dark"] .stat-icon-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .stat-icon-navy { background: rgba(79, 143, 247, 0.15); color: #4f8ff7; }
[data-theme="dark"] .stat-icon-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Stat accent line (bottom edge) */
.stat-accent-line {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 60px;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

/* ---- Loading Placeholder ---- */
.skeleton {
    background: linear-gradient(
        105deg,
        var(--color-surface-alt) 0%,
        var(--color-surface-alt) 30%,
        rgba(30, 58, 95, 0.04) 45%,
        var(--color-border-light) 50%,
        rgba(30, 58, 95, 0.04) 55%,
        var(--color-surface-alt) 70%,
        var(--color-surface-alt) 100%
    );
    background-size: 300% 100%;
    animation: skeletonPulse 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonPulse {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---- Search Input ---- */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 40px;
}

.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
}

/* ---- File Upload Zone ---- */
.file-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    background-color: var(--color-surface-alt);
    text-align: center;
}

.file-upload-zone:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.file-upload-zone-active {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.file-upload-icon {
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.file-upload-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 4px 0 0;
}

.file-upload-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.file-upload-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-upload-file-icon {
    color: var(--color-primary);
    flex-shrink: 0;
}

.file-upload-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-upload-file-size {
    font-size: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.file-upload-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.file-upload-remove:hover {
    color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.1);
}

.file-upload-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.file-upload-error {
    font-size: 13px;
    color: var(--color-danger);
    margin-top: 8px;
    padding: 8px 12px;
    background-color: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius-sm);
}

/* ---- Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spinnerRotate 600ms linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
}

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

/* ---- Attachment List ---- */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.attachment-item:hover {
    background-color: var(--color-border-light);
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.attachment-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
    display: flex;
}

.attachment-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

.attachment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.attachment-actions .btn-xs {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-actions .attachment-download:hover {
    color: var(--color-primary);
}

.attachment-actions .attachment-delete:hover {
    color: var(--color-danger);
}

/* ---- Wizard Steps ---- */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 0 32px;
    position: relative;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.wizard-step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    background-color: var(--color-surface-alt);
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.wizard-step.active .wizard-step-num {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15);
    animation: wizardStepPulse 2s ease-in-out infinite;
}

@keyframes wizardStepPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(var(--color-primary-rgb), 0.08); }
}

.wizard-step.completed .wizard-step-num {
    background-color: var(--color-success);
    color: var(--color-text-light);
    border-color: var(--color-success);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    font-size: 0;
}

/* Checkmark for completed steps */
.wizard-step.completed .wizard-step-num::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.wizard-step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.wizard-step.active .wizard-step-label {
    color: var(--color-text);
    font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
    color: var(--color-success);
}

.wizard-step-line {
    width: 60px;
    height: 3px;
    background-color: var(--color-border);
    margin: 0 12px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
    position: relative;
}

/* Filled connecting line for completed steps */
.wizard-step.completed + .wizard-step-line {
    background-color: var(--color-success);
}

.wizard-step-content {
    padding: 0 8px 8px;
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- CSV Mode Selector ---- */
.csv-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-label:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.radio-label input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

.radio-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-text strong {
    font-size: 14px;
    color: var(--color-text);
}

.radio-text small {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ---- CSV Mapping Grid ---- */
.csv-mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.csv-mapping-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-fast);
}

.csv-mapping-item:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.015);
}

.csv-mapping-item.mapped {
    background-color: rgba(34, 197, 94, 0.06);
    border-left: 3px solid var(--color-success);
}

.csv-mapping-item.unmapped {
    background-color: var(--color-surface-alt);
    opacity: 0.6;
    border-left: 3px solid var(--color-border);
}

.csv-mapping-item:hover {
    border-color: var(--color-primary);
}

.csv-mapping-csv {
    font-weight: 500;
    color: var(--color-text);
}

.csv-mapping-arrow {
    color: var(--color-text-muted);
    font-size: 11px;
}

.csv-mapping-db {
    color: var(--color-text-secondary);
}

.csv-mapping-item.mapped .csv-mapping-db {
    color: var(--color-success);
    font-weight: 500;
}

/* ---- CSV Preview Table ---- */
.csv-preview-table {
    font-size: 12px;
    border-collapse: collapse;
    width: 100%;
}

.csv-preview-table th.mapped-col {
    color: var(--color-success);
}

.csv-preview-table th.unmapped-col {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.csv-preview-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.018);
}

.csv-preview-table tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb), 0.04);
}

/* ---- CSV Errors ---- */
.csv-error-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.02);
}

.csv-error-item {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-danger);
    transition: background-color var(--transition-fast);
}

.csv-error-item:hover {
    background-color: rgba(239, 68, 68, 0.04);
}

.csv-error-item:last-child {
    border-bottom: none;
}

/* ---- Table Responsive ---- */
.table-responsive {
    overflow-x: auto;
}

/* ---- Button Extra Sizes ---- */
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

/* ---- Changelog ---- */
.changelog-list {
    max-height: 300px;
    overflow-y: auto;
}

.changelog-entry {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    align-items: baseline;
}

.changelog-date {
    color: var(--color-text-muted);
    min-width: 120px;
}

.changelog-user {
    color: var(--color-primary);
    font-weight: 600;
    min-width: 80px;
}

.changelog-detail {
    color: var(--color-text-secondary);
    flex: 1;
}

.changelog-detail strong {
    color: var(--color-text);
}

.changelog-detail em {
    font-style: normal;
    background: var(--color-bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
}

/* ---- Dark Theme Solid Surfaces (Brutalist) ---- */
[data-theme="dark"] .modal {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .toast {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
}

/* ---- Dark Theme Focus States ---- */
[data-theme="dark"] input:focus-visible,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* ---- Dark Theme Skeleton Fix ---- */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-alt) 50%, var(--color-surface) 75%);
    background-size: 200% 100%;
}

/* ---- Dark Theme Empty State ---- */
[data-theme="dark"] .empty-state svg {
    opacity: 0.4;
    color: #60a5fa;
}

[data-theme="dark"] .empty-state {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

/* ---- Dark Theme Select Arrow ---- */
[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- Dark Theme File Upload & Radio ---- */
[data-theme="dark"] .file-upload-zone:hover,
[data-theme="dark"] .file-upload-zone-active {
    background-color: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .radio-label:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.pagination-btn.active {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
}

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

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 6px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ---- Button Loading Spinner (item 8) ---- */
.btn-loading {
    pointer-events: none;
    opacity: 0.75;
    position: relative;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-text-light);
    border-radius: 50%;
    animation: spinnerRotate 600ms linear infinite;
}

.btn-secondary.btn-loading .btn-spinner,
.btn-ghost.btn-loading .btn-spinner {
    border-color: rgba(59, 130, 246, 0.2);
    border-top-color: var(--color-primary);
}

/* ---- Form Field Validation (item 9) ---- */

/* Smooth transition on border for validation feedback */
.input-group input,
.input-group select,
.input-group textarea {
    transition: border-color 0.2s ease, border-left-width 0.2s ease, box-shadow 0.2s ease;
}

.input-group.field-valid input,
.input-group.field-valid select,
.input-group.field-valid textarea {
    border-color: var(--color-success);
    border-left: 3px solid var(--color-success);
}

.input-group.field-valid input:focus-visible,
.input-group.field-valid select:focus-visible,
.input-group.field-valid textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.input-group.field-invalid input,
.input-group.field-invalid select,
.input-group.field-invalid textarea {
    border-color: var(--color-danger);
    border-left: 3px solid var(--color-danger);
}

.input-group.field-invalid input:focus-visible,
.input-group.field-invalid select:focus-visible,
.input-group.field-invalid textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Error text below invalid field */
.input-group .field-error {
    display: none;
    font-size: 12px;
    color: var(--color-danger);
    margin-top: 4px;
    line-height: 1.3;
}

/* Shake animation for submit validation errors */
.input-group.field-shake {
    animation: fieldShake 0.4s ease;
}

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(5px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(1px); }
}

/* Green checkmark icon for valid fields */
.input-group.field-valid label::after {
    content: ' ✓';
    color: var(--color-success);
    font-size: 14px;
    font-weight: 700;
    margin-left: 4px;
    animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Red X icon for invalid fields */
.input-group.field-invalid label::after {
    content: ' ✗';
    color: var(--color-danger);
    font-size: 14px;
    font-weight: 700;
    margin-left: 4px;
}

/* Form Progress Indicator */
.form-progress-indicator {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-progress-bar-wrap {
    flex: 1;
    position: relative;
}

.form-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.form-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.form-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.form-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.form-progress-bar-fill.complete {
    background: linear-gradient(90deg, var(--color-success) 0%, #10b981 100%);
}

.form-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

.form-progress-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.form-progress-icon.complete {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

/* Enhanced field hints for complex inputs */
.input-group .field-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-style: italic;
}

.input-group .field-hint svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ---- Character Count for Textarea (item 10) ---- */
.char-count {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    transition: color 0.15s ease;
}

.char-count.near-limit {
    color: var(--color-warning);
}

.char-count.at-limit {
    color: var(--color-danger);
    font-weight: 500;
}

/* ---- Enhanced Empty State (items 5-7) ---- */
.empty-state-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    background-image: radial-gradient(circle, var(--color-border-light) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center;
    border-radius: var(--radius-lg);
}

.empty-state-enhanced .empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-light), rgba(47, 184, 255, 0.08));
}

.empty-state-enhanced .empty-state-icon svg {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    opacity: 0.75;
}

.empty-state-enhanced h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.empty-state-enhanced p {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.empty-state-enhanced .btn {
    margin-top: 12px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
}

/* ---- Tag Pills ---- */
.tag-pills-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.tag-add-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px dashed var(--color-border);
    background: none;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.tag-add-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ---- Tag Editor Popover ---- */
.tag-editor {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 12px;
    width: 260px;
    animation: dropdownFadeIn 0.12s ease-out;
}

.tag-editor-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.tag-editor-current {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.tag-editor-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.tag-editor-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.tag-editor-remove:hover {
    color: #fff;
}

.tag-editor-input-row {
    margin-bottom: 8px;
}

.tag-editor-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
}

.tag-editor-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12);
}

.tag-editor-colors {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.tag-color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.1s ease;
    padding: 0;
}

.tag-color-btn:hover {
    transform: scale(1.15);
}

.tag-color-btn.active {
    border-color: var(--color-text);
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-text-muted);
}

.tag-editor-suggestions {
    border-top: 1px solid var(--color-border-light);
    padding-top: 8px;
}

.tag-editor-sug-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.tag-editor-sug-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--color-text);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.1s;
}

.tag-editor-sug-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

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

/* ---- Keyboard Shortcuts Modal ---- */
.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}

.shortcut-row:hover {
    background: var(--color-surface-alt);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.shortcut-arrow {
    font-size: 11px;
    color: var(--color-text-muted);
    margin: 0 2px;
}

.shortcut-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: right;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: 6px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

/* ---- Side Panel ---- */
.side-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 249;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.side-panel-backdrop.open {
    opacity: 1;
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 250;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.side-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.side-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.side-panel-nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.side-panel-nav-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}

.side-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.side-panel-close:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.side-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

/* Side panel preview styles */
.sp-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.sp-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sp-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
}

.sp-section:last-child {
    border-bottom: none;
}

.sp-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.sp-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 13px;
}

.sp-field-label {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.sp-field-value {
    color: var(--color-text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.sp-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 8px 0;
}

.sp-empty {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
}

.sp-changelog-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 12px;
}

.sp-changelog-entry:last-child {
    border-bottom: none;
}

.sp-changelog-date {
    color: var(--color-text-muted);
    font-size: 11px;
}

.sp-changelog-detail {
    color: var(--color-text-secondary);
}

.sp-changelog-detail strong {
    color: var(--color-text);
}

.sp-changelog-detail em {
    font-style: normal;
    background: var(--color-surface-alt);
    padding: 1px 4px;
    border-radius: 3px;
}

/* ---- Comments section in side panel ---- */
.sp-comments-list { padding: 0 20px 8px; max-height: 300px; overflow-y: auto; }
.sp-comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border-light); }
.sp-comment:last-child { border-bottom: none; }
.sp-comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary-light, rgba(79, 143, 247, 0.1)); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sp-comment-body { flex: 1; min-width: 0; }
.sp-comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sp-comment-author { font-size: 13px; font-weight: 600; color: var(--color-text); }
.sp-comment-time { font-size: 11px; color: var(--color-text-muted); }
.sp-comment-content { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.sp-comment-form { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--color-border-light); }
.sp-comment-input { flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; font-family: inherit; min-height: 36px; max-height: 80px; background: var(--color-surface); color: var(--color-text); }
.sp-comment-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15); }
.sp-comment-submit { padding: 8px 16px; background: var(--color-primary); color: #fff; border: none; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.15s ease; }
.sp-comment-submit:hover { filter: brightness(1.1); }
.sp-comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.sp-comment-empty { text-align: center; padding: 16px; color: var(--color-text-muted); font-size: 13px; }

/* Active row highlight for side panel */
tr.sp-active {
    box-shadow: inset 3px 0 0 var(--color-primary);
    background: rgba(30, 58, 95, 0.04) !important;
}

@media (max-width: 640px) {
    .side-panel {
        width: 100vw;
    }
}

/* ---- Notification Bell ---- */
.topbar-notifications {
    position: relative;
}

.notification-bell {
    position: relative;
}

.notification-bell-icon {
    display: flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    border: 2px solid var(--color-surface, #fff);
    animation: notifBadgePop 0.3s ease;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

@keyframes notifBadgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 200;
    margin-top: 8px;
    overscroll-behavior: contain;
}

.notification-dropdown.open {
    display: flex;
    flex-direction: column;
    animation: notifDropdownSlide 0.18s ease;
}

@keyframes notifDropdownSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-muted);
    padding: 2px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.notification-close:hover {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

/* Legacy classes kept for compatibility */
.notification-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light, #f0f0f0);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--color-primary-light);
}

.notification-item-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.notification-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
}

.notification-item-days {
    font-weight: 600;
}

.notification-urgent {
    border-left-color: var(--color-danger);
}

.notification-urgent .notification-item-days {
    color: var(--color-danger);
}

.notification-soon {
    border-left-color: var(--color-warning);
}

.notification-soon .notification-item-days {
    color: var(--color-warning);
}

.notification-normal {
    border-left-color: var(--color-success);
}

.notification-normal .notification-item-days {
    color: var(--color-success);
}

.notification-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13px;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Sidebar Count Badges ---- */
.sidebar-badge {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Importy badge: primary color style */
.sidebar-badge[data-badge="imports"] {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

/* Archiwum badge: muted style */
.sidebar-badge[data-badge="archive"] {
    background-color: var(--color-surface-alt);
    color: var(--color-text-muted);
}

/* Hide badges when sidebar is collapsed */
.collapsed .sidebar-badge {
    display: none !important;
}

/* ---- Trend Indicators ---- */
.stat-trend {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    vertical-align: middle;
}
.trend-up {
    color: var(--color-success);
    background-color: rgba(34, 197, 94, 0.1);
}
.trend-down {
    color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.1);
}
.trend-neutral {
    color: var(--color-text-muted);
}

/* ---- Side Panel Mobile Fix ---- */
@media (max-width: 768px) {
    .side-panel {
        width: 100% !important;
        max-width: 100vw;
    }
}

/* ============================================
   Mobile Responsiveness Improvements
   ============================================ */

/* ---- Table scroll shadow indicators (CSS-only) ---- */
@media (max-width: 768px) {
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Reduce table border-radius for tighter mobile look */
    .table-wrapper {
        border-radius: var(--radius-md);
    }
}

/* ---- Compact stat cards on mobile (2-column) ---- */
@media (max-width: 768px) {
    .stat-card {
        min-width: 0 !important;
        flex: none !important;
    }

    .stat-card:hover {
        transform: none; /* Disable hover lift on touch devices */
        box-shadow: none;
    }

    .stat-accent-line {
        left: 12px;
        width: 40px;
    }

    .stat-trend {
        font-size: 10px;
        padding: 1px 4px;
        margin-left: 4px;
    }
}

@media (max-width: 480px) {
    .stat-card-top {
        gap: 8px;
    }

    .stat-accent-line {
        left: 10px;
        width: 30px;
        height: 2px;
    }

    .stat-trend {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
}

/* ---- Full-width modals on mobile ---- */
@media (max-width: 768px) {
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
}

/* ---- Touch targets: all clickable elements min 44px ---- */
@media (max-width: 768px) {
    /* Tabs need larger touch targets */
    .tab {
        padding: 14px 16px;
        font-size: 13px;
    }

    /* File upload remove button */
    .file-upload-remove {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Notification items need more padding */
    .notification-item {
        padding: 14px 16px;
    }

    /* Wizard step numbers */
    .wizard-step-num {
        width: 36px;
        height: 36px;
    }

    /* Comments submit button */
    .sp-comment-submit {
        min-height: 44px;
        padding: 10px 18px;
    }

    /* Sidebar nav items */
    .sidebar-nav-item {
        min-height: 44px;
    }

    /* Side panel action buttons */
    .side-panel-actions .btn,
    .side-panel-actions button {
        min-width: 40px;
        min-height: 40px;
    }

    /* Tag editor buttons */
    .tag-editor-sug-item {
        padding: 10px 8px;
        min-height: 44px;
    }

    .tag-editor-remove {
        min-width: 28px;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Pagination buttons */
    .pagination {
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }

    /* Changelog entries need more vertical padding for touch */
    .changelog-entry {
        padding: 10px 0;
    }

    /* Card hover disabled on touch */
    .card:hover {
        box-shadow: var(--shadow-card);
        transform: none;
    }
}

/* ---- Swipe gesture hints for horizontal scrollable elements ---- */
@media (max-width: 768px) {
    .table-wrapper,
    .tabs,
    .csv-preview-table,
    .table-responsive {
        position: relative;
    }

    /* Fade edge hints to indicate horizontal scroll */
    .table-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to left, var(--color-surface, #fff), transparent);
        pointer-events: none;
        z-index: 3;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    /* Tabs scroll hint */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Firefox */
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .tabs::after {
        content: '';
        position: sticky;
        right: 0;
        width: 32px;
        min-height: 100%;
        background: linear-gradient(to left, var(--color-surface, #fff), transparent);
        pointer-events: none;
        flex-shrink: 0;
    }
}

/* Dark theme scroll hint adjustment */
@media (max-width: 768px) {
    [data-theme="dark"] .table-wrapper::after {
        background: linear-gradient(to left, var(--color-surface, #1e293b), transparent);
    }

    [data-theme="dark"] .tabs::after {
        background: linear-gradient(to left, var(--color-surface, #1e293b), transparent);
    }
}

/* ---- Bottom sheet dropdown improvements ---- */
@media (max-width: 768px) {
    /* Tag editor as bottom sheet on mobile */
    .tag-editor {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15) !important;
        z-index: 1100 !important;
        padding: 16px !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }

    .tag-editor::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--color-border);
        border-radius: 2px;
        margin: 0 auto 12px;
    }

    .tag-editor-colors {
        gap: 8px;
    }

    .tag-color-btn {
        width: 36px;
        height: 36px;
    }
}

/* ---- Table column hiding on mobile ---- */
@media (max-width: 768px) {
    /* Helper classes for explicit column control */
    .table-col-priority-low {
        display: none !important;
    }

    .table-col-priority-medium {
        /* Show but compact */
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .table-col-priority-medium {
        display: none !important;
    }

    /* More compact empty state on small screens */
    .empty-state {
        padding: 40px 16px;
        background-size: 16px 16px;
    }

    .empty-state-enhanced {
        padding: 40px 16px;
        background-size: 16px 16px;
    }

    .empty-state-enhanced .empty-state-icon {
        width: 88px;
        height: 88px;
    }

    .empty-state-enhanced .empty-state-icon svg {
        width: 36px;
        height: 36px;
    }

    .empty-state-enhanced h3 {
        font-size: 1.1rem;
    }

    .empty-state h3 {
        font-size: 1.1rem;
    }

    /* Notification dropdown compact */
    .notification-dropdown.open {
        max-height: 60vh;
    }
}

/* ---- Toast mobile improvements ---- */
@media (max-width: 768px) {
    #toast-container {
        top: auto;
        bottom: 72px; /* Above bottom nav */
        right: 8px;
        left: 8px;
        max-width: 100%;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* ---- Card compact on mobile ---- */
@media (max-width: 768px) {
    .card {
        padding: 16px;
    }

    .card-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .card-header h3 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .card-header {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
}

/* ---- Badge compact on mobile ---- */
@media (max-width: 480px) {
    .badge {
        padding: 3px 8px;
        font-size: 10px;
    }
}

/* ---- Wizard responsive ---- */
@media (max-width: 768px) {
    .wizard-steps {
        padding: 12px 0 20px;
    }

    .wizard-step-label {
        display: none; /* Show only numbers on mobile */
    }

    .wizard-step-line {
        width: 32px;
        margin: 0 8px;
    }
}

/* ---- Comments section mobile ---- */
@media (max-width: 768px) {
    .sp-comment-form {
        flex-direction: column;
        gap: 8px;
    }

    .sp-comment-submit {
        align-self: flex-end;
    }

    .sp-comment-input {
        min-height: 44px;
    }
}

/* ---- CSV mapping grid mobile ---- */
@media (max-width: 768px) {
    .csv-mapping-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Search input mobile ---- */
@media (max-width: 768px) {
    .search-input input {
        height: 44px;
        font-size: 16px; /* prevent iOS zoom */
    }
}

/* ---- File upload zone mobile ---- */
@media (max-width: 768px) {
    .file-upload-zone {
        padding: 24px 16px;
    }

    .file-upload-preview {
        flex-wrap: wrap;
    }
}

/* ---- Keyboard shortcuts modal hidden on mobile ---- */
@media (max-width: 768px) {
    .shortcuts-grid .shortcut-keys kbd {
        min-width: 28px;
        height: 28px;
    }
}

/* ---- Reduced motion: disable all new animations ---- */
@media (prefers-reduced-motion: reduce) {
    .swipe-hint {
        animation: none !important;
        display: none !important;
    }

    .table-scroll-shadow-left,
    .table-scroll-shadow-right {
        transition: none !important;
    }
}

/* ============================================
   Conditional Formatting
   ============================================ */

/* ---- Formatted cell base ---- */
.cf-formatted {
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* ---- Icon indicator inside cell ---- */
.cf-icon-wrap {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.cf-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---- Toolbar ---- */
.cf-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cf-config-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.cf-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.cf-toggle-btn {
    padding: 6px 8px;
}

.cf-toggle-btn.active svg {
    color: var(--color-primary);
}

/* ---- Global toggle ---- */
.cf-global-toggle {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.cf-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}

.cf-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* ---- Sections ---- */
.cf-section {
    margin-bottom: 16px;
}

.cf-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

/* ---- Preset grid ---- */
.cf-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cf-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cf-preset-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.cf-preset-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

.cf-preset-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cf-preset-name {
    white-space: nowrap;
}

/* ---- Rule row ---- */
.cf-rule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    transition: background-color 0.15s ease;
}

.cf-rule-row:hover {
    background-color: var(--color-surface-alt);
}

.cf-rule-preview {
    width: 36px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    border: 1px solid var(--color-border-light);
}

.cf-rule-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    flex-wrap: wrap;
}

.cf-rule-col {
    font-weight: 600;
    color: var(--color-text);
}

.cf-rule-type {
    color: var(--color-text-muted);
    font-size: 12px;
}

.cf-rule-val {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 12px;
    background: var(--color-primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.cf-rule-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cf-rule-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cf-rule-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.cf-rule-edit-btn,
.cf-rule-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.cf-rule-edit-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-primary);
}

.cf-rule-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* ---- Empty state ---- */
.cf-empty {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 13px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}

/* ---- Add rule section ---- */
.cf-add-section {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* ---- Rule editor ---- */
.cf-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.cf-editor-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cf-editor-field input[type="text"],
.cf-editor-field select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
}

.cf-editor-field-inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.cf-editor-field-inline label {
    text-transform: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cf-editor-values {
    display: flex;
    gap: 12px;
}

.cf-editor-values .cf-editor-field {
    flex: 1;
}

/* ---- Style section ---- */
.cf-editor-style {
    border-top: 1px solid var(--color-border-light);
    padding-top: 14px;
}

.cf-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cf-color-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-color-input-wrap input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

.cf-color-text {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
}

/* ---- Preview cell ---- */
.cf-preview-cell {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border: 1px solid var(--color-border-light);
    transition: all 0.15s ease;
}

/* ---- Dark theme overrides ---- */
[data-theme="dark"] .cf-rule-row {
    border-color: var(--color-border);
}

[data-theme="dark"] .cf-preset-btn {
    border-color: var(--color-border);
    background: var(--color-surface);
}

[data-theme="dark"] .cf-preset-btn:hover,
[data-theme="dark"] .cf-preset-btn.active {
    background: rgba(59, 130, 246, 0.12);
}

[data-theme="dark"] .cf-empty {
    border-color: var(--color-border);
}

[data-theme="dark"] .cf-global-toggle {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

/* ---- Mobile responsive ---- */
@media (max-width: 768px) {
    .cf-presets-grid {
        flex-direction: column;
    }

    .cf-preset-btn {
        width: 100%;
    }

    .cf-style-grid {
        grid-template-columns: 1fr;
    }

    .cf-editor-values {
        flex-direction: column;
    }

    .cf-rule-info {
        font-size: 12px;
    }

    .cf-rule-row {
        gap: 8px;
        padding: 8px 10px;
    }

    .cf-toolbar {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .cf-config-btn span {
        display: none;
    }
}

/* ============================================
   Import Lifecycle Stepper
   ============================================ */
.import-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light, #e5e7eb);
    position: relative;
}

.import-stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.import-stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--color-border, #d1d5db);
    background: var(--color-surface, #fff);
    color: var(--color-text-muted, #9ca3af);
    transition: all 0.3s;
}

.import-stepper-step.completed .import-stepper-circle {
    background: var(--color-success, #10b981);
    border-color: var(--color-success, #10b981);
    color: #fff;
}

.import-stepper-step.current .import-stepper-circle {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.import-stepper-label {
    font-size: 11px;
    margin-top: 6px;
    color: var(--color-text-muted, #9ca3af);
    text-align: center;
    white-space: nowrap;
}

.import-stepper-step.completed .import-stepper-label,
.import-stepper-step.current .import-stepper-label {
    color: var(--color-text, #1f2937);
    font-weight: 500;
}

.import-stepper-date {
    font-size: 11px;
    color: var(--color-text-muted, #9ca3af);
    margin-top: 2px;
    min-height: 14px;
}

.import-stepper-line {
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--color-border, #d1d5db);
    z-index: -1;
}

.import-stepper-step.completed .import-stepper-line {
    background: var(--color-success, #10b981);
}

.import-stepper-step:last-child .import-stepper-line {
    display: none;
}

@media (max-width: 480px) {
    .import-stepper {
        padding: 12px 12px;
    }

    .import-stepper-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .import-stepper-step.current .import-stepper-circle {
        transform: scale(1.1);
    }

    .import-stepper-label {
        font-size: 10px;
    }

    .import-stepper-line {
        top: 13px;
        left: calc(50% + 16px);
        right: calc(-50% + 16px);
    }
}

/* ============================================
   Illustrated Empty States & Micro-animations
   ============================================ */

/* Illustrated icon variant - larger SVG in circular bg */
.empty-state-icon-illustrated {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 30, 58, 95), 0.05), rgba(var(--color-primary-rgb, 30, 58, 95), 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: emptyStateFloat 3s ease-in-out infinite;
    position: relative;
    box-shadow: 0 4px 20px rgba(var(--color-primary-rgb, 30, 58, 95), 0.06);
}

.empty-state-icon-illustrated::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed rgba(var(--color-primary-rgb, 30, 58, 95), 0.1);
    animation: emptyStateSpin 20s linear infinite;
}

.empty-state-icon-illustrated svg {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    opacity: 0.8;
}

@keyframes emptyStateSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Micro-animations for list items appearing */
@keyframes listItemAppear {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: listItemAppear 0.3s ease-out both;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 50ms; }
.animate-in:nth-child(3) { animation-delay: 100ms; }
.animate-in:nth-child(4) { animation-delay: 150ms; }
.animate-in:nth-child(5) { animation-delay: 200ms; }
.animate-in:nth-child(6) { animation-delay: 250ms; }
.animate-in:nth-child(7) { animation-delay: 300ms; }
.animate-in:nth-child(8) { animation-delay: 350ms; }

/* Fade-in for empty state itself */
@keyframes emptyStateFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.empty-state-enhanced {
    animation: emptyStateFadeIn 0.4s ease-out both;
}

/* Reduced motion: disable all empty state and list animations */
@media (prefers-reduced-motion: reduce) {
    .empty-state-icon-illustrated,
    .empty-state-icon-illustrated::after,
    .animate-in,
    .empty-state-enhanced {
        animation: none !important;
    }
}

/* Responsive: smaller illustrated icon on mobile */
@media (max-width: 640px) {
    .empty-state-icon-illustrated {
        width: 88px;
        height: 88px;
    }

    .empty-state-icon-illustrated svg {
        width: 36px;
        height: 36px;
    }

    .empty-state-icon-illustrated::after {
        inset: -6px;
    }
}

/* ---- Table Cell Keyboard Navigation ---- */
.table-cell-focused {
    outline: 2px solid var(--color-primary, #3b82f6);
    outline-offset: -2px;
    position: relative;
    z-index: 2;
    transition: outline-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.table-cell-focused.cell-editable {
    cursor: pointer;
}

.table-cell-navigating {
    background-color: rgba(59, 130, 246, 0.04);
}

/* Navigating mode indicator on wrapper */
.table-wrapper.table-cell-nav-active {
    outline: none;
}

/* Smooth focus transition on all table cells with tabindex */
tbody td[tabindex] {
    transition: outline-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    outline: 2px solid transparent;
    outline-offset: -2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .table-cell-focused,
    tbody td[tabindex] {
        transition: none;
    }
}

/* Editable cell hover pencil icon */
.cell-editable {
    position: relative;
}

.cell-editable:hover::after {
    content: '✎';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--color-text-muted);
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cell-editable:hover::after {
    opacity: 1;
}

/* Column resize guideline */
.col-resize-guideline {
    position: absolute;
    width: 2px;
    background: var(--color-primary);
    opacity: 0.6;
    z-index: 1000;
    pointer-events: none;
    transition: left 0.05s ease;
    box-shadow: 0 0 4px rgba(var(--color-primary-rgb, 59, 130, 246), 0.4);
}

/* ============================================
   Document Checklist
   ============================================ */

/* Header with title and count */
.doc-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.doc-checklist-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary, #3b82f6);
    background: var(--color-primary-light, rgba(59, 130, 246, 0.08));
    padding: 3px 10px;
    border-radius: 12px;
}

/* Progress bar */
.doc-checklist-progress {
    position: relative;
    height: 8px;
    background: var(--color-surface-alt, #f3f4f6);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: visible;
}

.doc-checklist-progress-bar {
    height: 100%;
    background: var(--color-primary, #3b82f6);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    min-width: 0;
}

.doc-checklist-progress-bar.complete {
    background: var(--color-success, #10b981);
}

.doc-checklist-progress-label {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
}

/* Checklist container */
.doc-checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Individual checklist item */
.doc-checklist-item {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md, 6px);
    border: 1px solid var(--color-border-light, #e5e7eb);
    background: var(--color-surface, #fff);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.doc-checklist-item:hover {
    border-color: var(--color-border, #d1d5db);
}

.doc-checklist-item.checked {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.25);
}

/* Checkbox */
.doc-checklist-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--color-success, #10b981);
}

/* Label area */
.doc-checklist-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.doc-checklist-label-main {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #1f2937);
    line-height: 1.4;
}

.doc-checklist-item.checked .doc-checklist-label-main {
    text-decoration: line-through;
    color: var(--color-text-muted, #6b7280);
}

.doc-checklist-label-sub {
    font-size: 11px;
    color: var(--color-text-muted, #9ca3af);
    line-height: 1.3;
}

/* Note toggle button */
.doc-checklist-note-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: var(--radius-sm, 4px);
    background: none;
    color: var(--color-text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.15s;
}

.doc-checklist-note-toggle:hover {
    background: var(--color-surface-alt, #f3f4f6);
    color: var(--color-text, #1f2937);
    border-color: var(--color-border, #d1d5db);
}

.doc-checklist-note-toggle.has-note {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary, #3b82f6);
    border-color: rgba(59, 130, 246, 0.25);
}

/* Note area */
.doc-checklist-note {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    padding: 0;
}

.doc-checklist-note.visible {
    max-height: 120px;
    padding-top: 6px;
}

.doc-checklist-note-input {
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text, #1f2937);
    background: var(--color-surface-alt, #f9fafb);
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: var(--radius-sm, 4px);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.doc-checklist-note-input:focus {
    border-color: var(--color-primary, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.doc-checklist-note-input::placeholder {
    color: var(--color-text-muted, #9ca3af);
}

/* ---- Cost Analysis Charts ---- */
.cost-chart-container {
    position: relative;
    max-height: 200px;
    margin-bottom: 12px;
}

.cost-chart-container canvas {
    max-height: 200px;
}

.cost-chart-bar {
    max-height: 240px;
    padding: 8px 0;
}

.cost-chart-bar canvas {
    max-height: 240px;
}

.cost-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.cost-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-secondary, #4b5563);
}

.cost-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cost-legend-label {
    font-weight: 500;
}

.cost-legend-value {
    color: var(--color-text-muted, #6b7280);
    font-size: 11px;
}

.cost-per-unit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-md, 6px);
    background: var(--color-surface-alt, #f9fafb);
    border: 1px solid var(--color-border-light, #e5e7eb);
}

.cost-per-unit-label {
    font-size: 13px;
    color: var(--color-text-secondary, #4b5563);
    font-weight: 500;
}

.cost-per-unit-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.cost-total-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg, 8px);
    padding: 16px 20px;
    text-align: center;
}

.cost-total-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 4px;
}

.cost-total-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary, #3b82f6);
}

/* Cost overview section on imports page */
.cost-overview-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.cost-overview-header {
    margin-bottom: 12px;
}

.cost-overview-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

/* Fin card costs variant */
.fin-card--costs {
    border-left: 3px solid #8b5cf6;
}

.fin-card--costs .fin-card-icon svg {
    color: #8b5cf6;
}

/* ---- Quick Actions Panel ---- */
.topbar-quick-actions {
    position: relative;
}

.quick-actions-btn {
    position: relative;
}

.topbar-actions-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 200;
    margin-top: 8px;
    padding: 6px 0;
    overscroll-behavior: contain;
}

.topbar-actions-panel.open {
    display: block;
    animation: fadeSlideDown 0.15s ease;
}

.topbar-actions-section-label {
    display: block;
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    user-select: none;
}

.topbar-actions-divider {
    height: 1px;
    background: var(--color-border);
    margin: 6px 0;
}

.topbar-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 80ms ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    border-radius: 0;
}

.topbar-action-item:hover {
    background: var(--color-primary-light, rgba(37, 99, 235, 0.06));
}

.topbar-action-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-surface-alt, #f5f7fa);
    color: var(--color-text-secondary, #64748b);
    transition: background 80ms ease, color 80ms ease;
}

.topbar-action-item:hover .topbar-action-item-icon {
    background: var(--color-primary);
    color: #fff;
}

.topbar-action-item-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-action-shortcut {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    height: 20px;
    padding: 0 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    color: var(--color-text-muted);
    background: var(--color-surface-alt, #f5f7fa);
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .topbar-actions-panel {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto;
    }
}

/* ============================================
   Progress Bars - Animated Gradient Stripe
   ============================================ */
.doc-checklist-progress-bar,
.bulk-edit-progress-fill,
.csv-progress-bar-fill,
.password-strength-fill,
[class*="progress-fill"],
[class*="progress-bar-fill"] {
    position: relative;
    overflow: hidden;
}

.doc-checklist-progress-bar::after,
.bulk-edit-progress-fill::after,
.csv-progress-bar-fill::after,
.password-strength-fill::after,
[class*="progress-fill"]::after,
[class*="progress-bar-fill"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent 0px,
        transparent 6px,
        rgba(255, 255, 255, 0.12) 6px,
        rgba(255, 255, 255, 0.12) 12px
    );
    background-size: 17px 17px;
    animation: progressStripeScroll 0.6s linear infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes progressStripeScroll {
    0%   { background-position: 0 0; }
    100% { background-position: 17px 0; }
}

/* ============================================
   Badge Pulse - Live Indicators
   Subtle pulse for green dots on exchange rate,
   Na zywo toggle, and similar live indicators
   ============================================ */
.badge-pulse,
.rate-dot-fresh,
.activity-live-toggle.active .activity-live-dot {
    animation: badgePulseGlow 2.5s ease-in-out infinite;
}

@keyframes badgePulseGlow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0);
    }
}

/* Inline live-dot pulse (circle elements like rate-dot) */
.rate-dot-fresh {
    animation: rateDotPulse 2.5s ease-in-out infinite;
}

@keyframes rateDotPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0);
    }
}

/* ============================================
   Button Ripple - Dark variant (ghost/outline btns)
   ============================================ */
.btn-ghost::after,
.btn-outline::after,
.btn-secondary::after {
    background: radial-gradient(circle at 50% 50%, rgba(30, 58, 95, 0.12) 0%, transparent 65%);
}

/* ============================================
   Scroll-to-top Button
   ============================================ */
.scroll-top-btn {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    color: var(--color-text-secondary, #4b5563);
    border: 1px solid var(--color-border-light, #e5e7eb);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
                background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* ============================================
   Smooth scroll for scrollable table containers
   ============================================ */
.table-wrapper {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   Shortcut Action Pill
   Small temporary pill that shows which shortcut
   was triggered. Fixed at top center of viewport.
   ============================================ */
@keyframes shortcutPillIn {
    0%   { opacity: 0; transform: translate(-50%, -100%); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes shortcutPillOut {
    0%   { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -100%); }
}

.shortcut-action-pill {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    color: #fff;
    background: rgba(30, 30, 40, 0.82);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    pointer-events: none;
    animation: shortcutPillIn 0.2s ease-out forwards;
}

.shortcut-action-pill.hiding {
    animation: shortcutPillOut 0.25s ease-in forwards;
}

.shortcut-action-pill .sap-keys {
    opacity: 0.7;
    font-weight: 500;
}

.shortcut-action-pill .sap-arrow {
    opacity: 0.5;
    font-size: 10px;
}

.shortcut-action-pill .sap-label {
    opacity: 1;
}

/* ============================================
   CSV Import - Enhanced Styles
   ============================================ */

/* Progress bar - taller, rounded, gradient fill */
.csv-progress-bar-outer {
    height: 8px !important;
    border-radius: 4px !important;
    background: var(--color-surface-alt) !important;
    overflow: hidden;
}

.csv-progress-bar-inner {
    height: 100%;
    border-radius: 4px !important;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover)) !important;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.csv-progress-bar-inner.done {
    background: linear-gradient(90deg, var(--color-success), #10b981) !important;
}

.csv-progress-bar-inner.error {
    background: linear-gradient(90deg, var(--color-danger), #ef4444) !important;
}

/* CSV mapping row (injected) - enhanced with alternating rows */
.csv-mapping-row {
    border-radius: var(--radius-md) !important;
    transition: all 0.2s ease !important;
}

.csv-mapping-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.015) !important;
}

.csv-mapping-row:hover {
    box-shadow: var(--shadow-xs) !important;
}

/* CSV mapping select - improved dropdown */
.csv-mapping-select {
    border-radius: var(--radius-md) !important;
    padding: 6px 10px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.csv-mapping-select:focus {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12) !important;
}

/* CSV error summary - clearer presentation */
.csv-error-summary {
    border-radius: 12px !important;
    border-left: 4px solid var(--color-danger) !important;
}

.csv-error-summary-item {
    padding: 5px 0 !important;
    border-bottom: 1px solid rgba(239, 68, 68, 0.08);
}

.csv-error-summary-item:last-child {
    border-bottom: none;
}

/* CSV preview table - enhanced with alternating rows (injected table too) */
.csv-preview-wrap {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.csv-preview-table thead th {
    font-weight: 600 !important;
}

.csv-preview-table tbody tr:nth-child(even):not(.csv-row-warning):not(.csv-row-error):not(.csv-row-skipped) {
    background-color: rgba(0, 0, 0, 0.018);
}

/* CSV saved mappings - improved */
.csv-saved-item {
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast) !important;
}

.csv-saved-item:hover {
    box-shadow: var(--shadow-xs) !important;
}

/* Radio label (mode selector) - improved */
.radio-label {
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.radio-label:hover {
    box-shadow: var(--shadow-xs);
}

/* ============================================
   Mobile Responsiveness - Touch-Friendly
   ============================================ */

/* Touch-friendly sizing for all interactive elements */
@media (max-width: 768px) {
    /* Dropdown items: larger padding and font */
    .dropdown-item {
        padding: 14px 18px !important;
        font-size: 15px !important;
        min-height: 44px;
    }

    .dropdown-divider {
        margin: 6px 14px !important;
    }

    /* Tab buttons: larger touch targets */
    .tab,
    .tab-item,
    .view-tab {
        min-height: 44px;
        padding: 10px 18px;
    }

    /* Pagination buttons */
    .pagination-btn {
        min-width: 44px;
        height: 44px;
        font-size: 15px;
    }

    /* Filter pills: larger touch targets */
    .filter-pill,
    .pill,
    .tag-pill {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
    }

    /* Button group items */
    .btn-group .btn {
        min-height: 44px;
        padding: 10px 18px;
    }

    /* Input fields: larger for better mobile UX */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="search"],
    input[type="url"],
    input[type="tel"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 10px 14px;
    }

    select {
        padding-right: 40px;
        background-size: 14px 10px;
    }

    /* Checkbox and radio: larger touch targets */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 22px;
        min-height: 22px;
        width: 22px;
        height: 22px;
    }

    /* Badge: slightly larger on mobile */
    .badge {
        padding: 6px 13px;
        font-size: 12px;
    }

    /* Card: better spacing */
    .card {
        padding: 18px;
    }

    .card-header {
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    /* Toast: full width on mobile */
    #toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: 100%;
    }

    .toast {
        min-width: 100%;
        padding: 16px;
    }

    .toast-close {
        width: 44px;
        height: 44px;
    }

    /* Icon buttons: larger touch targets */
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-icon.btn-sm {
        min-width: 40px;
        min-height: 40px;
    }

    .btn-icon-circle {
        width: 44px;
        height: 44px;
    }

    /* Table actions: larger for touch */
    .table-actions button {
        min-width: 40px;
        min-height: 40px;
    }
}

/* ============================================
   Mobile Dropdowns: Bottom Sheet Style
   ============================================ */
@media (max-width: 768px) {
    /* Convert dropdowns to bottom sheets on mobile */
    .dropdown-menu.open {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
        border: none !important;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15) !important;
        z-index: 1100 !important;
        padding: 8px 0 !important;
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
        animation: bottomSheetSlideUp 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }

    @keyframes bottomSheetSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Drag handle for bottom sheet */
    .dropdown-menu.open::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--color-border);
        border-radius: 2px;
        margin: 8px auto 12px;
    }

    /* Backdrop for bottom sheet */
    .dropdown-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1099;
        animation: fadeIn 200ms ease forwards;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .modal,
    .dropdown-menu.open,
    .toast,
    .btn,
    .card {
        animation: none !important;
        transition: none !important;
    }

    .btn:active:not(:disabled) {
        transform: none !important;
    }
}

/* ============================================
   Print Styles - Components
   ============================================ */
@media print {

    /* --- Modals: hide completely --- */
    .modal-backdrop,
    .modal,
    #modal-overlay {
        display: none !important;
    }

    /* --- Side panel: show as inline print block when .print-panel is set --- */
    .side-panel:not(.print-panel) {
        display: none !important;
    }

    .side-panel.print-panel {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-left: none !important;
    }

    .side-panel.print-panel .side-panel-close,
    .side-panel.print-panel .side-panel-nav-btn,
    .side-panel.print-panel .side-panel-actions,
    .side-panel.print-panel .sp-tab-bar,
    .side-panel.print-panel .side-panel-footer {
        display: none !important;
    }

    .side-panel.print-panel .side-panel-header {
        background: none !important;
        padding: 0 0 8pt 0 !important;
        border-bottom: 2px solid #333 !important;
        margin-bottom: 10pt !important;
    }

    .side-panel.print-panel .side-panel-header::after {
        display: none !important;
    }

    .side-panel.print-panel .side-panel-header h3 {
        font-size: 16pt !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    .side-panel.print-panel .side-panel-body {
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    /* --- Buttons: hide all non-print --- */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-ghost,
    .btn-outline,
    .btn-success,
    .btn-icon,
    .btn-icon-circle {
        display: none !important;
    }

    .btn.print-visible {
        display: inline-flex !important;
    }

    /* --- Cards: flat, no shadow, thin border --- */
    .card,
    .chart-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        border-radius: 2px !important;
        background: #ffffff !important;
    }

    .card-header {
        border-bottom: 1px solid #ddd !important;
    }

    /* --- Toasts: hide --- */
    #toast-container,
    .toast {
        display: none !important;
    }

    /* --- Dropdown: hide --- */
    .dropdown-menu,
    .dropdown-backdrop,
    .cell-dropdown {
        display: none !important;
    }

    /* --- Tabs: hide interactive tabs --- */
    .tab-bar,
    .tabs-nav {
        display: none !important;
    }

    /* --- Form elements: show values only --- */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    textarea,
    select {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        font-size: 10pt !important;
        color: #000 !important;
    }

    /* --- Toggle switches: show as text --- */
    .toggle-switch {
        display: none !important;
    }

    /* --- Progress bars: show with border --- */
    .progress-bar {
        border: 1px solid #ccc !important;
        background: #f0f0f0 !important;
        border-radius: 2px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .progress-fill {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* --- Pagination: hide --- */
    .pagination,
    .pagination-wrapper {
        display: none !important;
    }

    /* --- File upload areas: hide --- */
    .file-upload-area,
    .file-upload-zone {
        display: none !important;
    }
}
