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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    padding: 20px;
}

.lucide {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    color: #f6f6f6;
    margin-bottom: 30px;
    padding: 25px;
    background: #2a2a2a;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ff6b35;
}

.logo {
    height: 40px;
    margin-right: 20px;
}

.header-left {
    display: flex;
    align-items: center;
}

.page-back-btn {
    background: #ff6b35;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.page-back-btn:hover {
    background: #ff8555;
    transform: none;
    box-shadow: none;
}

h1 {
    font-size: 1.5em;
    text-shadow: none;
    margin: 0;
}

.header-title-wrapper {
    text-align: right;
}

.header-title-wrapper h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.header-title-wrapper .subtitle {
    font-size: 0.9em;
    opacity: 0.8;
}

.header-title-wrapper .order-desc-subtitle {
    color: rgb(119, 98, 98);
    opacity: 1;
}

.content {
    background: #2a2a2a;
    border-radius: 0;
    padding: 30px;
    box-shadow: none;
}

.loading {
    text-align: center;
    padding: 60px;
    font-size: 1.3em;
    color: #ff6b35;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading i,
.loading svg {
    animation: rotate 1s linear infinite;
}

.loading-progress {
    padding: 60px 40px;
    max-width: 480px;
    margin: 0 auto;
}

.loading-progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3em;
    margin-bottom: 24px;
    color: #cccccc;
}

.loading-progress-header i,
.loading-progress-header svg {
    animation: rotate 1s linear infinite;
    flex-shrink: 0;
}

.loading-progress-bar-wrap {
    background: #2a2a2a;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.loading-progress-bar {
    height: 100%;
    background: #ff6b35;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 0.82em;
    color: #888;
}

.loading-counter {
    white-space: nowrap;
    color: #aaa;
}

.loading-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.error {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b35;
    padding: 20px;
    border-radius: 0;
    margin: 20px 0;
    text-align: center;
    border: 2px solid #ff6b35;
}

.load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 60px 40px;
}

.load-error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b35;
    font-size: 1.1em;
    border: 2px solid #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    padding: 16px 24px;
    border-radius: 4px;
    max-width: 520px;
    width: 100%;
    justify-content: center;
}

.load-error-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.load-error-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid #555;
    background: #2a2a2a;
    color: #ccc;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.load-error-btn:hover {
    background: #333;
    border-color: #777;
    color: #fff;
}

.load-error-btn-primary {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

.load-error-btn-primary:hover {
    background: #ff8555;
    border-color: #ff8555;
}

.client-view-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 72px 40px;
    text-align: center;
}

.client-view-notice-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.12);
    border: 2px solid rgba(255, 107, 53, 0.28);
}

.client-view-notice-icon svg {
    width: 32px;
    height: 32px;
}

.client-view-notice-title {
    color: #f4f4f4;
    font-size: 1.5em;
    font-weight: 700;
}

.client-view-notice-message {
    max-width: 620px;
    color: #cfcfcf;
    line-height: 1.6;
    font-size: 1.03em;
}

.client-view-notice-actions {
    display: flex;
    justify-content: center;
}

.printer-access-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    margin-bottom: 18px;
    border: 1px solid #3f5b73;
    background: linear-gradient(135deg, rgba(42, 58, 71, 0.92), rgba(31, 42, 52, 0.92));
    border-radius: 6px;
}

.printer-access-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.printer-access-banner-title {
    color: #f6f6f6;
    font-size: 1.05em;
    font-weight: 700;
}

.printer-access-banner-text {
    color: #b7c1c8;
    line-height: 1.45;
}

.printer-access-banner-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .printer-access-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .printer-access-banner-btn {
        justify-content: center;
    }
}

.products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.products-table th {
    background: #353535;
    color: #f6f6f6;
    padding: 15px;
    text-align: left;
    font-size: 1.1em;
    border-bottom: 2px solid #ff6b35;
}

.products-table th:first-child {
    border-radius: 0;
    width: 300px;
}

.products-table th:last-child {
    border-radius: 0;
}

.products-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #3a3a3a;
    vertical-align: top;
}

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

.products-table tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

.folder-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 15px;
    display: block;
}

