:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --ink: #17212b;
    --muted: #647483;
    --line: #dce5ec;
    --primary: #1167a8;
    --primary-dark: #0b4c7d;
    --green: #1f8a5b;
    --amber: #9a6a00;
    --red: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Tahoma, Arial, sans-serif;
}

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

.login-layout {
    width: min(1040px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(320px, 460px) 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 24px 80px rgba(23, 33, 43, .12);
}

.login-panel,
.login-aside {
    padding: 48px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-aside {
    display: flex;
    align-items: end;
    color: #ffffff;
    background: #0d3a5e;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: bold;
}

h1,
h2,
p {
    margin-top: 0;
}

.login-panel h1 {
    margin: 22px 0 10px;
    font-size: 30px;
    line-height: 1.25;
}

.login-panel p,
.login-aside p,
.topbar p {
    color: var(--muted);
    line-height: 1.65;
}

.login-aside p {
    color: rgba(255, 255, 255, .82);
}

.login-aside h2 {
    max-width: 540px;
    font-size: 34px;
    line-height: 1.25;
}

.research-contact-panel {
    width: 100%;
}

.research-contact-panel h2 {
    margin: 0 0 16px;
    max-width: none;
    font-size: 28px;
}

.research-contact-list {
    display: grid;
    gap: 10px;
    max-height: 470px;
    overflow: auto;
    padding-right: 4px;
}

.research-contact-card {
    display: grid;
    gap: 3px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255,255,255,.08);
}

.research-contact-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.research-contact-card strong {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.25;
}

.research-contact-card span {
    color: rgba(255,255,255,.78);
    font-size: 12px;
}

.research-contact-card a {
    color: #d6ebff;
    font-size: 13px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.research-contact-card a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

.entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.helper-link {
    margin-top: 18px;
    font-size: 14px;
}

label {
    /*display: grid;*/
    gap: 7px;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    color: var(--ink);
    font: 15px Tahoma, Arial, sans-serif;
    background: #ffffff;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 9px 14px;
    color: #ffffff;
    background: var(--primary);
    font: bold 14px Tahoma, Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.button.ghost {
    color: var(--primary);
    background: #ffffff;
}

.button.small {
    min-height: 34px;
    padding: 6px 10px;
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    padding: 22px;
    background: #101820;
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand span {
    display: block;
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    border-radius: 6px;
    padding: 11px 12px;
    color: rgba(255, 255, 255, .76);
    text-decoration: none;
}

.sidebar a.active,
.sidebar a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .1);
}

.content {
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar h1 {
    margin-bottom: 0;
    font-size: 28px;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.notice {
    margin-bottom: 16px;
    border: 1px solid #b9dfc9;
    border-radius: 6px;
    padding: 12px 14px;
    color: #165a36;
    background: #edf8f1;
}

.notice.error {
    border-color: #f2beb9;
    color: var(--red);
    background: #fff1ef;
}

.swal-lite-root {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 32, .44);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}

.swal-lite-root.is-open {
    opacity: 1;
    pointer-events: auto;
}

.swal-lite-card {
    width: min(420px, 100%);
    border-radius: 10px;
    padding: 26px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 32, .22);
    text-align: center;
    transform: translateY(10px) scale(.98);
    transition: transform .16s ease;
}

.swal-lite-root.is-open .swal-lite-card {
    transform: translateY(0) scale(1);
}

.swal-lite-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    color: var(--primary);
    font-size: 30px;
    font-weight: bold;
}

.swal-success .swal-lite-icon {
    border-color: var(--green);
    color: var(--green);
}

.swal-warning .swal-lite-icon {
    border-color: var(--amber);
    color: var(--amber);
}

.swal-error .swal-lite-icon {
    border-color: var(--red);
    color: var(--red);
}

.swal-lite-title {
    margin: 0 0 8px;
    font-size: 22px;
}

.swal-lite-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.swal-lite-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.swal-lite-button {
    min-width: 96px;
}

.swal-lite-button.secondary {
    color: var(--primary);
    background: #ffffff;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.metric-card {
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 32px;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr);
    gap: 18px;
}

.dashboard-instrument-layout {
    display: grid;
    grid-template-columns: 1fr;
}

