:root {
    --bg: #EEF3FF;
    --card-bg: #FFFFFF;
    --primary: #FF7A18;
    --secondary: #4F46E5;
    --accent: #0D9488;
    --pink: #EC4899;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --line: rgba(79, 70, 229, 0.14);
    --shadow: 0 12px 30px rgba(30, 41, 59, 0.10);
    --radius: 16px;
    --max-width: 1400px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    color: inherit;
}

.floating-nav {
    position: sticky;
    top: 18px;
    z-index: 20;
    width: min(92vw, 920px);
    margin: 18px auto 0;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.nav-logo {
    color: var(--secondary);
    font-size: 1.02rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.floating-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
    list-style: none;
}

.floating-nav a {
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    transition: color 160ms ease;
}

.floating-nav a:hover {
    color: var(--primary);
}

main {
    width: min(var(--max-width), calc(100vw - 32px));
    margin: 0 auto;
    padding: 38px 0 72px;
}

.admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: end;
    gap: 28px;
    padding: 54px 0 34px;
}

.location-tag,
.card-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 122, 24, 0.12);
    color: #B45309;
    font-size: 0.77rem;
    font-weight: 900;
}

.admin-hero h1 {
    max-width: 880px;
    margin-top: 18px;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: 0;
}

.hero-intro {
    max-width: 780px;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 1.04rem;
}

.year-switcher {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
}

label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 900;
}

select,
button,
input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
}

select {
    padding: 0 12px;
}

select[multiple] {
    min-height: 128px;
    padding: 8px 10px;
}

button {
    cursor: pointer;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 0 28px;
}

.metric-card,
.bento-card,
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.metric-card {
    display: grid;
    gap: 7px;
    min-height: 132px;
    padding: 20px;
}

.metric-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--secondary);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1;
    font-weight: 900;
}

.metric-card small {
    color: var(--text-muted);
    font-weight: 700;
}

.metric-card.is-alert strong {
    color: var(--primary);
}

.metric-card.is-ok strong {
    color: var(--accent);
}

.panel {
    margin-top: 22px;
    padding: 24px;
}

.advice-panel {
    background: rgba(255, 255, 255, 0.82);
}

.balance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.balance-summary-grid article {
    display: grid;
    gap: 4px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #F8FAFC;
}

.balance-summary-grid span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.balance-summary-grid strong {
    color: var(--secondary);
    font-size: 1.25rem;
    font-weight: 900;
}

.balance-table-container table {
    min-width: 1180px;
}

.query-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #F8FAFC;
}

.query-form-compact {
    grid-template-columns: minmax(260px, 1fr) auto;
}

.query-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.query-form label span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.query-form input,
.query-form select {
    width: 100%;
    min-width: 0;
}

.query-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
}

.query-table {
    margin-top: 16px;
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.advice-grid article {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.advice-grid strong {
    color: var(--secondary);
    font-weight: 900;
}

.advice-grid span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: 0;
}

.cards-table {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.course-card {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.course-card h3 {
    margin-top: 10px;
    font-size: 1.05rem;
    line-height: 1.25;
}

.course-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.course-card div div,
.course-card dl div {
    min-width: 0;
}

dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

dd {
    margin-top: 2px;
    font-weight: 900;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.08);
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #F8FAFC;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

tbody tr:hover {
    background: rgba(79, 70, 229, 0.045);
}

tfoot th {
    position: static;
    background: #EEF3FF;
    color: var(--text-main);
}

td.num {
    text-align: right;
    white-space: nowrap;
    font-weight: 900;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--secondary);
    font-size: 0.76rem;
    font-weight: 900;
}

.notice {
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 900;
}

.notice.is-ok {
    color: var(--accent);
}

.notice.is-error {
    color: #BE123C;
}

.editor-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.edit-form,
.record-card,
.record-fields {
    display: grid;
    gap: 14px;
}

.edit-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.edit-form label,
.record-fields label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.edit-form label span,
.record-fields label span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.edit-form input,
.record-fields input,
.edit-form select,
.record-fields select {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
}

.cta-button,
.danger-button {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    font-weight: 900;
}

.cta-button {
    background: var(--primary);
    color: #fff;
}

.danger-button {
    background: rgba(236, 72, 153, 0.12);
    color: #BE185D;
}

.editor-list {
    display: grid;
    gap: 14px;
}

.record-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.record-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-head strong {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 900;
}

.record-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bulk-editor-form {
    display: grid;
    gap: 0;
}

.save-dock {
    position: sticky;
    bottom: 14px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(760px, calc(100vw - 32px));
    margin: 22px auto 0;
    padding: 12px 14px;
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 40px rgba(30, 41, 59, 0.16);
    backdrop-filter: blur(12px);
}

.save-dock span {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 900;
}

.quick-editor-panel {
    margin-top: 8px;
}

.family-list,
.payout-grid {
    display: grid;
    gap: 14px;
}

.family-card,
.payout-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.family-head,
.payout-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.family-head strong,
.payout-card-head strong {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 900;
}

.head-actions,
.teacher-payout-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.compact-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.75rem;
}

.payout-card-head span {
    color: var(--text-muted);
    font-weight: 800;
}

.family-parent-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.children-list {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(30, 41, 59, 0.08);
}

.child-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: 12px;
    align-items: end;
    padding: 10px 0;
}