.label-thumbnail {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #3a3a3a;
}

.label-thumbnail:hover {
    transform: none;
    box-shadow: none;
    border-color: #ff6b35;
}

.production-thumbnail {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.production-thumbnail:hover {
    opacity: 0.9;
}

.production-column {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 0;
}

.production-column .pdf-item {
    background: #353535;
    border-radius: 0;
    border: 1px solid #3a3a3a;
    position: relative;
}

.production-column .pdf-item:hover {
    background: #404040;
    border-color: #ff6b35;
}

.production-column .pdf-name {
    color: #e0e0e0;
}

.production-column .pdf-size {
    color: #b0b0b0;
}

.label-link {
    display: inline-block;
    margin-top: 10px;
}

.pswp-trigger img {
    cursor: zoom-in;
}

.pdf-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pdf-item {
    padding: 15px;
    background: #353535;
    border-radius: 0;
    transition: all 0.3s ease;
    border: 1px solid #3a3a3a;
}

.pdf-item:hover {
    background: #404040;
    transform: none;
    border-color: #ff6b35;
}

.pdf-name {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 1.05em;
    margin-bottom: 5px;
}

.pdf-size {
    color: #b0b0b0;
    font-size: 0.95em;
}

.thumbnail-loading {
    text-align: center;
    padding: 20px;
    color: #b0b0b0;
    font-style: italic;
}

.thumbnail-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #353535;
    color: #b0b0b0;
    font-size: 0.9em;
}

.spinner {
    border: 3px solid #404040;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.thumbnail-loaded {
    display: none;
}

.thumbnail-visible {
    display: block;
}

.search-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #353535;
    border-bottom: 2px solid #ff6b35;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #808080;
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.toolbar-search-input {
    width: 100%;
    padding: 12px 40px 12px 45px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    color: #f6f6f6;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.toolbar-search-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.toolbar-search-input::placeholder {
    color: #808080;
}

.clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #808080;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    display: none;
    transition: color 0.3s ease;
    line-height: 1;
}

.clear-search:hover {
    color: #ff6b35;
}

.clear-search.visible {
    display: block;
}

.search-stats {
    margin-top: 10px;
    color: #b0b0b0;
    font-size: 0.9em;
}

.hidden-row {
    display: none !important;
}

