:root {
    --primary-color: #E42521;
    --primary-hover: #B91C1C;
    --primary-dark: #7F1D1D;
    --primary-soft: #FFF1F1;
    --danger-color: #B91C1C;
    --warning-color: #B45309;
    --success-color: #15803D;
    --bg-color: #F5F6F8;
    --bg-gradient: radial-gradient(circle at top left, rgba(228, 37, 33, 0.08), transparent 34rem), #F5F6F8;
    --surface-color: #FFFFFF;
    --surface-muted: #F9FAFB;
    --border-color: #E2E8F0;
    --border-strong: #CBD5E1;
    --text-color: #172033;
    --heading-color: #0F172A;
    --muted-color: #64748B;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --header-height: 72px;
    --sidebar-width: 280px;
    --content-max-width: 1320px;
    --content-wide-max-width: 1900px;
    --focus-ring: 0 0 0 4px rgba(228, 37, 33, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    line-height: 1.55;
    font-size: 14px;
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

img, svg, video, canvas {
    max-width: 100%;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 3000;
    padding: 10px 14px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
}

/* Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 12px clamp(14px, 2vw, 28px);
}

.top-header-left,
.top-header-right,
.user-info {
    display: flex;
    align-items: center;
    min-width: 0;
}

.top-header-left {
    gap: 14px;
}

.header-logo a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--heading-color);
    text-decoration: none;
}

.header-logo img {
    display: block;
    max-height: 44px;
    width: auto;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.header-brand-text strong {
    font-size: 0.96rem;
    letter-spacing: -0.01em;
    color: var(--heading-color);
}

.header-brand-text span {
    font-size: 0.78rem;
    color: var(--muted-color);
}

.menu-toggle {
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--heading-color);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.menu-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-info {
    gap: 12px;
    justify-content: flex-end;
}

.user-name {
    max-width: min(260px, 38vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-color);
    font-weight: 600;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    line-height: 1.1;
    box-shadow: 0 8px 16px rgba(228, 37, 33, 0.22);
}

.logout-btn:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
}

/* Layout */
.layout {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: rgba(255, 255, 255, 0.98);
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 18px 14px;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.03);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 13px;
    border-radius: var(--radius-md);
    color: #334155;
    font-weight: 650;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-hover);
    text-decoration: none;
    transform: translateX(2px);
}

.sidebar-nav a.active,
.sidebar-nav a[aria-current="page"] {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    box-shadow: 0 10px 22px rgba(228, 37, 33, 0.24);
}

.sidebar-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.content {
    flex: 1 1 auto;
    min-width: 0;
    padding: clamp(18px, 2.3vw, 34px);
}

.content-inner,
.content-inner-wide {
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}

.content-inner {
    max-width: var(--content-max-width);
}

.content-inner-wide {
    max-width: var(--content-wide-max-width);
}

.content h1,
.content h2,
.content h3 {
    color: var(--heading-color);
    letter-spacing: -0.02em;
}

.content h1 {
    margin: 0 0 18px;
    font-size: clamp(1.55rem, 1.2rem + 1vw, 2.25rem);
    line-height: 1.12;
    font-weight: 800;
}

.content h2 {
    margin: 30px 0 16px;
    font-size: clamp(1.15rem, 1rem + 0.35vw, 1.45rem);
    line-height: 1.2;
    font-weight: 800;
}

.content h2:first-child {
    margin-top: 0;
}

.content h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 8px;
    border-radius: 99px;
    background: var(--primary-color);
}

.content h3 {
    font-size: 1rem;
    margin: 22px 0 12px;
}

.content p {
    color: #475569;
}

/* Cards and dashboard */
.card,
.panel,
.easy-panel,
.programme-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.card {
    padding: clamp(18px, 2vw, 26px);
    margin-bottom: 22px;
}

.card p {
    margin: 0 0 14px;
    color: #475569;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.icon-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.icon-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--primary-color);
    opacity: 0.9;
}

.icon-card:hover {
    transform: translateY(-3px);
    border-color: rgba(228, 37, 33, 0.35);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.icon-card .icon,
.icon-badge {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 1.35rem;
    font-style: normal;
    font-weight: 800;
}

.icon-card h2 {
    margin: 0;
    font-size: 1.08rem;
}

.icon-card h2::after {
    display: none;
}

.icon-card p {
    margin: 0;
    color: #64748B;
    font-size: 0.94rem;
}

/* Buttons */
.btn,
.btn-secondary,
button.btn,
button.btn-secondary,
a.btn,
a.btn-secondary,
input[type="submit"].btn,
input[type="submit"].btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    max-width: 100%;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 750;
    font-size: 0.92rem;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none !important;
    white-space: normal;
    vertical-align: middle;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.btn,
button.btn,
a.btn,
input[type="submit"].btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 10px 18px rgba(228, 37, 33, 0.20);
}

