:root {
    --forest-900: #10251b;
    --forest-700: #214433;
    --forest-600: #2f5a43;
    --sage-100: #dfe8dd;
    --sage-50: #f4f7f1;
    --cream: #fbf7ef;
    --cream-2: #fffdf7;
    --border: #d8ded2;
    --status-wstepna: #f2b705;
    --status-zadatek: #c47a1b;
    --status-potwierdzona: #2f9e44;
    --status-anulowana: #b42318;
    --amber: #c9902e;
    --clay: #a65a44;
    --cancelled: #b42318;
    --cancelled-soft: #fff1f0;
    --cancelled-border: rgba(180, 35, 24, 0.35);
    --text: #17231b;
    --muted: #687468;
    --shadow: 0 18px 38px rgba(16, 37, 27, 0.07);
    --soft-shadow: 0 8px 22px rgba(16, 37, 27, 0.055);
    --focus: 0 0 0 3px rgba(47, 90, 67, 0.2);
    --bg: var(--sage-50);
    --surface: var(--cream-2);
    --line: var(--border);
    --green: var(--forest-600);
    --green-dark: var(--forest-900);
    --yellow: var(--amber);
    --red: var(--cancelled);
    --gray: #7d857b;
    --event-day-bg: rgba(47, 90, 67, 0.08);
    --event-day-bg-strong: rgba(47, 90, 67, 0.14);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
            linear-gradient(180deg, rgba(223, 232, 221, 0.72), rgba(251, 247, 239, 0.72) 280px),
            var(--sage-50);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.fc a:focus-visible {
    outline: 0;
    box-shadow: var(--focus);
}

a.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 28px;
    border-bottom: 1px solid rgba(16, 37, 27, 0.12);
    background: rgba(255, 253, 247, 0.94);
    backdrop-filter: blur(8px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.brand-link,
.brand-content-link {
    color: inherit;
    text-decoration: none;
}

.brand-content-link {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.brand-link:hover .brand-logo,
.brand-content-link:hover .brand-logo {
    transform: translateY(-1px) scale(1.01);
}

.admin-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(47, 90, 67, 0.18);
    border-radius: 8px;
    color: var(--forest-700);
    background: rgba(244, 247, 241, 0.72);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.admin-back-link:hover {
    border-color: rgba(47, 90, 67, 0.36);
    background: rgba(223, 232, 221, 0.72);
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 7px;
    background: #050505;
    box-shadow: 0 6px 18px rgba(16, 37, 27, 0.16);
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--forest-700);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    color: var(--forest-900);
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.12;
}

h2 {
    color: var(--forest-900);
    font-size: 18px;
    line-height: 1.25;
}

h3 {
    color: var(--forest-900);
    font-size: 14px;
    line-height: 1.25;
}

.actions,
.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar-actions {
    gap: 10px;
}

.topbar-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.primary-actions {
    padding: 0 8px;
    border-left: 1px solid rgba(16, 37, 27, 0.1);
    border-right: 1px solid rgba(16, 37, 27, 0.1);
}

.topbar .actions {
    position: relative;
    z-index: 1010;
}

.mobile-admin-actions-slot {
    display: none;
}

.icon-button,
.view-button,
.primary-button,
.secondary-button,
.danger-button,
.tiny-button,
.nav-button,
.admin-back-link {
    min-height: 40px;
    border-radius: 11px;
    border: 1px solid var(--border);
    cursor: pointer;
    line-height: 1;
    will-change: transform;
}

.icon-button:not(:disabled):hover,
.view-button:not(:disabled):hover,
.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.danger-button:not(:disabled):hover,
.tiny-button:not(:disabled):hover,
.nav-button:hover,
.admin-back-link:hover {
    transform: translateY(-1px) scale(1.015);
}

.icon-button:not(:disabled):active,
.view-button:not(:disabled):active,
.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.danger-button:not(:disabled):active,
.tiny-button:not(:disabled):active,
.nav-button:active,
.admin-back-link:active {
    transform: scale(0.985);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: #edf4ea;
    color: var(--forest-700);
    font-weight: 800;
}

.admin-back-link {
    min-height: 34px;
}

.icon-button:hover {
    border-color: rgba(47, 90, 67, 0.42);
    background: var(--sage-100);
}

.icon-button svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.2;
}

.view-button {
    padding: 0 13px;
    background: #f7faf4;
    color: var(--forest-700);
    font-size: 14px;
    font-weight: 800;
}

.view-button:hover {
    border-color: rgba(47, 90, 67, 0.42);
    background: #edf4ea;
}

.view-button.active {
    border-color: var(--forest-600);
    background: var(--forest-600);
    color: white;
}

.primary-button {
    padding: 0 16px;
    border-color: var(--forest-600);
    background: var(--forest-600);
    color: white;
    font-weight: 800;
}

.add-event-button {
    min-height: 44px;
    padding-inline: 20px;
    border-color: rgba(47, 90, 67, 0.78);
    box-shadow: 0 10px 22px rgba(47, 90, 67, 0.18);
    font-size: 14px;
}

.add-event-button:hover {
    box-shadow: 0 12px 26px rgba(47, 90, 67, 0.22);
}

.primary-button:hover {
    border-color: var(--forest-900);
    background: var(--forest-700);
}

.secondary-button,
.danger-button {
    padding: 0 14px;
    background: var(--cream-2);
    color: var(--forest-700);
    font-weight: 700;
}

.secondary-button:hover {
    border-color: rgba(47, 90, 67, 0.42);
    background: #f7faf4;
}

.danger-button {
    border-color: var(--cancelled-border);
    color: var(--cancelled);
}

.danger-button:hover {
    border-color: var(--cancelled);
    background: var(--cancelled-soft);
}

.details-page-button {
    border-color: rgba(47, 90, 67, 0.24);
    color: var(--green);
    background: rgba(47, 90, 67, 0.08);
}

.details-page-button:not(:disabled):hover {
    border-color: rgba(47, 90, 67, 0.38);
    background: rgba(47, 90, 67, 0.13);
}

.delete-event-button,
.app-modal-actions .delete-event-button {
    border-color: var(--cancelled);
    background: var(--cancelled);
    color: white;
    box-shadow: 0 10px 22px rgba(180, 35, 24, 0.18);
}

.delete-event-button:not(:disabled):hover,
.app-modal-actions .delete-event-button:not(:disabled):hover {
    border-color: #8f1d14;
    background: #9f2018;
    color: white;
}

.delete-event-button:disabled {
    border-color: rgba(180, 35, 24, 0.22);
    background: rgba(180, 35, 24, 0.2);
    color: rgba(255, 255, 255, 0.88);
}

.logout-button {
    border-color: rgba(180, 35, 24, 0.24);
    color: #9f2f27;
    background: #fff8f6;
}

.logout-button:hover {
    border-color: rgba(180, 35, 24, 0.5);
    color: var(--cancelled);
    background: #fff1f0;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

button:disabled {
    transform: none;
}

.date-jump {
    position: relative;
    z-index: 1100;
}

.date-jump-panel {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 3000;
    width: 290px;
    max-width: calc(100vw - 32px);
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--cream-2);
    box-shadow: 0 18px 42px rgba(16, 37, 27, 0.18);
}

.date-jump-overlay[hidden] {
    display: none;
}

.date-jump-panel label {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.date-jump-panel select {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 10px;
    color: var(--text);
    background: white;
}

.date-jump-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 23vw, 380px);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    padding: 20px;
}

