/* Optional presentation layer. Remove its link in index.html for the old design. */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&display=swap");

/* 1. Palette and surfaces */
:root,
body.admin-mode {
  --font-editorial: "Playfair Display", Georgia, serif;
  /* Main site's pricing CTA, gold border, tour CTA, and glass navigation. */
  --manor-maroon: #803e49;
  --manor-gold: #ac8945;
  --manor-green: #327848;
  --manor-nav: rgba(98, 10, 23, 0.8);
  --background: #faf8f5;
  --foreground: #303030;
  --card: #ffffff;
  --card-foreground: #303030;
  --popover: #ffffff;
  --popover-foreground: #303030;
  --muted: #f1eeea;
  --muted-foreground: #6b6561;
  --border: #e4ded6;
  --input: #d9d1c7;
  --primary: var(--manor-maroon);
  --primary-strong: #622d37;
  --primary-soft: #f5ebed;
  --brand-primary: var(--manor-maroon);
  --brand-primary-strong: #622d37;
  --brand-primary-soft: #f5ebed;
  --brand-primary-border: #c6a2a8;
  --brand-primary-glow: rgba(128, 62, 73, 0.1);
  --secondary: #f3eddf;
  --primary-rgb: 128, 62, 73;
  --primary-strong-rgb: 98, 45, 55;
  --primary-soft-rgb: 245, 235, 237;
  --secondary-rgb: 172, 137, 69;
  --ink-rgb: 48, 48, 48;
  --ink-900: #303030;
  --ink-800: #404040;
  --ink-700: #514b48;
  --ink-600: #605955;
  --ink-500: #6b6561;
  --paper: var(--background);
  --surface-muted: #f7f4ef;
  --surface-raised: #ffffff;
  --border-strong: #cfc3b5;
  --line: #e4ded6;
  --line-strong: #cfc3b5;
  --today-accent: var(--manor-maroon);
  --radius: 6px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --btn-primary-shadow: none;
  --btn-primary-shadow-hover: none;
  --btn-outline-border: var(--input);
  --btn-outline-text: var(--ink-700);
  --shadow-nav: 0 4px 16px rgba(48, 32, 30, 0.12);
  --shadow-card: 0 5px 20px rgba(48, 32, 30, 0.035);
  --shadow-float: 0 18px 55px rgba(48, 32, 30, 0.16);
  --shadow-soft: 0 5px 18px rgba(48, 32, 30, 0.04);
}

body,
body.admin-mode {
  background: radial-gradient(ellipse at 10% 0%, #f1e8e4 0, transparent 44%), var(--background);
}

.calendar-card,
.list-card,
.summary-card,
.account-card,
.admin-panel,
.admin-page-card,
.modal-card,
.staff-row,
.shift-row,
.admin-sidebar {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

/* 2. Navigation and dashboard hierarchy */
.page {
  max-width: 1440px;
  padding: 112px 32px 40px;
}

.top-nav {
  background: var(--manor-nav);
  padding: 14px 32px;
  border-radius: 0;
  box-shadow: var(--shadow-nav);
}

.top-nav::after {
  left: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, var(--manor-gold) 20%, #e1c98e 50%, var(--manor-gold) 80%, transparent);
  opacity: 1;
}

.brand-logo {
  height: 44px;
  filter: brightness(0) invert(1);
}

.account-back,
.calendar-nav-button {
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
}

.user-strip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: none;
  border-radius: 5px;
}

.user-caret {
  color: #f4e4a6;
}

.user-strip:hover,
.user-strip:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: #e1c98e;
  color: #ffffff;
  box-shadow: none;
}

.top-nav :is(button, a):focus-visible {
  outline: 2px solid #f4e4a6;
  outline-offset: 3px;
}

.top-nav .account-menu :is(button, a):focus-visible {
  outline-color: var(--primary);
}

.dashboard-view {
  gap: 20px;
}

.dashboard-view #calendar-section {
  width: 100%;
  margin: 0;
  padding: 20px;
  border-top: 3px solid var(--manor-gold);
}

