/**
 * ADR Document Generator - Stylesheet
 * Version: 3.3
 * Author: Fagron a.s.
 */

/* ==========================================================================
   CSS Variables / Design Tokens
   ========================================================================== */
:root {
    /* Brand colors */
    --primary: #e6352b;
    --primary-dark: #c42d25;
    --primary-light: #ff4f44;
    --primary-bg: rgba(230, 53, 43, 0.08);
    
    /* Neutral colors */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Semantic colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Layout */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);

    /* ADR Print Document Typography */
    --adr-print-base-size: 0.55rem;      /* Základní velikost textu */
    --adr-print-heading-size: 0.75rem;   /* Velikost nadpisu */
    --adr-print-table-header-size: 0.48rem;  /* Velikost záhlaví tabulek (menší než základní text) */
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder {
    width: 140px;
    height: 48px;
    background: var(--white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.5rem;
}

.logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.header-badge {
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================================================
   Container
   ========================================================================== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem 3rem;
    flex: 1;
    width: 100%;
}

/* ==========================================================================
   Upload Section
   ========================================================================== */
.upload-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title svg {
    color: var(--primary);
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
    align-items: end;
}

@media (max-width: 900px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   File Drop Zone
   ========================================================================== */
.file-drop {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--gray-50);
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-drop.has-file {
    border-color: var(--success);
    background: var(--success-bg);
}

.file-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
    color: var(--gray-400);
}

.file-drop.has-file .file-drop-icon {
    color: var(--success);
}

.file-drop-text {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.file-drop-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 53, 43, 0.3);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Processing Overlay
   ========================================================================== */
.processing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.processing-overlay.active {
    display: flex;
}

.processing-container {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

.processing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.processing-logo {
    height: 50px;
    margin-bottom: 1.5rem;
}

.processing-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.processing-header p {
    color: var(--gray-500);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.progress-bar-container {
    height: 12px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 100px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-weight: 600;
}

.processing-log {
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    max-height: 350px;
    overflow-y: auto;
    font-size: 0.8125rem;
}

.log-entry {
    padding: 0.375rem 0;
    display: flex;
    gap: 0.75rem;
    color: var(--gray-400);
    animation: fadeIn 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

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

.log-entry.adr {
    color: #ff8a80;
    background: rgba(230, 53, 43, 0.1);
    padding: 0.5rem 0.75rem;
    margin: 0.25rem -0.75rem;
    border-radius: 4px;
}

.log-entry .log-time {
    color: var(--gray-600);
    min-width: 70px;
}

.log-entry.success { color: #69f0ae; }
.log-entry.info { color: #40c4ff; }
.log-entry.warning { color: #ffab40; }

/* ==========================================================================
   Results Section
   ========================================================================== */
.results-section {
    display: none;
}

.results-section.active {
    display: block;
}

.results-header {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.stats-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
}

.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

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

.tab-content {
    display: none;
    padding-top: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* ==========================================================================
   Routes Grid
   ========================================================================== */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.route-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideIn 0.3s ease backwards;
    font-size: 0.875rem;
}

.route-card.over-limit { border: 3px solid var(--danger); }
.route-card.under-limit { border: 2px solid var(--success); }
.route-card.no-adr { opacity: 0.5; }

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

.route-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.route-card.over-limit .route-header { background: var(--danger-bg); }
.route-card.under-limit .route-header { background: var(--success-bg); }

.route-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.route-icon {
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.route-card.over-limit .route-icon { background: var(--danger); color: var(--white); }
.route-card.under-limit .route-icon { background: var(--success); color: var(--white); }

.route-name {
    font-weight: 700;
    font-size: 0.9375rem;
}

.route-code {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.route-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.route-badge.over { background: var(--danger); color: var(--white); }
.route-badge.under { background: var(--success); color: var(--white); }
.route-badge.none { background: var(--gray-200); color: var(--gray-600); }

.route-body {
    padding: 0.75rem 1rem;
}

.route-empty {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.route-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    margin-bottom: 0.75rem;
}

.points-label {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.points-value {
    font-weight: 600;
    font-size: 1.25rem;
}

.points-value.over { color: var(--danger); }
.points-value.under { color: var(--success); }

.points-limit {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ==========================================================================
   UN Row
   ========================================================================== */
.un-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--primary);
    margin-bottom: 0.5rem;
}

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

.un-class {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.un-class.class-3 { background: #fff3e0; color: #e65100; border: 2px solid #ffb74d; }
.un-class.class-5 { background: #fff8e1; color: #f57f17; border: 2px solid #ffca28; }
.un-class.class-6 { background: #f3e5f5; color: #7b1fa2; border: 2px solid #ba68c8; }
.un-class.class-8 { background: #e3f2fd; color: #1565c0; border: 2px solid #64b5f6; }
.un-class.class-9 { background: #e8f5e9; color: #2e7d32; border: 2px solid #81c784; }

.un-info {
    flex: 1;
    min-width: 0;
}

.un-number {

    font-weight: 700;
    font-size: 0.8125rem;
}

.un-name {
    font-size: 0.6875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.un-detail {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.125rem;
}

.un-stats {
    text-align: right;
    font-size: 0.75rem;
}

.un-volume {
    font-weight: 700;
    color: var(--primary);
}

.un-points {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.route-footer {
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.route-stats {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ==========================================================================
   Not Found Section
   ========================================================================== */
.not-found-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-top: 2rem;
}

.not-found-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.not-found-header h3 {
    color: var(--warning);
}

.not-found-table {
    width: 100%;
    border-collapse: collapse;
}

.not-found-table th,
.not-found-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.not-found-table th {
    background: var(--gray-50);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-600);
}

.not-found-table tr:hover {
    background: var(--gray-50);
}

.item-code {
    font-weight: 600;
}

/* ==========================================================================
   Print Modal
   ========================================================================== */
.print-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.print-modal.active {
    display: flex;
}

.print-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.print-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.print-body {
    padding: 2rem;
}

.btn-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--gray-200);
}

/* ==========================================================================
   ADR Document (Print)
   ========================================================================== */
/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    /* Hide everything except print area */
    body > *:not(.print-modal) {
        display: none !important;
    }

    .print-modal {
        display: block !important;
        position: static !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-content {
        display: block !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

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

    .print-body {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .print-area {
        display: block !important;
        position: static !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .adr-document {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        page-break-after: always !important;
    }

    /* Last document should not create a new page */
    .adr-document:last-child {
        page-break-after: avoid !important;
    }

    .adr-document * {
        page-break-inside: avoid !important;
    }

    /* Ensure table rows don't break */
    .adr-doc-table tr {
        page-break-inside: avoid !important;
    }

    /* Hide page separator markers in print */
    .adr-document::after {
        display: none !important;
    }
}

/* ==========================================================================
   UN Detail Modal
   ========================================================================== */
.un-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.un-detail-content {
    background: white;
    border-radius: var(--radius);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.un-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.un-detail-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.un-detail-header p {
    margin: 0.5rem 0 0 0;
    color: var(--gray-600);
    font-size: 0.9375rem;
}

.un-detail-header small {
    color: var(--gray-500);
}

.un-detail-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.5rem;
    line-height: 1;
}

.un-detail-close:hover {
    color: var(--gray-700);
}

.un-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.un-detail-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.un-detail-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.un-detail-stat-value.success {
    color: #22c55e;
}

.un-detail-stat-value.danger {
    color: #ef4444;
}

.un-detail-stat-value .multiplier {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.un-detail-stat-value .separator {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0 0.25rem;
}

.un-detail-stat-value .limit {
    color: var(--gray-600);
}

.un-detail-section-title {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.un-detail-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.un-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.un-detail-table thead {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: white;
    z-index: 1;
}

.un-detail-table th {
    padding: 0.75rem;
    text-align: left;
}

.un-detail-table th.center {
    text-align: center;
}

.un-detail-table th.right {
    text-align: right;
}

.un-detail-table tbody tr.sj-row {
    background: var(--primary-bg);
    font-weight: 600;
}

.un-detail-table tbody tr.item-row {
    background: var(--gray-50);
}

.un-detail-table td {
    padding: 0.5rem 0.75rem;
}

.un-detail-table td.item-no {
    padding-left: 2rem;
    font-size: 0.8125rem;
}

.un-detail-table td.description {
    font-size: 0.875rem;
}

.un-detail-table td.center {
    text-align: center;
}

.un-detail-table td.right {
    text-align: right;
}

.un-detail-footer {
    margin-top: 1.5rem;
    text-align: right;
}

/* Print modal content - ensure documents don't overlap */
@media screen {
    .print-body .adr-document {
        margin-bottom: 3rem;
        padding: 1.5rem;
        border: 1px solid var(--gray-200);
        border-radius: 0;
        background: white;
        box-shadow: none;
    }

    .print-body .adr-document:last-child {
        margin-bottom: 0;
    }

    /* Separator between documents in preview - HIDDEN IN PRINT */
    .print-body .adr-document::after {
        content: '--- Konec strany ---';
        display: block;
        text-align: center;
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px dashed var(--gray-300);
        color: var(--gray-400);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .print-body .adr-document:last-child::after {
        display: none;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-brand strong {
    color: var(--white);
    font-size: 0.9375rem;
}

.footer-brand span {
    font-size: 0.8125rem;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    padding-left: 2rem;
    border-left: 1px solid var(--gray-600);
    flex-wrap: wrap;
}

.footer-contact a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.footer-contact a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-email {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.footer-sep {
    color: var(--gray-500);
    margin: 0 0.25rem;
}

.footer-stats {
    display: flex;
    gap: 2rem;
}

.footer-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.footer-stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-contact {
        padding-left: 0;
        border-left: none;
        flex-direction: column;
    }
    
    .footer-stats {
        width: 100%;
        justify-content: center;
    }
}

@media print {
    .footer {
        display: none;
    }
}

/* ==========================================================================
   Carrier Selection
   ========================================================================== */
.carrier-selection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.carrier-selection > label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.carrier-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.carrier-group {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.carrier-group:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.carrier-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.carrier-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.carrier-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.carrier-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.carrier-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.carrier-checkbox input[type="checkbox"]:checked ~ .carrier-label .carrier-name {
    color: var(--primary);
}

.carrier-group:has(input[type="checkbox"]:checked) {
    border-color: var(--primary);
    background: var(--primary-bg);
}

@media (max-width: 768px) {
    .carrier-options {
        grid-template-columns: 1fr;
    }
}

.carrier-checkbox-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    transition: background 0.2s;
}

.carrier-checkbox-small:hover {
    background: var(--gray-50);
}

.carrier-checkbox-small input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.carrier-checkbox-small input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 600;
}

/* ==========================================================================
   Validation Alerts
   ========================================================================== */
.validation-alert {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-line;
}

.validation-alert.error {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--gray-800);
}

.validation-alert.warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--gray-800);
}

.validation-alert.success {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--gray-800);
}

.validation-alert strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.validation-alert ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.validation-alert ul li {
    margin: 0.25rem 0;
}

.log-entry.error {
    color: var(--danger);
    font-weight: 600;
}

.log-entry.warning {
    color: var(--warning);
    font-weight: 500;
}

/* ==========================================================================
   UN Detail Modal
   ========================================================================== */
.un-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

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

.un-detail-content {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: slideUp 0.3s ease-out;
}

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

.un-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

/* UN row hover effect */
.un-row {
    transition: all 0.2s ease;
}

.un-row:hover {
    background: var(--primary-bg) !important;
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .un-detail-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    .un-detail-header h2 {
        font-size: 1.25rem;
    }
}
/* ==========================================================================
   Data Issues Alert - chybějící datové podklady (UN databáze / objemy)
   ========================================================================== */
.data-issues-alert {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #7f1d1d;
}
.data-issues-alert .dia-title {
    font-size: 1rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 0.5rem;
}
.data-issues-alert .dia-block { margin: 0.5rem 0; }
.data-issues-alert .dia-block ul { margin: 0.25rem 0 0.25rem 1.25rem; padding: 0; }
.data-issues-alert .dia-block li { margin: 0.15rem 0; }
.data-issues-alert code {
    background: #fee2e2;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85em;
}
.data-issues-alert .dia-footer {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #fecaca;
    font-size: 0.8125rem;
    color: #991b1b;
}