.calendar-section {
    display: grid;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.calendar-control-panel,
.calendar-card {
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(16, 37, 27, 0.1);
    border-radius: 18px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--shadow);
}

.calendar-control-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.calendar-card {
    padding: 14px;
    overflow: visible;
}

.calendar-control-heading h2 {
    font-size: clamp(24px, 2.1vw, 32px);
    line-height: 1.05;
}

.calendar-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 1px 2px 12px;
    border-bottom: 1px solid rgba(216, 222, 210, 0.78);
}

.calendar-card-heading h2 {
    grid-column: 2;
    font-size: clamp(22px, 1.8vw, 28px);
    line-height: 1.12;
    text-align: center;
    text-transform: capitalize;
}

.calendar-navigation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.calendar-navigation-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    justify-self: end;
}

.calendar-navigation-actions .secondary-button {
    min-height: 38px;
}

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.calendar-control-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 0.82fr) minmax(330px, 1fr);
    align-items: stretch;
    gap: 14px;
}

.control-segment {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    padding: 2px 14px 2px 0;
    border-right: 1px solid rgba(16, 37, 27, 0.08);
}

.control-segment:last-child {
    padding-right: 0;
    border-right: 0;
}

.control-segment h2 {
    font-size: clamp(20px, 1.6vw, 25px);
    line-height: 1.08;
}