.family-child-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(220px, 1.4fr) auto;
}

.child-course-list,
.readonly-related-list {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.child-course-list span,
.readonly-related-list span,
.registration-row span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.child-course-list strong,
.readonly-related-list strong,
.readonly-related-list em,
.registration-row strong {
    color: var(--text-main);
    font-size: 0.86rem;
    font-style: normal;
    font-weight: 800;
}

.child-row label,
.payout-edit-fields label {
    display: grid;
    gap: 6px;
}

.payout-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.payout-facts div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: 12px;
    background: #F8FAFC;
}

.payout-facts dd {
    color: var(--secondary);
}

.payout-edit-fields {
    grid-template-columns: 220px minmax(0, 1fr);
}

.editor-shortcuts {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.editor-shortcut {
    display: grid;
    gap: 7px;
    min-height: 108px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease;
}

.editor-shortcut:hover,
.editor-shortcut.is-active {
    border-color: rgba(255, 122, 24, 0.55);
    transform: translateY(-1px);
}

.editor-shortcut strong {
    color: var(--secondary);
    font-size: 0.98rem;
    font-weight: 900;
}

.editor-shortcut span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.registration-hero {
    grid-template-columns: minmax(0, 1fr) 260px;
}

.form-year {
    color: var(--secondary);
    font-size: 1.55rem;
    font-weight: 900;
}

.registration-form {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid label {
    display: grid;
    gap: 7px;
}

.form-grid label span,
.consent-box label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.form-grid input,
.form-grid select {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
}

.wide-field {
    grid-column: 1 / -1;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
}

.consent-box {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(79, 70, 229, 0.055);
}

.consent-box label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    line-height: 1.45;
    text-transform: none;
}

.consent-box input {
    min-height: auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--secondary);
}

.consent-box a {
    color: var(--secondary);
    font-weight: 900;
}

.register-submit {
    justify-self: start;
    min-width: 220px;
}

.success-panel {
    border-color: rgba(13, 148, 136, 0.28);
}

.payment-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.payment-box article {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.payment-box strong {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.payment-box span {
    color: var(--secondary);
    font-weight: 900;
}

.payment-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-weight: 800;
}

.public-registration-hero {
    grid-template-columns: 1fr;
    padding-top: 38px;
    padding-bottom: 20px;
}

.public-registration-hero h1 {
    max-width: 720px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.registration-form .section-header h2,
.success-panel .section-header h2 {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
}

.copy-billing-toggle {
    display: inline-grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: fit-content;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #F8FAFC;
    color: var(--text-main);
    text-transform: none;
}

.copy-billing-toggle input {
    min-height: auto;
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
}

:is(.editor-shell, .report-shell) {
    --bg: #F5F7FB;
    --card-bg: #FFFFFF;
    --primary: #0EA5E9;
    --secondary: #0284C7;
    --accent: #16A34A;
    --text-main: #172033;
    --text-muted: #64748B;
    --line: rgba(15, 23, 42, 0.10);
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    --radius: 8px;
    background: var(--bg);
}

:is(.editor-shell, .report-shell) .floating-nav {
    top: 10px;
    width: min(96vw, 1180px);
    max-width: 1180px;
    margin-top: 10px;
    padding: 10px 16px;
    border-color: var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

:is(.editor-shell, .report-shell) .nav-logo {
    color: var(--text-main);
    font-size: 0.98rem;
}

:is(.editor-shell, .report-shell) .floating-nav a {
    color: var(--text-muted);
    font-size: 0.82rem;
}

:is(.editor-shell, .report-shell) .floating-nav a:hover {
    color: var(--primary);
}

:is(.editor-shell, .report-shell) .floating-nav a.is-active {
    color: var(--secondary);
    font-weight: 800;
}

:is(.editor-shell, .report-shell) .nav-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

:is(.editor-shell, .report-shell) .nav-group::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -12px;
    right: -12px;
    height: 12px;
}

:is(.editor-shell, .report-shell) .nav-group > span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: default;
}

:is(.editor-shell, .report-shell) .nav-group.is-active > span,
:is(.editor-shell, .report-shell) .nav-group:hover > span {
    color: var(--secondary);
}

:is(.editor-shell, .report-shell) .nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: -10px;
    z-index: 30;
    display: none;
    min-width: 180px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow);
}

:is(.editor-shell, .report-shell) .nav-group:hover .nav-submenu,
:is(.editor-shell, .report-shell) .nav-group:focus-within .nav-submenu {
    display: grid;
    gap: 4px;
}

:is(.editor-shell, .report-shell) .nav-submenu a {
    display: block;
    padding: 7px 9px;
    border-radius: 6px;
    white-space: nowrap;
}

:is(.editor-shell, .report-shell) .nav-submenu a:hover,
:is(.editor-shell, .report-shell) .nav-submenu a.is-active {
    background: rgba(14, 165, 233, 0.08);
}

:is(.editor-shell, .report-shell) main {
    width: min(1400px, calc(100vw - 40px));
    padding-top: 22px;
}

:is(.editor-shell, .report-shell) .admin-hero {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 20px;
    padding: 16px 0 12px;
}

