:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 8px;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 16px;
  background: #111827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: inherit;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d1d5db;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.topbar > div:first-child {
  position: relative;
  min-width: 0;
}

.topbar-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.lang.active {
  border-color: var(--brand);
  color: var(--brand);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

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

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.panel-head.results-head {
  justify-content: space-between;
}

.results-panel-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.results-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.results-filter-form label {
  min-width: 190px;
}

.venue-management-head {
  align-items: center;
}

.venue-management-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.venue-filter-form {
  margin-bottom: 14px;
}

.venue-filter-form label {
  flex: 1 1 300px;
  min-width: min(300px, 100%);
}

.appointment-panel-head {
  align-items: flex-start;
}

.appointment-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.capacity-button {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}

.button.capacity-button:hover {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}

.table-sort {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.table-sort:hover {
  color: var(--brand);
}

.table-sort span {
  margin-left: 3px;
  color: var(--brand);
  font-weight: 800;
}

.table-sort .sort-indicator {
  opacity: 0.65;
}

.table-sort .sort-indicator.active {
  opacity: 1;
}

.system-email-settings {
  margin: 18px 0;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.section-heading p {
  margin: 5px 0 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.success {
  color: #166534;
  background: #dcfce7;
}

.status-badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.system-email-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(180px, 1fr) minmax(240px, 1.35fr);
  gap: 10px;
}

.system-email-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.danger-option {
  color: var(--danger);
}

.venue-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.venue-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
}

.venue-card[data-venue-focus] {
  cursor: pointer;
}

.venue-card[data-venue-focus]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.venue-card-open {
  margin-top: 8px;
}

.venue-thumb,
.image-frame,
.placeholder-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #f3f4f6);
}

.venue-thumb {
  width: 88px;
  height: 72px;
}

.venue-thumb img,
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-frame {
  width: 100%;
  min-height: 220px;
  margin-bottom: 14px;
}

.image-frame.compact {
  min-height: 150px;
  margin-bottom: 8px;
}

.placeholder-logo {
  width: 100%;
  min-height: 220px;
  font-size: 42px;
  font-weight: 800;
  color: var(--brand);
}

.venue-card-body p {
  margin: 4px 0 10px;
  color: var(--muted);
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.progress-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0f766e);
}

.progress-line.compact { width: 140px; }
.progress-line.large { height: 12px; }

.badge,
.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}