.control-label {
    margin: 2px 0 0;
    color: var(--forest-700);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.search-field {
    position: relative;
    display: grid;
    gap: 7px;
    flex: none;
    min-width: 300px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.search-field input {
    min-height: 46px;
    border: 1px solid rgba(47, 90, 67, 0.28);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text);
    background: white;
    box-shadow: 0 7px 18px rgba(16, 37, 27, 0.045);
}

.search-field input::placeholder {
    color: #849081;
}

.search-results {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 30;
    width: min(540px, calc(100vw - 40px));
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--cream-2);
    box-shadow: 0 18px 42px rgba(16, 37, 27, 0.18);
}

.search-result,
.search-empty {
    width: 100%;
    padding: 12px 13px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: var(--cream-2);
    color: var(--text);
    text-align: left;
}

.search-result {
    cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible {
    background: #f0f5ed;
}

.search-result:last-child,
.search-empty:last-child {
    border-bottom: 0;
}

.search-result-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 800;
}

.search-result-meta {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.legend {
    display: flex;
    gap: 9px 11px;
    flex: 0 1 auto;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(244, 247, 241, 0.72);
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.preliminary {
    background: var(--status-wstepna);
}

.confirmed {
    background: var(--status-potwierdzona);
}

.paid {
    background: var(--status-zadatek);
}

.canceled {
    background: var(--status-anulowana);
}

.status-wstepna {
    --event-status-color: var(--status-wstepna);
}

.status-zadatek {
    --event-status-color: var(--status-zadatek);
}

.status-potwierdzona {
    --event-status-color: var(--status-potwierdzona);
}

.status-anulowana {
    --event-status-color: var(--status-anulowana);
}

.status-zrealizowana {
    --event-status-color: #868e96;
}

.print-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(116px, 1fr)) auto;
    gap: 8px;
    align-items: end;
    flex: 0 0 auto;
}

.print-range label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

.print-range input {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 10px;
    color: var(--text);
    background: white;
}

#calendar {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

#calendar[hidden] {
    display: none;
}

.custom-list-view {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.custom-list-view[hidden] {
    display: none;
}

.custom-list-day {
    display: grid;
    gap: 7px;
}

.custom-list-day h2 {
    margin: 4px 0 1px;
    padding: 8px 10px;
    border: 1px solid rgba(216, 222, 210, 0.72);
    border-radius: 12px;
    color: var(--forest-900);
    background: rgba(244, 247, 241, 0.86);
    font-size: 15px;
    font-weight: 800;
}

.custom-list-event {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--forest-600);
    border-radius: 14px;
    background: #fbfcf7;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.custom-list-event:hover,
.custom-list-event:focus-visible {
    border-color: rgba(47, 90, 67, 0.42);
    background: #f2f6ef;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 37, 27, 0.08);
}

.custom-list-event.cancelled-event {
    border-left-color: var(--cancelled);
    background: var(--cancelled-soft);
}

.custom-list-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 3px;
    color: var(--forest-900);
    font-weight: 800;
}