.panel {
    overflow: hidden;
}

.budget-filter-panel {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.panel-title {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    background:  #dff0fb;
}

.panel-title h2 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-dark);
}

.panel-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #ffffff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.empty {
    color: var(--muted);
    text-align: center;
}

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: bold;
}

.status.pending {
    color: var(--amber);
    background: #fff3cc;
}

.status.approved {
    color: var(--green);
    background: #e4f6ed;
}

.status.rejected,
.status.cancelled {
    color: var(--red);
    background: #ffe4e0;
}

.empty-inline {
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.status-approved {
    color: #11603d;
    background: #e4f6ed;
}

.status-rejected {
    color: #991b1b;
    background: #ffe4e4;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(540px, 360px) auto;
    align-items: end;
    gap: 12px;
    padding: 16px;
}

.inline-form.wide-form {
    grid-template-columns: minmax(320px, 620px) auto;
}

.staff-budget-filter {
    grid-template-columns: minmax(360px, 1.8fr) minmax(140px, 190px) minmax(160px, 220px) 88px;
    align-items: start;
    gap: 12px;
}

.staff-budget-filter label {
    display: grid;
    gap: 6px;
    min-width: 0;
    line-height: 1.25;
}

.staff-budget-filter input,
.staff-budget-filter select {
    height: 43px;
    margin: 0;
}

.staff-budget-filter button {
    width: 100%;
    min-height: 43px;
    margin-top: 20px;
}

.staff-budget-filter .selected-student-name {
    min-height: 18px;
    margin-top: 0;
    font-size: 13px;
    line-height: 1.35;
}

.staff-budget-filter .autocomplete-menu {
    top: 69px;
    z-index: 120;
}

.report-filter-panel {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.staff-report-filter {
    display: grid;
    grid-template-columns: minmax(140px, 170px) minmax(140px, 170px) minmax(260px, 1fr) minmax(220px, 1fr) auto auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
}

.staff-report-filter label {
    display: grid;
    gap: 6px;
    min-width: 0;
    line-height: 1.25;
    font-weight: 800;
}

.staff-report-filter input,
.staff-report-filter select {
    height: 43px;
    margin: 0;
}

.staff-report-filter button,
.staff-report-filter .button {
    min-height: 43px;
    margin-top: 20px;
}

.staff-report-filter .selected-student-name {
    min-height: 18px;
    margin-top: 0;
    font-size: 13px;
    line-height: 1.35;
}

.staff-report-filter .field-help {
    min-height: 18px;
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.staff-report-filter .autocomplete-menu {
    top: 69px;
    z-index: 120;
}

.report-metrics {
    margin-top: 18px;
}

.report-summary-layout {
    margin-bottom: 18px;
}

.budget-chip {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    background: #fef3c7;
    color: #8a4b00;
    font-weight: 800;
}

.link-danger {
    min-height: auto;
    border: 0;
    padding: 0;
    color: var(--red);
    background: transparent;
    text-decoration: underline;
}

.link-danger:hover {
    background: transparent;
}

.review-form {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.review-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.link-button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    font-weight: 800;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

.link-button:hover {
    background: transparent;
    color: var(--primary-dark);
}

.instrument-list-table .link-button {
    font-size: 14px;
    line-height: 1.35;
}

.instrument-list-table small {
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 12px 14px;
    background: #f8fbfd;
}

.pagination .disabled {
    opacity: .45;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.page-numbers a,
.page-numbers span {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 9px;
    color: var(--primary);
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.page-numbers a.active {
    border-color: var(--primary);
    color: #ffffff;
    background: var(--primary);
}

.page-numbers span {
    color: var(--muted);
    background: transparent;
}

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

.staff-form-grid .span-all {
    grid-column: 1 / -1;
}

.staff-form-grid label {
    margin: 0;
}

.selected-instrument-box {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    background: #f8fafc;
}

.selected-instrument-box span {
    color: var(--muted);
    font-size: 13px;
}

.selected-instrument-box strong {
    color: var(--ink);
}

.staff-form-grid input,
.staff-form-grid select,
.staff-form-grid textarea {
    margin-top: 6px;
}

.student-autocomplete-field {
    position: relative;
}

.selected-student-name {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.autocomplete-menu {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 32, .16);
}

.autocomplete-option {
    width: 100%;
    min-height: 0;
    display: grid;
    gap: 2px;
    justify-content: start;
    border: 0;
    border-radius: 0;
    padding: 9px 11px;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
}

.autocomplete-option:hover {
    background: #eef6ff;
}

.autocomplete-option span {
    color: var(--muted);
    font-size: 12px;
}

.autocomplete-empty {
    padding: 10px 11px;
    color: var(--muted);
    font-size: 13px;
}

.time-select-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: end;
}

.time-select-group span {
    grid-column: 1 / -1;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
}

.staff-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(12, 24, 36, .48);
}

.staff-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 90;
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(12, 24, 36, .28);
}

.staff-modal.budget-modal {
    width: min(900px, calc(100vw - 28px));
}

.staff-modal.instrument-modal {
    width: min(960px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
}

.instrument-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 8px 10px;
    padding: 12px;
    background: #f8fbfd;
}

.instrument-edit-form label,
.instrument-edit-actions,
.radio-field {
    display: grid;
    grid-template-columns: minmax(130px, .42fr) minmax(180px, .58fr);
    align-items: center;
    gap: 8px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.instrument-edit-form .span-all,
.radio-field,
.instrument-edit-actions {
    grid-column: 1 / -1;
}

.instrument-edit-form .span-all {
    grid-template-columns: minmax(130px, .22fr) minmax(360px, .78fr);
}

.instrument-edit-form input,
.instrument-edit-form select,
.instrument-edit-form textarea {
    margin: 0;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
}

.instrument-edit-form textarea {
    min-height: 56px;
    resize: vertical;
}

.radio-field {
    grid-template-columns: minmax(180px, .34fr) 1fr 1fr;
    align-items: center;
    min-height: 42px;
}

.radio-field legend {
    padding: 0;
    color: var(--ink);
}

.radio-field label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    padding: 0;
    background: transparent;
    font-weight: 700;
}

.radio-field input {
    width: auto;
}

.instrument-edit-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    border: 0;
    padding: 2px 0 0;
    background: transparent;
}

.instrument-edit-actions .button,
.instrument-edit-actions button {
    min-height: 34px;
    min-width: 112px;
    padding: 6px 12px;
}

.staff-modal-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--primary);
    color: #ffffff;
}

