/* System ED — interfejs aplikacji zapisów na egzaminy.
   Wszystko scope'owane pod .ed-app, żeby nie zderzać się ze stylami motywu. */

.ed-app {
	--ed-bg: #f4f6fb;
	--ed-surface: #ffffff;
	--ed-ink: #1c2433;
	--ed-muted: #5b6678;
	--ed-line: #e2e7f0;
	--ed-primary: #2a5bd7;
	--ed-primary-dark: #1e47ac;
	--ed-ok: #1f9d57;
	--ed-warn: #b54708;
	--ed-danger: #c0362c;
	--ed-radius: 12px;
	--ed-shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);

	margin: 0;
	background: var(--ed-bg);
	color: var(--ed-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	min-height: 100vh;
}
.ed-app * { box-sizing: border-box; }
.ed-app h1, .ed-app h2 { margin: 0 0 .4em; line-height: 1.25; }

/* ---------- Logowanie ---------- */
.ed-login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
	background: linear-gradient(135deg, #eef2fb, #e7ecf7); }
.ed-login__card { background: var(--ed-surface); border-radius: 16px; box-shadow: var(--ed-shadow);
	padding: 40px; max-width: 460px; width: 100%; text-align: center; }
.ed-login__logo, .ed-header__logo { display: inline-grid; place-items: center; width: 56px; height: 56px;
	border-radius: 12px; background: var(--ed-primary); color: #fff; font-weight: 800; letter-spacing: .5px; }
.ed-login__logo { margin-bottom: 16px; font-size: 20px; }
.ed-login h1 { font-size: 22px; }
.ed-login__sub { color: var(--ed-muted); margin: 0 0 24px; }
.ed-login__note { color: var(--ed-muted); font-size: 13px; margin-top: 20px; }

/* ---------- Nagłówek ---------- */
.ed-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
	justify-content: space-between; gap: 16px; flex-wrap: wrap;
	background: var(--ed-surface); border-bottom: 1px solid var(--ed-line);
	padding: 12px 24px; }
.ed-header__brand { display: flex; align-items: center; gap: 12px; }
.ed-header__logo { width: 40px; height: 40px; font-size: 15px; }
.ed-header__title { font-weight: 700; }
.ed-header__user { display: flex; align-items: center; gap: 12px; }
.ed-header__name { color: var(--ed-muted); }

.ed-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
	background: #eef1f8; color: var(--ed-muted); text-transform: uppercase; letter-spacing: .4px; }
.ed-badge--admin { background: #fdecea; color: var(--ed-danger); }
.ed-badge--teacher { background: #e9f1ff; color: var(--ed-primary-dark); }
.ed-badge--student { background: #e7f6ee; color: var(--ed-ok); }

/* ---------- Layout ---------- */
.ed-main { max-width: 1180px; margin: 0 auto; padding: 24px; }

/* ---------- Powłoka z bocznym menu ---------- */
.ed-shell { display: flex; gap: 22px; align-items: flex-start; }
.ed-side { flex: 0 0 212px; position: sticky; top: 80px; background: var(--ed-surface);
	border: 1px solid var(--ed-line); border-radius: var(--ed-radius); padding: 8px; box-shadow: var(--ed-shadow); }
.ed-side nav { display: flex; flex-direction: column; gap: 2px; }
.ed-side__link { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ed-ink);
	text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.ed-side__link:hover { background: #f1f4f9; }
.ed-side__link.is-active { background: var(--ed-primary); color: #fff; }
.ed-content { flex: 1; min-width: 0; }
.ed-tab { display: none; }
.ed-tab.is-active { display: block; animation: ed-fade .15s ease; }
.ed-tab__title { font-size: 20px; margin-bottom: 16px; }
@keyframes ed-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
	.ed-shell { flex-direction: column; }
	.ed-side { position: static; flex: none; width: 100%; }
	.ed-side nav { flex-direction: row; flex-wrap: wrap; }
	.ed-side__link { flex: 1 1 auto; text-align: center; }
}
.ed-section { margin-top: 28px; }
.ed-section__title { font-size: 18px; margin-bottom: 14px; }
.ed-section__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-section__bar .ed-section__title { margin-bottom: 0; }
.ed-empty { color: var(--ed-muted); background: var(--ed-surface); border: 1px dashed var(--ed-line);
	border-radius: var(--ed-radius); padding: 20px; text-align: center; }
.ed-hint { color: var(--ed-muted); font-size: 13px; }

/* ---------- Statystyki ---------- */
.ed-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ed-stat { background: var(--ed-surface); border: 1px solid var(--ed-line); border-radius: var(--ed-radius);
	padding: 18px; text-align: center; box-shadow: var(--ed-shadow); }
.ed-stat__num { display: block; font-size: 30px; font-weight: 800; }
.ed-stat__lbl { color: var(--ed-muted); font-size: 13px; }

/* ---------- Zakładki ---------- */
.ed-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px;
	border-bottom: 1px solid var(--ed-line); }
.ed-tab { padding: 10px 16px; text-decoration: none; color: var(--ed-muted); font-weight: 600;
	border-bottom: 2px solid transparent; }
.ed-tab.is-active { color: var(--ed-primary); border-bottom-color: var(--ed-primary); }
/* Pokazujemy wszystkie sekcje admina jedna pod drugą (zakładki = kotwice). */

/* ---------- Karty ---------- */
.ed-card { background: var(--ed-surface); border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius); padding: 20px; box-shadow: var(--ed-shadow); margin-bottom: 18px; }
.ed-card--info { background: #f0f5ff; border-color: #d6e2fb; box-shadow: none; }

/* ---------- Formularze ---------- */
.ed-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ed-form-grid__full { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-app label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ed-muted); }
.ed-app input, .ed-app select, .ed-app textarea { font: inherit; color: var(--ed-ink);
	padding: 9px 10px; border: 1px solid var(--ed-line); border-radius: 8px; background: #fff; width: 100%; }
.ed-app input:focus, .ed-app select:focus, .ed-app textarea:focus { outline: 2px solid #bcd0fb; border-color: var(--ed-primary); }
.ed-textarea-wide { margin-bottom: 12px; }
.ed-filter { margin-bottom: 16px; max-width: 280px; }

/* ---------- Przyciski ---------- */
.ed-btn { display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
	padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; text-decoration: none; text-align: center; }
.ed-btn--primary { background: var(--ed-primary); color: #fff; }
.ed-btn--primary:hover { background: var(--ed-primary-dark); }
.ed-btn--secondary { background: #eef1f8; color: var(--ed-ink); border-color: var(--ed-line); }
.ed-btn--ghost { background: transparent; color: var(--ed-muted); border-color: var(--ed-line); }
.ed-btn--danger-ghost { background: transparent; color: var(--ed-danger); border-color: #f1c9c5; }
.ed-btn--danger-ghost:hover { background: #fdecea; }
.ed-btn--disabled { background: #f0f0f3; color: #9aa3b2; cursor: not-allowed; }
.ed-btn--block { display: block; width: 100%; }

/* ---------- Siatka terminów ---------- */
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ed-slot { background: var(--ed-surface); border: 1px solid var(--ed-line); border-left: 4px solid var(--ed-line);
	border-radius: var(--ed-radius); padding: 16px; box-shadow: var(--ed-shadow); display: flex; flex-direction: column; gap: 10px; }
.ed-slot.is-free { border-left-color: var(--ed-ok); }
.ed-slot.is-booked { border-left-color: var(--ed-warn); }
.ed-slot__head { display: flex; justify-content: space-between; align-items: center; }
.ed-slot__subject { font-weight: 700; font-size: 16px; }
.ed-slot__status { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--ed-muted); }
.ed-slot.is-free .ed-slot__status { color: var(--ed-ok); }
.ed-slot.is-booked .ed-slot__status { color: var(--ed-warn); }
.ed-slot__meta { font-size: 13px; color: var(--ed-muted); display: grid; gap: 2px; }
.ed-slot__meta strong { color: var(--ed-ink); }
.ed-slot__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.ed-slot__actions form { margin: 0; }
.ed-pill { font-size: 12px; color: var(--ed-ok); background: #e7f6ee; padding: 6px 10px; border-radius: 8px; }

/* ---------- Oceny ---------- */
.ed-grade { display: flex; align-items: center; gap: 10px; background: #f7f9fc; border-radius: 8px; padding: 8px 12px; }
.ed-grade__value { font-size: 22px; font-weight: 800; color: var(--ed-primary); }
.ed-grade__note { font-size: 13px; color: var(--ed-muted); }

.ed-gradeform summary { list-style: none; }
.ed-gradeform summary::-webkit-details-marker { display: none; }
.ed-gradeform__body { display: grid; gap: 10px; margin-top: 10px; padding: 12px; background: #f7f9fc; border-radius: 8px; }

.ed-grid--grades { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ed-gradecard { display: flex; gap: 14px; align-items: center; background: var(--ed-surface);
	border: 1px solid var(--ed-line); border-radius: var(--ed-radius); padding: 16px; box-shadow: var(--ed-shadow); }
.ed-gradecard__value { font-size: 38px; font-weight: 800; color: var(--ed-primary);
	background: #eef3ff; width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ed-gradecard__subject { font-weight: 700; }
.ed-gradecard__meta { font-size: 13px; color: var(--ed-muted); }
.ed-gradecard__note { font-size: 13px; margin-top: 4px; }

/* ---------- Powiadomienia ---------- */
.ed-mails { display: grid; gap: 12px; }
.ed-mail { background: var(--ed-surface); border: 1px solid var(--ed-line); border-radius: var(--ed-radius); padding: 14px 16px; }
.ed-mail__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ed-mail__subj { font-weight: 700; }
.ed-mail__to, .ed-mail__time { font-size: 12px; color: var(--ed-muted); }
.ed-mail__body { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: var(--ed-ink);
	background: #f7f9fc; border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; }

/* ---------- Wybór przedmiotu (uczeń) ---------- */
.ed-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ed-pick[hidden] { display: none; }
.ed-pick__tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left;
	background: var(--ed-surface); border: 1px solid var(--ed-line); border-left: 4px solid var(--ed-primary);
	border-radius: var(--ed-radius); padding: 18px; box-shadow: var(--ed-shadow); cursor: pointer; font: inherit; transition: transform .1s, box-shadow .1s; }
.ed-pick__tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,24,40,.1); }
.ed-pick__tile.is-locked { cursor: default; border-left-color: var(--ed-line); opacity: .7; box-shadow: none; }
.ed-pick__tile.is-locked:hover { transform: none; box-shadow: none; }
.ed-pick__subj { font-weight: 700; font-size: 16px; color: var(--ed-ink); }
.ed-pick__meta { font-size: 13px; color: var(--ed-muted); }
.ed-pick__group .ed-section__bar { margin-bottom: 14px; }

/* ---------- Status kompletu ---------- */
.ed-status { padding: 14px 16px; border-radius: var(--ed-radius); margin-bottom: 18px; border: 1px solid; }
.ed-status--ok { background: #e7f6ee; border-color: #b6e3c8; color: #14663b; }
.ed-status--warn { background: #fdf3e7; border-color: #f4d7b0; color: #8a4b08; }
.ed-schedule__complete { color: #14663b; font-weight: 600; margin-top: 16px; }
.ed-schedule__incomplete { color: #8a4b08; font-weight: 600; margin-top: 16px; }

/* ---------- Klasy (ustawienia) ---------- */
.ed-classrow { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--ed-line); flex-wrap: wrap; }
.ed-classrow__name { flex: 0 0 160px; }
.ed-classrow__name input { width: 100%; }
.ed-classrow__subs { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 240px; }
.ed-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: 13px; color: var(--ed-ink) !important;
	background: #f1f4f9; border: 1px solid var(--ed-line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.ed-chip input { width: auto; margin: 0; }
.ed-chip.is-optional { background: #fff; border-style: dashed; color: var(--ed-muted) !important; }

/* ---------- Uczniowie i klasy ---------- */
.ed-students { display: grid; gap: 8px; margin-bottom: 14px; }
.ed-students__row { display: flex; align-items: center; gap: 12px; }
.ed-students__name { flex: 1; font-weight: 600; }
.ed-students__row input { max-width: 200px; }
.ed-students__item { padding: 10px 0; border-top: 1px solid var(--ed-line); }
.ed-students__ext { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-left: 4px; }

.ed-enrollee__sen { display: inline-block; font-size: 12px; color: #8a4b08; background: #fdf3e7;
	border: 1px solid #f4d7b0; border-radius: 6px; padding: 2px 8px; margin-top: 2px; }
.ed-students__sen { margin-top: 8px; }
.ed-students__sen label { font-size: 12px; color: var(--ed-muted); font-weight: 600; gap: 4px; }
.ed-students__sen textarea { width: 100%; }

.ed-account-box { background: #e7f6ee; border: 1px solid #b6e3c8; color: #14663b; border-radius: var(--ed-radius); padding: 14px 16px; margin-bottom: 18px; }
.ed-account-box code { background: #fff; padding: 1px 7px; border-radius: 6px; font-size: 14px; }
.ed-account-box .ed-hint { color: #2c7a52; margin-top: 6px; }

/* ---------- Import ---------- */
.ed-import-result { margin-top: 14px; padding: 12px 14px; background: #f7f9fc; border: 1px solid var(--ed-line); border-radius: 8px; }
.ed-import-errors { margin: 8px 0 0; padding-left: 18px; color: var(--ed-danger); font-size: 13px; }
.ed-import-result input[type=file] { font: inherit; }

/* ---------- Komunikaty ---------- */
.ed-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.ed-notice--ok { background: #e7f6ee; color: var(--ed-ok); }
.ed-notice--error { background: #fdecea; color: var(--ed-danger); }

/* ---------- Okienka (widok nauczyciela/admina) ---------- */
.ed-windows { display: grid; gap: 8px; }
.ed-window { border: 1px solid var(--ed-line); border-radius: 8px; overflow: hidden; }
.ed-window__head { display: flex; justify-content: space-between; align-items: center;
	padding: 6px 10px; background: #f7f9fc; font-size: 14px; }
.ed-window__fill { font-size: 12px; font-weight: 700; color: var(--ed-ok); background: #e7f6ee; padding: 2px 8px; border-radius: 999px; }
.ed-window__fill.is-full { color: var(--ed-warn); background: #fde6d6; }
.ed-window__empty { padding: 6px 10px; color: #9aa3b2; font-size: 13px; }
.ed-window__list { list-style: none; margin: 0; padding: 0; }
.ed-window__list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
	padding: 8px 10px; border-top: 1px solid var(--ed-line); flex-wrap: wrap; }
.ed-enrollee { display: flex; flex-direction: column; gap: 2px; }
.ed-enrollee__name { font-weight: 600; }
.ed-enrollee__oral { font-size: 12px; color: var(--ed-muted); }
.ed-enrollee__grade { display: inline-block; font-size: 12px; font-weight: 800; color: var(--ed-primary);
	background: #eef3ff; padding: 1px 8px; border-radius: 6px; width: fit-content; }
.ed-enrollee__actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.ed-btn--sm { padding: 5px 10px; font-size: 13px; }

.ed-chairbox { margin-top: 4px; padding: 10px; background: #f0f5ff; border: 1px solid #d6e2fb; border-radius: 8px; }
.ed-chairbox .ed-inline-form { width: 100%; }
.ed-chairbox label { flex: 1; }

/* Godziny ucznia */
.ed-mytime { display: flex; gap: 24px; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; }
.ed-mytime span { display: block; font-size: 12px; color: var(--ed-muted); }
.ed-mytime strong { font-size: 17px; }

.ed-check { flex-direction: row !important; align-items: center; gap: 8px; color: var(--ed-ink) !important; font-weight: 600; }
.ed-check input { width: auto; }
.ed-inline-form { display: flex; gap: 10px; align-items: center; }
.ed-inline-form input { max-width: 100px; }

/* Reguły przedmiotów */
.ed-rules { display: grid; gap: 8px; margin-bottom: 16px; }
.ed-rules__row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 10px; align-items: center; }
.ed-rules__row--head { font-size: 12px; font-weight: 700; color: var(--ed-muted); text-transform: uppercase; letter-spacing: .3px; }
.ed-rules__name { font-weight: 600; }
@media (max-width: 600px) {
	.ed-rules__row { grid-template-columns: 1fr 1fr; }
	.ed-rules__row--head { display: none; }
	.ed-rules__name { grid-column: 1 / -1; }
}

/* ---------- Protokół egzaminu ---------- */
.ed-protocol-bar { display: flex; justify-content: space-between; gap: 12px;
	max-width: 800px; margin: 24px auto 0; padding: 0 24px; }
.ed-protocol { max-width: 800px; margin: 16px auto 48px; background: #fff;
	border: 1px solid var(--ed-line); border-radius: var(--ed-radius); padding: 48px; box-shadow: var(--ed-shadow); }
.ed-protocol__head { text-align: center; margin-bottom: 28px; }
.ed-protocol__school { font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ed-muted); }
.ed-protocol h1 { font-size: 22px; margin: 12px 0 4px; }
.ed-protocol__law { color: var(--ed-muted); margin: 0; }
.ed-protocol h2 { font-size: 15px; margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--ed-muted); }
.ed-protocol__table { width: 100%; border-collapse: collapse; }
.ed-protocol__table th, .ed-protocol__table td { text-align: left; padding: 10px 12px; border: 1px solid var(--ed-line); vertical-align: top; }
.ed-protocol__table th { width: 38%; background: #f7f9fc; font-weight: 600; }
.ed-protocol__grade { font-size: 20px; font-weight: 800; color: var(--ed-primary); }
.ed-schedule th { background: #f7f9fc; font-size: 13px; }
.ed-schedule td, .ed-schedule th { text-align: left; }
.ed-schedule__stmt { margin: 24px 0 8px; }
.ed-protocol__notes { min-height: 70px; border: 1px solid var(--ed-line); border-radius: 8px; padding: 12px; }
.ed-protocol__sign { display: flex; justify-content: space-around; gap: 40px; margin-top: 64px; text-align: center; color: var(--ed-muted); font-size: 13px; }
.ed-protocol__sign span { display: block; border-top: 1px solid #1c2433; margin-bottom: 6px; padding-top: 6px; }
.ed-protocol__foot { text-align: right; color: var(--ed-muted); font-size: 12px; margin-top: 28px; }

@media print {
	.ed-protocol-bar { display: none; }
	.ed-app { background: #fff; }
	.ed-protocol { box-shadow: none; border: none; margin: 0; padding: 0; max-width: 100%; }
}

/* ---------- Responsywność ---------- */
@media (max-width: 760px) {
	.ed-form-grid { grid-template-columns: 1fr 1fr; }
	.ed-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
	.ed-form-grid { grid-template-columns: 1fr; }
	.ed-main { padding: 16px; }
}
