/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f5f6fa; color: #333; min-height: 100vh; }

/* ---- Login page ---- */
body.login-page {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}
.login-box {
    background: #fff; border-radius: 12px; padding: 2.5rem 2rem;
    width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.login-box h1 { font-size: 1.6rem; color: #1a73e8; margin-bottom: .25rem; }
.login-box h2 { font-size: 1.1rem; color: #555; margin-bottom: 1.5rem; font-weight: 400; }
.login-box label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.login-box input { width: 100%; padding: .6rem .75rem; border: 1px solid #ccc; border-radius: 6px;
    font-size: 1rem; margin-bottom: 1rem; }
.login-box input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.login-box button { width: 100%; padding: .75rem; background: #1a73e8; color: #fff;
    border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: 600; }
.login-box button:hover { background: #1558c0; }

/* ---- App layout: sidebar + content ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 230px;
    min-width: 230px;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.25rem 1.1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
}
.sidebar-brand-icon { font-size: 1.4rem; }

.sidebar-nav {
    flex: 1;
    padding: .6rem 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-section {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    padding: .9rem 1.1rem .25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1.1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0;
    font-size: .92rem;
    transition: background .12s, color .12s;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #f1f5f9;
}
.nav-item.nav-active {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}
.nav-icon { font-size: 1.05rem; width: 1.4rem; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 9999px;
    font-size: .68rem;
    font-weight: 700;
    padding: .1rem .45rem;
    min-width: 1.2rem;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.sidebar-user-name {
    font-size: .88rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.role-badge {
    display: inline-block;
    background: rgba(26,115,232,.35);
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .72rem;
    color: #93c5fd;
    font-weight: 600;
}
.sidebar-user-actions {
    display: flex;
    gap: .4rem;
    margin-top: .25rem;
    flex-wrap: wrap;
}
.sidebar-action-btn {
    flex: 1;
    text-align: center;
    background: rgba(255,255,255,.1);
    color: #cbd5e1;
    text-decoration: none;
    padding: .3rem .5rem;
    border-radius: 6px;
    font-size: .78rem;
    transition: background .12s;
    white-space: nowrap;
}
.sidebar-action-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.sidebar-action-logout { background: rgba(239,68,68,.25); color: #fca5a5; }
.sidebar-action-logout:hover { background: rgba(239,68,68,.45); color: #fff; }

/* ---- Content area ---- */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Layout ---- */
.container { max-width: 1300px; margin: 1.75rem auto; padding: 0 1.5rem; width: 100%; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.page-header h1 { font-size: 1.6rem; color: #1a73e8; }
h1 { margin-bottom: 1rem; }

/* ---- Dashboard stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 1.5rem;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.stat-number { font-size: 2.5rem; font-weight: 700; color: #1a73e8; }
.stat-label { color: #666; font-size: .92rem; }

/* ---- Buttons ---- */
.btn {
    display: inline-block; padding: .55rem 1.1rem; background: #1a73e8; color: #fff;
    border: none; border-radius: 6px; font-size: .92rem; cursor: pointer;
    text-decoration: none; font-weight: 500; transition: background .15s;
}
.btn:hover { background: #1558c0; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #565e64; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #b02a37; }
.btn-shifts { background: #f59e0b; color: #fff; }
.btn-shifts:hover { background: #d97706; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }

/* ---- Alerts ---- */
.alert { padding: .85rem 1.1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ---- Table ---- */
.table { width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.table th { background: #1a73e8; color: #fff; padding: .75rem 1rem;
    text-align: left; font-size: .88rem; font-weight: 600; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid #eef0f5; font-size: .9rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f0f4ff; }
.text-center { text-align: center; color: #888; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-full { grid-column: 1 / -1; }
.form-group label { font-size: .85rem; font-weight: 600; color: #444; }
.form-group input, .form-group select {
    padding: .6rem .75rem; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: .95rem; background: #fff;
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.checkboxes { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.checkboxes label { display: flex; align-items: center; gap: .4rem; font-size: .92rem; cursor: pointer; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: .75rem; }
.checkbox-list label { display: flex; align-items: center; gap: .35rem; font-size: .9rem; cursor: pointer;
    background: #f3f4f6; padding: .35rem .75rem; border-radius: 6px; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }

/* ---- Footer ---- */
.footer { text-align: center; padding: 1rem 1.5rem; color: #aaa; font-size: .78rem; border-top: 1px solid #e5e7eb; margin-top: auto; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sidebar { width: 58px; min-width: 58px; }
    .sidebar-brand-text, .nav-label, .nav-section,
    .sidebar-user-name, .sidebar-user-actions, .role-badge { display: none; }
    .sidebar-brand { justify-content: center; padding: 1rem .5rem; }
    .nav-item { justify-content: center; padding: .7rem 0; }
    .nav-icon { width: auto; font-size: 1.2rem; }
    .sidebar-footer { padding: .6rem .35rem; align-items: center; }
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .table { font-size: .82rem; }
    .table th, .table td { padding: .5rem .6rem; }
    .container { padding: 0 .75rem; }
}

/* ---- Login page ---- */
body.login-page {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}
.login-box {
    background: #fff; border-radius: 12px; padding: 2.5rem 2rem;
    width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.login-box h1 { font-size: 1.6rem; color: #1a73e8; margin-bottom: .25rem; }
.login-box h2 { font-size: 1.1rem; color: #555; margin-bottom: 1.5rem; font-weight: 400; }
.login-box label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.login-box input { width: 100%; padding: .6rem .75rem; border: 1px solid #ccc; border-radius: 6px;
    font-size: 1rem; margin-bottom: 1rem; }
.login-box input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.login-box button { width: 100%; padding: .75rem; background: #1a73e8; color: #fff;
    border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: 600; }
.login-box button:hover { background: #1558c0; }

/* ---- Panel wyboru pracownikow ---- */
.pracownicy-wybor-panel {
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:8px;
    margin-bottom:2.5rem;
    overflow:hidden;
}
.pracownicy-wybor-summary {
    display:flex; align-items:center; gap:.6rem;
    padding:.6rem 1rem;
    cursor:pointer;
    font-weight:600;
    font-size:.9rem;
    color:#1e293b;
    background:#f8fafc;
    user-select:none;
    list-style:none;
}
.pracownicy-wybor-summary::-webkit-details-marker { display:none; }
.pracownicy-wybor-summary::before { content:'▶'; font-size:.7rem; color:#64748b; transition:transform .15s; }
details[open] .pracownicy-wybor-summary::before { transform:rotate(90deg); }
.wybrani-count {
    margin-left:auto;
    background:#dbeafe;
    color:#1d4ed8;
    border-radius:12px;
    padding:.1rem .6rem;
    font-size:.78rem;
    font-weight:700;
}
.pracownicy-wybor-form { padding:.75rem 1rem; }
.wybor-toolbar { display:flex; gap:.5rem; margin-bottom:.75rem; flex-wrap:wrap; }
.wybor-lista {
    display:flex; flex-wrap:wrap; gap:.4rem;
}
.wybor-item {
    display:flex; align-items:center; gap:.4rem;
    padding:.3rem .6rem;
    border:1px solid #e2e8f0;
    border-radius:6px;
    cursor:pointer;
    background:#f8fafc;
    font-size:.82rem;
    transition:background .1s, border-color .1s;
    user-select:none;
}
.wybor-item input[type=checkbox] { accent-color:#3b82f6; }
.wybor-item.selected { background:#eff6ff; border-color:#93c5fd; }
.wybor-item:hover { border-color:#94a3b8; }
.wybor-name { font-weight:600; color:#1e293b; }
.wybor-rola { color:#64748b; font-size:.74rem; }