.calendar-toolbar {
  padding: 0 0 20px;
  gap: 14px 20px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.calendar-schedule-kind,
.account-eyebrow,
.preview-controls-label {
  color: var(--primary);
  letter-spacing: 0.15em;
}

.calendar-schedule-title,
.calendar-title,
.account-header h1,
.admin-sidebar-head h2,
.admin-page-header h3 {
  font-family: var(--font-editorial);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.calendar-schedule-title {
  font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1.05;
}

.calendar-title {
  font-size: 25px;
}

.calendar-nav {
  width: max-content;
}

.calendar-nav-button {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.preview-controls {
  margin-top: 12px;
}

.preview-user-select {
  background: var(--surface-muted);
  border-color: var(--line);
  border-radius: 5px;
  min-height: 38px;
}

.dashboard-admin-shifts {
  padding: 14px 20px;
  background: var(--surface-muted);
  box-shadow: none;
}

.dashboard-admin-shifts .card-header h2 {
  font-size: 14px;
  letter-spacing: 0.015em;
}

.dashboard-admin-shifts .card-hint {
  font-size: 12px;
  margin-top: 3px;
}

/* 3. Shift list, controls and weekly summary */
#list-section,
#week-summary {
  padding: 24px;
}

#list-section .card-header {
  margin-bottom: 20px;
}

.list-title-button {
  color: var(--ink);
  font-family: var(--font-editorial);
  font-size: 30px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.025em;
}

.list-filters {
  background: var(--muted);
  border-color: transparent;
  border-radius: 7px;
  box-shadow: none;
}

.list-filter {
  border-radius: 5px;
  letter-spacing: 0;
  font-size: 12px;
  min-height: 36px;
  padding: 8px 12px;
}

.list-filter.is-active {
  background: var(--primary);
  box-shadow: none;
}

.account-save,
.staff-save,
.shift-save,
.auth-submit {
  background: var(--primary);
  border-color: var(--manor-gold);
  box-shadow: none;
  border-radius: 6px;
}

.account-save:hover,
.staff-save:hover,
.shift-save:hover,
.auth-submit:hover:not(:disabled) {
  background: var(--primary-strong);
  box-shadow: none;
}

.cleaning-item {
  padding: 18px 12px;
  border-color: var(--line);
  border-radius: 6px;
}

.cleaning-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cleaning-meta {
  margin-top: 6px;
  font-size: 13px;
  gap: 10px;
}

.time-chip {
  background: var(--muted);
  border-color: transparent;
  color: var(--ink-600);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
}

.assign-quick {
  min-height: 40px;
  padding: 8px 14px;
  box-shadow: none;
  border-radius: 5px;
}

.cleaning-item[data-ownership="mine"] .assign-quick {
  box-shadow: none;
}

#week-summary {
  display: flex;
  align-items: center;
  gap: 32px;
  background: #f5f0e6;
  border-color: #e3d7bd;
  box-shadow: none;
}

#week-summary .card-header {
  margin: 0;
  flex: 0 0 auto;
}

#week-summary h2 {
  font-family: var(--font-editorial);
  font-size: 25px;
}

#week-summary .card-hint {
  font-size: 12px;
  margin: 4px 0 0;
}