:is(.editor-shell, .report-shell) .admin-hero h1 {
    margin-top: 8px;
    color: var(--text-main);
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    line-height: 1.15;
}

:is(.editor-shell, .report-shell) .hero-intro {
    margin-top: 8px;
    max-width: 680px;
    font-size: 0.9rem;
}

:is(.editor-shell, .report-shell) .section-header {
    align-items: center;
    margin-bottom: 14px;
}

:is(.editor-shell, .report-shell) .section-header > div:first-child {
    display: grid;
    gap: 5px;
}

:is(.editor-shell, .report-shell) .section-header h2 {
    color: var(--text-main);
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
}

:is(.editor-shell, .report-shell) .panel {
    margin-top: 14px;
    padding: 18px;
}

:is(.editor-shell, .report-shell) .panel,
:is(.editor-shell, .report-shell) .year-switcher,
:is(.editor-shell, .report-shell) .record-card,
:is(.editor-shell, .report-shell) .family-card,
:is(.editor-shell, .report-shell) .payment-student-card,
:is(.editor-shell, .report-shell) .payment-course-card,
:is(.editor-shell, .report-shell) .teacher-payout-card,
:is(.editor-shell, .report-shell) .registration-child-card,
:is(.editor-shell, .report-shell) .editor-shortcut {
    border-color: var(--line);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: none;
}

:is(.editor-shell, .report-shell) input,
:is(.editor-shell, .report-shell) select,
:is(.editor-shell, .report-shell) button {
    border-color: rgba(15, 23, 42, 0.12);
    background: #FFFFFF;
    color: var(--text-main);
}

:is(.editor-shell, .report-shell) input,
:is(.editor-shell, .report-shell) select {
    min-height: 38px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 650;
}

:is(.editor-shell, .report-shell) .location-tag,
:is(.editor-shell, .report-shell) .card-tag,
:is(.editor-shell, .report-shell) .status-pill {
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(14, 165, 233, 0.10);
    color: #0369A1;
    font-size: 0.7rem;
}

:is(.editor-shell, .report-shell) .editor-shortcut:hover,
:is(.editor-shell, .report-shell) .editor-shortcut.is-active {
    border-color: rgba(14, 165, 233, 0.44);
    background: rgba(14, 165, 233, 0.06);
    transform: none;
}

:is(.editor-shell, .report-shell) .save-dock {
    width: min(700px, calc(100vw - 40px));
    border-color: rgba(14, 165, 233, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

:is(.editor-shell, .report-shell) .editor-shortcut {
    min-height: 82px;
    padding: 12px;
}

:is(.editor-shell, .report-shell) .editor-shortcut strong,
:is(.editor-shell, .report-shell) .record-head strong,
:is(.editor-shell, .report-shell) .family-head strong,
:is(.editor-shell, .report-shell) .payment-student-summary span,
:is(.editor-shell, .report-shell) .teacher-payout-card h3,
:is(.editor-shell, .report-shell) .registration-child-card h3,
:is(.editor-shell, .report-shell) .teacher-payout-head h3 {
    color: var(--secondary);
}

:is(.editor-shell, .report-shell) .cta-button {
    min-height: 38px;
    border-radius: 8px;
    background: var(--primary);
    font-size: 0.88rem;
}

:is(.editor-shell, .report-shell) .danger-button {
    min-height: 38px;
    border-radius: 8px;
    background: rgba(244, 63, 94, 0.10);
    color: #BE123C;
    font-size: 0.84rem;
}

.admin-login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.admin-login-card {
    display: grid;
    gap: 14px;
    width: min(440px, 100%);
    margin: 0;
}

.admin-login-card h1 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.5rem;
}

.admin-login-card label {
    display: grid;
    gap: 6px;
}

.admin-login-card label span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

:is(.editor-shell, .report-shell) .compact-button {
    min-height: 30px;
    font-size: 0.74rem;
}

:is(.editor-shell, .report-shell) .payment-static-facts div,
:is(.editor-shell, .report-shell) .payout-facts div,
:is(.editor-shell, .report-shell) .balance-summary-grid article,
:is(.editor-shell, .report-shell) .query-form {
    border-radius: 8px;
    background: #F8FAFC;
}

.report-shell .metric-grid {
    gap: 12px;
    padding-bottom: 14px;
}

.report-shell .metric-card,
.report-shell .bento-card,
.report-shell .table-container {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.report-shell .metric-card {
    min-height: 98px;
    padding: 14px;
}

.report-shell .metric-card span,
.report-shell .balance-summary-grid span {
    font-size: 0.7rem;
}

.report-shell .metric-card strong {
    font-size: clamp(1.18rem, 2vw, 1.45rem);
}

.report-shell .metric-card small {
    font-size: 0.8rem;
}

.report-shell .query-form {
    padding: 12px;
    border-color: var(--line);
    grid-template-columns: repeat(2, minmax(190px, max-content)) auto;
    justify-content: start;
}

.report-shell .query-form-compact {
    grid-template-columns: minmax(190px, max-content) auto;
}

.report-shell .query-form label {
    width: min(360px, calc(100vw - 64px));
}

.report-shell .query-form select,
.report-shell .query-form input[type="search"] {
    width: min(100%, 360px);
}

:is(.editor-shell, .report-shell) .year-switcher {
    justify-self: end;
    width: min(100%, 300px);
}

:is(.editor-shell, .report-shell) .year-switcher select {
    width: 100%;
}

.report-shell .ghost-button {
    min-height: 38px;
    border-radius: 8px;
    font-size: 0.84rem;
}

.report-shell .ghost-button-small,
.editor-shell .ghost-button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.muted-line {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 650;
}

.archive-teaser {
    margin-top: 12px;
}

.archive-table-container {
    margin-top: 14px;
}

:is(.editor-shell, .report-shell) .section-actions,
:is(.editor-shell, .report-shell) .mode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

:is(.editor-shell, .report-shell) .mode-actions {
    justify-content: flex-start;
    margin-top: 12px;
}

.report-shell .subnav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.report-shell .subnav-tabs a {
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.report-shell .subnav-tabs a.is-active,
.report-shell .subnav-tabs a:hover {
    border-color: rgba(14, 165, 233, 0.36);
    background: rgba(14, 165, 233, 0.08);
    color: var(--secondary);
}

.report-shell .form-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.report-shell .form-settings-grid article {
    display: grid;
    gap: 8px;
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #F8FAFC;
}

.report-shell .form-settings-grid span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-shell .form-settings-grid strong {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.45;
}

.report-shell .registration-form-admin {
    display: grid;
    gap: 14px;
}

.report-shell .registration-form-admin-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
    gap: 18px;
    align-items: start;
}

.report-shell .form-copy-editor,
.report-shell .registration-form-preview {
    display: grid;
    gap: 14px;
}

.report-shell .form-copy-editor label {
    display: grid;
    gap: 7px;
}

.report-shell .form-copy-editor label span,
.report-shell .preview-section > span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-shell .form-copy-editor textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--text-main);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
}