/* Modal "Dodaj zlecenie" */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: #252525;
    border: 1px solid #444;
    border-radius: 6px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #383838;
    font-weight: bold;
    font-size: 1.05em;
    color: #e0e0e0;
}
.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.4em;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: #fff; }
.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.nc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.nc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    background: #2e2e2e;
    color: #e0e0e0;
    transition: background 0.15s;
}
.nc-item:hover { background: #3a3a3a; }
.modal-back-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-bottom: 12px;
}
.modal-back-btn:hover { color: #fff; }
.modal-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1e1e1e;
    color: #fff;
    font-size: 0.95em;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.modal-info    { color: #aaa; padding: 12px 0; }
.modal-success { color: #6dbf6d; padding: 12px 0; font-weight: bold; }
.modal-error   { color: #e06060; padding: 12px 0; }

.confirm-box   { padding: 8px 0; }
.confirm-text  { color: #aaa; font-size: 0.9em; margin-bottom: 8px; }
.confirm-name  { color: #e0e0e0; font-size: 1.05em; font-weight: bold; margin-bottom: 20px; }
.confirm-btns  { display: flex; gap: 10px; }

.modal-primary-btn {
    padding: 9px 20px;
    background: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
}
.modal-primary-btn:hover { background: #ff8555; }

.modal-secondary-btn {
    padding: 9px 20px;
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
}
.modal-secondary-btn:hover { border-color: #888; color: #fff; }

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top svg {
    width: 22px;
    height: 22px;
}

.scroll-to-top:hover {
    background: #ff8555;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Styles for index page */
.client-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    margin-bottom: -10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #444;
    font-size: 0.8em;
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.client-header:first-child {
    margin-top: 10px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.order-card {
    background: #353535;
    border-radius: 0;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    border: 2px solid #3a3a3a;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ff6b35;
}

.order-card:hover {
    transform: translateY(-5px);
    border-color: #ff6b35;
}

.order-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 10px;
}

.order-name {
    font-size: .9em;
    color: #e0e0e0;
    line-height: 1.2;
}

.order-icon {
    float: right;
    font-size: 2em;
    opacity: 0.3;
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-source-badge {
    position: absolute;
    right: -6px;
    bottom: -2px;
    min-width: 28px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #2a2a2a;
    font-size: 0.34em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    opacity: 1;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.order-source-local {
    background: #397251;
}

.order-source-nextcloud {
    background: #2f5f8a;
}

.order-card--blocked::before {
    background: #c0392b;
}

.order-card--blocked:hover {
    border-color: #c0392b;
}

.order-flag-badge {
    position: absolute;
    left: -6px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.order-flag-badge svg {
    width: 13px;
    height: 13px;
}

.order-flag-blocked {
    background: #c0392b;
    color: #fff;
}

.order-status-chips {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
    clear: both;
}

.order-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.order-status-chip svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.chip-nc-shared {
    background: rgba(47, 95, 138, 0.25);
    border-color: rgba(47, 95, 138, 0.55);
    color: #7ab3d9;
}

.chip-printer {
    background: rgba(70, 100, 50, 0.25);
    border-color: rgba(70, 110, 50, 0.55);
    color: #9dc876;
}

.empty-state {
    text-align: center;
    color: #b0b0b0;
    padding: 60px;
    background: #353535;
    border-radius: 0;
    font-size: 1.2em;
    border: 2px solid #3a3a3a;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.8;
    color: #e0e0e0;
}

.admin-badge {
    background: #ff6b35;
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn,
.filter-errors-btn,
.logout-btn {
    padding: 12px 18px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.logout-btn {
    padding: 24px 18px;
}

.refresh-btn {
    background: #ff6b35;
    color: #ffffff;
    border: none;
}

.refresh-btn:hover {
    background: #ff8555;
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.filter-errors-btn {
    background: #353535;
    color: #f6f6f6;
    border: 2px solid #ff6b35;
}

.filter-errors-btn:hover {
    background: #404040;
}

.filter-errors-btn.active {
    background: #ff6b35;
    color: #ffffff;
    border-color: #ff6b35;
}

.refresh-btn i,
.refresh-btn svg,
.filter-errors-btn i,
.filter-errors-btn svg {
    width: 16px;
    height: 16px;
}

.logout-btn {
    background: #353535;
    color: #f6f6f6;
    border: 2px solid #ff6b35;
}

.logout-btn:hover {
    background: #ff6b35;
    color: #ffffff;
}

.logout-btn i,
.logout-btn svg {
    width: 16px;
    height: 16px;
}

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

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

/* Admin page */
.admin-page .pdf-item {
    position: relative;
}

.admin-page .refresh-folder-btn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.table-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.table-header-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #ff6b35;
    color: #f6f6f6;
    background: transparent;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    font-family: inherit;
    text-decoration: none;
    appearance: none;
    cursor: pointer;
}

.table-header-link {
    text-decoration: none;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #f6f6f6;
    border: 1px solid #ff6b35;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-right: 20px;
}

.back-btn:hover {
    background: #ff6b35;
    color: #fff;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.btn-group {
    display: inline-flex;
}

.toolbar-split-dropdown {
    position: relative;
    display: inline-flex;
}

.table-header-split-group {
    display: inline-flex;
}

.btn-group .table-header-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.btn-group .table-header-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.admin-page .refresh-folder-btn:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}

.table-header-btn:hover {
    background: #ff6b35;
    color: #ffffff;
}

.table-header-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.table-header-btn:disabled:hover {
    background: transparent;
    color: #f6f6f6;
}

.table-header-btn.copied {
    background: #4caf50;
    border-color: #4caf50;
    color: #ffffff;
}

.table-header-btn.copy-error {
    background: #e53935;
    border-color: #e53935;
    color: #ffffff;
}

.admin-page .filter-errors-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #ffffff;
}

.admin-page .refresh-folder-btn svg {
    width: 14px;
    height: 14px;
}

.table-header-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.table-header-btn-share.is-shared,
.table-header-btn-split-toggle.is-shared,
.table-header-btn-share.is-shared:hover,
.table-header-btn-split-toggle.is-shared:hover {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #ffffff;
}

.table-header-btn-split-toggle {
    width: 42px;
    padding: 0;
}

.toolbar-split-dropdown.open .table-header-btn-split-toggle {
    background: #ff6b35;
    color: #ffffff;
}

.toolbar-split-dropdown.open .table-header-btn-split-toggle.is-shared {
    background: #2e7d32;
    color: #ffffff;
}

.table-header-btn-client-view.is-invalidated,
.table-header-btn-split-toggle.is-invalidated,
.table-header-btn-client-view.is-invalidated:hover,
.table-header-btn-split-toggle.is-invalidated:hover {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #ffffff;
}

.table-header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    display: none;
    flex-direction: column;
    padding: 6px;
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 30;
}

.table-header-dropdown-menu.open {
    display: flex;
}

.table-header-dropdown-item {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #f6f6f6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.table-header-dropdown-item:hover {
    background: rgba(255, 107, 53, 0.14);
    color: #ffffff;
}

.table-header-dropdown-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.table-header-dropdown-item:disabled:hover {
    background: transparent;
    color: #f6f6f6;
}

.table-header-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-page .file-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.admin-page .file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-page .pdf-size {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-page .pdf-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-page .pdf-meta-separator {
    color: #666;
}

.admin-page .pdf-page-count {
    color: #b0b0b0;
}

.admin-page .layout-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
}

.admin-page .layout-btn {
    background: #2e2e2e;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s;
}

.admin-page .layout-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: #ccc;
}

.admin-page .layout-btn:hover {
    opacity: 1;
    border-color: #ff6b35;
}

.admin-page .layout-btn.active {
    opacity: 1;
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.15);
}

.admin-page .pages-container {
    margin-top: 8px;
}

.admin-page .pages-container.layout-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.admin-page .page-loading {
    color: #888;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
}

.admin-page .layout-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.admin-page .layout-four {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 4px;
}

.admin-page .layout-spread .pages-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.admin-page .page-thumb {
    border-radius: 2px;
    transition: opacity 0.2s;
    display: block;
    width: 100%;
    height: auto;
}

.admin-page .page-thumb-link {
    display: block;
    width: 100%;
    text-align: center;
}

.admin-page .page-thumb:hover {
    opacity: 0.85;
}

.admin-page .page-thumb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2a2a2a;
    border-radius: 2px;
    aspect-ratio: 210 / 297;
    width: 100%;
}

.admin-page .page-thumb-placeholder .spinner {
    margin-right: 0;
    flex-shrink: 0;
}

.admin-page .page-thumb-placeholder span {
    font-size: 0.72em;
    color: #777;
    text-align: center;
    padding: 0 8px;
}

.admin-page .file-actions {
    position: relative;
    display: inline-block;
    width: 100%;
}

.admin-page .replace-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.admin-page .replace-btn:hover {
    background: #ff8555;
    transform: scale(1.05);
}

.admin-page .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.admin-page .modal-content {
    background-color: #2a2a2a;
    margin: 10% auto;
    padding: 30px;
    border: 2px solid #ff6b35;
    width: 90%;
    max-width: 600px;
    max-height: none;
    display: block;
    overflow: visible;
    border-radius: 8px;
    animation: slideDown 0.3s;
}

.admin-page .modal-header {
    color: #f6f6f6;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding: 0 0 15px;
    border-bottom: 2px solid #ff6b35;
}

.admin-page .modal-body {
    color: #e0e0e0;
    padding: 0;
    overflow: visible;
    flex: initial;
}

.admin-page .close {
    color: #b0b0b0;
    float: right;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    line-height: 0.8;
    transition: color 0.3s;
}

.admin-page .close:hover {
    color: #ff6b35;
}

.admin-page .form-group {
    margin-bottom: 20px;
}

.admin-page .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #f6f6f6;
    font-weight: bold;
}

.admin-page .file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.admin-page .file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.admin-page .file-input-label {
    display: block;
    padding: 12px;
    background: #353535;
    border: 2px dashed #3a3a3a;
    color: #b0b0b0;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.admin-page .file-input-label:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}

.admin-page .file-input-label.has-file {
    border-style: solid;
    border-color: #ff6b35;
    color: #ff6b35;
}

.admin-page .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
}

.admin-page .btn-primary {
    background: #ff6b35;
    color: #ffffff;
}

.admin-page .btn-primary:hover {
    background: #ff8555;
}

.admin-page .btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
}

.admin-page .btn-secondary:hover {
    background: #4a4a4a;
}

.admin-page .modal-footer {
    margin-top: 25px;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.admin-page .file-info {
    background: #353535;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #ff6b35;
}

.admin-page .file-info-label {
    color: #b0b0b0;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.admin-page .file-info-value {
    color: #f6f6f6;
    font-size: 1.1em;
    font-weight: bold;
}

.admin-page .name-conflict-warning {
    background: rgba(255, 107, 53, 0.1);
    border: 2px solid #ff6b35;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    color: #ff6b35;
}

.admin-page .radio-group {
    margin-top: 10px;
}

.admin-page .radio-group label {
    display: block;
    padding: 10px;
    margin-bottom: 8px;
    background: #353535;
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-page .radio-group label:hover {
    border-color: #ff6b35;
}

.admin-page .radio-group input[type="radio"] {
    margin-right: 10px;
}

.admin-page .radio-group input[type="radio"]:checked + span {
    color: #ff6b35;
}

.admin-page .progress {
    display: none;
    width: 100%;
    height: 30px;
    background: #353535;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.admin-page .progress-bar {
    height: 100%;
    background: #ff6b35;
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
}

.admin-page .confirm-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

.admin-page .confirm-modal-content {
    background-color: #2a2a2a;
    margin: 15% auto;
    padding: 40px;
    border: 2px solid #4caf50;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    text-align: center;
    animation: slideDown 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.admin-page .confirm-modal-content.error {
    border-color: #f44336;
}

.admin-page .confirm-icon {
    color: #4caf50;
    margin-bottom: 20px;
}

.admin-page .confirm-icon.error {
    color: #f44336;
}

.admin-page .confirm-icon svg {
    width: 64px;
    height: 64px;
}

.admin-page .confirm-message {
    color: #f6f6f6;
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.5;
}

.admin-page .confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.admin-page .confirm-buttons .btn {
    min-width: 120px;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.login-page .login-box {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    color: #f6f6f6;
    padding: 40px;
    width: 100%;
    max-width: 360px;
}

.login-page .login-box h1 {
    color: #f6f6f6;
    margin: 0 0 8px;
    font-size: 1.4em;
}

.login-page .login-box .subtitle {
    color: #888;
    font-size: 0.85em;
    margin-bottom: 28px;
}

.login-page .login-box label {
    display: block;
    font-size: 0.85em;
    margin-bottom: 6px;
    color: #aaa;
}

.login-page .login-box input[type="text"],
.login-page .login-box input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #2a2a2a;
    color: #f6f6f6;
    font-size: 1em;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.login-page .login-box input[type="text"]:focus,
.login-page .login-box input[type="password"]:focus {
    outline: none;
    border-color: #ff6b35;
}

.login-page .login-box input[type="text"]::placeholder,
.login-page .login-box input[type="password"]::placeholder {
    color: #888;
}

.login-page .login-box button {
    width: 100%;
    padding: 11px;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
}

.login-page .login-box button:hover {
    background: #ff8555;
}

.login-page .error-msg {
    background: #5c1a1a;
    border: 1px solid #a33;
    color: #f88;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Styl dla plików z błędnym rozmiarem */
.pdf-item.size-error {
    border: 2px solid #ff6b35 !important;
    background: rgba(255, 107, 53, 0.1) !important;
}

/* Ukrywanie wierszy przez filtr */
.hidden-by-filter {
    display: none !important;
}

/* Animacja rotacji dla ikony refresh */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

@media (max-width: 1024px) {
    .products-table th:first-child {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .products-table,
    .products-table tbody,
    .products-table tr,
    .products-table td {
        display: block;
        width: 100%;
    }

    .products-table th {
        display: none;
    }

    .products-table td {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    h1 {
        font-size: 1.8em;
    }

    .orders-grid {
        grid-template-columns: 1fr;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }

}