.badge.low,
.badge.approved,
.badge.completed { background: #dcfce7; color: #166534; }
.badge.medium,
.badge.pending,
.badge.in_progress { background: #dbeafe; color: #1d4ed8; }
.badge.not_started { background: #f1f5f9; color: #475569; }
.badge.high,
.badge.rejected { background: #fee2e2; color: #991b1b; }
.badge.critical { background: #7f1d1d; color: #fff; }
.badge.current { background: #fef3c7; color: #92400e; }

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child { border-bottom: 0; }
.list-item p { margin: 2px 0 0; color: var(--muted); }

.table-wrap {
  overflow-x: auto;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.pagination-end {
  justify-content: flex-end;
}

.pagination-links,
.page-size-form label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-form select {
  width: auto;
  min-width: 70px;
}

.page-jump-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.page-jump-form label {
  min-width: 130px;
}

.page-jump-form input {
  width: 82px;
}

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

.results-table {
  table-layout: fixed;
  min-width: 1120px;
}

.results-table th:nth-child(1),
.results-table td:nth-child(1) { width: 105px; }
.results-table th:nth-child(2),
.results-table td:nth-child(2) { width: 145px; }
.results-table th:nth-child(3),
.results-table td:nth-child(3) { width: 145px; }
.results-table th:nth-child(4),
.results-table td:nth-child(4) { width: 190px; }
.results-table th:nth-child(5),
.results-table td:nth-child(5) { width: 105px; }
.results-table th:nth-child(6),
.results-table td:nth-child(6) { width: 145px; }
.results-table th:nth-child(7),
.results-table td:nth-child(7) { width: 120px; }
.results-table th:nth-child(8),
.results-table td:nth-child(8) { width: 130px; }
.results-table th:nth-child(9),
.results-table td:nth-child(9) { width: 170px; }

.results-table .results-title-cell {
  overflow-wrap: anywhere;
  white-space: normal;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stack-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

textarea { resize: vertical; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.password-field {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.password-field input {
  min-width: 0;
}

.password-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.password-note {
  margin: 0 0 12px;
}

.account-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.account-readonly-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-readonly-grid span {
  color: var(--muted);
  font-size: 12px;
}

.account-readonly-grid strong {
  overflow-wrap: anywhere;
}

.account-password-section {
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-password-section legend {
  padding: 0 6px;
  color: var(--text);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.ghost {
  background: transparent;
}

.button.warning {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

.button.small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.button.tiny { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.button.danger { border-color: #fecaca; background: #fef2f2; color: var(--danger); }
.button.full { width: 100%; }

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.success { border-color: #bbf7d0; background: #f0fdf4; }
.flash.error { border-color: #fecaca; background: #fef2f2; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.calendar-week {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--week-border, var(--line));
  border-top: 4px solid var(--week-accent, var(--brand));
  border-radius: 10px;
  background: var(--week-background, #f8fafc);
}

.calendar-week.week-1 {
  --week-accent: #2563eb;
  --week-border: #bfdbfe;
  --week-background: #eff6ff;
}

.calendar-week.week-2 {
  --week-accent: #0f766e;
  --week-border: #99f6e4;
  --week-background: #f0fdfa;
}

.calendar-week.week-3 {
  --week-accent: #d97706;
  --week-border: #fde68a;
  --week-background: #fffbeb;
}

.calendar-week.week-4 {
  --week-accent: #7c3aed;
  --week-border: #ddd6fe;
  --week-background: #f5f3ff;
}

.calendar-week-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 9px;
  color: var(--week-accent, var(--brand));
}

.calendar-week-title span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-week-days {
  display: grid;
  gap: 8px;
}

.day-card {
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.event-card {
  position: relative;
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 8px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: #fff;
}

.event-card.approved {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.event-card.pending {
  border-left-color: #60a5fa;
  background: #eff6ff;
}

.appointment-row.approved > td,
.appointment-list-item.approved {
  background: #f0fdf4;
}

.appointment-row.pending > td,
.appointment-list-item.pending {
  background: #eff6ff;
}

.appointment-row.approved > td:first-child {
  border-left: 3px solid #22c55e;
}

.appointment-row.pending > td:first-child {
  border-left: 3px solid #60a5fa;
}

.badge.cancelled {
  background: #f1f5f9;
  color: #475569;
}

.event-card-top,
.event-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.event-card-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.appointment-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}

.appointment-view-details,
.appointment-revoke-details {
  position: relative;
}

.appointment-detail-popover,
.appointment-revoke-form {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  width: min(360px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
}

.appointment-detail-popover h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.appointment-detail-grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
  gap: 6px 10px;
  font-size: 12px;
}

.appointment-detail-grid span {
  color: var(--muted);
}

.appointment-detail-grid strong {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.appointment-revoke-form {
  display: grid;
  gap: 8px;
  min-width: 230px;
}

.modal-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-dialog-small {
  max-width: 420px;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.modal-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.event-card.unavailable {
  border-left-color: var(--danger);
  background: #fff7f7;
}

.event-card.unavailable-partial {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.event-card.capacity-adjustment {
  border-left-color: #a78bfa;
  background: #f5f3ff;
}

.event-card.available-time {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.event-card span,
.event-card em,
.event-card small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.appointment-booking-hint {
  max-width: 280px;
  font-size: 12px;
  line-height: 1.35;
}

.inline-form {
  display: inline-flex;
  margin-right: 4px;
}

.date-checkbox-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.date-checkbox-group legend {
  padding: 0 5px;
  color: var(--muted);
  font-weight: 650;
}

.date-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.date-checkbox-grid .checkbox {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--panel-soft);
  font-size: 12px;
}

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

.inline-details {
  display: inline-block;
  margin-right: 4px;
  vertical-align: top;
}

.inline-details summary {
  list-style: none;
}

.inline-details summary::-webkit-details-marker,
.create-drawer summary::-webkit-details-marker,
.topbar-edit-drawer summary::-webkit-details-marker,
.contract-summary::-webkit-details-marker,
.module-panel > summary::-webkit-details-marker {
  display: none;
}

.inline-details > summary::after,
.edit-block > summary::after,
.topbar-edit-drawer > summary::after {
  content: " v";
  margin-left: 5px;
  font-weight: 800;
}

.inline-details[open] > summary::after,
.edit-block[open] > summary::after,
.topbar-edit-drawer[open] > summary::after {
  content: " ^";
}

.create-drawer {
  position: relative;
}

.create-drawer summary {
  list-style: none;
}

.create-drawer[open] {
  width: auto;
}

.create-drawer .result-create-form {
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(460px, 80vw);
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.topbar-edit-drawer {
  position: relative;
}

.topbar-edit-drawer summary {
  list-style: none;
}

.topbar-edit-drawer .title-edit-form {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 8;
  width: min(560px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox input {
  width: auto;
  min-height: auto;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.detail-list span { color: var(--muted); }

.basic-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.basic-info-grid div {
  align-items: flex-start;
  min-width: 0;
}

.basic-info-grid strong {
  max-width: 62%;
  text-align: right;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.progress-summary-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(130px, 0.6fr) minmax(260px, 1.5fr);
  gap: 14px;
  align-items: center;
}

.progress-summary-panel > div {
  display: grid;
  gap: 5px;
}

.progress-summary-main {
  min-width: 0;
}

.module-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 700;
}

.module-panel > summary::after {
  content: "v";
  font-size: 13px;
  color: var(--muted);
}

.module-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}

.module-panel[open] > summary::after {
  content: "^";
}

.module-panel > *:not(summary) {
  margin: 18px;
}

.edit-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.edit-block summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

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

.empty.small {
  font-size: 12px;
}

.dashboard-map-panel {
  margin-bottom: 18px;
}

.map-search {
  display: grid;
  gap: 7px;
  margin: -2px 0 12px;
}

.map-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.map-search-form input {
  min-width: 0;
}

.map-search-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.map-search-status {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.map-search-status.error {
  color: var(--danger);
}

.map-search-results {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.map-search-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.map-search-result:hover,
.map-search-result:focus-visible {
  border-color: #a78bfa;
  outline: none;
  background: #faf5ff;
}

.map-search-result strong {
  font-size: 13px;
  line-height: 1.25;
}

.map-search-result small,
.map-search-result span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search-result span {
  color: #6d28d9;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-hero-grid,
.dashboard-bottom-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-hero-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  align-items: start;
}

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

.map-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.map-frame,
.venue-map,
.map-empty {
  min-height: 360px;
}

.map-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.map-frame.square {
  width: 100%;
  min-height: 420px;
  aspect-ratio: 1 / 1;
}

.map-frame.square .venue-map,
.map-frame.square .map-empty {
  min-height: 0;
  height: 100%;
}

.venue-map {
  width: 100%;
}

.map-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    #f8fafc;
  background-size: 42px 42px;
}

.map-empty strong {
  color: var(--text);
}

.map-fallback {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  color: #dffaff;
  background:
    radial-gradient(circle at 68% 42%, rgba(34, 211, 238, 0.18), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.25), transparent 32%),
    linear-gradient(135deg, #071a2a, #0b2538 50%, #08121f);
}

.map-fallback-grid {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(420px) rotateX(52deg) scale(1.35) translateY(23%);
  transform-origin: center bottom;
}

.map-fallback-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.2), transparent);
  transform: translateX(-100%);
  animation: map-scan 5s ease-in-out infinite;
}

.map-fallback-orbit {
  position: absolute;
  border: 1px solid rgba(103, 232, 249, 0.34);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.orbit-one {
  width: 370px;
  height: 170px;
  left: 26%;
  top: 12%;
}

.orbit-two {
  width: 280px;
  height: 120px;
  left: 38%;
  top: 29%;
  border-color: rgba(96, 165, 250, 0.28);
  transform: rotate(24deg);
}

.map-fallback-route {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, #67e8f9, #60a5fa);
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.7);
}

.route-one {
  left: 17%;
  top: 64%;
  width: 52%;
  transform: rotate(-18deg);
}

.route-two {
  left: 53%;
  top: 61%;
  width: 28%;
  transform: rotate(34deg);
}

.map-fallback-pin {
  position: absolute;
  left: 58%;
  top: 48%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #e0fbff;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 0 10px rgba(6, 182, 212, 0.16), 0 0 28px rgba(103, 232, 249, 0.9);
}

.map-fallback-pin span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.map-fallback-card {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 3px;
  max-width: min(310px, calc(100% - 48px));
  padding: 14px 16px;
  border: 1px solid rgba(165, 243, 252, 0.28);
  border-radius: 12px;
  background: rgba(3, 15, 27, 0.82);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
}

.map-fallback-kicker,
.map-fallback-hud,
.map-fallback-note {
  color: #8bd8e6;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-fallback-card strong {
  color: #f0fdff;
  font-size: 16px;
}

.map-fallback-card > span:not(.map-fallback-kicker) {
  color: #b6d3dc;
}

.map-fallback-card a {
  margin-top: 6px;
  color: #67e8f9;
  font-weight: 700;
}

.map-fallback-hud {
  position: absolute;
  right: 22px;
  top: 18px;
}

.map-fallback-hud.hud-bottom {
  right: 22px;
  top: auto;
  bottom: 20px;
  color: rgba(191, 219, 254, 0.72);
}

.map-fallback-note {
  position: absolute;
  right: 22px;
  bottom: 58px;
  max-width: 230px;
  text-align: right;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: none;
}

@keyframes map-scan {
  0%, 35% { transform: translateX(-100%); }
  65%, 100% { transform: translateX(100%); }
}

.map-venue-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.map-venue-item {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
}

.map-venue-item:hover {
  border-color: #93c5fd;
  background: #fff;
}

.map-venue-item span,
.map-venue-item small {
  color: var(--muted);
}

.map-info {
  display: grid;
  gap: 3px;
  min-width: 175px;
  max-width: 215px;
  color: var(--text);
}

.map-info-thumb {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 170px;
  margin: 0 auto 1px;
  border-radius: 6px;
  object-fit: contain;
  background: #eef2f7;
}

.map-info strong {
  font-size: 13px;
  line-height: 1.15;
}

.map-info p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  margin: 0;
  color: var(--muted);
  line-height: 1.15;
  font-size: 12px;
}

.compact-map-popup .leaflet-popup-content {
  margin: 10px 12px;
}

.compact-map-popup .leaflet-popup-content p {
  margin: 0;
}

.map-info p b {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.map-info-rfz b.rfz-inside {
  color: #b91c1c;
}

.map-info-rfz b.rfz-near {
  color: #a16207;
}

.map-info-rfz b.rfz-outside {
  color: #0f766e;
}

.map-info-rfz b.rfz-unknown {
  color: #a16207;
}

.map-info-zone-name {
  color: #b91c1c;
  font-size: 10px;
  line-height: 1.2;
}

.map-info a {
  margin-top: 4px;
  font-weight: 700;
}

.map-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 5px;
  align-items: stretch;
}

.map-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 24px;
  margin-top: 0;
  padding: 4px 5px;
  border-radius: 6px;
  background: #eef2ff;
  line-height: 1.18;
  text-align: center;
  font-size: 11px;
}

.leaflet-popup-content {
  margin: 8px 10px;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.dashboard-search {
  margin-bottom: 12px;
}

.dashboard-venue-list {
  grid-template-columns: 1fr;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-scroll-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 600;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-grid.compact {
  grid-template-columns: 1fr;
  max-height: 150px;
}

.venue-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.venue-chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

[hidden] {
  display: none !important;
}

.leaflet-venue-pin {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  transform: rotate(-45deg);
}

.leaflet-venue-pin::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.map-legend {
  display: grid;
  gap: 5px;
  margin: 0 0 10px 10px;
  padding: 7px 9px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.16);
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.map-legend-zone {
  display: inline-block;
  width: 15px;
  height: 11px;
  border: 2px solid #b91c1c;
  border-radius: 2px;
  background: rgba(239, 68, 68, 0.28);
}

.map-legend-marker.leaflet-venue-pin {
  --pin-color: #0f766e;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-width: 2px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
}

.map-legend-marker.leaflet-venue-pin::after {
  left: 3px;
  top: 3px;
  width: 4px;
  height: 4px;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(8, 145, 178, 0.16) 18% 19%, transparent 19% 48%, rgba(168, 85, 247, 0.12) 48% 49%, transparent 49%),
    linear-gradient(90deg, rgba(103, 232, 249, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(129, 140, 248, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #070913 0%, #101624 48%, #0b1118 100%);
  background-size: auto, 46px 46px, 46px 46px, auto;
}

.login-body .app-shell {
  grid-template-columns: 1fr;
}

.login-body .main {
  padding: 0;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-page::before {
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 255, 255, 0.025) 10px 11px),
    linear-gradient(90deg, transparent 0 8%, rgba(255, 255, 255, 0.12) 8% 8.3%, transparent 8.3% 100%);
  opacity: 0.7;
}

.login-page::after {
  left: 50%;
  top: -22%;
  width: min(720px, 82vw);
  height: 140%;
  border-left: 1px solid rgba(103, 232, 249, 0.24);
  border-right: 1px solid rgba(168, 85, 247, 0.18);
  transform: translateX(-50%) rotate(17deg);
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.08), transparent);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: block;
}

.login-panel {
  display: grid;
  gap: 16px;
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(6, 10, 20, 0.9)),
    rgba(15, 23, 42, 0.88);
  color: #e5edf7;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.login-kicker {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.polyu-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 4px 0 2px;
  text-align: center;
}

.polyu-brand img {
  display: block;
  width: min(190px, 70%);
  aspect-ratio: 600 / 336;
  object-fit: contain;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.polyu-brand strong {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.login-brand {
  color: #f8fafc;
  font-size: 17px;
}

.login-brand .brand-mark {
  background: linear-gradient(135deg, #06b6d4, #7c3aed 58%, #f59e0b);
}

.login-heading h1 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-heading p {
  margin: 8px 0 0;
  color: #aab8c8;
}

.login-panel label {
  color: #cbd5e1;
}

.login-panel input {
  min-height: 44px;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
}

.login-panel input:focus {
  outline: 2px solid rgba(103, 232, 249, 0.28);
  border-color: #67e8f9;
}

.login-panel .password-toggle {
  min-height: 44px;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

.login-panel .password-toggle:hover {
  border-color: #67e8f9;
  color: #67e8f9;
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.demo-box,
.language-row {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.52);
  color: #9fb0c2;
}

.demo-box p {
  margin: 4px 0;
}

.language-row {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.language-row a {
  color: #67e8f9;
  font-weight: 700;
}

.venue-media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.venue-media-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-create-form {
  display: grid;
  grid-template-columns: minmax(140px, 1.05fr) minmax(110px, 0.8fr) minmax(130px, 0.95fr) 90px minmax(130px, 0.95fr) minmax(110px, 0.75fr);
  gap: 10px;
  margin-bottom: 16px;
  align-items: end;
}

.contract-create-form .button {
  align-self: end;
}

.contract-list {
  display: grid;
  gap: 16px;
}

.contract-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.contract-details {
  padding: 0;
  overflow: hidden;
  border-color: #cbd5e1;
  background: #fff;
}

.contract-details[open] {
  border-color: #93c5fd;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.1);
}

.contract-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.contract-summary::after {
  content: "v";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contract-details[open] > .contract-summary::after {
  content: "^";
}

.contract-summary-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contract-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.contract-summary-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.contract-summary-main small,
.contract-summary-side {
  color: var(--muted);
}

.contract-summary-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.contract-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 3px;
}

.contract-delete-form {
  display: none;
}

.contract-body {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.contract-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.contract-head h3 {
  margin: 0;
  font-size: 16px;
}

.contract-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.contract-status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.contract-finance-grid,
.contract-edit-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.contract-finance-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.contract-finance-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-finance-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.contract-edit-form {
  gap: 8px;
}

.contract-edit-date-grid,
.contract-edit-meta-grid {
  display: grid;
  gap: 8px;
}

.contract-edit-date-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contract-edit-meta-grid {
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  align-items: start;
}

.contract-edit-actions {
  display: flex;
  justify-content: flex-end;
}

.venue-summary-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.venue-summary-row div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.venue-summary-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.venue-summary-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.venue-summary-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.contract-file-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.contract-file-box h4 {
  margin: 0;
  font-size: 14px;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.file-actions .inline-form {
  margin: 0;
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.danger-zone {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #fecaca;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .content-grid,
  .stats-grid,
  .dashboard-hero-grid,
  .dashboard-bottom-grid,
  .map-layout,
  .basic-info-grid,
  .progress-summary-panel,
  .contract-create-form,
  .contract-edit-finance-grid,
  .contract-finance-grid,
  .venue-summary-row,
  .venue-media-grid.two,
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-panel {
    min-height: auto;
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-frame.square {
    min-height: 360px;
  }
  .create-drawer,
  .create-drawer[open],
  .create-drawer .result-create-form {
    width: 100%;
  }
  .create-drawer .result-create-form {
    position: static;
  }
  .topbar-edit-drawer,
  .topbar-edit-drawer .title-edit-form {
    width: 100%;
  }
  .topbar-edit-drawer .title-edit-form {
    position: static;
    margin-top: 10px;
  }
}

@media (max-width: 640px) {
  .main { padding: 16px; }
  .topbar,
  .row-between,
  .detail-list div,
  .appointment-panel-head,
  .table-pagination,
  .results-panel-actions,
  .results-filter-form {
    align-items: flex-start;
    flex-direction: column;
  }
  .appointment-filter-bar {
    justify-content: flex-start;
  }
  .two-col,
  .three-col,
  .account-readonly-grid,
  .system-email-grid,
  .check-grid,
  .attachment-row,
  .calendar-grid,
  .map-actions,
  .contract-summary {
    grid-template-columns: 1fr;
  }
  .date-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contract-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .contract-summary-side {
    justify-content: flex-start;
  }
  .contract-summary-actions {
    margin-left: 0;
  }
  .contract-edit-date-grid,
  .contract-edit-meta-grid {
    grid-template-columns: 1fr;
  }
  .basic-info-grid strong {
    max-width: 100%;
    text-align: left;
  }
  .attachment-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .venue-card {
    grid-template-columns: 1fr;
  }
  .venue-thumb {
    width: 100%;
  }
  .login-page {
    padding: 16px;
  }
  .login-shell {
    width: 100%;
  }
  .login-panel {
    padding: 20px;
  }
  .modal-card {
    padding: 16px;
  }
  .map-frame,
  .venue-map,
  .map-empty {
    min-height: 280px;
  }
  .map-frame.square {
    min-height: 280px;
  }
}