.custom-list-time {
    color: var(--forest-700);
    font-weight: 850;
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-inline .dot {
    flex: 0 0 auto;
}

.custom-list-empty {
    margin: 0;
}

.fc {
    --fc-border-color: var(--border);
    --fc-button-bg-color: var(--forest-600);
    --fc-button-border-color: var(--forest-600);
    --fc-button-hover-bg-color: var(--forest-700);
    --fc-button-hover-border-color: var(--forest-700);
    --fc-button-active-bg-color: var(--forest-900);
    --fc-button-active-border-color: var(--forest-900);
    --fc-today-bg-color: rgba(223, 232, 221, 0.52);
    color: var(--text);
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.fc .fc-view-harness,
.fc .fc-scrollgrid {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.fc .fc-scrollgrid,
.fc table,
.fc .fc-scrollgrid table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

.fc .fc-toolbar {
    align-items: center;
    margin-bottom: 14px;
}

.fc .fc-toolbar-title {
    color: var(--forest-900);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: capitalize;
}

.fc .fc-button {
    border-radius: 11px;
    box-shadow: none;
    font-weight: 800;
}

.fc .fc-col-header-cell {
    background: #edf3e9;
}

.fc .fc-col-header-cell-cushion {
    padding: 10px 6px;
    color: var(--forest-700);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.fc .fc-daygrid-day-number {
    padding: 8px 9px 2px;
    color: var(--forest-900);
    font-weight: 800;
}

.fc .fc-daygrid-day-frame {
    min-height: 92px;
    background: rgba(255, 253, 247, 0.82);
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.fc .fc-daygrid-day:hover .fc-daygrid-day-frame {
    background: rgba(47, 90, 67, 0.06);
    box-shadow: inset 0 0 0 1px rgba(47, 90, 67, 0.18);
    transform: translateY(-1px);
}

.fc .fc-day-other .fc-daygrid-day-frame {
    background: rgba(246, 248, 242, 0.78);
}

.fc .fc-day-today .fc-daygrid-day-frame {
    box-shadow: inset 0 0 0 2px rgba(47, 90, 67, 0.22);
}

.fc .event-day:not(.selected-date) .fc-daygrid-day-frame {
    background: var(--event-day-bg);
}

.fc .event-day:not(.selected-date):hover .fc-daygrid-day-frame {
    background: rgba(47, 90, 67, 0.13);
}

.fc .selected-date .fc-daygrid-day-frame {
    background: rgba(47, 90, 67, 0.2);
    box-shadow: inset 0 0 0 2px rgba(47, 90, 67, 0.68), 0 8px 18px rgba(16, 37, 27, 0.08);
}

.fc .fc-timeGridWeek-view .fc-timegrid-slot {
    height: 1.72em;
}

.fc .fc-timeGridWeek-view .fc-event {
    font-size: 12px;
}

.fc .fc-timeGridWeek-view .fc-timegrid-event-harness {
    min-width: 82px;
}

.fc .fc-timeGridWeek-view .fc-v-event {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 4px 6px;
    border-radius: 10px;
}

.fc .fc-timeGridWeek-view .fc-timegrid-event,
.fc .fc-timeGridWeek-view .fc-event-main,
.fc .fc-timeGridWeek-view .fc-event-main-frame {
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: visible;
}

.fc .fc-timeGridWeek-view .calendar-event-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    gap: 2px;
    line-height: 1.15;
    overflow: visible;
}

.fc .fc-timeGridWeek-view .calendar-event-title {
    display: block;
    min-width: 0;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.15;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.fc .fc-timeGridWeek-view .calendar-event-time {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.1;
}

.fc .fc-daygrid-day-events {
    padding: 1px 6px 7px;
}

.fc .fc-event {
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(16, 37, 27, 0.12);
    transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease, outline-color 150ms ease;
}

.fc .fc-event.status-wstepna,
.fc .fc-event.status-zadatek,
.fc .fc-event.status-potwierdzona,
.fc .fc-event.status-anulowana,
.fc .fc-event.status-zrealizowana {
    background-color: var(--event-status-color) !important;
    border-color: var(--event-status-color) !important;
}

.fc .fc-event:hover,
.fc .fc-event:focus {
    filter: saturate(1.05);
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(16, 37, 27, 0.14);
}

.fc .fc-event.selected-event,
.fc .fc-event.return-highlight {
    outline: 2px solid rgba(16, 37, 27, 0.44);
    outline-offset: 2px;
    box-shadow: 0 10px 22px rgba(16, 37, 27, 0.2);
}

.fc .fc-daygrid-event {
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 1px 0;
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.25;
}

.fc .fc-daygrid-event-harness {
    margin-left: 0;
    margin-right: 0;
}

.fc .fc-daygrid-dot-event {
    display: block;
    padding: 0;
}

.fc .fc-daygrid-event .calendar-event-content {
    width: 100%;
}

.fc .fc-event-time {
    font-weight: 800;
}

.fc .fc-event-title {
    font-weight: 800;
}

.calendar-event-content {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.calendar-event-time {
    flex: 0 0 auto;
    font-weight: 900;
}

.calendar-event-title {
    min-width: 0;
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-panel {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 18px;
    align-self: start;
    min-width: 0;
    max-width: 380px;
}

.side-section {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(16, 37, 27, 0.1);
    border-radius: 16px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--soft-shadow);
}

.upcoming-section {
    margin-bottom: 4px;
    border-color: rgba(201, 144, 46, 0.2);
    background: rgba(255, 248, 220, 0.72);
}

.day-section {
    margin-top: 6px;
}

.section-heading {
    display: grid;
    gap: 2px;
    margin-bottom: 12px;
}

.section-heading h2 {
    font-size: 18px;
}

.detail-title {
    font-size: 21px;
    line-height: 1.18;
}

.details-eyebrow {
    margin-top: 0;
}

.day-schedule {
    display: grid;
    gap: 10px;
}

.schedule-item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--forest-600);
    border-radius: 14px;
    background: #fbfcf7;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.schedule-item:hover,
.schedule-item:focus-visible {
    border-color: rgba(47, 90, 67, 0.42);
    background: #f2f6ef;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 37, 27, 0.08);
}

.schedule-time {
    color: var(--forest-700);
    font-weight: 800;
}

.schedule-title {
    margin: 0 0 4px;
    font-weight: 800;
}

.schedule-meta {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.empty-state {
    margin: 0;
    padding: 12px;
    border-radius: 13px;
    background: #f2f5ed;
    color: var(--muted);
    line-height: 1.45;
}

.loading-state {
    margin: 0;
    padding: 12px;
    border-radius: 13px;
    background: linear-gradient(90deg, rgba(244, 247, 241, 0.78), rgba(255, 253, 247, 0.92), rgba(244, 247, 241, 0.78));
    color: var(--muted);
    line-height: 1.45;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    font-weight: 850;
}

.details-panel dl {
    display: grid;
    margin: 14px 0 0;
}

.details-panel dl div {
    display: grid;
    grid-template-columns: minmax(98px, 0.82fr) 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(216, 222, 210, 0.92);
}

.details-panel dl div:first-child {
    padding-top: 0;
}

.details-panel dl div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

dt {
    color: var(--muted);
    font-size: 13px;
}

dd {
    margin: 0;
    color: var(--forest-900);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.soft-section,
.note-box {
    background: #f7f6ed;
}

.soft-section p,
.note-box p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.details-section {
    margin-top: 16px;
}

.upcoming-list,
.task-list,
.staff-list,
.history-list {
    display: grid;
    gap: 9px;
    margin-top: 10px;
}

.upcoming-item,
.task-item,
.staff-item,
.history-item {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fbfcf7;
}

.upcoming-item {
    width: 100%;
    border-color: rgba(201, 144, 46, 0.18);
    background: rgba(255, 253, 244, 0.9);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.upcoming-item:hover,
.upcoming-item:focus-visible {
    border-color: rgba(201, 144, 46, 0.34);
    background: rgba(255, 247, 216, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(147, 101, 21, 0.08);
}

.upcoming-title,
.history-title {
    color: var(--forest-900);
    font-weight: 800;
}

.task-row,
.staff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-title.done {
    color: var(--muted);
    text-decoration: line-through;
}

.item-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.tiny-button {
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--forest-700);
    cursor: pointer;
    font-weight: 700;
}

.tiny-button:hover {
    border-color: rgba(47, 90, 67, 0.42);
    background: #f2f6ef;
}

.inline-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.inline-form input,
.inline-form select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 10px;
    color: var(--text);
    background: white;
}

.panel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(216, 222, 210, 0.92);
}

.panel-actions > * {
    width: 100%;
    min-height: 40px;
    text-align: center;
    justify-content: center;
}

.event-dialog {
    width: min(760px, calc(100vw - 32px));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0;
    color: var(--text);
    background: var(--cream-2);
    box-shadow: 0 24px 80px rgba(16, 37, 27, 0.26);
}

.event-dialog::backdrop {
    background: rgba(16, 37, 27, 0.42);
}

.event-form {
    padding: 20px;
}

.event-dialog.editing-dialog {
    border-color: rgba(201, 144, 46, 0.5);
}

.event-dialog.editing-dialog .dialog-header {
    margin: -20px -20px 18px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(201, 144, 46, 0.28);
    border-radius: 8px 8px 0 0;
    background: rgba(201, 144, 46, 0.1);
}

.event-dialog.editing-dialog #eventDialogModeLabel {
    color: #8b641d;
}

.form-error {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(166, 90, 68, 0.36);
    border-radius: 8px;
    background: #fff4ef;
    color: var(--clay);
    line-height: 1.45;
}

.form-success {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(47, 90, 67, 0.28);
    border-radius: 8px;
    background: #eef7eb;
    color: var(--forest-700);
    line-height: 1.45;
}

.dialog-header,
.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dialog-header {
    margin-bottom: 18px;
}

.dialog-actions {
    margin-top: 18px;
}

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

.form-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--text);
    background: white;
}

.form-grid textarea {
    resize: vertical;
}

.full-row {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    align-self: end;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.form-grid label.checkbox-field {
    display: flex;
}

.checkbox-field input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
}

.form-checkbox-card {
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.app-modal {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    padding: 0;
    color: var(--text);
    background: transparent;
}

.app-modal::backdrop {
    background: rgba(16, 37, 27, 0.42);
}

.app-modal-card {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--cream-2);
    box-shadow: 0 24px 80px rgba(16, 37, 27, 0.24);
}

.app-modal-card h2 {
    margin: 0;
    color: var(--forest-900);
    font-size: 20px;
}

.app-modal-message {
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}

.app-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.form-section {
    margin: 4px 0 0;
    padding: 14px;
    border: 1px solid rgba(216, 222, 210, 0.92);
    border-radius: 8px;
    background: #f9f8f1;
}

.form-section legend {
    padding: 0 7px;
    color: var(--forest-700);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-grid {
    margin-top: 4px;
}

.admin-shell {
    display: grid;
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.admin-section {
    padding: 20px;
    border: 1px solid rgba(16, 37, 27, 0.12);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--shadow);
}

.print-shell {
    width: min(1180px, calc(100% - 32px));
}

.print-view-nav {
    justify-content: flex-end;
}

.print-range-label {
    margin: 10px 0 0;
    color: var(--forest-700);
    font-size: 13px;
    font-weight: 800;
}

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

.print-table-card {
    overflow: hidden;
}

.print-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.print-events-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    background: white;
    font-size: 12px;
}

.print-events-table th,
.print-events-table td {
    padding: 8px;
    border: 1px solid #b9c2bd;
    text-align: left;
    vertical-align: top;
}

.print-events-table th {
    background: #edf3ef;
    color: var(--forest-900);
    font-weight: 800;
}

.print-notes {
    max-width: 280px;
    white-space: pre-wrap;
}

.print-event-extra {
    margin-top: 4px;
    color: var(--forest-700);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.admin-form {
    padding: 0;
    margin-top: 18px;
}

.event-details-shell {
    display: grid;
    gap: 18px;
    width: min(1100px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.event-details-hero {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid rgba(16, 37, 27, 0.12);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--shadow);
}

.event-details-hero p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

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

.event-details-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(16, 37, 27, 0.12);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: 0 10px 24px rgba(16, 37, 27, 0.055);
}

.event-details-card h3 {
    margin-bottom: 12px;
}

.event-details-card dl {
    display: grid;
    margin: 0;
}

.event-details-card dl div {
    display: grid;
    grid-template-columns: minmax(140px, 0.75fr) 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(216, 222, 210, 0.92);
}

.event-details-card dl div:last-child {
    border-bottom: 0;
}

.event-details-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
}

.event-details-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    justify-content: flex-end;
    gap: 8px;
    width: min(430px, 100%);
    margin-left: auto;
}

.event-details-actions > * {
    width: 100%;
    min-height: 42px;
    justify-content: center;
}

.event-details-form {
    padding: 18px;
    border: 1px solid rgba(47, 90, 67, 0.18);
    border-radius: 8px;
    background: rgba(249, 248, 241, 0.94);
}

.event-details-form[hidden] {
    display: none;
}

.event-details-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(216, 222, 210, 0.92);
}

.event-details-form-header h3 {
    margin: 2px 0 0;
    font-size: 18px;
}

.event-details-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.user-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.user-card {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) minmax(180px, 240px) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcf7;
}

