/* Layout */
body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; height: 100vh; background: #f4f7f6; }
side-bar { flex: 0 0 200px; width: 200px; background-color: #2c3e50; color: white; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: width 0.2s ease, padding 0.2s ease; }
side-bar a { color: #bdc3c7; text-decoration: none; padding: 10px 12px; border-radius: 8px; transition: background 0.2s ease, color 0.2s ease; display: flex; align-items: center; gap: 10px; }
side-bar a:hover { color: white; background: rgba(255, 255, 255, 0.08); }
side-bar.is-collapsed { flex: 0 0 64px; width: 64px; padding: 16px 8px; }
side-bar.is-collapsed a { justify-content: center; padding: 10px 6px; }
main-content { flex-grow: 1; min-width: 0; padding: 40px; overflow-y: auto; }

/* Tables */
.custom-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.custom-table th { background: #ecf0f1; padding: 15px; text-align: left; color: #7f8c8d; }
.custom-table td { padding: 15px; border-bottom: 1px solid #eee; }

.time-logs-table th {
    padding: 10px 12px;
}

.time-logs-table td {
    padding: 10px 12px;
    vertical-align: top;
}

.time-logs-table-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 240px;
}

.time-logs-table-scroll {
    flex: 1;
    overflow: auto;
    border-radius: 8px;
}

.time-logs-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ecf0f1;
}

.time-logs-table.summary-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    border-top: none;
}

.time-logs-table-footer {
    margin-top: 6px;
}

.time-logs-table tbody tr.time-log-incomplete td {
    background: #fff7ed;
}

.time-logs-table tbody tr.time-log-incomplete td:first-child {
    border-left: 3px solid #f59e0b;
}

.time-logs-table .btn-clear {
    padding: 4px 8px;
    font-size: 11px;
}

.time-logs-table small {
    font-size: 11px;
}

.time-logs-status {
    white-space: nowrap;
}

.time-logs-status .status-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.time-logs-status .status-link:hover {
    text-decoration: underline;
}

.time-logs-status .status-meta {
    font-size: 11px;
    color: #6b7280;
    margin-left: 6px;
}

.time-logs-status .status-preview {
    font-size: 11px;
    margin-left: 8px;
    color: #2563eb;
    text-decoration: none;
    border: 1px solid #cbd5f5;
    padding: 2px 6px;
    border-radius: 6px;
}

.time-logs-status .status-preview:hover {
    border-color: #94a3b8;
    color: #1d4ed8;
}

.time-logs-status .status-pending {
    color: #e67e22;
}

.time-logs-table .summary-row td {
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

/* Modal & Animation */
/* MODAL - NOWA WERSJA Z PŁYNNĄ ANIMACJĄ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    
    /* Ukrywamy go w ten sposób, aby działała animacja */
    visibility: hidden;
    opacity: 0;
    pointer-events: none; /* Żeby nie blokował kliknięć gdy jest ukryty */
    
    transition: all 0.3s ease-in-out;
    display: flex; /* Centrujemy zawartość flexem */
    align-items: flex-start;
    justify-content: center;
}

/* Stan aktywny - pokazujemy */
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 500px;
    margin-top: 50px; /* Odległość od góry */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);

    /* Efekt "wjeżdżania" z góry */
    transform: translateY(-100px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Gdy modal jest aktywny, przesuwamy treść na miejsce */
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap; /* Pozwala zawijać w razie małego ekranu */
    align-items: flex-end;
    gap: 15px;
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: bold;
}

.form-input {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

/* Styl dla inputów w filtrach */
.filter-bar input, .filter-bar select {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.time-logs-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.time-logs-toolbar h1 {
    margin: 0;
    white-space: nowrap;
}

.time-logs-toolbar .filter-bar {
    margin-bottom: 0;
    flex: 1;
    min-width: 520px;
}

.time-logs-toolbar .btn-save {
    white-space: nowrap;
}

.filter-bar.compact {
    padding: 12px 14px;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.filter-bar.compact .filter-group {
    min-width: 120px;
}

.filter-bar.compact input,
.filter-bar.compact select {
    padding: 6px;
    font-size: 13px;
}

.filter-bar.compact label {
    font-size: 10px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-short {
    display: none;
    font-size: 14px;
    font-weight: 700;
}

side-bar.is-collapsed .brand-full {
    display: none;
}

side-bar.is-collapsed .brand-short {
    display: inline-flex;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ecf0f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

side-bar.is-collapsed .nav-label {
    display: none;
}


.logout-form {
    width: 100%;
    margin-top: 10px;
}

.logout-btn {
    background: none;
    border: none;
    color: #e74c3c; /* Czerwony kolor dla wyróżnienia */
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

side-bar.is-collapsed .logout-btn {
    justify-content: center;
}


.logout-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

/* Buttons */
.btn-primary,
.btn-save {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-clear {
    background: transparent;
    color: #2563eb;
    border: 1px solid #cbd5f5;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover,
.btn-save:hover {
    background: #1d4ed8;
}

.btn-clear:hover {
    border-color: #94a3b8;
    color: #1d4ed8;
}

.btn-clear.danger {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-clear.danger:hover {
    border-color: #fca5a5;
    color: #b91c1c;
}

.inline-form {
    display: inline-flex;
}

.action-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.action-inline .inline-form {
    margin: 0;
}

.client-link {
    color: #1f2937;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.client-link:hover {
    background: #e0f2fe;
    color: #0369a1;
    box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.15);
}

.client-link[aria-disabled="true"] {
    pointer-events: none;
    color: #9ca3af;
    background: transparent;
    box-shadow: none;
}