.staff-modal-title h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
}

.modal-close {
    min-height: 30px;
    padding: 5px 9px;
    background: rgba(255,255,255,.18);
}

.budget-history-panel {
    border-top: 1px solid var(--line);
    padding: 0 18px 18px;
}

.budget-history-panel h3 {
    margin: 16px 0 10px;
    font-size: 17px;
}

.budget-history-table th {
    color: #ffffff;
    background: var(--primary);
}

.budget-history-table td {
    padding: 9px 10px;
}

.history-type {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 800;
}

.history-type.add {
    color: var(--green);
    background: #e4f6ed;
}

.history-type.remove {
    color: var(--red);
    background: #ffe4e0;
}

.instrument-detail-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    margin: 0;
}

.instrument-detail-grid dt,
.instrument-detail-grid dd {
    margin: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
}

.instrument-detail-grid dt {
    background: #f8fafc;
    color: #425463;
    font-weight: 800;
}

.instrument-detail-grid dd {
    color: var(--ink);
}

body.modal-open {
    overflow: hidden;
}

.staff-calendar-content {
    padding: 0;
}

.staff-calendar-topbar {
    margin: 0;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.staff-calendar-filter {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px 0;
}

.staff-calendar-filter label {
    width: min(520px, 100%);
    margin: 0;
}

.staff-calendar-filter select {
    margin-top: 6px;
}

.staff-calendar-panel {
    margin: 14px 18px;
    overflow: hidden;
    border: 1px solid #9aa7b1;
    border-radius: 0;
    background: #ffffff;
}

.staff-calendar-instrument {
    border-bottom: 1px solid #9aa7b1;
    padding: 7px 9px;
    font-size: 14px;
}

.staff-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 7px 16px;
    border-bottom: 1px solid #f7c6d1;
    background: #ffd1dc;
    color: #b42318;
}