.btn:hover,
button.btn:hover,
a.btn:hover,
input[type="submit"].btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(228, 37, 33, 0.26);
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary,
input[type="submit"].btn-secondary {
    background: #fff;
    color: #334155;
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn-secondary:hover,
input[type="submit"].btn-secondary:hover {
    background: var(--surface-muted);
    color: var(--primary-hover);
    border-color: rgba(228, 37, 33, 0.35);
    transform: translateY(-1px);
    text-decoration: none;
}

button:not(.btn):not(.btn-secondary):not(.menu-toggle):not(.close-modal):not(.programme-tab):not(.btn-icon):not(.gantt-order-btn):not(.site-action-card),
input[type="submit"]:not(.btn):not(.btn-secondary) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    line-height: 1.15;
    white-space: normal;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

button:not(.btn):not(.btn-secondary):not(.menu-toggle):not(.close-modal):not(.programme-tab):not(.btn-icon):not(.gantt-order-btn):not(.site-action-card):hover,
input[type="submit"]:not(.btn):not(.btn-secondary):hover {
    border-color: rgba(228, 37, 33, 0.35);
    color: var(--primary-hover);
    background: var(--surface-muted);
}

button[disabled],
.btn[disabled],
.btn-secondary[disabled],
.is-loading {
    opacity: 0.68;
    cursor: wait !important;
    transform: none !important;
}

[style*="background:#c00"],
[style*="background: #c00"],
[style*="background:#C00"],
[style*="background: #C00"] {
    background: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: #fff !important;
}

.action-group,
.table-actions,
.assignment-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.action-group form,
.table-actions form,
.assignment-actions form {
    margin: 0;
}

td.assignment-actions {
    display: table-cell;
}

/* Tables */
.table-container,
.table-responsive,
.programme-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container,
.table-responsive {
    margin: 16px 0 22px;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0;
    table-layout: auto;
    box-shadow: var(--shadow-sm);
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.data-table th {
    font-weight: 800;
    letter-spacing: 0.01em;
}

.data-table tbody tr:nth-child(even) {
    background: #FCFCFD;
}

.data-table tbody tr:hover {
    background: var(--primary-soft);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td:last-child {
    min-width: 136px;
}

/* Site index action panel */
.site-index-page .data-table th:last-child,
.site-index-page .data-table td:last-child {
    text-align: center;
}

.site-index-page .data-table th:last-child {
    width: 132px !important;
}

.site-actions-cell {
    white-space: nowrap;
}

.site-actions-btn {
    min-width: 96px;
}

.site-actions-modal {
    width: min(94vw, 760px);
}

.modal-subtitle {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
    line-height: 1.25;
}

.site-actions-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.site-actions-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-muted);
    color: #475569;
    font-size: 0.86rem;
}

.site-actions-summary strong {
    color: var(--heading-color);
}

.site-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.site-action-grid[hidden] {
    display: none !important;
}

.site-action-grid .site-action-form {
    display: flex;
    margin: 0;
}

.site-action-card,
button.site-action-card {
    width: 100%;
    min-height: 98px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 7px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    text-align: left;
    text-decoration: none !important;
    white-space: normal;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.site-action-card strong {
    color: var(--heading-color);
    font-size: 0.98rem;
    line-height: 1.2;
}

.site-action-card span {
    color: var(--muted-color);
    font-size: 0.86rem;
    line-height: 1.35;
}

.site-action-card:hover,
button.site-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(228, 37, 33, 0.38);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.site-action-primary {
    border-color: rgba(228, 37, 33, 0.34);
    background: linear-gradient(135deg, #fff, var(--primary-soft));
}

.site-action-danger {
    border-color: #FECACA;
    background: #FEF2F2;
}

.site-action-danger strong {
    color: #991B1B;
}

.site-action-danger:hover {
    border-color: #EF4444;
}

.site-action-success {
    border-color: #BBF7D0;
    background: #F0FDF4;
}

.site-action-success strong {
    color: #166534;
}

.site-action-success:hover {
    border-color: #22C55E;
}

.data-table td form {
    display: inline-flex !important;
    align-items: center;
    margin: 0 6px 6px 0 !important;
    vertical-align: top;
}

.data-table td > .btn,
.data-table td > .btn-secondary,
.data-table td > button,
.data-table td > a.btn,
.data-table td > a.btn-secondary {
    margin: 0 6px 6px 0;
}

.off-hired {
    background: #F1F5F9 !important;
    color: #94A3B8;
}

/* Forms */
label {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="file"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 15px;
    background: #fff;
    color: var(--text-color);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

input[type="file"] {
    padding: 8px 10px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 7px;
    accent-color: var(--primary-color);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    outline: none;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

form {
    min-width: 0;
}

.form-row,
.filter-row,
.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.form-row > *,
.filter-row > *,
.search-row > * {
    min-width: 180px;
    flex: 1 1 220px;
}

.form-actions,
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 18px clamp(14px, 2vw, 28px);
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--muted-color);
}

.footer p {
    margin: 0;
}

/* Modals */
.modal-overlay,
.modal-overlay2 {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.58);
    z-index: 2200;
    overflow-y: auto;
}

.modal-overlay2 {
    background: rgba(15, 23, 42, 0.86);
}

.modal {
    width: min(94vw, 640px);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.wide-modal,
.modal.wide-modal {
    width: min(96vw, 980px);
    max-width: 980px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.16rem;
}

.modal-header h2::after {
    display: none;
}

.close-modal {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.24);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal input[type="text"],
.modal input[type="date"],
.modal input[type="time"],
.modal input[type="number"],
.modal select,
.modal textarea {
    margin-bottom: 12px;
}

/* Calendar */
.calendar-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.calendar-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0;
}

.calendar-filter-form label {
    flex: 1 1 240px;
    margin: 0;
}

.calendar-filter-form select {
    margin-bottom: 0;
}

.calendar-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr);
    gap: 20px;
    align-items: start;
}

