.dashboard-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas: "left main";
    height: 100vh;
    overflow: hidden;
}

/* Global scrollbar polish */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.25);
}

.dashboard-sidebar-left {
    grid-area: left;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.dashboard-sidebar-left .sidebar-logo {
    width: 100%;
    padding: 16px 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.dashboard-sidebar-left .sidebar-logo img,
.dashboard-sidebar-left .sidebar-logo .sidebar-logo-img,
.sidebar .sidebar-logo img,
.sidebar .sidebar-logo .sidebar-logo-img {
    width: 90%;
    max-width: none;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Close button — hidden on desktop, shown inside mobile drawer */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.sidebar-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-logout {
    width: 100%;
    background: transparent;
    border: 1px solid #e57373;
    color: #e57373;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-logout:hover {
    background: rgba(229, 115, 115, 0.1);
    color: #d9534f;
    border-color: #d9534f;
}

.admin-dashboard-cards {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
}

.admin-dashboard-page .admin-dashboard-title {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.admin-dashboard-page .welcome-greeting {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.admin-dashboard-page .welcome-body {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #4b5563;
}

.welcome-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
    min-height: 300px;
    padding-right: 620px;
    z-index: 1;
}

.welcome-text {
    max-width: 520px;
    position: relative;
    z-index: 2;
}

.welcome-illustration {
    position: absolute;
    right: 0px;
    top: -90px;
    width: clamp(420px, 50%, 640px);
    max-width: 640px;
    z-index: 1;
    pointer-events: none;
}

.welcome-illustration img {
    width: 100%;
    height: auto;
    display: block;
}

.admin-tasks {
    position: relative;
    z-index: 5;
}

@media (max-width: 1200px) {
    .welcome-card {
        padding-right: 420px;
    }

    .welcome-illustration {
        width: clamp(360px, 45%, 480px);
        top: -60px;
    }
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-avatar-fallback {
    background: #FFD2CA;
    color: #EB6666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar-user-name {
    font-weight: 600;
    color: #1f2937;
}

.sidebar-user-username {
    font-size: 0.85rem;
    color: #6b7280;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #9ca3af;
}

.clock-total-value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.admin-tasks .section-header {
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.admin-tasks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.task-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-meta .title {
    font-weight: 600;
    color: #111827;
}

.task-meta .subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 4px;
}

.task-badge {
    min-width: 44px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 10px;
}

.task-badge.is-zero {
    background: #f1f3f5;
    color: #667085;
}

.task-badge.is-hot {
    background: rgba(235, 102, 102, 0.16);
    color: #e85c5c;
}

.dashboard-ops .ops-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ops-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.ops-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.ops-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-avatar-fallback {
    background: #FFD2CA;
    color: #EB6666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.feed-content {
    flex: 1;
    min-width: 0;
}

.feed-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.feed-preview {
    color: #667085;
    font-size: 0.9rem;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: 8px;
}

.ops-empty {
    font-size: 0.9rem;
    color: #9ca3af;
}

.card-footer-link {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    font-size: 0.9rem;
    padding-top: 12px;
}

.team-snapshot-card .team-snapshot-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}

.team-snapshot-card .stat {
    text-align: center;
}

.team-snapshot-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: #111827;
}

.team-snapshot-card .stat-label {
    margin-top: 6px;
    font-size: 0.95rem;
    color: #667085;
}

@media (max-width: 480px) {
    .team-snapshot-card .team-snapshot-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .admin-dashboard-page .admin-dashboard-title {
        font-size: 1.5rem;
    }

    .admin-dashboard-page .welcome-greeting {
        font-size: 2.1rem;
    }
}

@media (max-width: 1200px) {
    .admin-tasks-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-ops .ops-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .dashboard-ops .ops-grid {
        grid-template-columns: 1fr;
    }
}

.student-list-page .levels-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.student-list-page .level-box-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.student-list-page .level-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    box-shadow: none;
    color: #111827;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    text-align: center;
    appearance: none;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.student-list-page .level-box:hover {
    border-color: rgba(235, 102, 102, 0.5);
    box-shadow: 0 4px 10px rgba(235, 102, 102, 0.12);
}

.student-list-page .level-box:focus-visible {
    outline: 2px solid rgba(235, 102, 102, 0.4);
    outline-offset: 2px;
}

.student-list-page .level-box.is-active {
    border-color: rgba(235, 102, 102, 0.7);
    background: rgba(235, 102, 102, 0.08);
}

.student-list-page .class-group.is-hidden,
.student-list-page .roster-section.is-hidden {
    display: none;
}

.student-list-page .class-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fbfbfb;
}

.student-list-page .class-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.student-list-page .class-card-timing {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin-top: 2px;
}

.student-list-page .class-card-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 8px;
}

.student-list-page .class-card-stats {
    text-align: right;
    min-width: 220px;
}

.student-list-page .stat-strong {
    font-weight: 700;
    color: #111827;
}

.student-list-page .stat-muted {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}

.student-list-page .stat-note {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
}

.student-list-page .class-details-link {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #eb6666;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.student-list-page .class-details-link:hover {
    color: #d84f4f;
}

.student-list-page .compact-table-wrapper {
    overflow-x: auto;
}

.student-list-page .compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.student-list-page .compact-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.student-list-page .compact-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
    color: #374151;
}

