/* Shared shell mirrors the main E-Office sidebar without an embedded document. */
body.eoffice-module-page {
    display: block;
    height: auto;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: auto;
    background: #f1f5f9;
}
/* Reserve the header/sidebar even while the parser is waiting for shell JS. */
body.eoffice-module-page:not(.eoffice-shell-ready)::before { content: ''; display: block; height: 64px; background: white; }
@media (min-width: 64rem) {
    body.eoffice-module-page:not(.eoffice-shell-ready)::before { position: fixed; inset: 0 auto 0 0; width: 16rem; height: 100dvh; background: #3730a3; }
}
.eoffice-app-navigation, .eoffice-module-header, .eoffice-module-backdrop { box-sizing: border-box; }
.eoffice-app-navigation {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 16rem;
    max-width: calc(100vw - 3rem);
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .2s, visibility .2s;
}
.eoffice-app-navigation[data-open="true"] { transform: none; visibility: visible; }
.eoffice-module-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    padding: 8px 16px;
    background: white;
    box-shadow: 0 2px 6px #0f172a18;
    font: 600 18px/1.4 'Prompt', sans-serif;
}
.eoffice-module-header a { color: #4338ca; text-decoration: none; }
.eoffice-module-header .eoffice-module-menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #475569; font-size: 24px; cursor: pointer; }
.eoffice-module-backdrop { position: fixed; inset: 0; z-index: 35; background: #0008; }
.eoffice-module-backdrop[hidden] { display: none; }
.eoffice-module-content { box-sizing: border-box; min-width: 0; padding: 16px; container-type: inline-size; container-name: eoffice-content; }
.eoffice-module-view { min-width: 0; }
.eoffice-module-view[data-page$="/management/user_manage.html"] { padding: 16px; }
.eoffice-module-view[data-page$="/management/department_manage.html"] { padding: 15px; }
.eoffice-module-view[data-page$="/email_send/my_dashboard.html"] { padding: 20px; }
.eoffice-module-view[data-page$="/email_send/doc_send_email.html"],
.eoffice-module-view[data-page$="/email_send/ai_settings.html"],
.eoffice-module-view[data-page$="/maintenance_requests/admin.html"] { padding: 24px; }
.eoffice-module-view[data-page$="/room_booking/edit_room_booking.html"] { padding: 16px; }
.eoffice-draft-notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; background: #eef2ff; color: #3730a3; font: 400 14px/1.6 'Prompt', sans-serif; }
.eoffice-draft-notice[hidden] { display: none; }
.eoffice-calendar-view { display: flex; flex-direction: column; }
@media (min-width: 768px) {
    .eoffice-module-content { padding: 24px; }
    .eoffice-calendar-view { flex-direction: row; height: max(450px, calc(100dvh - 112px)); }
    .eoffice-module-view[data-page$="/room_booking/edit_room_booking.html"] { padding: 32px; }
}
@media (max-width: 768px) { .eoffice-module-view[data-page$="/maintenance_requests/admin.html"] { padding: 16px; } }
@media (max-width: 720px) {
    .eoffice-module-view[data-page$="/email_send/doc_send_email.html"], .eoffice-module-view[data-page$="/email_send/ai_settings.html"] { padding: 12px; }
}
@media (max-width: 600px) {
    .eoffice-module-view[data-page$="/management/user_manage.html"] { padding: 8px; }
    .eoffice-module-view[data-page$="/email_send/my_dashboard.html"] { padding: 10px; }
}
@media (min-width: 64rem) {
    .eoffice-app-navigation { max-width: none; transform: none; visibility: visible; }
    .eoffice-module-header, .eoffice-module-backdrop { display: none; }
    .eoffice-module-content { margin-left: 16rem; padding: 32px; }
    .eoffice-calendar-view { height: max(450px, calc(100dvh - 64px)); }
}
@media (prefers-reduced-motion: reduce) { .eoffice-app-navigation { transition: none; } }
@container eoffice-content (min-width: 768px) and (max-width: 1023px) { .eoffice-calendar-view > aside { width: 33.333333%; } }
@container eoffice-content (max-width: 767px) {
    .eoffice-calendar-view { flex-direction: column; height: auto; }
    .eoffice-calendar-view > main { height: auto; min-height: 450px; order: 1; }
    .eoffice-calendar-view > aside { width: 100%; height: auto; min-height: 350px; order: 2; }
    .eoffice-calendar-view .calendar-grid { grid-auto-rows: minmax(55px,1fr); }
}
@media print { .eoffice-app-navigation, .eoffice-module-header, .eoffice-module-backdrop { display: none; } .eoffice-module-content { margin: 0; padding: 0; } }