.report-shell .form-copy-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.report-shell .form-label-editor {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #F8FAFC;
}

.report-shell .form-label-editor summary {
    cursor: pointer;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 850;
}

.report-shell .form-label-editor .form-copy-row {
    margin-top: 12px;
}

.report-shell .registration-form-preview {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
}

.report-shell .preview-hero {
    display: grid;
    gap: 7px;
    padding-bottom: 4px;
}

.report-shell .preview-hero span,
.report-shell .preview-payment strong {
    color: var(--secondary);
    font-size: 0.76rem;
    font-weight: 850;
}

.report-shell .preview-hero h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.15rem;
}

.report-shell .preview-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.report-shell .preview-section {
    display: grid;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.report-shell .preview-section h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 0.98rem;
}

.report-shell .preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.report-shell .preview-grid label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.report-shell .preview-grid .wide-field {
    grid-column: 1 / -1;
}

.report-shell .preview-grid input,
.report-shell .preview-grid select {
    min-height: 34px;
    border-radius: 8px;
    background: #F8FAFC;
    color: var(--text-muted);
}

.report-shell .preview-toggle,
.report-shell .preview-consent,
.report-shell .preview-payment {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #F8FAFC;
    color: var(--text-main);
    font-size: 0.84rem;
}

.report-shell .preview-submit {
    width: fit-content;
    opacity: 0.72;
}

.report-shell .preview-payment {
    display: grid;
    gap: 5px;
}

.report-shell .course-toggle-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.report-shell .course-toggle-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
}

.report-shell .course-toggle-row input {
    width: 18px;
    height: 18px;
    min-height: auto;
    margin-top: 2px;
    accent-color: var(--secondary);
}

.report-shell .course-toggle-row span {
    display: grid;
    gap: 4px;
}

.report-shell .course-toggle-row strong {
    color: var(--text-main);
    font-size: 0.92rem;
}

.report-shell .course-toggle-row em {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: normal;
}

.report-shell .workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.report-shell .workflow-card {
    display: grid;
    gap: 8px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--text-main);
    text-decoration: none;
}

.report-shell .workflow-card:hover {
    border-color: rgba(14, 165, 233, 0.36);
    background: rgba(14, 165, 233, 0.04);
}

.report-shell .workflow-card strong {
    color: var(--secondary);
    font-size: 0.98rem;
}

.report-shell .workflow-card span {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.report-shell .course-card {
    gap: 12px;
    padding: 14px;
}

.report-shell .course-card h3 {
    margin-top: 7px;
    color: var(--secondary);
    font-size: 0.98rem;
}

.report-shell .balance-summary-grid {
    gap: 10px;
    margin-bottom: 12px;
}

.report-shell .balance-summary-grid article {
    min-height: 72px;
    padding: 12px;
}

.report-shell .balance-summary-grid strong {
    color: var(--secondary);
    font-size: 1.05rem;
}

.sarkanykert-card-list {
    display: grid;
    gap: 18px;
}

.sarkanykert-filter-form {
    grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(150px, 0.72fr)) auto;
}

.sarkanykert-card {
    display: grid;
    gap: 22px;
    padding: 18px;
    border: 1px solid #D8E1EC;
    border-radius: 8px;
    background: #F5F9FF;
}

.sarkanykert-card-head {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(260px, 0.45fr) minmax(130px, 0.18fr);
    gap: 18px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 1px solid #D8E1EC;
}

.sarkanykert-title-block,
.sarkanykert-slot-block,
.sarkanykert-fee-block {
    display: grid;
    gap: 6px;
}

