/* Vlastní styly pro stránku Přijaté faktury */

body {
    padding: 0;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1 {
    color: #0056b3;
    margin-bottom: 20px;
}

.main-layout {
    display: flex;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar .nav-link {
    color: #495057;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link.active {
    color: #0056b3;
    font-weight: bold;
    background-color: #e9ecef;
    border-radius: 4px;
}

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

.content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    height: 100vh;
}

.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.summary-panel {
    display: flex;
    gap: 2rem;
    margin-bottom: 20px;
    font-size: 1.1rem;
    background: #f6f8fa;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.summary-panel .summary-item {
    font-weight: 500;
    color: #0056b3;
}

.table-responsive {
    margin-top: 20px;
    padding-top: 0;
    overflow-x: auto;
}

.table th {
    background-color: #0056b3;
    color: white;
    position: sticky;
    top: 0;
    padding: 12px 8px;
    z-index: 10;
    border-bottom: 2px solid #004494;
    white-space: nowrap;
}

.table td {
    word-break: break-word;
    vertical-align: middle;
    padding: 10px 8px;
    border-bottom: 1px solid #e9ecef;
}

.table .sticky-col {
    position: sticky;
    left: 0;
    background: #f8f9fa;
    z-index: 1;
    box-shadow: 2px 0 4px -2px rgba(0,0,0,0.1);
}

.table thead .sticky-col {
    z-index: 12; /* Vyšší z-index pro hlavičku, aby byla nad ostatními buňkami */
    background: #0056b3;
}

.table tbody .sticky-col {
    background: #f8f9fa;
    z-index: 11;
}

.table .action-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    white-space: nowrap;
}

.table .action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
}

.sberna-row {
    transition: background-color 0.2s ease;
}
.sberna-row:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Zvýraznění řádků s vysokou částkou */
.high-amount-row {
    background-color: rgba(255, 236, 236, 0.7);
}
.high-amount-row:hover {
    background-color: rgba(255, 236, 236, 0.9);
}

/* --- Barevné karty sběren --- */
.db-card {
    border-left: 5px solid !important;
    border-radius: 8px !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    background: linear-gradient(135deg, #e3f0ff 0%, #fafdff 60%, #f5f5f5 100%) !important;
    transition: box-shadow 0.2s;
    margin-bottom: 1rem !important;
    border: 1px solid #e0e0e0 !important;
}
.db-card:hover {
    box-shadow: 0 4px 12px rgba(33,150,243,0.2) !important;
    border-color: #1976d2 !important;
}
.db-card-krmelin {
    border-left-color: #1565c0 !important;
    background: linear-gradient(135deg, #b3e5fc 0%, #e6f7ff 60%, #d0eaff 100%) !important;
}
.db-card-havirov {
    border-left-color: #ff9800 !important;
    background: linear-gradient(135deg, #ffe0b2 0%, #fff0e6 60%, #ffd180 100%) !important;
}
.db-card-centrum {
    border-left-color: #388e3c !important;
    background: linear-gradient(135deg, #c8e6c9 0%, #f0f7e6 60%, #d8f5e3 100%) !important;
}
.db-card .card-body {
    padding: 0.5rem 0.75rem !important;
}
.db-card .card-header {
    padding: 0.5rem 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 8px 8px 0 0 !important;
    background: none !important;
    font-size: 1em !important;
}
.db-header-krmelin {
    background-color: #42a5f5 !important;
    color: #fff !important;
}
.db-header-havirov {
    background-color: #ffb74d !important;
    color: #fff !important;
}
.db-header-centrum {
    background-color: #66bb6a !important;
    color: #fff !important;
}

.db-card .card-body .row {
    margin-top: -0.25rem;
}

.db-card .row .col-12 {
    margin-bottom: 0.25rem;
}

/* --- Upozornění na vysokou částku --- */
.high-amount-alert {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    color: #8a6d1b;
    padding: 0.3em 0.5em;
    border-radius: 4px;
    font-size: 0.85em;
    margin-top: 0.3em;
    margin-bottom: 0.3em;
}
.high-amount-alert i {
    color: #ff9800;
    margin-right: 0.3em;
    font-size: 0.9em;
    vertical-align: middle;
}
.high-amount-alert strong {
    color: #d17b00;
}

/* --- Celkový přehled --- */
.card.border-primary {
    border-left: 7px solid #1976d2 !important;
    border-radius: 12px;
    background: linear-gradient(135deg, #e3f0ff 80%, #c8e1fa 100%);
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.07);
}
.card-header.bg-primary {
    background: linear-gradient(90deg, #1976d2 80%, #42a5f5 100%);
    color: #fff !important;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}


/* Styly pro buňku s částkou */
.amount-cell {
    text-align: right;
    white-space: nowrap;
    color: #333;
}

.amount-over10k {
    color: #d63939;
}

.dynamic-card-title {
    font-size: 0.9rem;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2;
}
.dynamic-card-label {
    font-size: 0.75rem;
    white-space: normal !important;
    word-break: break-word !important;
    margin-bottom: 0 !important;
    color: #555;
    line-height: 1.2;
}
.dynamic-card-value {
    font-size: 0.9rem;
    font-weight: bold;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2;
}

/* Styly pro detail faktur */
.invoice-detail-header {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-left: 4px solid #0056b3;
}

.invoice-items-table th {
    position: sticky;
    top: 0;
    background-color: #f0f7ff;
    color: #0056b3;
    z-index: 5;
}

/* Loader */
#pageLoader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    z-index: 2000;
}
#pageLoader .spinner-border {
    width: 4rem;
    height: 4rem;
}

/* Responzivní styly */
@media (max-width: 992px) {
    .table-responsive {
        overflow-x: auto;
    }
    
    .table .sticky-col {
        position: relative; /* Vypnutí sticky pro mobilní zařízení */
        left: auto;
    }
}

@media (max-width: 768px) {
    .summary-panel {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .db-card {
        margin-bottom: 1rem;
    }
    
    .action-btns {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-btns .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    .content-area {
        height: auto;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .search-form .col-md-auto {
        margin-top: 1rem;
    }
    
    .search-form .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
