/* Variable Definition */
:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-focus: #3b82f6;
    --shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --radius-lg: 20px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

/* Reset i bazy */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Karta główna */
.login-card {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Sekcja z logo */
.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background-color: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid #dbeafe;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Tytuł i opis */
.card-titles {
    margin-bottom: 28px;
}

.card-titles h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.card-titles p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Formularz i wejścia */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    background-color: #ffffff;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Akcje */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.forgot-password {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Przycisk */
.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

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

.submit-btn:active {
    transform: scale(0.99);
}

/* Stopka */
.card-footer {
    margin-top: 28px;
    text-align: center;
}

.card-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- LAYOUT APLIKACJI I SIDEBAR --- */
body.dashboard-body {
    background-color: #f8fafc;
    min-height: 100vh;
    display: block;
    padding: 0;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f1f5f9;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.user-profile-card .avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background-color: #eff6ff;
    color: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background-color: #fef2f2;
}

/* --- OBSZAR GŁÓWNY --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    max-width: 1200px;
}

.content-header {
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- SIATKA KART --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.card-header-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.card-badge.primary {
    background-color: #dbeafe;
    color: var(--primary);
}

.dash-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease;
}

.card-link:hover {
    color: var(--primary-hover);
}

/* Wyróżniona karta */
.featured-card {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

/* Responsywność */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}