:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #617082;
  --line: #d9e0e8;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --rose: #ef4d72;
  --teal: #1b9f72;
  --mint: #e7f7ee;
  --yellow: #f8a42b;
  --blue: #44a9d7;
  --orange-soft: #fff4e6;
  --shadow: 0 14px 34px rgba(32, 48, 70, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(68, 169, 215, 0.09) 0 12%, transparent 12% 100%),
    linear-gradient(180deg, #fbfcfe, #eef8f5 48%, #fff8ed);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.mobile-menu-button,
.mobile-menu-close,
.mobile-menu-backdrop {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(68, 169, 215, 0.08), transparent 180px),
    #ffffff;
  border-right: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 4px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rose), var(--yellow));
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 122px;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
  border-radius: 6px;
  mix-blend-mode: multiply;
}

.login-card .brand-logo {
  width: 190px;
  margin-bottom: 14px;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sync-status {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sync-status.online {
  color: var(--teal);
}

.sync-status.offline {
  color: var(--rose);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.nav-tabs {
  display: grid;
  gap: 5px;
}

.nav-label {
  padding: 0 10px 7px;
  color: #8190a0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-tools-label {
  margin-top: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.nav-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 7px 36px 7px 8px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-tool-button {
  color: #345c72;
}

.nav-tool-button .nav-icon {
  border-color: #b8dce9;
  background: #eef8fc;
  color: #247da6;
}

.nav-button::after {
  content: "›";
  position: absolute;
  right: 14px;
  color: #a5b0ba;
  font-size: 21px;
  line-height: 1;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #dce5ec;
  border-radius: 7px;
  background: #f8fafc;
  color: #567084;
  font-size: 15px;
  font-weight: 900;
}

.nav-button.active,
.nav-button:hover {
  background: linear-gradient(90deg, #eaf8f3, #fff8ec);
  color: #0f6d54;
  transform: translateX(2px);
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--yellow), 0 5px 14px rgba(32, 48, 70, 0.07);
}

.nav-button.active::after,
.nav-button:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon {
  border-color: #acdcca;
  background: #ffffff;
  color: var(--teal);
}

.contact-panel {
  margin-top: auto;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, var(--soft), #ffffff);
}

.sidebar .contact-panel {
  border-color: #dce7ed;
  box-shadow: 0 8px 22px rgba(32, 48, 70, 0.07);
}

.contact-panel span,
.contact-panel small {
  color: var(--muted);
}

.contact-panel strong {
  font-size: 20px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions,
.form-actions,
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--rose), var(--yellow));
  color: #fff;
  box-shadow: 0 8px 18px rgba(239, 77, 114, 0.18);
}

.ghost-button,
.icon-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(68, 169, 215, 0.45);
  background: #f8fcff;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.event-form,
.info-card,
.content-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  border-top: 3px solid rgba(68, 169, 215, 0.65);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.metric-card strong {
  font-size: 32px;
  color: #142f3f;
}

.dashboard-grid,
.info-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.events-header h3 {
  margin: 2px 0 0;
  color: #183b4d;
  font-size: 24px;
}

.events-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 0;
}

.events-layout.form-visible {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.events-layout > * {
  min-width: 0;
}

.panel {
  padding: 18px;
}

.panel-header h3 {
  color: #183b4d;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.availability-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.availability-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, #f8fcff, #fff8ed);
}

.availability-heading strong {
  color: #183b4d;
}

.availability-heading span,
.availability-weekday {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.availability-weekday {
  display: grid;
  min-height: 30px;
  place-items: center;
}

.availability-day {
  min-width: 0;
  min-height: 92px;
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
  border: 1px solid transparent;
  overflow: hidden;
}

.availability-day.busy {
  background: #e9f8f2;
  border-color: #9edac7;
}

.availability-day.busy.payment-pending {
  background: #fff0f3;
  border-color: #f5b7c6;
}

.availability-day.today {
  border-color: rgba(68, 169, 215, 0.7);
  box-shadow: inset 0 0 0 2px rgba(68, 169, 215, 0.18);
}

.availability-day.muted {
  visibility: hidden;
}

.availability-day strong {
  display: block;
  margin-bottom: 6px;
}

.availability-day span {
  color: var(--muted);
  font-size: 13px;
}

.availability-events {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.availability-event,
.availability-more {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 11px !important;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability-event b {
  color: #247da6;
  font-size: 10px;
}

.availability-more {
  font-weight: 800;
}

.availability-free {
  display: block;
}

.calendar-toolbar {
  justify-content: center;
  margin-bottom: 16px;
}

.calendar-toolbar h3 {
  min-width: 240px;
  text-align: center;
  font-size: 22px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.calendar-cell,
.calendar-weekday {
  background: #fff;
  min-height: 112px;
  padding: 10px;
}

.calendar-cell {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.calendar-weekday {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-cell.muted {
  background: #f7f9fb;
  color: #98a4b1;
}

.calendar-cell.today {
  box-shadow: inset 0 0 0 2px var(--teal);
}

.calendar-date {
  font-weight: 800;
}

.calendar-event {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 8px;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--mint);
  color: #075f5b;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-form {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 18px;
}

.form-section {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(68, 169, 215, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(68, 169, 215, 0.07);
}

.form-section legend,
.payments-fieldset legend,
.extras-fieldset legend {
  padding: 0 7px;
  font-size: 13px;
  font-weight: 900;
}

.event-details-section legend {
  color: #247da6;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.event-item-compact {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
}

.event-item-compact .event-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  border-top: 1px solid #edf1f3;
  padding-top: 10px;
}

.event-item.completed {
  border-color: rgba(27, 159, 114, 0.28);
  background: #f4fbf8;
}

.event-item.completed .event-date-badge {
  background: #dff5eb;
  color: #157b59;
}

.event-date-badge {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  background: #eef7ff;
  color: #1e5f94;
  font-weight: 900;
  text-align: center;
}

.event-date-badge span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.event-date-badge small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

.event-item h4 {
  margin: 0 0 5px;
  font-size: 16px;
}

.event-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-title-line h4 {
  margin-bottom: 0;
}

.event-status {
  border-radius: 999px;
  padding: 3px 7px;
  background: #dff5eb;
  color: #157b59;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-summary {
  min-width: 0;
}

.event-facts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.event-facts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f3f6f8;
  color: #455864;
  font-size: 11px;
}

.event-facts b {
  color: #71808a;
  font-size: 9px;
  text-transform: uppercase;
}

.event-facts .event-balance-pending {
  background: #fff2e3;
  color: #9a5815;
}

.event-facts .event-balance-paid {
  background: #e8f7f0;
  color: #157b59;
}

.event-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.action-icon {
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
}

.event-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #30576c;
}

.event-action-button > span:first-child {
  font-size: 16px;
}

.view-event-button {
  border-color: #b9dceb;
  background: #f1f9fc;
  color: #1f7397;
}

.itinerary-button {
  border-color: #bfe2d5;
  background: #f0faf6;
  color: #157b59;
}

.edit-button {
  color: #247da6;
}

.notes-button {
  color: #6756a8;
}

.complete-button {
  color: #157b59;
}

.action-icon:disabled,
.calendar-event:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.contract-button {
  border-color: #d7c9ed;
  background: #f7f3fc;
  color: #6756a8;
}

.event-detail-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: min(780px, calc(100dvh - 32px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(28, 45, 55, 0.24);
}

.event-detail-dialog::backdrop {
  background: rgba(17, 35, 45, 0.54);
}

.itinerary-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(28, 45, 55, 0.24);
}

.itinerary-dialog::backdrop {
  background: rgba(17, 35, 45, 0.58);
}

.itinerary-dialog[open] {
  display: flex;
  flex-direction: column;
}

.itinerary-dialog-header,
.itinerary-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.itinerary-dialog-header {
  border-bottom: 1px solid var(--line);
}

.itinerary-dialog-header h3,
.itinerary-dialog-header p,
.itinerary-editor-heading h4,
.itinerary-editor-heading p {
  margin: 0;
}

.itinerary-dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.itinerary-dialog-meta {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.itinerary-editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.itinerary-editor-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.itinerary-activities {
  display: grid;
  gap: 10px;
}

.itinerary-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.itinerary-activity-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.itinerary-activity-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.itinerary-remove-activity {
  width: 42px;
  height: 42px;
  border: 1px solid #f0c5cf;
  border-radius: 7px;
  background: #fff4f6;
  color: #b52e4e;
  font-size: 20px;
  font-weight: 800;
}

.itinerary-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.event-detail-dialog-header,
.event-detail-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.event-detail-dialog-header {
  border-bottom: 1px solid var(--line);
}

.event-detail-dialog-header h3,
.event-detail-dialog-header p {
  margin: 0;
}

.event-detail-dialog-body {
  overflow-y: auto;
  max-height: calc(100dvh - 230px);
  padding: 20px;
}

.event-detail-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.event-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.event-detail-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #f8fafb;
}

.event-detail-field span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.event-detail-field strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.event-detail-field.pending {
  border-color: #f2d5ad;
  background: #fff8ef;
  color: #9a5815;
}

.event-detail-field.paid {
  border-color: #bfe2d5;
  background: #f0faf6;
  color: #157b59;
}

.event-detail-section {
  margin-top: 18px;
}

.event-detail-section h4 {
  margin: 0 0 8px;
}

.event-detail-section p {
  margin: 0;
  color: var(--muted);
}

.event-detail-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-detail-section li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.event-detail-payments-total {
  margin-top: 3px;
  border-bottom: 0 !important;
  border-top: 2px solid var(--line);
  padding-top: 10px !important;
  color: var(--teal);
}

.event-detail-notes {
  border-radius: 8px;
  padding: 12px;
  background: #f5f7f8;
  white-space: pre-wrap;
}

.event-notes-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(28, 45, 55, 0.24);
}

.event-notes-dialog::backdrop {
  background: rgba(23, 40, 49, 0.56);
}

.event-notes-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.event-notes-dialog-header h3,
.event-notes-dialog-header p {
  margin-bottom: 0;
}

.event-notes-dialog-close {
  flex: 0 0 auto;
}

.event-notes-dialog-meta {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.event-notes-dialog-content {
  min-height: 120px;
  max-height: 50dvh;
  overflow-y: auto;
  padding: 20px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pdf-preview-dialog {
  width: min(1120px, calc(100% - 24px));
  height: min(900px, calc(100dvh - 24px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(28, 45, 55, 0.28);
}

.pdf-preview-dialog::backdrop {
  background: rgba(23, 40, 49, 0.68);
}

.pdf-preview-dialog[open] {
  display: flex;
  flex-direction: column;
}

.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.pdf-preview-header h3,
.pdf-preview-header p {
  margin-bottom: 0;
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-preview-frame {
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: #edf3f5;
}

@media (max-width: 640px) {
  .itinerary-dialog {
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .itinerary-dialog-header,
  .itinerary-dialog-body,
  .itinerary-dialog-actions {
    padding: 14px;
  }

  .itinerary-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .itinerary-activity-row {
    grid-template-columns: minmax(105px, 0.38fr) minmax(0, 1fr) 42px;
  }

  .itinerary-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .itinerary-dialog-actions button {
    width: 100%;
  }

  .pdf-preview-dialog {
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .pdf-preview-header {
    align-items: flex-start;
    padding: 12px;
  }

  .pdf-preview-actions {
    gap: 6px;
  }

  .pdf-preview-actions .primary-button {
    padding: 9px 10px;
    font-size: 12px;
  }
}

@media (max-width: 460px) {
  .itinerary-activity-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .itinerary-activity-row input[type="time"] {
    grid-column: 1;
  }

  .itinerary-activity-row input[type="text"] {
    grid-column: 1;
  }

  .itinerary-remove-activity {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

.info-grid,
.content-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.info-card,
.content-column {
  padding: 16px;
}

.content-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.info-card h3,
.content-column h3 {
  margin-bottom: 10px;
}

.content-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 14px;
  color: #247da6;
  font-weight: 900;
  text-decoration: none;
}

.content-detail-link:hover {
  color: var(--teal);
}

.content-detail {
  max-width: 1040px;
  margin: 0 auto;
}

.content-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.content-detail-header {
  margin-bottom: 14px;
}

.content-detail-header h3 {
  margin: 4px 0 0;
  color: #183b4d;
  font-size: 28px;
}

.content-detail-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.content-detail-tables {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  align-items: start;
}

.content-table-section h4 {
  margin: 0 0 8px;
  color: #183b4d;
  font-size: 16px;
}

.content-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.content-items-table {
  width: 100%;
  border-collapse: collapse;
}

.content-items-table th,
.content-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.content-items-table th {
  background: #eef7fb;
  color: #294b5b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.content-items-table td {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.content-items-table tbody tr:last-child td {
  border-bottom: 0;
}

.content-items-table.grouped {
  table-layout: auto;
}

.content-subgroup-title th {
  width: 100%;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef7fb;
  color: #294b5b;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.content-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.content-gallery-item {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.content-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.content-gallery-item figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.price-line,
.price-summary,
.price-total,
.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-line {
  margin-bottom: 10px;
  color: var(--teal);
  font-weight: 900;
}

.price-summary,
.price-total,
.balance-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.price-summary span,
.price-total span,
.payment-summary span,
.balance-alert span {
  color: var(--muted);
  font-weight: 800;
}

.price-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.balance-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: rgba(217, 72, 110, 0.35);
  background: rgba(217, 72, 110, 0.1);
}

.balance-alert strong {
  color: var(--rose);
}

.balance-alert.settled {
  border-color: rgba(0, 143, 138, 0.3);
  background: var(--mint);
}

.balance-alert.settled strong {
  color: var(--teal);
}

.payment-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.payments-section-color {
  border-color: rgba(27, 159, 114, 0.34);
  background: rgba(27, 159, 114, 0.08);
}

.payments-section-color legend {
  color: #157b59;
}

.payment-summary div {
  display: grid;
  gap: 3px;
}

.compact-button {
  min-height: 40px;
  padding-inline: 12px;
  white-space: nowrap;
}

.calendar-more {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-event.payment-pending {
  background: #ffe3e8;
  color: #9c1f3a;
  box-shadow: inset 3px 0 0 #dc4666;
}

.calendar-event.payment-settled {
  background: var(--mint);
  color: #075f5b;
}

.calendar-event.completed {
  background: #dff5eb;
  color: #157b59;
  box-shadow: inset 3px 0 0 #1b9f72;
}

.payments-fieldset {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.payments-fieldset.collapsed {
  display: none;
}

.payments-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.payment-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) auto;
  gap: 10px;
  align-items: end;
}

.payments-list {
  display: grid;
  gap: 8px;
}

.payment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.payment-item span {
  color: var(--muted);
  font-weight: 800;
}

.price-total {
  background: #fff7dc;
  border-color: #efd37a;
}

.extras-fieldset {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.extras-section-color {
  border-color: rgba(42, 145, 164, 0.34);
  background: rgba(42, 145, 164, 0.07);
}

.extras-section-color legend {
  color: #227a8a;
}

.extras-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.extras-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding-right: 4px;
}

.extra-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.extra-option.hidden {
  display: none;
}

.extra-option input {
  width: 18px;
  height: 18px;
}

.extra-price {
  color: var(--teal);
  font-weight: 900;
}

.extras-search {
  margin-bottom: 2px;
}

.custom-extra-box {
  display: none;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.custom-extra-box.active {
  display: grid;
}

.notes-section {
  border: 1px solid rgba(27, 159, 114, 0.3);
  border-radius: 8px;
  padding: 12px;
  background: rgba(27, 159, 114, 0.06);
  color: #157b59;
}

.notes-section textarea {
  border-color: rgba(27, 159, 114, 0.28);
}

.subsection-header {
  margin: 22px 0 12px;
}

.extras-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.extras-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.extras-table th,
.extras-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.extras-table th {
  background: #eef7fb;
  color: #294b5b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.extras-table th:first-child {
  width: 26%;
}

.extras-table th:last-child {
  width: 150px;
  text-align: right;
}

.extras-table td:last-child {
  text-align: right;
}

.extras-table tbody tr:last-child td {
  border-bottom: 0;
}

.extras-table tbody tr:hover {
  background: #f8fcfd;
}

.extras-table-name {
  color: var(--ink);
}

.extras-table-price {
  color: var(--teal);
  white-space: nowrap;
}

.extras-table-empty td {
  color: var(--muted);
  text-align: center;
}

.info-card p,
.content-column p,
.profile-copy p {
  color: var(--muted);
  line-height: 1.5;
}

.info-card ul,
.content-column ul,
.check-list,
.terms-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.terms-list {
  display: grid;
  gap: 10px;
}

.terms-list li strong,
.terms-list li span {
  display: block;
}

.terms-list li strong {
  color: var(--ink);
}

.public-info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}

.info-layout {
  align-items: start;
}

.wide {
  grid-column: 1 / -1;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fff;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card .brand-block {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-status.error {
  color: var(--rose);
}

.user-panel {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.logout-button {
  margin-top: 10px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.store-heading {
  margin-bottom: 16px;
}

.store-heading h3,
.store-heading p {
  margin: 0;
}

.store-heading > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

.store-tool-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.store-tool-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.store-tool-button:hover,
.store-tool-button.active {
  border-color: #8bcdbb;
  background: #effaf6;
  box-shadow: 0 8px 20px rgba(27, 159, 114, 0.1);
}

.store-tool-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 9px;
  background: #e4f4ef;
  color: #157b59;
  font-size: 21px;
}

.store-tool-button > span:last-child {
  min-width: 0;
}

.store-tool-button strong,
.store-tool-button small {
  display: block;
}

.store-tool-button strong {
  font-size: 13px;
}

.store-tool-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.store-section-panel[hidden] {
  display: none !important;
}

.store-sale-primary {
  max-width: 900px;
}

.store-sale-step {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fbfcfd;
}

.store-sale-step legend {
  padding: 0 7px;
  color: var(--ink);
  font-weight: 900;
}

.store-sale-step legend span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 5px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
}

.store-add-button {
  justify-self: start;
}

.store-sale-checkout {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 18px;
  border-radius: 10px;
  padding: 16px;
  background: #eef8f5;
}

.store-sale-checkout .price-total {
  margin: 0;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.store-sale-form,
.store-cart,
.store-sales-list,
.store-period-list {
  display: grid;
  gap: 10px;
}

.store-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.store-report-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.store-report-card > span,
.store-report-card small,
.store-report-row span,
.store-report-row small {
  color: var(--muted);
  font-weight: 700;
}

.store-report-card > strong {
  font-size: 30px;
}

.store-report-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.store-report-row span,
.store-report-row small {
  display: block;
  font-size: 13px;
}

.store-cart {
  margin: 4px 0;
}

.store-cart-item,
.store-sale-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.store-sale-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.store-cart-item span,
.store-sale-item span,
.store-sale-item small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.store-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.store-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.store-card strong {
  font-size: 18px;
}

.store-card span,
.store-card small {
  color: var(--muted);
  font-weight: 700;
}

.store-price {
  color: var(--teal);
  font-size: 24px;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(340px, 88vw);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 24px 0 55px rgba(32, 48, 70, 0.24);
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    border: 0;
    padding: 0;
    background: rgba(24, 38, 48, 0.48);
    backdrop-filter: blur(2px);
  }

  .app-shell.menu-open .mobile-menu-backdrop,
  .mobile-menu-button,
  .mobile-menu-close {
    display: inline-flex;
  }

  .mobile-menu-close {
    margin-left: auto;
    flex: 0 0 auto;
    border-color: #d9e4eb;
    background: #fff;
  }

  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .info-grid,
  .content-board,
  .store-grid,
  .store-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-tool-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .events-layout,
  .events-layout.form-visible,
  .info-layout,
  .store-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .extras-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .extras-table,
  .extras-table tbody,
  .extras-table tr,
  .extras-table td {
    display: block;
    width: 100%;
  }

  .extras-table {
    table-layout: auto;
  }

  .extras-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .extras-table tbody {
    display: grid;
    gap: 10px;
  }

  .extras-table tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .extras-table td {
    display: grid;
    grid-template-columns: minmax(110px, 36%) minmax(0, 1fr);
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .extras-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .extras-table td:last-child {
    border-bottom: 0;
    text-align: left;
  }

  .extras-table-price {
    white-space: normal;
  }

  .extras-table-empty td {
    display: block;
    text-align: center;
  }

  .extras-table-empty td::before {
    content: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .events-header {
    align-items: stretch;
    flex-direction: column;
  }

  .events-header .primary-button {
    width: 100%;
  }

  .content-gallery {
    grid-template-columns: 1fr;
  }

  .content-detail-tables {
    grid-template-columns: 1fr;
  }

  .content-detail-header h3 {
    font-size: 23px;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 14px;
    border-color: #cfdde5;
    background: #fff;
    box-shadow: 0 6px 16px rgba(32, 48, 70, 0.08);
  }

  .menu-button-icon {
    display: grid;
    gap: 3px;
    width: 17px;
  }

  .menu-button-icon i {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .topbar-actions,
  .form-actions,
  .form-row,
  .payment-entry {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid,
  .info-grid,
  .content-board,
  .store-grid,
  .store-report-grid,
  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .store-tool-nav,
  .store-sale-checkout {
    grid-template-columns: 1fr;
  }

  .store-tool-button {
    width: 100%;
  }

  .store-add-button,
  .store-sale-checkout .form-actions,
  .store-sale-checkout .form-actions button {
    width: 100%;
  }

  .availability-strip {
    gap: 5px;
  }

  .availability-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .availability-weekday {
    min-height: 24px;
    font-size: 11px;
  }

  .availability-day {
    min-height: 68px;
    padding: 6px 4px;
    text-align: center;
  }

  .availability-day strong {
    margin-bottom: 2px;
    font-size: 13px;
  }

  .availability-events {
    gap: 2px;
  }

  .availability-event {
    font-size: 9px !important;
  }

  .availability-event b {
    display: block;
    font-size: 8px;
  }

  .availability-more,
  .availability-free {
    font-size: 9px !important;
    line-height: 1.1;
  }

  .store-report-row {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .calendar-toolbar h3 {
    min-width: 0;
    font-size: 18px;
  }

  .calendar-grid {
    width: 100%;
    min-width: 0;
    gap: 5px;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .calendar-weekday {
    min-height: 24px;
    border-radius: 6px;
    background: transparent;
    font-size: 11px;
  }

  .calendar-cell {
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
  }

  .calendar-date {
    display: block;
    font-size: 13px;
  }

  .calendar-event {
    display: block;
    margin-top: 3px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 8px;
    line-height: 1.15;
    text-align: left;
  }

  .calendar-cell.has-events::after {
    content: none;
  }

  .calendar-more {
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.1;
  }

  .calendar-cell.muted {
    opacity: 0.38;
  }

  #calendar-view {
    overflow-x: visible;
  }

  .event-item {
    grid-template-columns: 64px minmax(0, 1fr);
    min-width: 0;
  }

  .event-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .event-item p {
    overflow-wrap: anywhere;
  }

  .event-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-action-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