.user-card h3 {
    margin: 0 0 4px;
}

.user-action {
    display: grid;
    gap: 6px;
}

.user-action label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.user-action input,
.user-action select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    background: white;
}

.login-page {
    min-height: 100vh;
    background:
            radial-gradient(circle at top, rgba(223, 232, 221, 0.9), transparent 34rem),
            linear-gradient(180deg, #fffdf7 0%, var(--sage-50) 100%);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    border: 1px solid rgba(16, 37, 27, 0.12);
    border-radius: 22px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: 0 26px 70px rgba(16, 37, 27, 0.13);
}

.login-logo {
    display: block;
    width: 86px;
    height: 86px;
    margin: 0 auto 22px;
    border-radius: 12px;
    object-fit: cover;
    background: #050505;
    box-shadow: 0 12px 28px rgba(16, 37, 27, 0.18);
}

.login-card .eyebrow,
.login-card h1,
.login-intro {
    text-align: center;
}

.login-card h1 {
    font-size: 26px;
}

.login-intro {
    margin: 12px 0 24px;
    color: var(--muted);
    line-height: 1.55;
}

.login-message {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.45;
}

.login-error {
    border: 1px solid rgba(166, 90, 68, 0.28);
    background: #fff3ec;
    color: var(--clay);
}

.login-success {
    border: 1px solid rgba(47, 90, 67, 0.24);
    background: #edf6ea;
    color: var(--forest-700);
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text);
    background: white;
}