.summary-grid {
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.summary-item {
  padding: 0 22px;
  background: transparent;
  border: 0;
  border-left: 1px solid #dbcba9;
  border-radius: 0;
  gap: 0;
}

.summary-label {
  font-size: 10px;
  letter-spacing: 0.1em;
}

.summary-value {
  font-family: var(--font-editorial);
  font-size: 34px;
  line-height: 1.2;
  font-variant-numeric: lining-nums tabular-nums;
}

/* 4. Calendar readability; existing red/open and green/assigned meanings remain */
.fc {
  --fc-border-color: #e8e2da;
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: #f7f4ef;
}

.fc .fc-col-header-cell-cushion {
  color: var(--ink-600);
  font-size: 10px;
  letter-spacing: 0.13em;
  padding: 10px 4px;
}

.fc .fc-daygrid-day-number {
  font-size: 11px;
  padding: 7px 9px;
}

.event-card {
  padding: 5px 6px;
  border-radius: 4px;
  min-height: 38px;
  border-left-width: 3px;
  gap: 3px;
}

.event-title {
  font-size: 12px;
  line-height: 1.2;
}

.event-title-text {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-meta-compact {
  font-size: 10px;
  line-height: 1.15;
}

.event-card[data-assignee-key="unassigned"],
.cleaning-item[data-assignee-key="unassigned"],
.modal-card[data-assignee-key="unassigned"] {
  --assignee-ink: #a23f2d;
  --assignee-ink-soft: #a23f2d;
  --assignee-border: #ca9d8f;
  --assignee-bg: #fff8f2;
  --assignee-bg-hover: #f8e8de;
  --assignee-caret: #a23f2d;
}

.event-card[data-ownership="mine"],
.cleaning-item[data-ownership="mine"],
.modal-card[data-ownership="mine"] {
  --assignee-ink: #28573e;
  --assignee-ink-soft: #28573e;
  --assignee-border: #9bb5a0;
  --assignee-bg: #edf3e9;
  --assignee-bg-hover: #e0ecdb;
}

/* 5. Admin forms and feedback */
.account-input,
.staff-input,
.shift-input {
  background: var(--card);
  border-color: var(--input);
  box-shadow: none;
  border-radius: 5px;
}

.admin-sidebar {
  border-right-color: var(--line);
}

.admin-nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 3px 0 var(--manor-gold);
}

.admin-nav-link:not(.is-active) {
  background: transparent;
}

.admin-panel {
  border-radius: 10px;
}

.admin-overview-card,
.staff-insight-card,
.admin-action-card,
.account-profile-card,
.admin-form-card {
  background: var(--surface-muted);
  box-shadow: none;
  border-color: var(--line);
}

.staff-name {
  font-weight: 600;
}

.staff-meta {
  color: var(--muted-foreground);
}

.staff-alert-item.is-warn {
  color: #815820;
}

.staff-filter-pill span {
  background: var(--card);
  border-color: var(--input);
}

.staff-filter-pill input:checked + span {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.banner {
  background: #fff4d9;
  border-color: #dcc58c;
  color: #6c4d14;
}

.sync-status[data-state="live"] {
  background: #e8eee2;
  color: var(--manor-green);
  border-color: #becdb7;
}

:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* 6. Sign-in: keep the existing manor photograph and logo */
.auth {
  background-color: #eee5df;
  background-image: linear-gradient(110deg, rgba(64, 24, 32, 0.32), rgba(250, 247, 241, 0.72)), url("/background-1536.jpg");
}

.auth-card {
  padding: 44px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-top: 3px solid var(--manor-gold);
  box-shadow: 0 20px 65px rgba(48, 24, 30, 0.18);
  border-radius: 10px;
}

.auth-logo {
  margin-bottom: 18px;
}

.auth-form input {
  background: var(--card);
  border-color: var(--input);
  border-radius: 5px;
  min-height: 46px;
  box-shadow: none;
}

.auth-submit {
  min-height: 46px;
  margin-top: 8px;
}

.auth-submit:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
}

/* 7. Responsive refinements; retain the existing list-first phone layout */
@media (max-width: 1100px) and (min-width: 721px) {
  .calendar-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .calendar-schedule-copy {
    grid-column: 1 / -1;
  }
  .calendar-nav {
    grid-column: 1;
    justify-self: start;
  }
  .calendar-view-toggle {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 94px 16px 24px;
  }
  .top-nav {
    padding: 14px 16px;
  }
  .brand-logo {
    height: auto;
    width: min(240px, 65vw);
  }
  .dashboard-view {
    gap: 16px;
  }
  .dashboard-admin-shifts {
    padding: 16px;
  }
  .dashboard-admin-shifts .card-header {
    gap: 12px;
  }
  .dashboard-admin-shifts .card-hint {
    line-height: 1.5;
  }
  #list-section,
  #week-summary {
    padding: 18px 16px;
  }
  #list-section .card-header {
    margin-bottom: 8px;
    justify-content: flex-start;
  }
  .list-title-button {
    font-size: 28px;
    padding: 5px 0;
    min-height: 44px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .list-filters {
    background: var(--card);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--line);
  }
  .list-filter {
    min-height: 44px;
    font-size: 14px;
  }
  .cleaning-item {
    padding: 16px 4px;
    gap: 10px;
  }
  .cleaning-title {
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
  }
  .cleaning-meta {
    font-size: 12px;
    gap: 5px;
  }
  .time-chip {
    font-size: 10px;
    padding: 3px 5px;
  }
  .assign-quick {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px;
  }
  #week-summary {
    display: block;
  }
  #week-summary .card-header {
    margin-bottom: 16px;
  }
  #week-summary .card-header > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .summary-item {
    padding: 0 10px;
  }
  .summary-item:first-child {
    border-left: 0;
    padding-left: 0;
  }
  .summary-label {
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .summary-value {
    font-size: 30px;
  }
  .auth {
    padding: 24px;
    background-image: linear-gradient(110deg, rgba(64, 24, 32, 0.32), rgba(250, 247, 241, 0.72)), url("/background-900.jpg");
  }
  .auth-card {
    padding: 28px 24px;
  }
  .auth-form input,
  .account-input,
  .staff-input,
  .shift-input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