.student-list-page .compact-table tbody tr:last-child td {
    border-bottom: none;
}

.student-list-page .row-index {
    width: 32px;
    color: #9ca3af;
    text-align: right;
}

.student-list-page .compact-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.student-list-page .avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.student-list-page .person-name {
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-list-page .student-name-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 600;
    color: #111827;
}

.student-list-page .student-name-chinese {
    font-size: 0.85rem;
    color: #6b7280;
}

.student-list-page .person-meta {
    font-size: 0.8rem;
    color: #9ca3af;
}

.student-list-page .person-contact {
    font-size: 0.85rem;
    color: #4b5563;
}

.student-list-page .enrolled-cell {
    white-space: nowrap;
    width: 110px;
}

.student-list-page .edit-cell {
    width: 40px;
    text-align: right;
}

.student-list-page .edit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #6b7280;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.student-list-page .edit-icon:hover {
    background: rgba(235, 102, 102, 0.12);
    color: #d84f4f;
}

.student-list-page .edit-icon-svg {
    width: 16px;
    height: 16px;
}

.student-list-page .details-summary {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafafa;
}

.student-list-page .address-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-list-page .remarks-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-list-page .remarks-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.status-check-page .status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.status-check-page .status-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    padding: 18px;
    position: relative;
}

.status-check-page .status-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
}

.status-check-page .status-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 2px;
}

.status-check-page .status-donut-wrapper {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px;
}

.status-check-page .status-donut {
    position: relative;
    width: 140px;
    height: 140px;
}

.status-check-page .donut-svg {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.status-check-page .donut-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 12;
}

.status-check-page .donut-ring {
    fill: none;
    stroke: #eb6666;
    stroke-width: 12;
}

.status-check-page .donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.status-check-page .donut-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
}

.status-check-page .donut-note {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
}

.status-check-page .status-footer {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 8px;
}

.status-check-page .status-footer span {
    color: #111827;
    font-weight: 600;
}

.status-check-page .status-tooltip {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 8px);
    background: #111827;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.status-check-page .status-donut:hover .status-tooltip {
    opacity: 1;
}

.status-check-page .tooltip-row + .tooltip-row {
    margin-top: 4px;
}

@media (max-width: 1200px) {
    .status-check-page .status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .status-check-page .status-grid {
        grid-template-columns: 1fr;
    }
}

.student-list-page .details-summary:hover {
    color: #d84f4f;
}

.student-list-page .compact-empty {
    padding: 16px 20px;
    color: #9ca3af;
    font-size: 0.9rem;
}