.login-form .primary-button {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border-radius: 12px;
}

.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(16, 37, 27, 0.12);
    border-radius: 12px;
    background: rgba(255, 253, 247, 0.84);
    box-shadow: var(--shadow);
}

.admin-hero p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.staff-admin-shell {
    width: min(1120px, calc(100% - 32px));
}

.staff-list-admin {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.staff-card-admin {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcf7;
}

.staff-card-main,
.staff-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.staff-card-main h3 {
    margin-bottom: 5px;
    font-size: 17px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-pill.active {
    border: 1px solid rgba(47, 90, 67, 0.22);
    background: #edf6ea;
    color: var(--forest-700);
}

.status-pill.inactive {
    border: 1px solid var(--cancelled-border);
    background: var(--cancelled-soft);
    color: var(--cancelled);
}

.history-shell {
    width: min(1060px, calc(100% - 32px));
}

.history-section {
    display: grid;
    gap: 22px;
}

.history-day-group {
    display: grid;
    gap: 10px;
}

.history-day-group h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(216, 222, 210, 0.92);
    font-size: 18px;
}

.history-admin-list {
    display: grid;
    gap: 9px;
}

.history-admin-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcf7;
}

.history-admin-item time {
    color: var(--forest-700);
    font-weight: 900;
}

.history-admin-title {
    margin: 0 0 4px;
    color: var(--forest-900);
    font-weight: 800;
}

