.booking-panel { padding: 18px 22px; }
.booking-toolbar { display: flex; align-items: center; gap: 10px; }
.booking-search { position: relative; flex: 1; }
.booking-search svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: #7b898d; stroke-width: 2; stroke-linecap: round; }
.booking-search input { width: 100%; min-height: 44px; padding: 10px 14px 10px 38px; border: 1px solid #ccd8dc; border-radius: 22px; outline: 0; color: var(--ink); background: #f7faf9; font-size: 13px; }
.booking-search input:focus { border-color: var(--ocean); background: white; box-shadow: 0 0 0 3px rgba(10,100,128,.1); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: var(--ocean); cursor: pointer; }
.icon-button:hover { background: var(--ocean-dark); }
.icon-button svg, .bk-icon svg, .file-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.booking-count { display: block; margin: 10px 0 4px 14px; color: var(--muted); font-size: 10px; }
.booking-list { display: grid; }
.booking-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.booking-item[hidden] { display: none; }
.booking-item:first-child { border-top: 0; }
.booking-main { min-width: 0; flex: 1; }
.booking-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.booking-heading h2, .booking-heading h3 { margin: 0; color: var(--ocean-deep, var(--ocean-dark)); font-size: 15px; }
.booking-sub { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.booking-title { margin: 8px 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.5; }
.booking-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: #49656b; font-size: 11px; }
.booking-tag { padding: 4px 8px; border-radius: 4px; color: #416b58; background: #e8f3eb; font-size: 10px; font-weight: 700; }
.bk-icon { display: inline-flex; align-items: center; gap: 6px; }
.booking-detail-button { flex: 0 0 auto; min-height: 36px; padding: 0 14px; text-decoration: none; }
.topbar nav .notif-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 7px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; line-height: 0; }
.notif-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notif-label { display: none; }
.notif-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; padding: 2px 5px; border-radius: 10px; color: white; background: #d9362b; font-size: 10px; font-weight: 700; line-height: 1.3; text-align: center; }
.notif-menu { width: min(360px, calc(100vw - 24px)); max-height: 70vh; padding: 0; overflow-y: auto; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ocean-dark); font-size: 13px; }
.notif-head form { margin: 0; }
.topbar nav .notif-readall { padding: 0; border: 0; color: var(--ocean); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.notif-empty { margin: 0; padding: 22px 14px; color: var(--muted); font-size: 12px; text-align: center; }
.notif-menu form { margin: 0; }
.topbar nav .notif-item { display: grid; gap: 3px; width: 100%; padding: 11px 14px 11px 22px; border: 0; border-bottom: 1px solid #eef2f2; border-radius: 0; color: var(--ink); background: white; font: inherit; text-align: left; cursor: pointer; }
.topbar nav .notif-item:hover { background: #f3f7f6; }
.topbar nav .notif-item.unread { position: relative; background: #f2f9fb; }
.notif-item.unread::before { content: ''; position: absolute; top: 17px; left: 9px; width: 7px; height: 7px; border-radius: 50%; background: #d9362b; }
.notif-item strong { color: var(--ocean-dark); font-size: 12px; }
.notif-item span { color: #49656b; font-size: 11px; line-height: 1.5; }
.notif-item small { color: #8a969a; font-size: 10px; }
@media (max-width: 760px) {
  .user-topbar.menu-open .notif-label { display: inline; margin-left: 8px; font-size: 13px; }
  .user-topbar.menu-open nav .notif-toggle { display: flex; justify-content: flex-start; width: 100%; padding: 12px 10px; border: 0; line-height: 1.2; }
  .user-topbar.menu-open .notif-badge { position: static; margin-left: auto; }
  .user-topbar.menu-open .notif-menu { width: 100%; margin: 4px 0; padding: 0; border-radius: 6px; background: white; }
  .user-topbar.menu-open .notif-head { color: var(--ocean-dark); }
}
.feed-audience-form select { min-height: 31px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ocean-dark); background: white; font-size: 10px; }
.booking-row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.booking-row-actions form { margin: 0; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ocean-dark); background: white; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.icon-action:hover { border-color: var(--ocean); background: #edf4f2; }
.icon-action.danger { color: #a14a41; }
.icon-action.danger:hover { border-color: #d8a39c; background: #fdf1ef; }
.icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.urgent-flag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 12px; color: #a3281d; background: #fdeceb; font-size: 11px; font-weight: 700; }
.urgent-flag i { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: white; background: #d9362b; font-size: 11px; font-style: normal; line-height: 1; }
.booking-back { display: inline-block; margin-bottom: 14px; color: var(--ocean); font-size: 12px; font-weight: 700; text-decoration: none; }
.booking-detail { margin-top: 16px; }
.booking-files, .booking-status-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.booking-status-actions form { margin: 0; }
.file-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ocean-dark); background: #f7faf9; font-size: 12px; font-weight: 700; text-decoration: none; }
.file-link:hover { background: #edf4f2; }
.file-link.muted { color: var(--muted); font-weight: 400; }

.booking-dialog { width: min(100% - 24px, 460px); max-height: calc(100vh - 32px); padding: 22px; border: 0; border-radius: 10px; box-shadow: 0 20px 50px rgba(4,34,43,.3); }
.booking-dialog::backdrop { background: rgba(4,34,43,.5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; color: var(--ocean-dark); font-size: 16px; }
.dialog-close { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.dialog-close:hover { background: #edf4f2; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.booking-dialog .field input, .booking-dialog .field select, .booking-dialog .field textarea, .booking-form-panel .field input, .booking-form-panel .field select, .booking-form-panel .field textarea { width: 100%; padding: 9px 10px; border: 1px solid #ccd8dc; border-radius: 5px; color: var(--ink); background: white; font: 12px/1.5 'DM Sans','Segoe UI',sans-serif; }
.booking-dialog .field input, .booking-dialog .field select, .booking-form-panel .field input:not([type="file"]):not([type="radio"]), .booking-form-panel .field select { min-height: 39px; }

.calendar { margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--ocean-dark); font-size: 13px; }
.calendar-head button { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--ocean-dark); background: #edf4f2; font-size: 18px; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dayname { padding: 4px 0; color: #839195; font-size: 10px; font-weight: 700; }
.cal-day { position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; color: var(--ink); background: transparent; font-size: 12px; cursor: pointer; }
.cal-day:hover:not(:disabled) { background: #edf4f2; }
.cal-day:disabled { color: #c4cdcf; cursor: not-allowed; }
.cal-day.selected { color: white; background: var(--ocean); }
.cal-day.has-availability::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #65ad99; transform: translateX(-50%); }
.calendar-summary { margin: 6px 0 12px; color: var(--muted); font-size: 11px; }
.availability-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.availability-list { display: grid; gap: 4px; max-height: 110px; margin: 4px 0 0; padding: 10px 12px; overflow-y: auto; border-radius: 6px; color: #49656b; background: #f3f7f6; font-size: 11px; list-style: none; }

.booking-form-panel { width: 100%; max-width: 640px; margin-inline: auto; }
main:has(.booking-form-panel) > .welcome { max-width: 640px; margin-inline: auto; }
.booking-description { padding: 10px 12px; border-left: 3px solid #65ad99; color: #49656b; background: #f3f7f6; font-size: 12px; line-height: 1.6; }
.booking-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 12px 0 20px; padding: 12px 14px; border-radius: 6px; color: #20343a; background: #f3f7f6; font-size: 12px; }
.booking-change { margin-left: auto; color: var(--ocean); font-weight: 700; text-decoration: none; }
.drive-button { flex: 0 0 auto; gap: 8px; min-height: 39px; padding: 0 12px; color: var(--ocean-dark); border: 1px solid #ccd8dc; background: white; text-decoration: none; }
.drive-button:hover { background: #f3f7f6; }
.drive-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.drive-button span { font-size: 12px; }

.student-home-panel h2 { margin-bottom: 14px; }
.student-email-list { display: grid; }
.student-email-item { display: grid; gap: 5px; width: 100%; padding: 13px 2px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.student-email-item:first-child { border-top: 0; }
.student-email-item:hover strong { color: var(--ocean); }
.student-email-date { color: var(--muted); font-size: 10px; }
.student-email-item strong { color: var(--ocean-dark); font-size: 13px; }
.student-email-preview { overflow: hidden; color: #49656b; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.student-email-dialog { width: min(100% - 24px, 560px); }
.student-email-dialog-date { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.student-email-dialog-message { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.lecturer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lecturer-search { margin-bottom: 4px; }
.lecturer-card[hidden] { display: none; }
.lecturer-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfb; }
.lecturer-avatar { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: #e6efec; }
.lecturer-avatar-fallback { color: var(--ocean-dark); font-size: 20px; font-weight: 700; }
.lecturer-card-info { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.lecturer-card-info h3 { margin: 0; color: var(--ocean-dark); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.lecturer-booking-button { min-height: 34px; padding: 0 11px; font-size: 11px; text-decoration: none; }
.lecturer-booking-button:disabled { border-color: #d3dcda; color: #788785; background: #eef2f1; cursor: not-allowed; }
.profile-photo-preview { display: block; width: 88px; height: 88px; margin: 0 0 10px; border-radius: 50%; object-fit: cover; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.backup-panel { min-width: 0; }
.backup-panel h2 { margin-top: 0; color: var(--ocean-dark); font-size: 16px; }
.backup-panel h3 { margin: 20px 0 8px; color: var(--ocean-dark); font-size: 13px; }
.backup-file-status { display: grid; gap: 5px; margin: 16px 0; padding: 12px; border-left: 3px solid var(--ocean); background: #f3f7f6; color: #49656b; font-size: 11px; }
.backup-file-status strong { color: var(--ocean-dark); font-size: 12px; }
.backup-file-status .settings-link { margin: 3px 0 0; }
.backup-progress { display: block; width: 100%; height: 12px; margin-top: 14px; accent-color: var(--ocean); }
.backup-status, .backup-last-run { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.backup-settings-panel { grid-column: 1 / -1; }
.backup-settings-panel .field small code { overflow-wrap: anywhere; }
.retention-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 180px); align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.retention-row .news-option { margin: 0; }
.retention-row select { min-height: 36px; padding: 6px 9px; border: 1px solid #ccd8dc; border-radius: 5px; color: var(--ink); background: white; font: inherit; }
.backup-settings-panel #runRetentionNow { margin-top: 14px; }
.pwa-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pwa-install-banner { position: fixed; z-index: 1200; inset: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; align-items: center; gap: 14px; min-height: 62px; padding: 9px clamp(14px, 3vw, 32px); border-bottom: 1px solid #d5e0de; color: var(--ink); background: #fff; box-shadow: 0 4px 16px rgba(4, 34, 43, .14); }
.pwa-install-banner[hidden] { display: none; }
body.pwa-install-banner-visible { padding-top: 62px; }
.pwa-install-copy { display: grid; gap: 2px; min-width: 0; }
.pwa-install-copy strong { color: var(--ocean-dark); font-size: 13px; }
.pwa-install-copy span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.pwa-install-action { min-height: 38px; padding: 0 16px; white-space: nowrap; }
.pwa-install-dismiss { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.pwa-install-dismiss:hover { color: var(--ink); background: #edf4f2; }
.pwa-install-dialog { width: min(100% - 24px, 430px); }
.pwa-install-steps { margin: 12px 0 0; padding-left: 22px; color: var(--ink); font-size: 13px; line-height: 1.8; }
.pwa-admin-panel { min-width: 0; }
.pwa-admin-panel h2 { margin-top: 0; color: var(--ocean-dark); font-size: 16px; }
.pwa-brand-preview { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #f7faf9; }
.pwa-brand-preview .landing-brand-mark, .pwa-brand-preview .brand-logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.pwa-brand-preview .landing-brand-mark { color: white; background: var(--ocean); }
.pwa-brand-preview div { display: grid; gap: 3px; min-width: 0; }
.pwa-brand-preview strong { color: var(--ocean-dark); font-size: 13px; overflow-wrap: anywhere; }
.pwa-brand-preview small, .pwa-status { color: var(--muted); font-size: 11px; line-height: 1.5; }
.pwa-status { min-height: 18px; margin: 10px 0 0; }
.topbar nav .push-toggle { padding: 8px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; color: white; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.topbar nav .push-toggle:hover { background: rgba(255,255,255,.12); }
.topbar nav .push-toggle[hidden] { display: none; }
.admin-dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.admin-stat { display: grid; gap: 5px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--ocean); border-radius: 6px; background: #fff; }
.admin-stat span { color: #49656b; font-size: 11px; font-weight: 700; }
.admin-stat strong { color: var(--ocean-dark); font-size: 27px; line-height: 1.1; }
.admin-stat small { color: var(--muted); font-size: 10px; }
.admin-booking-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-booking-shortcut h2 { margin: 0; color: var(--ocean-dark); font-size: 15px; }
.admin-booking-shortcut .settings-description { margin: 5px 0 0; }
.admin-booking-list { display: grid; }
.admin-booking-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.admin-booking-filters .booking-search { min-width: min(280px, 100%); }
.admin-booking-page-size { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-booking-page-size select { min-height: 40px; padding: 0 9px; border: 1px solid #ccd8dc; border-radius: 5px; color: var(--ink); background: white; font: inherit; }
.admin-booking-clear { color: var(--ocean); font-size: 11px; font-weight: 700; text-decoration: none; }
.admin-booking-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.admin-booking-pagination nav { display: flex; gap: 8px; }
.admin-booking-pagination a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ocean-dark); background: white; font-weight: 700; text-decoration: none; }
.admin-booking-pagination a:hover { border-color: var(--ocean); background: #f3f8f7; }
.admin-booking-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-booking-row:first-child { border-top: 0; }
.admin-booking-date { display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.admin-booking-date strong { color: var(--ocean-dark); font-size: 12px; }
.admin-booking-copy { display: grid; gap: 4px; min-width: 0; }
.admin-booking-copy strong { color: var(--ink); font-size: 12px; }
.admin-booking-copy span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.admin-booking-row .booking-detail-button { min-height: 34px; padding: 0 11px; }
.admin-booking-detail-panel { max-width: 880px; }
.admin-booking-actions { align-items: center; }
.admin-booking-actions form { margin: 0; }

@media (max-width: 760px) {
  .booking-panel { padding: 14px; }
  .booking-item { align-items: flex-start; flex-direction: column; gap: 10px; }
  .booking-detail-button { width: 100%; }
  .availability-fields { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
  body.pwa-install-banner-visible { padding-top: 78px; }
  .pwa-install-banner { grid-template-columns: minmax(0, 1fr) auto 32px; gap: 8px; min-height: 78px; padding: 9px 10px 9px 14px; }
  .pwa-install-copy strong { font-size: 12px; }
  .pwa-install-copy span { max-width: 185px; font-size: 10px; }
  .pwa-install-action { min-height: 36px; padding: 0 11px; font-size: 11px; }
  .pwa-install-dismiss { width: 32px; height: 32px; }
  .lecturer-grid { grid-template-columns: 1fr; }
  .lecturer-card { grid-template-columns: 56px minmax(0, 1fr); padding: 12px 0; border-width: 1px 0 0; border-radius: 0; background: transparent; }
  .lecturer-avatar { width: 56px; height: 56px; }
  .backup-grid { grid-template-columns: 1fr; }
  .backup-settings-panel { grid-column: auto; }
  .pwa-admin-grid { grid-template-columns: 1fr; }
  .admin-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stat { padding: 12px; }
  .admin-stat strong { font-size: 23px; }
  .admin-booking-shortcut { align-items: flex-start; flex-direction: column; }
  .admin-booking-filters { align-items: stretch; }
  .admin-booking-filters .booking-search { flex-basis: 100%; }
  .admin-booking-filters > .button { flex: 1; }
  .admin-booking-pagination { align-items: flex-start; flex-direction: column; }
  .admin-booking-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .admin-booking-date { grid-column: 1; }
  .admin-booking-copy { grid-column: 1 / -1; grid-row: 2; }
  .admin-booking-row > .status { grid-column: 2; grid-row: 1; justify-self: end; }
  .admin-booking-row > .booking-detail-button { grid-column: 1 / -1; grid-row: 3; width: 100%; }
}