.sarkanykert-title-block span,
.sarkanykert-slot-block span,
.sarkanykert-fee-block span,
.sarkanykert-info-box > span,
.sarkanykert-owner-form > span,
.sarkanykert-filter-form label span,
.sarkanykert-edit-form label span,
.sarkanykert-payment-form label span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.sarkanykert-title-block h3,
.sarkanykert-slot-block strong,
.sarkanykert-fee-block strong {
    color: var(--secondary);
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.25;
}

.sarkanykert-title-block p,
.sarkanykert-info-box p {
    margin: 0;
}

.sarkanykert-title-block p {
    color: var(--text-main);
    font-weight: 650;
}

.sarkanykert-info-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.85fr 1fr 0.85fr 0.82fr;
    gap: 14px;
    align-items: start;
}

.sarkanykert-info-box {
    display: grid;
    gap: 9px;
    min-height: 132px;
    padding: 14px;
    border: 1px solid #DDE5EF;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.sarkanykert-info-box strong {
    color: var(--secondary);
    font-size: 1.02rem;
    font-weight: 900;
    line-height: 1.35;
}

.sarkanykert-info-box p {
    color: var(--text-muted);
    font-weight: 650;
}

.sarkanykert-info-box a {
    color: var(--secondary);
    font-weight: 650;
    text-decoration: underline;
}

.sarkanykert-owner-form label,
.sarkanykert-edit-form label,
.sarkanykert-payment-form label {
    display: grid;
    gap: 6px;
}

.sarkanykert-owner-form select {
    width: 100%;
}

.payment-state {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.86rem !important;
}

.payment-state.is-waiting {
    background: #FFF1E4;
    color: #B45309;
}

.payment-state.is-partial {
    background: #FEF3C7;
    color: #92400E;
}

.payment-state.is-paid {
    background: #DCFCE7;
    color: #166534;
}

.payment-state.is-free {
    background: #E0F2FE;
    color: #0369A1;
}

.sarkanykert-free-note {
    padding: 14px 18px;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    background: #F0F9FF;
    color: #0369A1;
    font-weight: 700;
}

.sarkanykert-edit-details,
.sarkanykert-payment-details {
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

.sarkanykert-payment-details {
    border-color: #DDECEB;
    background: #F5FEFC;
}

.sarkanykert-edit-details summary,
.sarkanykert-payment-details summary {
    padding: 13px 16px;
    color: #0369A1;
    font-weight: 900;
    cursor: pointer;
}

.sarkanykert-edit-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 16px;
}

.sarkanykert-edit-form .is-wide {
    grid-column: span 2;
}

.sarkanykert-edit-form textarea {
    min-height: 88px;
    resize: vertical;
}

.sarkanykert-edit-form .check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
}

.sarkanykert-edit-form .check-row input {
    min-height: auto;
}

.sarkanykert-form-actions {
    display: flex;
    align-items: end;
}

.sarkanykert-payment-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.48fr) minmax(210px, 0.82fr) minmax(120px, 0.45fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 0 14px 14px;
}

.sarkanykert-payment-form h4 {
    margin: 0;
    color: #0284C7;
    font-size: 0.95rem;
    font-weight: 900;
}

.sarkanykert-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
}

.sarkanykert-card-foot > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.email-sent-pill,
.payment-log-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 900;
}

.email-sent-pill {
    background: #DDF7E8;
    color: #15803D;
}

.payment-log-pill {
    background: #E0F2FE;
    color: #0369A1;
}

.report-shell th,
.report-shell td {
    padding: 10px 12px;
    font-size: 0.86rem;
}

.report-shell th {
    background: #F8FAFC;
    font-size: 0.7rem;
}

.report-shell tbody tr:hover {
    background: rgba(14, 165, 233, 0.045);
}

.report-shell tfoot th {
    background: #EAF6FD;
}

.payment-editor-list,
.teacher-payout-list,
.registration-editor-list {
    display: grid;
    gap: 14px;
}

.payment-student-card,
.teacher-payout-card,
.registration-child-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.payment-student-card {
    padding: 0;
    overflow: hidden;
}