.calendar-container,
.tasks-container {
    min-width: 0;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.calendar-controls .current-month {
    font-weight: 800;
    font-size: 1.06rem;
    color: var(--heading-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(108px, 1fr));
    min-width: 760px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.calendar-container {
    overflow-x: auto;
    padding-bottom: 4px;
}

.calendar-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    text-align: center;
    font-weight: 800;
    padding: 10px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.calendar-header:nth-child(7) {
    border-right: none;
}

.calendar-cell {
    min-height: 118px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.calendar-cell.empty {
    background: #F8FAFC;
}

.calendar-date {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.calendar-cell p {
    margin: 0;
    color: #64748B;
    font-size: 0.86rem;
}

.calendar-cell .btn-secondary,
.calendar-cell .btn {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.today-date {
    background: #FFF7ED !important;
    border: 2px solid #FDBA74 !important;
}

.assignment-list-container,
.task-list-container {
    max-height: 340px;
    overflow: auto;
    border-radius: var(--radius-md);
}

/* Utility */
.notice,
.error,
.success,
.warning {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin: 12px 0;
    border: 1px solid transparent;
}

.error {
    color: #991B1B;
    background: #FEF2F2;
    border-color: #FECACA;
}

.success {
    color: #166534;
    background: #F0FDF4;
    border-color: #BBF7D0;
}

.warning {
    color: #92400E;
    background: #FFFBEB;
    border-color: #FDE68A;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .calendar-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 64px;
        --sidebar-width: 286px;
    }

    .top-header {
        padding: 10px 14px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-brand-text {
        display: none;
    }

    .header-logo img {
        max-height: 38px;
    }

    .user-name {
        display: none;
    }

    .layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        z-index: 1100;
        height: calc(100vh - var(--header-height));
        transform: translateX(calc(-100% - 8px));
        transition: transform 0.22s ease;
        box-shadow: 18px 0 45px rgba(15, 23, 42, 0.25);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        padding: 18px 14px 26px;
    }

    .content h1 {
        margin-bottom: 14px;
    }

    .card,
    .panel,
    .easy-panel,
    .programme-panel {
        border-radius: var(--radius-md);
    }

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

    .modal-overlay,
    .modal-overlay2 {
        padding: 10px;
        align-items: flex-start;
    }

    .modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: var(--radius-md);
    }

    .modal-header,
    .modal-body {
        padding: 14px;
    }

    .form-actions,
    .modal-actions {
        justify-content: stretch;
    }

    .form-actions .btn,
    .form-actions .btn-secondary,
    .modal-actions .btn,
    .modal-actions .btn-secondary {
        flex: 1 1 140px;
    }

    .calendar-grid {
        min-width: 700px;
    }

    .data-table {
        min-width: 680px;
    }

    .site-action-grid {
        grid-template-columns: 1fr;
    }

    .site-action-card,
    button.site-action-card {
        min-height: 82px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 13px;
    }

    .top-header {
        gap: 8px;
    }

    .logout-btn {
        min-height: 36px;
        padding: 8px 11px;
        font-size: 0.84rem;
    }

    .btn,
    .btn-secondary,
    button.btn,
    button.btn-secondary,
    a.btn,
    a.btn-secondary {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.88rem;
    }

    .calendar-controls {
        justify-content: stretch;
    }

    .calendar-controls .btn-secondary,
    .calendar-controls .current-month {
        flex: 1 1 100%;
        text-align: center;
    }
}