.student-list-page .class-group {
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.student-list-page .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.student-list-page .status-official {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.student-list-page .status-trial {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.student-list-page .status-new {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.student-list-page .status-neutral {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}

.student-list-page .mode-label {
    font-weight: 600;
    color: #6b7280;
}

.student-list-page .status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #6b7280;
}

.student-list-page .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 900px) {
    .student-list-page .class-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-list-page .class-card-stats {
        text-align: left;
        min-width: 0;
    }
}

.student-list-page .level-box-grid::-webkit-scrollbar {
    height: 6px;
}

@media (max-width: 992px) {
    .admin-dashboard-cards {
        grid-template-columns: 1fr;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
        min-height: unset;
        padding-right: 24px;
    }

    .welcome-text {
        max-width: 100%;
    }

    .welcome-illustration {
        position: static;
        width: min(360px, 100%);
        margin-top: 20px;
        margin-left: auto;
        align-self: flex-end;
    }
}

.dashboard-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    background: #EDEDED;
    padding: 1.5rem;
}

.dashboard-sidebar-right {
    grid-area: right;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.dashboard-sidebar-content {
    padding: 1.5rem 1rem;
}

.right-sidebar {
    display: flex;
    flex-direction: column;
}

.right-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.right-sidebar-card {
    padding: 16px;
    border-radius: 14px;
}

.right-sidebar .card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.right-sidebar .profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.right-sidebar .profile-card .sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.right-sidebar .sidebar-user-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.right-sidebar .sidebar-user-username {
    font-size: 0.95rem;
    color: #6b7280;
    margin-top: 2px;
}

.right-sidebar .sidebar-user-role {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-top: 2px;
}

.right-sidebar .calendar-header {
    grid-template-columns: 28px 1fr 28px;
    margin-bottom: 10px;
}

.right-sidebar .calendar-title {
    font-weight: 700;
    font-size: 1rem;
}

.right-sidebar .calendar-nav {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.right-sidebar .calendar-nav:hover {
    background: rgba(0, 0, 0, 0.04);
}

.right-sidebar .calendar-grid {
    gap: 8px;
    font-size: 0.92rem;
}

.right-sidebar .calendar-day {
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
}

.right-sidebar .calendar-day-label {
    font-size: 0.78rem;
    color: #9ca3af;
}

.daily-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.daily-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.daily-task-item input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
}

.daily-task-item .task-text {
    font-size: 0.98rem;
    color: #374151;
    line-height: 1.3;
}

.sidebar-calendar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-header {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    align-items: center;
}

.calendar-title {
    text-align: center;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    cursor: pointer;
}

.calendar-nav {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s;
}

.calendar-nav:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
    font-size: 0.78rem;
    color: #475569;
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    transition: background 0.12s;
    cursor: default;
}

.calendar-day-clickable:hover:not(.calendar-day-today):not(.ring--public_holiday):not(.ring--centre_break) {
    background: #f1f5f9;
}

.calendar-day-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day-muted {
    color: #94a3b8;
    opacity: 0.28;
}

.calendar-day-today {
    background: #0f172a !important;
    color: white !important;
    font-weight: 700;
    border-radius: 8px;
}

/* Day number span */
.calendar-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Event type cell colouring */
.ring--public_holiday {
    background: #fef2f2;
    color: #ef4444;
}

.ring--centre_break {
    background: #eff6ff;
    color: #3b82f6;
}

/* Dot indicator for events */
.sidebar-cal-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.dot--centre_event  { background: #f97316; }
.dot--prep_class    { background: #8b5cf6; }

/* Today overrides event colours */
.calendar-day-today .sidebar-cal-dot { display: none; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT — 3-stage breakdown
   Stage 1 (≤1280px): Right sidebar drops below main
   Stage 2 (≤1023px): Left sidebar becomes a drawer, right hidden
   Stage 3 (≤767px):  Fine-tuned mobile styles
   ═══════════════════════════════════════════════════════════════ */

/* Mobile top bar hidden by default (desktop) */
.mobile-topbar {
    display: none;
}

.mobile-topbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.mobile-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}
.mobile-hamburger:hover { background: #fff5f2; }
.mobile-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #4a3f3d;
    border-radius: 2px;
    transition: 0.25s;
}

/* ── Tablet layout ── */
@media (max-width: 1280px) {
    .dashboard-layout {
        grid-template-columns: 240px minmax(0, 1fr);
        grid-template-rows: 1fr;
        grid-template-areas: "left main";
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .dashboard-main {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .dashboard-sidebar-right {
        position: static;
        height: auto;
        overflow-y: visible;
        border-left: none;
        border-top: 1px solid #f2e1de;
    }

    /* Lay sidebar cards out horizontally when below main */
    .right-sidebar-content {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem 1.5rem;
        gap: 16px;
        align-items: flex-start;
    }

    .right-sidebar-card {
        flex: 1;
        min-width: 220px;
        max-width: 380px;
    }
}

/* ── Stage 2: Left sidebar becomes a drawer ── */
@media (max-width: 1023px) {
    /* Single column — main canvas takes everything */
    .dashboard-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    /* Hide right sidebar entirely */
    .dashboard-sidebar-right {
        display: none !important;
    }

    /* Left sidebar becomes a fixed slide-in drawer */
    .dashboard-sidebar-left {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 300;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100%;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    .dashboard-sidebar-left.mobile-open {
        transform: translateX(0);
    }

    /* Overlay backdrop */
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 299;
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(2px);
    }
    .mobile-overlay.active {
        display: block;
    }

    /* Show mobile top bar with hamburger */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 200;
        height: 56px;
        background: #fff;
        border-bottom: 1px solid #f2e1de;
        padding: 0 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .dashboard-main {
        grid-area: main;
        height: auto;
        min-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .dashboard-content {
        padding: 16px !important;
    }

    /* ── Mobile drawer: compact logo + close button ── */
    .dashboard-sidebar-left .sidebar-logo {
        padding: 10px 14px;
        margin-bottom: 0;
        justify-content: flex-start;
        gap: 0;
    }
    .dashboard-sidebar-left .sidebar-logo-img {
        width: auto !important;
        max-width: 110px !important;
        height: 38px !important;
    }
    .sidebar-close-btn {
        display: flex;
    }

    /* Tighter nav items so more links fit on screen */
    .sidebar-nav {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    .sidebar-nav .px-4.py-3,
    .sidebar-nav a.px-4.py-3,
    .sidebar-nav button.px-4.py-3 {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* ── Stage 3: Mobile fine-tuning ── */
@media (max-width: 767px) {
    .welcome-card {
        padding-right: 16px !important;
        min-height: auto !important;
        flex-direction: column;
        align-items: flex-start;
    }
    .welcome-illustration { display: none !important; }
    .admin-dashboard-cards {
        grid-template-columns: 1fr !important;
    }

    .overflow-x-auto, table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lg\:grid-cols-3, .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    .md\:grid-cols-2, .md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    input, select, textarea {
        max-width: 100%;
    }
}

/* Standalone suites use suite_mobile.css; do not style generic portal IDs here. */
@media (min-width: 1024px) {
    #mobile-sidebar-toggle { display: none !important; }
    .mobile-topbar { display: none !important; }
    .mobile-overlay { display: none !important; }
}

/* ==========================================================================
   Staff Scheduling & Leave Management
   (Duty Roster dashboard widget, Owner Schedule builder, Work Calendar)
   ========================================================================== */

.ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.ops-header .ops-title {
    margin-bottom: 0;
}

/* --- Flexible widget row (Duty Roster + reserved space for future widgets) --- */
.dashboard-widgets-row .widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: stretch;
}
.widget-span-2 {
    grid-column: span 2;
    min-width: 0;
}
@media (max-width: 900px) {
    .widget-span-2 {
        grid-column: span 1;
    }
}

.widget-placeholder-card {
    border: 1px dashed rgba(0, 0, 0, 0.12);
    background: #fbfbfc;
}
.widget-coming-soon-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    background: #f1f2f4;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.widget-placeholder-body {
    color: #9ca3af;
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
}

/* --- Duty Roster widget --- */
.duty-roster-card {
    gap: 4px;
}
.duty-roster-body {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .duty-roster-body {
        grid-template-columns: 1fr;
    }
}
.duty-roster-subhead {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    margin-bottom: 8px;
}
.duty-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.duty-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.duty-chip.is-cover {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}
.duty-chip-sub {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.mini-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    border-radius: 6px;
    color: #667085;
    background: #f8f9fb;
    position: relative;
}
.mini-cal-cell.is-outside {
    color: #d1d5db;
    background: transparent;
}
.mini-cal-cell.is-today {
    border: 1.5px solid #EB6666;
    font-weight: 700;
    color: #111827;
}
.mini-cal-cell.has-leave::after {
    content: "";
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f59e0b;
}

.duty-roster-leave-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 12px;
}
.leave-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.leave-list-name {
    font-weight: 600;
    color: #111827;
    flex: 1;
}
.leave-list-date {
    color: #667085;
}
.leave-list-status {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 2px 8px;
    border-radius: 999px;
}
.leave-list-status.status-approved {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}
.leave-list-status.status-pending {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}
.leave-list-status.status-rejected {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}
.leave-list-more {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* --- Owner Schedule builder & Work Calendar (shared) --- */
.schedule-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.schedule-month-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.schedule-month-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #374151;
    background: #fff;
}
.schedule-month-nav a:hover {
    background: #f8f9fb;
}
.schedule-month-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    min-width: 150px;
    text-align: center;
}

.schedule-layout {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1024px) {
    .schedule-layout {
        grid-template-columns: 1fr;
    }
}

.schedule-grid-scroll {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}
.schedule-grid-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.schedule-grid-table th, .schedule-grid-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px;
    font-size: 0.82rem;
    vertical-align: top;
}
.schedule-grid-table th {
    background: #f8f9fb;
    color: #667085;
    font-weight: 600;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}
.schedule-staff-col {
    min-width: 150px;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    font-weight: 600;
    color: #111827;
}
.schedule-staff-role {
    display: block;
    font-weight: 500;
    font-size: 0.72rem;
    color: #9ca3af;
}
.schedule-day-col {
    min-width: 88px;
}
.schedule-day-col.is-weekend {
    background: #fbfbfc;
}
.schedule-cell {
    min-width: 88px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.schedule-cell:hover {
    background: rgba(235, 102, 102, 0.06);
}
.schedule-cell.is-today {
    background: rgba(235, 102, 102, 0.05);
}
.schedule-cell-shift {
    display: inline-flex;
    flex-direction: column;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    margin-bottom: 2px;
}
.schedule-cell-shift.is-cover {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}
.schedule-cell-leave {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.schedule-sidebar-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}
.schedule-sidebar-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}
.pending-leave-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.pending-leave-item:last-child {
    border-bottom: none;
}
.pending-leave-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pending-leave-actions {
    display: flex;
    gap: 8px;
}
.btn-approve, .btn-reject, .btn-cancel-leave {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}
.btn-approve {
    background: #10b981;
    color: #fff;
}
.btn-approve:hover {
    background: #059669;
}
.btn-reject {
    background: #fee2e2;
    color: #dc2626;
}
.btn-reject:hover {
    background: #fecaca;
}
.btn-cancel-leave {
    background: #f1f2f4;
    color: #374151;
}
.btn-cancel-leave:hover {
    background: #e5e7eb;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #667085;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.legend-dot.is-duty { background: #10b981; }
.legend-dot.is-cover { background: #f59e0b; }
.legend-dot.is-leave { background: #ef4444; }

/* --- Work Calendar month grid (Admin/Tutor read view) --- */
.work-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.work-cal-weekday {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-align: center;
    padding-bottom: 4px;
}
.work-cal-cell {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 8px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.work-cal-cell.is-outside {
    background: #fbfbfc;
    opacity: 0.6;
}
.work-cal-cell.is-today {
    border: 1.5px solid #EB6666;
}
.work-cal-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: #111827;
}
.work-cal-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1.3;
    white-space: normal;
}
.work-cal-tag.is-duty { background: rgba(16, 185, 129, 0.14); color: #059669; }
.work-cal-tag.is-cover { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.work-cal-tag.is-leave { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.work-cal-more {
    font-size: 0.68rem;
    color: #9ca3af;
}

/* --- Leave application modal --- */
.leave-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.leave-modal-backdrop.is-open {
    display: flex;
}
.leave-modal {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.leave-modal h3 {
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}
.leave-modal .form-row {
    margin-bottom: 14px;
}
.leave-modal label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.leave-modal input, .leave-modal select, .leave-modal textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
}
.leave-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.btn-leave-apply {
    background: #EB6666;
    color: #fff;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-leave-apply:hover {
    background: #e04f4f;
}
.btn-leave-cancel {
    background: #f1f2f4;
    color: #374151;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}
.open-leave-modal-btn {
    background: #111827;
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}
.open-leave-modal-btn:hover {
    background: #1f2937;
}
.open-leave-modal-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* --- Auto-generated draft badge --- */
.schedule-cell-shift.is-draft {
    background: repeating-linear-gradient(
        45deg,
        rgba(16, 185, 129, 0.14),
        rgba(16, 185, 129, 0.14) 4px,
        rgba(16, 185, 129, 0.24) 4px,
        rgba(16, 185, 129, 0.24) 8px
    );
    border: 1px dashed #059669;
}
.schedule-cell-shift.is-cover.is-draft {
    background: repeating-linear-gradient(
        45deg,
        rgba(245, 158, 11, 0.16),
        rgba(245, 158, 11, 0.16) 4px,
        rgba(245, 158, 11, 0.26) 4px,
        rgba(245, 158, 11, 0.26) 8px
    );
    border: 1px dashed #b45309;
}

/* --- Availability day picker (self-service + Owner-on-behalf-of) --- */
.availability-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}
.availability-day-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}
.availability-day-chip:has(input:checked) {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #059669;
}
.availability-day-chip input {
    width: auto;
    margin: 0;
}

.availability-day-grid-compact {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.availability-day-chip-compact {
    flex-direction: column;
    padding: 6px 2px;
    font-size: 0.68rem;
    text-align: center;
    gap: 3px;
    border-radius: 8px;
}

/* --- Owner Schedule: month calendar view + role toggle + per-staff colours --- */
.schedule-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.view-toggle {
    display: inline-flex;
    background: #f1f2f4;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #667085;
    cursor: pointer;
}
.view-toggle-btn.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.staff-color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.staff-legend-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.staff-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.owner-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.owner-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.owner-cal-cell {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 8px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.owner-cal-cell.is-outside {
    background: #fbfbfc;
    opacity: 0.55;
}
.owner-cal-cell.is-today {
    border: 1.5px solid #EB6666;
}
.owner-cal-cell.is-holiday {
    background: #fef2f2;
    border-color: rgba(239, 68, 68, 0.25);
}
.owner-cal-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.owner-cal-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
}
.owner-cal-add-btn {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    background: transparent;
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.owner-cal-add-btn:hover {
    background: rgba(235, 102, 102, 0.08);
    border-color: #EB6666;
    color: #EB6666;
}
.owner-cal-holiday-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.owner-cal-chip-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.owner-cal-chip {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
}
.owner-cal-chip.is-draft {
    border: 1px dashed currentColor;
}
.owner-cal-chip.is-leave-chip {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    cursor: default;
}
@media (max-width: 900px) {
    .owner-cal-grid, .owner-cal-weekdays {
        grid-template-columns: repeat(7, minmax(80px, 1fr));
        overflow-x: auto;
    }
}

/* --- Unavailable-dates picker (My Availability + Owner on-behalf-of) --- */
.unavail-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.unavail-cal-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    color: #374151;
}
.unavail-cal-cell:hover {
    border-color: #EB6666;
}
.unavail-cal-cell.is-outside {
    opacity: 0.35;
    cursor: default;
}
.unavail-cal-cell.is-today {
    border: 1.5px solid #111827;
    font-weight: 700;
}
.unavail-cal-cell.is-marked {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #dc2626;
    font-weight: 700;
}
.unavail-cal-flag {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: #dc2626;
}
.unavail-reason-input {
    width: 100%;
    margin-top: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* --- Work Calendar: make the viewer's own working days stand out from everyone else's --- */
.work-cal-tag.is-mine {
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
}

/* Phone safe areas and usable drawer controls, including installed mode. */
@media screen and (max-width: 1023px) {
  .mobile-topbar { min-height: 56px; height: auto; padding-top: env(safe-area-inset-top,0px); padding-left: max(12px,env(safe-area-inset-left,0px)); padding-right: max(12px,env(safe-area-inset-right,0px)); }
  .mobile-hamburger, .sidebar-close-btn { width: 44px; height: 44px; min-width: 44px; }
  .dashboard-sidebar-left { max-width: 88vw; padding-top: env(safe-area-inset-top,0px); padding-bottom: env(safe-area-inset-bottom,0px); }
  .dashboard-main { min-width: 0; }
  .dashboard-content { padding-bottom: max(24px,env(safe-area-inset-bottom,0px)) !important; }
}
