:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
    --border: #dee2e6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    color: #212529;
    line-height: 1.6;
}

.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
}

.nav-links a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--secondary);
    font-size: 1rem;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

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

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

.btn-primary:disabled {
    background: var(--secondary);
    border-color: var(--secondary);
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(0.95);
}

.btn-ghost {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--secondary);
}

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

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-info {
    background: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

.alert-success {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.progress-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.progress-text {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    background: #fff;
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
}

.stats-bar {
    background: var(--light);
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

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

.stats-label {
    font-weight: 600;
    color: var(--secondary);
}

.stats-value {
    font-family: monospace;
}

.progress-bar {
    height: 0.5rem;
    background: var(--border);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s, background 0.3s;
}

.collection-list {
    display: grid;
    gap: 1rem;
}

.collection-item {
    background: #fff;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.collection-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.collection-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.collection-meta {
    color: var(--secondary);
    font-size: 0.875rem;
    display: flex;
    gap: 1rem;
}

.collection-meta i {
    margin-right: 0.25rem;
}

.breadcrumb {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-list a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-list a:hover {
    text-decoration: underline;
}

.breadcrumb-list .separator {
    color: var(--secondary);
}

.file-list {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    overflow: hidden;
}

.file-list-header {
    display: grid;
    grid-template-columns: 50px 1fr 120px 150px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
}

.file-item {
    display: grid;
    grid-template-columns: 50px 1fr 120px 150px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background 0.15s;
}

.file-item:hover {
    background: var(--light);
}

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

.file-icon {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.file-name a {
    color: var(--primary);
    text-decoration: none;
}

.file-name a:hover {
    text-decoration: underline;
}

.file-size,
.file-date {
    color: var(--secondary);
    font-size: 0.875rem;
}

.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    padding: 2rem;
}

.preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-content {
    background: #fff;
    border-radius: 0.375rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.preview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--dark);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.preview-close:hover {
    background: #000;
}

.preview-content img,
.preview-content embed {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.footer {
    background: var(--light);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--secondary);
    font-size: 0.875rem;
}

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

.footer a:hover {
    text-decoration: underline;
}

.spinner {
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

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

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--secondary);
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .file-list-header,
    .file-item {
        grid-template-columns: 40px 1fr;
    }

    .file-size,
    .file-date {
        display: none;
    }

    .collection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .collection-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.page-header.compact {
    padding: 1.5rem 0 1rem;
    margin-bottom: 1rem;
}

.page-subtitle {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.center-wrap {
    display: flex;
    justify-content: center;
}

.narrow {
    width: 100%;
    max-width: 560px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-inline {
    min-width: 280px;
}

.file-list.admin .file-list-header,
.file-list.admin .file-item {
    grid-template-columns: 1fr 120px 160px 120px;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: var(--light);
    color: var(--secondary);
    white-space: nowrap;
}

.hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--secondary);
}

.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .file-list.admin .file-list-header,
    .file-list.admin .file-item {
        grid-template-columns: 1fr 120px;
    }
}

.pending-list .file-list-header,
.pending-list .file-item {
    grid-template-columns: 1fr 220px 260px 180px;
}

.pending-file {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.pending-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-meta {
    font-size: 0.85rem;
    color: var(--secondary);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pending-dir select.form-control {
    width: 260px;
}

.pending-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

.pending-actions .form-control {
    width: 240px;
    padding: 0.55rem;
}

.pending-list .file-item > :nth-child(3) {
    padding-right: 0.75rem;
}

.simple-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1200;
    padding: 2rem;
}

.simple-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-modal-card {
    background: #fff;
    border-radius: 0.375rem;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    border: 1px solid var(--border);
}

.simple-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--dark);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.simple-modal-close:hover {
    background: #000;
}

.file-name {
    min-width: 0;
}

.text-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 992px) {
    .pending-list .file-list-header,
    .pending-list .file-item {
        grid-template-columns: 1fr;
    }

    .pending-actions {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .pending-actions .form-control {
        width: 100%;
    }
}

/* ===== UPPY – wersja subtelna ===== */

.uppy-Dashboard {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}

/* usuń ciężki header */
.uppy-Dashboard-inner {
  border-radius: 16px;
}

/* delikatniejsze tło contentu */
.uppy-Dashboard-content {
  background: #fafafa;
}

/* kafelki plików */
.uppy-Dashboard-Item {
  background: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-radius: 14px;
  margin: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.uppy-Dashboard-Item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.08);
}

/* miniaturka mniej kontrastowa */
.uppy-Dashboard-Item-preview {
  background: #f3f4f6 !important;
}

/* nazwa pliku */
.uppy-Dashboard-Item-name {
  font-weight: 500;
}

/* progress cieńszy */
.uppy-ProgressBar {
  height: 4px !important;
  background: rgba(0,0,0,0.05) !important;
}

.uppy-ProgressBar-inner {
  background: #0d6efd !important;
  border-radius: 10px;
}

/* przyciski bardziej miękkie */
.uppy-c-btn,
.uppy-Dashboard-upload,
.uppy-Dashboard-AddFiles {
  border-radius: 12px !important;
  font-weight: 500;
}

/* Upload primary bardziej stonowany */
.uppy-Dashboard-upload {
  background: #0d6efd !important;
  border-color: #0d6efd !important;
}

.uppy-Dashboard-upload:hover {
  filter: brightness(0.95);
}

/* Usuń zbędne linie/separatory */
.uppy-Dashboard-files {
  border-top: none !important;
}

/* komunikaty */
.uppy-Informer {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
/* Uppy full width */
#uppy { width: 100%; }

.uppy-Dashboard,
.uppy-Dashboard-inner {
  width: 100% !important;
  max-width: none !important;
}

.uppy-Dashboard-innerWrap,
.uppy-DashboardContent-bar,
.uppy-DashboardContent-panel {
  width: 100% !important;
  max-width: none !important;
}

/* żeby lista plików nie była "wąska" */
.uppy-Dashboard-files,
.uppy-Dashboard-Item {
  max-width: none !important;
}