/* --- 1. ZMIENNE I RESET --- */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-body: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }

body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    margin: 0; 
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. UKŁAD (LAYOUT) --- */
.main-header { 
    background: var(--white); 
    border-bottom: 1px solid var(--border); 
    padding: 0.75rem 0; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}

.header-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 1.5rem; 
}

.container { 
    max-width: 1200px; 
    margin: 2rem auto; 
    padding: 0 1.5rem; 
    min-height: 70vh; 
}

/* --- 3. NAWIGACJA I ELEMENTY INTERFEJSU --- */
.logo { 
    font-weight: 700; 
    font-size: 1.25rem; 
    color: var(--primary); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-weight: 500; 
    font-size: 0.95rem; 
    transition: 0.2s; 
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* Przyciski */
.btn-primary { 
    background: var(--primary); 
    color: white !important; 
    border: none; 
    padding: 0.6rem 1.25rem; 
    border-radius: var(--radius); 
    cursor: pointer; 
    font-weight: 500; 
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-logout { 
    background: none; 
    border: 1px solid var(--border); 
    padding: 0.4rem 1rem; 
    border-radius: var(--radius); 
    cursor: pointer; 
    color: var(--text-main); 
    font-weight: 500; 
    transition: 0.2s; 
}
.btn-logout:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* --- 4. BREADCRUMBS --- */
.breadcrumb-container {
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); font-weight: 400; }
.breadcrumb-separator { margin: 0 10px; color: var(--border); font-weight: 300; user-select: none; }

/* --- 5. FORMULARZE I INPUTY (Uniwersalne) --- */
.form-group {
    margin-bottom: 1.25rem;
}

.label-sm {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* To jest brakująca klasa, która naprawi wygląd pól w Account i Auth */
.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background-color: var(--white);
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
    display: block;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control:disabled, .form-control.readonly-input {
    background-color: #f1f5f9 !important;
    color: var(--text-muted);
    cursor: not-allowed;
}

.modal {
    display: none; /* Ukryty domyślnie */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.2s ease-out;
}


/* --- 6. PASEK AKCJI (Dashboard) --- */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Wykorzystujemy już zdefiniowaną klasę .form-control dla spójności */
.action-bar input[type="text"] {
    max-width: 250px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background-color: var(--white);
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
}

/* --- 7. TABELA I PLIKI --- */
.file-table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    margin-bottom: 5rem;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-height: 150px;
}

.file-table th {
    background: #f8fafc;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.file-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover { background-color: #f8fafc; }

.file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
}

.file-icon-svg { flex-shrink: 0; }

/* --- 8. MENU KEBAB (DROPDOWN) --- */
.actions-menu { position: relative; display: inline-block; }

.kebab-btn {
    background: none; border: none; font-size: 1.25rem; color: var(--text-muted); 
    cursor: pointer; padding: 8px 12px; border-radius: 50%; transition: 0.2s; line-height: 1;
}
.kebab-btn:hover { background-color: #f1f5f9; color: var(--primary); }

.dropdown-content {
    display: none; position: absolute; right: 0; top: calc(100% + 5px);
    min-width: 200px; background-color: var(--white); border-radius: 10px;
    box-shadow: var(--shadow-md); border: 1px solid var(--border); z-index: 1000; padding: 6px;
}

.dropdown-content.show { display: block; animation: fadeIn 0.15s ease-out; }

.dropdown-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
    text-decoration: none; color: var(--text-main); font-size: 0.875rem; font-weight: 500;
    border: none; background: none; cursor: pointer; border-radius: 6px; transition: 0.2s; text-align: left;
}

.dropdown-item:hover { background-color: #f1f5f9; color: var(--primary); }
.dropdown-item svg { flex-shrink: 0; opacity: 0.7; stroke: currentColor; }
.dropdown-divider { height: 1px; background-color: var(--border); margin: 6px 0; }
.dropdown-item.delete-btn { color: #ef4444; }
.dropdown-item.delete-btn:hover { background-color: #fef2f2; }

/* Otwieranie w górę dla ostatnich elementów */
tr:nth-last-child(-n+3) .dropdown-content { top: auto; bottom: 100%; margin-bottom: 8px; }

/* --- 9. ANIMACJE I INNE --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#loader { font-weight: 600; color: var(--primary); text-align: center; margin-top: 2rem; }


/* Style dla dropdownu */
        .user-dropdown { position: relative; display: inline-block; }
        .avatar-trigger {
            background: none; border: none; cursor: pointer; padding: 0;
            display: flex; align-items: center;
        }
        .avatar-img {
            width: 40px; height: 40px; border-radius: 50%;
            border: 2px solid #eee; object-fit: cover;
        }
        .dropdown-content {
            display: none; position: absolute; right: 0; top: 100%;
            background-color: #fff; min-width: 180px; border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; margin-top: 8px;
            overflow: hidden;
        }
        .dropdown-content.show { display: block; }
        .dropdown-content a, .dropdown-content button {
            color: #333; padding: 12px 16px; text-decoration: none;
            display: block; font-size: 14px; width: 100%; text-align: left;
            border: none; background: none; cursor: pointer;
            font-family: inherit;
        }
        .dropdown-content a:hover, .dropdown-content button:hover { background-color: #f8f9fa; }
        .dropdown-divider { border-top: 1px solid #eee; }
        .btn-logout-link { color: #d9534f !important; }