.staff-calendar-toolbar a {
    color: #b42318;
    font-weight: 800;
    text-decoration: none;
}

.staff-calendar-toolbar strong {
    font-size: 18px;
}

.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
}

.admin-calendar-head {
    border-right: 1px solid #9aa7b1;
    border-bottom: 1px solid #9aa7b1;
    padding: 7px;
    color: #123dff;
    font-size: 13px;
    text-align: center;
    background: #ffffff;
}

.admin-calendar-head.weekend {
    color: #d11a1a;
}

.admin-calendar-day {
    min-height: 86px;
    border-right: 1px solid #9aa7b1;
    border-bottom: 1px solid #9aa7b1;
    padding: 6px;
    background: #ffffff;
}

.admin-calendar-day.outside-month {
    background: #f7f9fb;
    color: #94a3af;
}

.admin-calendar-day.today {
    background: #ffe0ea;
}

.admin-calendar-day.holiday {
    background: #fff9c9;
}

.day-number {
    margin-bottom: 8px;
    font-weight: 800;
    text-align: right;
}

.admin-holiday-label {
    margin-top: 18px;
    color: #e00000;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.admin-holiday-detail {
    display: block;
    margin-top: 4px;
    color: #d11a1a;
    text-align: center;
}

.admin-calendar-event {
    display: grid;
    gap: 3px;
    margin-top: 6px;
    border-radius: 4px;
    padding: 6px 7px;
    background: #e4f6ed;
    color: #17212b;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
}

.admin-calendar-event.student-booking {
    background: #e4f6ed;
    border-left: 4px solid #1f8a5b;
}

.admin-calendar-event.staff-booking {
    background: #EFBF04; /*#eaf4fb;*/
    border-left: 4px solid #1167a8;
}

.admin-calendar-event strong {
    font-size: 12px;
}

.admin-calendar-event small,
.admin-calendar-event span {
    color: #526171;
}

.calendar-delete-form,
.modal-delete-form {
    margin: 4px 0 0;
}

.calendar-delete-button,
.calendar-edit-button {
    min-height: 0;
    width: auto;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 11px;
    line-height: 1.1;
}

.calendar-edit-button {
    margin-top: 4px;
    background: #dbeafe;
    color: #1d4ed8;
}

.calendar-edit-button:hover {
    background: #bfdbfe;
}

.calendar-delete-button {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-delete-button:hover {
    background: #fecaca;
}

.staff-booking-modal {
    width: min(780px, calc(100vw - 28px));
}

.compact-booking-form {
    padding-top: 14px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-delete-form {
    padding: 0 18px 18px;
}

.staff-calendar-legend {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 8px;
    font-size: 13px;
}

.staff-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.staff-calendar-legend i {
    width: 28px;
    height: 18px;
    display: inline-block;
    border: 1px solid #d5dde5;
}

.legend-today {
    background: #ffe0ea;
}

.legend-holiday {
    background: #fff9c9;
}

.legend-booked {
    background: #e4f6ed;
}

.legend-staff-booking {
    background: #efbf04;
    border-left: 4px solid #1167a8 !important;
}

@media (max-width: 980px) {
    .login-layout,
    .app-shell,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .staff-budget-filter {
        grid-template-columns: minmax(280px, 1fr) minmax(130px, 180px) minmax(150px, 200px);
    }

    .staff-budget-filter button {
        width: auto;
        min-width: 110px;
        margin-top: 0;
    }
}

@media (max-width: 700px) {
    .staff-login-page,
    .content,
    .login-panel,
    .login-aside {
        padding: 18px;
    }

    .login-layout {
        min-height: 0;
    }

    .topbar,
    .panel-title,
    .inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .staff-budget-filter {
        grid-template-columns: 1fr;
    }

    .staff-budget-filter button {
        width: 100%;
        min-width: 0;
    }

    .instrument-edit-form label {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .instrument-edit-form,
    .radio-field {
        grid-template-columns: 1fr;
    }

    .instrument-edit-actions {
        flex-direction: column;
    }
}