.payment-student-summary {
    display: grid;
    grid-template-columns: minmax(160px, 0.9fr) minmax(180px, 1.1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.payment-student-summary::-webkit-details-marker {
    display: none;
}

.payment-student-summary span,
.payment-student-summary strong,
.payment-student-summary em {
    min-width: 0;
}

.payment-student-summary span {
    color: var(--primary);
    font-weight: 900;
}

.payment-student-summary strong {
    color: var(--text-main);
    font-size: 0.92rem;
}

.payment-student-summary em {
    color: var(--accent);
    font-size: 0.86rem;
    font-style: normal;
    font-weight: 900;
    text-align: right;
}

.payment-card-form {
    display: grid;
    gap: 14px;
    padding: 0;
}

.payment-child-body {
    display: grid;
    gap: 12px;
    padding: 0 16px 16px;
}

.payment-course-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.payment-course-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.payment-course-head div {
    display: grid;
    gap: 3px;
}

.payment-course-head strong {
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 900;
}

.payment-course-head span {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 900;
}

.payment-student-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.payment-student-head div:first-child {
    display: grid;
    gap: 3px;
}

.payment-student-head span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.payment-total {
    display: grid;
    gap: 2px;
    justify-items: end;
    white-space: nowrap;
}

.payment-total span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.payment-total strong {
    color: var(--accent);
    font-size: 1.18rem;
    font-weight: 900;
}

.payment-static-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.payment-static-facts div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.payment-period-rows {
    display: grid;
    gap: 10px;
}

.payment-period-row {
    display: grid;
    grid-template-columns: 120px 160px minmax(170px, 1fr) 130px minmax(180px, 1.2fr);
    gap: 10px;
    align-items: end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.record-actions {
    display: flex;
    justify-content: flex-end;
}

.registration-child-card h3,
.teacher-payout-head h3 {
    color: var(--primary);
    font-size: 1rem;
}

.teacher-payout-head span {
    color: var(--accent);
    font-weight: 900;
}

.registration-rows {
    display: grid;
    gap: 10px;
}

.registration-row {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1.1fr) minmax(170px, 1fr) minmax(190px, 1.1fr) 140px minmax(180px, 1fr) 120px;
    gap: 10px;
    align-items: end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.registration-row label,
.registration-row div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.payment-period-row.is-empty {
    opacity: 0.74;
}

.payment-period-row.is-empty .period-index strong {
    color: var(--text-muted);
}

.payment-period-row label {
    display: grid;
    gap: 6px;
}

.period-index {
    display: grid;
    gap: 3px;
    min-height: 42px;
    padding: 6px 0;
}

.period-index span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.period-index strong {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 900;
}

.payout-table {
    display: grid;
    gap: 8px;
}

.payout-table-head,
.payout-table-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) 120px 150px 140px 140px 150px minmax(170px, 1.2fr);
    gap: 10px;
    align-items: center;
}

.payout-table-head {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.payout-table-row {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.payout-table-row strong {
    color: var(--text-main);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .admin-hero {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .cards-table,
    .advice-grid,
    .balance-summary-grid,
    .editor-shortcuts,
    .edit-form,
    .record-fields,
    .family-parent-fields,
    .payout-facts,
    .payment-box {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payout-edit-fields,
    .child-row,
    .family-child-row,
    .query-form,
    .query-form-compact,
    .report-shell .query-form,
    .report-shell .query-form-compact,
    .sarkanykert-card-head,
    .sarkanykert-info-grid,
    .sarkanykert-edit-form,
    .sarkanykert-payment-form,
    .payment-period-row,
    .payment-student-summary,
    .registration-row,
    .payout-table-head,
    .payout-table-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .floating-nav {
        position: static;
        border-radius: 24px;
    }

    .nav-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .floating-nav ul {
        justify-content: flex-start;
    }

    :is(.editor-shell, .report-shell) .nav-group {
        display: grid;
        gap: 6px;
    }

    :is(.editor-shell, .report-shell) .nav-group::after {
        display: none;
    }

    :is(.editor-shell, .report-shell) .nav-submenu {
        position: static;
        display: flex;
        flex-wrap: wrap;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    :is(.editor-shell, .report-shell) .nav-submenu a {
        padding: 0;
    }

    main {
        width: min(100vw - 20px, var(--max-width));
        padding-top: 20px;
    }

    .admin-hero {
        padding-top: 28px;
    }

    .metric-grid,
    .cards-table,
    .advice-grid,
    .balance-summary-grid,
    .editor-shortcuts,
    .edit-form,
    .record-fields,
    .family-parent-fields,
    .payout-facts,
    .payment-static-facts,
    .form-grid,
    .payment-box,
    .report-shell .course-toggle-list,
    .report-shell .registration-form-admin-grid,
    .report-shell .form-copy-row {
        grid-template-columns: 1fr;
    }

    .sarkanykert-card {
        padding: 14px;
    }

    .sarkanykert-edit-form .is-wide {
        grid-column: auto;
    }

    .sarkanykert-card-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .register-submit {
        justify-self: stretch;
        width: 100%;
    }

    .save-dock {
        align-items: stretch;
        flex-direction: column;
        bottom: 8px;
    }

    .query-actions {
        justify-content: stretch;
    }

    .report-shell .query-form label,
    .report-shell .query-form select,
    .report-shell .query-form input[type="search"],
    :is(.editor-shell, .report-shell) .year-switcher {
        width: 100%;
    }

    .query-actions .cta-button,
    .query-actions .ghost-button {
        flex: 1;
    }

    .panel {
        padding: 16px;
    }
}

/* Sárkánykert jelenléti mobilnézet */
.presence-shell {
    background: #eef7f2;
}

.presence-main {
    width: min(100vw - 14px, 760px);
    padding: 10px 0 36px;
}

.presence-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin: 0 0 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: #166534;
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(30, 41, 59, 0.08);
}

.presence-hero {
    margin: 0 0 10px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(13, 148, 136, 0.06)), #ffffff;
    box-shadow: var(--shadow);
}

.presence-hero h1 {
    margin: 5px 0 2px;
    color: #166534;
    font-size: clamp(1.55rem, 7vw, 2.35rem);
    line-height: 1;
    letter-spacing: 0;
}

.presence-hero p,
.presence-empty p {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
    font-weight: 500;
}

.presence-event-head p {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 500;
}

.presence-event {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(22, 163, 74, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.presence-event-head h2 {
    display: grid;
    gap: 2px;
    margin-top: 5px;
    color: #14532d;
    line-height: 1.08;
}

.presence-date-line {
    font-size: clamp(0.96rem, 4.3vw, 1.18rem);
    font-weight: 900;
}

.presence-time-line {
    font-size: clamp(1.16rem, 5.8vw, 1.56rem);
    font-weight: 900;
}

.presence-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.presence-stats article {
    min-height: 58px;
    padding: 8px 6px;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1px solid rgba(22, 163, 74, 0.12);
    text-align: center;
}

.presence-stats span {
    display: block;
    overflow: hidden;
    color: #64748b;
    font-size: clamp(0.56rem, 2.4vw, 0.68rem);
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.presence-stats strong {
    display: block;
    margin-top: 2px;
    color: #166534;
    font-size: clamp(1.38rem, 7vw, 2rem);
    line-height: 1;
}

.presence-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.presence-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 900;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.legend-dot.is-girl,
.presence-person.is-girl .presence-avatar {
    background: #f9a8d4;
    color: #831843;
}

.legend-dot.is-boy,
.presence-person.is-boy .presence-avatar {
    background: #93c5fd;
    color: #1e3a8a;
}

.presence-person.is-unknown .presence-avatar {
    background: #cbd5e1;
    color: #334155;
}

.legend-dot.is-parent,
.presence-person.is-parent .presence-avatar {
    background: #bbf7d0;
    color: #14532d;
}

.presence-family-list {
    display: grid;
    gap: 8px;
}

.presence-family-card {
    display: grid;
    gap: 7px;
    min-height: 86px;
    padding: 9px 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: #ffffff;
}

.presence-family-card.has-siblings {
    border-color: rgba(249, 115, 22, 0.28);
    box-shadow: inset 4px 0 0 rgba(249, 115, 22, 0.78);
}

.presence-family-card.has-single-child {
    border-color: rgba(14, 165, 233, 0.24);
    box-shadow: inset 4px 0 0 rgba(14, 165, 233, 0.62);
}

.presence-family-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
}

.presence-family-head strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    font-size: 0.95rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-family-card.has-parent-stay .presence-family-head strong::before {
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.presence-family-head span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.presence-people-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-content: flex-start;
}

.presence-person {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    padding: 5px 8px 5px 6px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.presence-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.presence-name {
    min-width: 0;
    max-width: min(292px, calc(100vw - 86px));
    overflow: hidden;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-person.is-parent {
    background: #f0fdf4;
}

.presence-person.is-parent .presence-name {
    color: #166534;
}

.presence-gender-picker {
    position: relative;
    flex: 0 0 auto;
}

.presence-gender-picker summary {
    display: inline-grid;
    cursor: pointer;
    list-style: none;
}

.presence-gender-picker summary::-webkit-details-marker {
    display: none;
}

.presence-gender-picker[open] .presence-gender-form {
    display: inline-flex;
}

.presence-gender-form {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 2;
    display: none;
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
}

.presence-gender-form button {
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(71, 85, 105, 0.16);
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.presence-gender-form button:hover {
    background: #e2e8f0;
}

.presence-empty {
    padding: 14px;
    border-radius: 18px;
}

.presence-empty h2 {
    margin-bottom: 8px;
    color: #14532d;
}

@media (max-width: 430px) {
    .presence-main {
        width: min(100vw - 10px, 760px);
        padding-top: 8px;
    }

    .presence-stats {
        gap: 5px;
    }

    .presence-stats article {
        min-height: 54px;
        padding: 7px 4px;
    }

    .presence-family-card {
        min-height: 84px;
    }

    .presence-family-head {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .presence-family-head span {
        justify-self: start;
    }

    .presence-name {
        max-width: min(258px, calc(100vw - 82px));
    }
}

@media (max-width: 360px) {
    .presence-stats span {
        font-size: 0.52rem;
    }

    .presence-name {
        max-width: min(232px, calc(100vw - 78px));
    }
}


.live-schedule-summary {
    display: grid;
    gap: 14px;
    margin: 16px 0 18px;
    padding: 16px;
    border: 1px solid #99F6E4;
    border-radius: 8px;
    background: linear-gradient(180deg, #ECFEFF 0%, #F0FDFA 100%);
    box-shadow: inset 4px 0 0 #14B8A6;
}

.live-schedule-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.live-schedule-head h3 {
    margin-top: 8px;
    color: #134E4A;
    font-size: 1.08rem;
    line-height: 1.2;
}

.live-schedule-head p {
    max-width: 520px;
    color: #0F766E;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.live-schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.live-schedule-legend span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.live-schedule-legend .is-available {
    background: #CCFBF1;
    color: #0F766E;
}

.live-schedule-legend .is-nearly-full {
    background: #FEF3C7;
    color: #B45309;
}

.live-schedule-legend .is-full {
    background: #E2E8F0;
    color: #64748B;
}

.live-schedule-legend .is-over-limit {
    background: #FFE4E6;
    color: #BE123C;
}

.live-timetable-wrap {
    overflow-x: auto;
    border: 1px solid rgba(20, 184, 166, 0.34);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.08);
}

.live-timetable {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.live-timetable th,
.live-timetable td {
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    vertical-align: top;
}

.live-timetable th:last-child,
.live-timetable td:last-child {
    border-right: 0;
}

.live-timetable tr:last-child th,
.live-timetable tr:last-child td {
    border-bottom: 0;
}

.live-timetable thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px;
    background: #CCFBF1;
    color: #115E59;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
}

.live-timetable thead th:first-child,
.live-timetable-time {
    width: 112px;
    background: #E6FFFA;
}

.live-timetable-time {
    padding: 12px;
    color: #134E4A;
    font-size: 0.88rem;
    font-weight: 900;
    white-space: nowrap;
}

.live-timetable td {
    width: calc((100% - 112px) / 5);
    min-height: 104px;
    padding: 8px;
    background: #FEFFFC;
}

.live-timetable td.is-empty {
    background: repeating-linear-gradient(
        -45deg,
        #FFFFFF,
        #FFFFFF 8px,
        #F8FAFC 8px,
        #F8FAFC 16px
    );
}

.live-timetable-item {
    display: grid;
    gap: 5px;
    min-height: 92px;
    padding: 10px;
    border: 1px solid rgba(20, 184, 166, 0.28);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.06);
}

.live-timetable-item + .live-timetable-item {
    margin-top: 8px;
}

.live-timetable-item.is-closed {
    border-color: rgba(148, 163, 184, 0.24);
    background: #F8FAFC;
}

.live-timetable-item.is-nearly-full {
    border-color: rgba(245, 158, 11, 0.32);
    background: #FFFBEB;
}

.live-timetable-item.is-full {
    border-color: rgba(148, 163, 184, 0.28);
    background: #F8FAFC;
}

.live-timetable-item.is-over-limit {
    border-color: rgba(244, 63, 94, 0.32);
    background: #FFF1F2;
}

.live-timetable-item h4 {
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.22;
}

.live-timetable-item p,
.live-timetable-item small,
.live-timetable-meta span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.live-timetable-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.live-timetable-meta strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #CCFBF1;
    color: #0F766E;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.live-timetable-item.is-closed .live-timetable-meta strong {
    background: #E2E8F0;
    color: #64748B;
}

.live-timetable-item.is-nearly-full .live-timetable-meta strong {
    background: #FEF3C7;
    color: #B45309;
}

.live-timetable-item.is-full .live-timetable-meta strong {
    background: #E2E8F0;
    color: #64748B;
}

.live-timetable-item.is-over-limit .live-timetable-meta strong {
    background: #FFE4E6;
    color: #BE123C;
}

.report-shell .registration-list-filter-form {
    grid-template-columns: repeat(3, minmax(170px, max-content)) auto;
    justify-content: start;
    margin-top: 4px;
}

.report-shell .registration-list-filter-form label {
    width: min(260px, calc(100vw - 64px));
}

.report-shell .registration-list-filter-form label:first-of-type {
    width: min(320px, calc(100vw - 64px));
}

.registration-list-meta {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 720px) {
    .live-schedule-head {
        align-items: start;
        flex-direction: column;
    }

    .live-schedule-head p {
        text-align: left;
    }

    .live-timetable {
        min-width: 820px;
    }

    .report-shell .registration-list-filter-form {
        grid-template-columns: 1fr;
    }
}

.registration-report-table .registration-edit-row td {
    padding: 0 10px 10px;
    background: #F8FAFC;
}

.kukucska-edit-details {
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 8px;
    background: #FFFFFF;
}

.kukucska-edit-details summary {
    cursor: pointer;
    padding: 10px 12px;
    color: #0369A1;
    font-size: 0.86rem;
    font-weight: 900;
}

.kukucska-edit-details[open] summary {
    border-bottom: 1px solid rgba(14, 165, 233, 0.16);
}

.kukucska-edit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    padding: 12px;
}

.kukucska-edit-form label {
    display: grid;
    gap: 6px;
}

.kukucska-edit-form label span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.kukucska-edit-form .is-wide {
    grid-column: span 2;
}

.kukucska-edit-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

@media (max-width: 820px) {
    .kukucska-edit-form {
        grid-template-columns: 1fr;
    }

    .kukucska-edit-form .is-wide {
        grid-column: auto;
    }
}

.student-payment-summary {
    margin-bottom: 14px;
}

.student-payment-table-container {
    max-height: calc(100vh - 310px);
    overflow: auto;
}

.compact-report-table {
    font-size: 0.82rem;
    line-height: 1.25;
}

.compact-report-table th,
.compact-report-table td {
    padding: 7px 10px;
    white-space: nowrap;
}

.compact-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.compact-report-table td:nth-child(3) {
    min-width: 220px;
    white-space: normal;
}

.compact-report-table tr.is-missing-payment td {
    background: #FFF7ED;
}

.payment-missing-pill,
.mini-note {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.payment-missing-pill {
    background: #FFEDD5;
    color: #C2410C;
}

.mini-note {
    margin-left: 6px;
    background: #E0F2FE;
    color: #0369A1;
}

.registration-type-choice {
    display: grid;
    gap: 10px;
    margin: 18px 0 24px;
    padding: 16px;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    background: #F0F9FF;
}

.registration-type-choice legend {
    padding: 0 8px;
    color: #0369A1;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.registration-type-choice p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.registration-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.registration-type-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 900;
}
