:root {
    --red: #d71920;
    --red-dark: #a90f15;
    --black: #111111;
    --ink: #1f2933;
    --muted: #687385;
    --line: #e5e7eb;
    --bg: #f4f5f7;
    --white: #ffffff;
    --green: #15803d;
    --orange: #b45309;
    --shadow: 0 12px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; }

.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: var(--black); color: var(--white); padding: 22px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 18px; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 48px; padding: 0; border-radius: 14px; background: #ffffff; box-shadow: 0 8px 22px rgba(0,0,0,.18); margin-bottom: 10px; overflow: hidden; text-decoration: none; }
.brand-logo-mark { display: none; width: 40px; height: 40px; object-fit: contain; }
.brand-logo-full { display: block; width: 170px; max-width: 100%; height: 34px; object-fit: contain; }
.brand small { color: #c9c9c9; }
.menu { display: grid; gap: 4px; }
.menu-section { color: #9ca3af; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 900; margin: 18px 10px 6px; }
.menu a { text-decoration: none; color: #f2f2f2; padding: 11px 13px; border-radius: 12px; font-weight: 700; border-left: 3px solid transparent; }
.menu a:hover { background: rgba(255,255,255,.08); border-left-color: var(--red); }
.menu a:focus, .menu a:active { background: rgba(215,25,32,.18); border-left-color: var(--red); }

.content-shell { min-width: 0; }
.topbar { height: 72px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.topbar span { color: var(--muted); margin-left: 10px; }
.logout { color: var(--red); text-decoration: none; font-weight: 800; }
main { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; }

.login-body { background: linear-gradient(135deg, #111, #2a0507); }
.login-main { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--white); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 18px; }
.login-logo { display: inline-flex; align-items: center; min-height: 58px; padding: 0 18px; border-radius: 16px; background: var(--black); color: #ffffff; border-left: 8px solid var(--red); font-size: 34px; font-weight: 1000; letter-spacing: .05em; line-height: 1; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.login-logo img { display: block; width: 270px; max-width: 100%; height: auto; object-fit: contain; }
.login-brand p { margin: 12px 0 0; color: var(--muted); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.demo-box { background: #f8f8f8; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 16px; color: var(--muted); }

.page-title { display: flex; justify-content: space-between; gap: 18px; align-items: center; background: var(--white); border-radius: 22px; padding: 24px; margin-bottom: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.page-title h1 { margin: 4px 0 8px; font-size: 32px; }
.page-title p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0; color: var(--red); text-transform: uppercase; font-size: 12px; letter-spacing: .12em; font-weight: 900; }
.muted { color: var(--muted); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.filters-card { border-left: 5px solid var(--red); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.stat-card span { color: var(--muted); font-weight: 800; font-size: 13px; }
.stat-card strong { display: block; font-size: 36px; margin: 8px 0 2px; }
.stat-card small { color: var(--muted); }
.stat-card.accent { border-left: 6px solid var(--red); }
.stat-card.accent strong { color: var(--red); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.layout-grid { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 18px; align-items: start; }
.form-card { position: sticky; top: 90px; }

form { display: grid; gap: 11px; }
label { font-weight: 800; color: #374151; }
input, select, textarea, button { width: 100%; border-radius: 11px; padding: 11px 12px; font-size: 15px; }
input, select, textarea { border: 1px solid #cfd4dc; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(215,25,32,.15); border-color: var(--red); }
button, .btn-primary { background: var(--red); color: white; border: 0; border-radius: 12px; padding: 11px 14px; font-weight: 900; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--black); color: white; border-radius: 12px; padding: 11px 14px; text-decoration: none; font-weight: 900; }
.btn-ok { background: var(--green); }
.btn-bad { background: var(--red); }
.btn-muted { background: #6b7280; }
.inline-form { display: inline-block; margin: 0 4px 4px 0; }
.inline-form button { width: auto; font-size: 13px; padding: 8px 10px; }
.date-grid, .filters-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filters-form { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.hint { background: #fff5f5; border-left: 4px solid var(--red); padding: 12px; border-radius: 12px; color: #7f1d1d; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f9fafb; color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: #fafafa; }
.empty-state { text-align: center; color: var(--muted); padding: 28px; }

.status { display: inline-block; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 900; }
.status-oczekuje { background: #fff7ed; color: var(--orange); }
.status-zaakceptowany { background: #dcfce7; color: #166534; }
.status-odrzucony { background: #fee2e2; color: #991b1b; }
.status-anulowany, .status-cofniety { background: #e5e7eb; color: #374151; }
.status-day-obecny { background: #dcfce7; color: #166534; }
.status-day-nieobecny { background: #fee2e2; color: #991b1b; }
.status-day-praca-zdalna { background: #e0f2fe; color: #075985; }
.status-day-delegacja { background: #fef3c7; color: #92400e; }
.msg { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; padding: 12px 14px; border-radius: 14px; margin-bottom: 18px; }
.msg p { margin: 0; }

.list-stack { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.list-item span { display: block; color: var(--muted); margin-top: 4px; }
.mini-summary { display: grid; gap: 12px; }
.mini-summary div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.mini-summary span { color: var(--muted); display: block; }
.mini-summary strong { font-size: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span, .chip { background: #f3f4f6; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; }

.calendar-card { overflow: hidden; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.calendar-head { font-weight: 900; color: var(--muted); padding: 8px; }
.calendar-day { min-height: 132px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.calendar-day.has-events { border-color: #fecaca; background: #fffafa; }
.calendar-day-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calendar-day-top span { background: var(--red); color: white; border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 900; }
.muted-day { opacity: .35; }
.calendar-event { background: #fff1f2; border-left: 4px solid var(--red); border-radius: 10px; padding: 7px; margin-top: 7px; font-size: 13px; }
.compact-event { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-more { margin-top: 8px; color: var(--red); font-size: 13px; font-weight: 900; }
.simple-page { padding: 28px; }

@media (max-width: 1000px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .menu { grid-template-columns: repeat(2, 1fr); }
    .stats-grid, .two-columns, .layout-grid { grid-template-columns: 1fr; }
    .form-card { position: static; }
    .filters-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-logo-mark { display: none; }
    .brand-logo-full { display: block; }
}
@media (max-width: 650px) {
    main { width: min(100% - 20px, 1500px); padding-top: 16px; }
    .page-title { display: block; }
    .stats-grid, .filters-form, .date-grid { grid-template-columns: 1fr; }
    .menu { grid-template-columns: 1fr; }
}
