:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --primary: #1769e0;
    --primary-dark: #0f4fac;
    --green: #15803d;
    --green-light: #e8f8ef;
    --red: #b42318;
    --red-light: #ffebe9;
    --yellow-light: #fff7db;
    --gray: #e5e7eb;
    --line: #d9e0ec;
    --shadow: 0 14px 35px rgba(23, 32, 51, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, #e8f1ff, var(--bg) 42%);
    color: var(--text);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 60px;
}
.page.narrow { width: min(720px, calc(100% - 32px)); }

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 30px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #10203d, #1c5fc7);
    color: #fff;
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 13px;
    opacity: .85;
}

h1, h2 { margin-top: 0; }
.hero h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); }
.lead { margin: 0; max-width: 760px; line-height: 1.55; opacity: .92; }

.admin-link, .secondary-btn, .link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    white-space: nowrap;
    cursor: pointer;
}
.button-like { font: inherit; }
.admin-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.admin-actions form { margin: 0; }

.card, .student-box, .save-bar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}

.login-card { max-width: 760px; margin-left: auto; margin-right: auto; }

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: #eef4ff;
}
.alert.success { background: var(--green-light); border-color: #b7ebc9; color: #095a2a; }
.alert.error { background: var(--red-light); border-color: #ffc5c0; color: var(--red); }
.alert.info { background: #eef4ff; color: #123a72; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
}
label { font-weight: 700; color: #27364f; }
input, select {
    width: 100%;
    display: block;
    margin-top: 7px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
}

.btn {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 13px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn.big { padding: 15px 24px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.inline-form { margin-top: 14px; }
.link-button { color: var(--primary); background: transparent; border: 0; padding-left: 0; font-weight: 700; }
.secondary-btn { color: var(--primary); background: #eef4ff; border-color: #cfe0ff; }

.student-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.muted { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }

.hours {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.hour-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.hour-card h2 { margin-bottom: 14px; }
.program-list { display: grid; gap: 12px; }

.program-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #f9fbff;
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.program-option:hover { transform: translateY(-1px); border-color: #bad0f6; }
.program-option input { width: auto; margin: 0; }
.program-main { display: grid; gap: 4px; }
.program-name { font-size: 17px; font-weight: 900; }
.program-capacity { color: var(--muted); font-size: 14px; }
.program-option.selected {
    border-color: #43b36b;
    background: var(--green-light);
}
.program-option.selected .program-name { color: var(--green); }
.chosen-badge {
    display: none;
    margin-left: auto;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: var(--green);
    padding: 6px 8px;
    border-radius: 999px;
}
.program-option.selected .chosen-badge { display: inline-flex; }
.program-option.full,
.program-option.disabled-by-choice {
    opacity: .58;
    cursor: not-allowed;
    background: #f0f1f3;
}
.program-option.full .program-capacity { color: var(--red); font-weight: 800; }
.program-option.disabled-by-choice::after {
    content: 'Már választva';
    margin-left: auto;
    font-size: 12px;
    font-weight: 900;
    color: #6b7280;
    background: #e5e7eb;
    padding: 6px 8px;
    border-radius: 999px;
}

.save-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    position: sticky;
    bottom: 18px;
    z-index: 5;
}

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}
th, td {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
    text-align: left;
}
th { background: #f4f7fc; font-size: 14px; }
.row-full { background: var(--yellow-light); }
.filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .hero, .save-bar, .student-box { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .hours { grid-template-columns: 1fr; }
    .form-grid, .filters { grid-template-columns: 1fr; }
}