.history-event-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    text-decoration: none;
    white-space: nowrap;
}

.session-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2800;
    width: min(340px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid rgba(201, 144, 46, 0.36);
    border-radius: 12px;
    background: rgba(255, 253, 247, 0.98);
    box-shadow: 0 18px 42px rgba(16, 37, 27, 0.18);
}

.session-toast[hidden] {
    display: none;
}

.session-toast h2 {
    margin-bottom: 5px;
    color: var(--forest-900);
    font-size: 16px;
}

.session-toast p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.45;
}

.session-toast.warning {
    border-color: rgba(201, 144, 46, 0.55);
}

.staff-card-meta {
    display: grid;
    gap: 0;
    margin: 0;
    border-top: 1px solid rgba(216, 222, 210, 0.86);
}

.staff-card-meta div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(216, 222, 210, 0.68);
}

.staff-card-meta div:last-child {
    border-bottom: 0;
}

.staff-card-meta dt {
    color: var(--muted);
}

.staff-card-meta dd {
    text-align: left;
}

.staff-edit-panel {
    border-top: 1px solid rgba(216, 222, 210, 0.86);
    padding-top: 12px;
}

.staff-edit-panel summary {
    width: fit-content;
    cursor: pointer;
    color: var(--forest-700);
    font-weight: 800;
}

.compact-form {
    padding: 14px 0 0;
}

@media (max-width: 1320px) {
    .calendar-control-grid {
        grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
    }

    .print-segment {
        grid-column: 1 / -1;
        padding-top: 12px;
        padding-right: 0;
        border-top: 1px solid rgba(16, 37, 27, 0.08);
        border-right: 0;
    }

    .legend-segment {
        padding-right: 0;
        border-right: 0;
    }
}

