/* static/css/style.css */

/* --- Ustawienia Globalne --- */
body { background-color: #f8f9fa; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* --- Pasek boczny (Sidebar) --- */
.sidebar { background: #2c3e50; min-height: 100vh; color: white; padding-top: 20px; display: flex; flex-direction: column; }
.sidebar .nav-link { color: #bdc3c7; border-radius: 5px; margin: 5px 15px; }
.sidebar .nav-link.active { background: #34495e; color: white; }
.sidebar .nav-link.text-danger:hover { background: rgba(220, 53, 69, 0.1); }

/* --- Elementy UI --- */
.card { border: none; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); margin-bottom: 20px; }
.table-container { background: white; border-radius: 10px; padding: 20px; }
.status-pill { font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; }
#invoicePreviewFrame { width: 100%; height: 80vh; border: none; border-radius: 10px; }
.btn-loading { pointer-events: none; opacity: 0.8; }
.filter-bar { gap: 10px; flex-wrap: wrap; }

/* --- Tabela i Sortowanie --- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { background-color: #e9ecef !important; }
.sort-icon { font-size: 0.8rem; color: #adb5bd; margin-left: 5px; }
th.sorted-asc .sort-icon::before { content: "\f574"; color: #0d6efd; }
th.sorted-desc .sort-icon::before { content: "\f570"; color: #0d6efd; }

/* --- Klikalne wiersze i statusy --- */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: #f1f3f5 !important; }

.exported-row { background-color: #f8f9fa; }
.exported-row td { color: #8e959c; }
.exported-row strong { color: #6c757d; }
.exported-row .badge { opacity: 0.5; }

/* --- Tryb Drukowania --- */
.print-header { display: none; }
@media print {
    body { background-color: white; }
    .sidebar, .filter-bar, h1, .alert, .print-controls, .modal { display: none !important; }
    .col-md-10 { width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .table-container { box-shadow: none !important; margin: 0; padding: 0; }

    #invoiceTable th:first-child, #invoiceTable td:first-child { display: none !important; }
    #invoiceTable { font-size: 11pt; width: 100%; }

    /* Zapobiega powtarzaniu stopki na każdej stronie - pokazuje ją tylko na końcu tabeli */
    tfoot { display: table-row-group; }

    .print-header { display: block !important; margin-bottom: 20px; border-bottom: 2px solid #000; padding-bottom: 10px; }

    .exported-row { background-color: transparent; }
    .exported-row td { color: #000; }
}

/* --- Panel Logowania --- */
body.login-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    max-width: 400px;
    width: 100%;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.login-header {
    background-color: #2c3e50;
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 20px;
    text-align: center;
}