@media (max-width: 1380px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .details-panel {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }

    .detail-summary,
    .day-section {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        gap: 12px;
        padding: 12px;
    }

    .brand {
        align-items: center;
        gap: 10px;
    }

    .brand-logo {
        width: 46px;
        height: 46px;
    }

    .brand .eyebrow {
        margin-bottom: 2px;
        font-size: 10px;
    }

    h1 {
        font-size: 20px;
    }

    .actions,
    .panel-actions {
        align-items: stretch;
    }

    .topbar .actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        width: 100%;
    }

    .topbar-action-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .view-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    }

    .primary-actions {
        grid-template-columns: 1fr;
        padding: 0;
        border: 0;
    }

    .admin-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar .actions > *,
    .topbar-action-group > *,
    .topbar .actions form,
    .topbar .actions form button,
    .topbar .date-jump,
    .topbar .date-jump .icon-button {
        width: 100%;
    }

    .topbar .actions .add-event-button {
        grid-column: 1 / -1;
        min-height: 48px;
        font-size: 15px;
    }

    .topbar .actions .icon-button,
    .topbar .actions .view-button,
    .topbar .actions .primary-button,
    .topbar .actions .secondary-button {
        min-height: 38px;
        padding-inline: 10px;
        font-size: 13px;
    }

    .add-event-button {
        box-shadow: 0 8px 18px rgba(47, 90, 67, 0.16);
    }

    .app-shell {
        gap: 14px;
        padding: 12px;
    }

    .calendar-section {
        gap: 12px;
    }

    .calendar-card {
        order: 1;
    }

    .calendar-control-panel {
        order: 2;
    }

    .calendar-control-panel,
    .calendar-card,
    .side-section {
        padding: 12px;
    }

    .calendar-control-heading h2 {
        font-size: 24px;
    }

    .calendar-card-heading {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .calendar-card-heading h2 {
        grid-column: auto;
        font-size: 22px;
        text-align: center;
    }

    .calendar-navigation-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        justify-self: stretch;
        width: 100%;
    }

    .toolbar,
    .calendar-control-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .control-segment,
    .print-segment {
        grid-column: auto;
        padding: 0 0 11px;
        border-right: 0;
        border-bottom: 1px solid rgba(16, 37, 27, 0.08);
        border-top: 0;
    }

    .control-segment:last-child,
    .print-segment {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .details-panel {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .detail-summary,
    .day-section {
        grid-column: auto;
    }

    .search-field {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .search-field input {
        height: 46px;
        min-height: 46px;
    }

    .search-results {
        width: 100%;
    }

    .print-range {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .print-range .secondary-button {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 40px;
    }

    .legend {
        order: initial;
        width: auto;
        gap: 8px 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .date-jump-panel {
        width: min(290px, calc(100vw - 32px));
    }

    .details-panel dl div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    dd {
        text-align: left;
    }

    .fc .fc-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .fc .fc-toolbar-title {
        font-size: 20px;
        text-align: left;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 68px;
    }

    .fc .fc-daygrid-event {
        font-size: 11px;
        padding: 2px 5px;
    }

    .fc .fc-col-header-cell-cushion {
        padding: 8px 2px;
        font-size: 10px;
    }

    .fc .fc-daygrid-day-number {
        padding: 6px 5px 1px;
        font-size: 12px;
    }

    .fc .fc-daygrid-day-events {
        padding: 0 3px 5px;
    }

    .user-card {
        grid-template-columns: 1fr;
    }

    .custom-list-event,
    .history-admin-item {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 26px;
    }

    .admin-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .print-view-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .print-view-nav .nav-button,
    .print-actions,
    .print-actions .primary-button {
        width: 100%;
    }

    .event-details-hero {
        flex-direction: column;
    }

    .event-details-grid {
        grid-template-columns: 1fr;
    }

    .event-details-card dl div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .staff-card-meta div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mobile-admin-actions-slot {
        display: block;
        width: 100%;
        padding: 0 12px 14px;
    }

    .mobile-admin-actions-slot .admin-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        padding: 12px;
        border: 1px solid rgba(16, 37, 27, 0.1);
        border-radius: 15px;
        background: rgba(255, 253, 247, 0.96);
        box-shadow: var(--soft-shadow);
    }

    .mobile-admin-actions-slot .admin-actions > *,
    .mobile-admin-actions-slot .admin-actions form,
    .mobile-admin-actions-slot .admin-actions form button {
        width: 100%;
    }

    .mobile-admin-actions-slot .admin-actions .logout-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 430px) {
    .topbar {
        gap: 10px;
        padding: 10px;
    }

    .view-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) 42px;
    }

    .admin-actions {
        grid-template-columns: 1fr;
    }

    .app-shell {
        padding: 10px;
    }

    .calendar-control-panel,
    .calendar-card,
    .side-section {
        border-radius: 15px;
        padding: 11px;
    }

    .legend span {
        padding-inline: 6px;
        font-size: 11px;
    }

    .custom-list-event,
    .schedule-item {
        grid-template-columns: 1fr;
        gap: 7px;
    }
}

@media (max-width: 390px) {
    .brand-logo {
        width: 42px;
        height: 42px;
    }

    h1 {
        font-size: 18px;
    }

    .view-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) 40px;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 58px;
    }

    .fc .fc-daygrid-event {
        font-size: 10px;
        padding: 2px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body {
        margin: 12mm;
        background: white;
    }

    .topbar,
    .print-actions {
        display: none !important;
    }

    .admin-shell.print-shell {
        width: auto;
        margin: 0;
        gap: 12px;
    }

    .print-hero,
    .print-table-card {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: white;
    }

    .print-table-wrap {
        overflow: visible;
    }

    .print-events-table {
        min-width: 0;
        font-size: 10px;
    }

    .print-events-table th,
    .print-events-table td {
        padding: 5px;
    }

    .print-event-extra {
        color: #24372c;
    }
}
