:root {
  --admin-ink: #26342c;
  --admin-muted: #657168;
  --admin-green: #294638;
  --admin-green-dark: #20372b;
  --admin-green-pale: #e9eee8;
  --admin-cream: #f5f4ef;
  --admin-paper: #fffefa;
  --admin-gold: #bb8d51;
  --admin-line: #e1e2da;
  --admin-danger: #a8463f;
  --admin-shadow: 0 12px 36px rgba(37, 49, 40, 0.07);
  font-family: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body.admin-shell,
body.admin-login-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--admin-cream);
  color: var(--admin-ink);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.55;
}

.admin-shell *,
.admin-login-page * {
  box-sizing: border-box;
}

.admin-shell h1,
.admin-shell h2,
.admin-shell h3,
.admin-login-page h1 {
  color: var(--admin-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

.admin-shell a,
.admin-login-page a {
  color: inherit;
}

.admin-shell :focus-visible,
.admin-login-page :focus-visible {
  outline: 3px solid var(--admin-gold);
  outline-offset: 3px;
}

/* Staff sign-in */
body.admin-login-page {
  background:
    linear-gradient(120deg, rgba(26, 43, 33, 0.94), rgba(32, 55, 43, 0.78)),
    url("../images/554322043_18011642273795734_6415915159354571299_n.jpg") center / cover fixed;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 72px 20px 24px;
}

.login-back-link {
  position: absolute;
  top: 26px;
  left: max(22px, calc((100% - 1080px) / 2));
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.9rem;
  text-decoration: none;
}

.login-back-link:hover,
.forgot-link:hover {
  text-decoration: underline;
}

.login-card {
  width: min(100%, 440px);
  padding: 42px clamp(26px, 7vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  background: var(--admin-paper);
  box-shadow: 0 24px 80px rgba(12, 24, 17, 0.28);
}

.login-logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border: 1px solid var(--admin-line);
  border-radius: 50%;
  object-fit: cover;
}

.admin-eyebrow {
  margin: 0 0 8px;
  color: var(--admin-gold);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 9px;
  font-size: 2.3rem;
  text-align: center;
}

.login-intro {
  margin: 0 0 28px;
  color: var(--admin-muted);
  font-size: 0.94rem;
  text-align: center;
}

.login-card form {
  display: grid;
  gap: 9px;
}

.login-card label {
  margin-top: 5px;
  color: var(--admin-ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #d4d8d1;
  border-radius: 3px;
  background: white;
  color: var(--admin-ink);
  font: inherit;
}

.login-card input:focus {
  border-color: var(--admin-green);
  outline: 3px solid rgba(41, 70, 56, 0.14);
}

.login-card button {
  min-height: 49px;
  margin-top: 11px;
  border: 1px solid var(--admin-green);
  border-radius: 3px;
  background: var(--admin-green);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.login-card button:hover {
  background: var(--admin-green-dark);
}

.login-card button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.login-error {
  margin: 7px 0 0;
  padding: 10px 12px;
  border: 1px solid #e8c4bf;
  border-radius: 3px;
  background: #fff0ed;
  color: #8b342d;
  font-size: 0.88rem;
}

.forgot-link {
  display: block;
  margin-top: 18px;
  color: var(--admin-green) !important;
  font-size: 0.86rem;
  text-align: center;
}

.login-footer {
  margin: 0;
  color: rgba(255, 255, 255, 0.77);
  font-size: 0.8rem;
}

/* Shared admin header and navigation */
.admin-shell .banner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: flex-start;
  padding: 10px max(22px, calc((100% - 1180px) / 2));
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-paper);
}

.admin-shell .banner::after {
  margin-left: 12px;
  color: var(--admin-green-dark);
  content: "The Village Cafe";
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.admin-shell .circular-logo {
  width: 54px;
  height: 54px;
  margin: 0;
  border: 1px solid var(--admin-line);
  box-shadow: none;
}

.admin-navbar {
  padding: 0 max(22px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-paper);
  box-shadow: none;
}

.admin-navbar ul {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 7px 0;
}

.admin-navbar li {
  margin: 0;
}

.admin-navbar a {
  display: block;
  padding: 10px 13px;
  border-radius: 3px;
  color: var(--admin-muted) !important;
  font-size: 0.88rem;
  text-decoration: none;
}

.admin-navbar a:hover,
.admin-navbar a.active {
  background: var(--admin-green-pale);
  color: var(--admin-green-dark) !important;
}

.admin-shell .dashboard-header {
  gap: 20px;
  min-height: 112px;
  padding: 26px max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--admin-line);
  background: transparent;
}

.admin-shell .dashboard-header h1 {
  margin: 0;
  color: var(--admin-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
}

.admin-shell .dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-shell .admin-public-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--admin-line);
  border-radius: 3px;
  background: var(--admin-paper);
  color: var(--admin-green) !important;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-shell .admin-public-link:hover {
  background: var(--admin-green-pale);
}

.admin-shell .print-reservations-button {
  margin-right: 8px;
}

.admin-shell #logoutBtn {
  padding: 10px 16px;
  border: 1px solid #d7bdb8;
  border-radius: 3px;
  background: var(--admin-paper);
  color: var(--admin-danger);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-shell #logoutBtn:hover {
  border-color: var(--admin-danger);
  background: #fff0ed;
}

.admin-shell .dashboard-content {
  width: min(1180px, 100%);
  align-self: center;
  padding: 30px 24px 64px;
}

.admin-shell .left-column {
  width: 100%;
  max-width: 1180px;
}

.admin-shell .post-form,
.admin-shell .card,
.admin-shell .post-list,
.admin-shell .reservation-card,
.admin-shell .no-reservations,
.admin-shell .new-reservation-form,
.admin-shell .left-panel,
.admin-shell .right-panel {
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  background: var(--admin-paper);
  box-shadow: var(--admin-shadow);
}

.admin-shell .post-form,
.admin-shell .card,
.admin-shell .post-list,
.admin-shell .new-reservation-form,
.admin-shell .left-panel,
.admin-shell .right-panel {
  padding: clamp(20px, 3vw, 30px);
}

.admin-shell .post-form h2,
.admin-shell .card h2,
.admin-shell .card h3,
.admin-shell .post-list h2,
.admin-shell .left-panel h2,
.admin-shell .right-panel h2,
.admin-shell .new-reservation-form h3 {
  margin: 0 0 20px;
  color: var(--admin-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.55rem;
}

.admin-shell input:not([type="checkbox"]),
.admin-shell textarea,
.admin-shell select {
  max-width: 100%;
  border: 1px solid #d4d8d1;
  border-radius: 3px;
  background: white;
  color: var(--admin-ink);
  font: inherit;
}

.admin-shell input:not([type="checkbox"]):focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
  border-color: var(--admin-green);
  outline: 3px solid rgba(41, 70, 56, 0.12);
}

.admin-shell button,
.admin-shell .button,
.admin-shell .add-btn {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--admin-green);
  border-radius: 3px;
  background: var(--admin-green);
  color: white;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.admin-shell button:hover,
.admin-shell .button:hover,
.admin-shell .add-btn:hover {
  border-color: var(--admin-green-dark);
  background: var(--admin-green-dark);
}

.admin-shell button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.admin-shell .button.secondary {
  border-color: #d5d8d1;
  background: #eef0eb;
  color: var(--admin-ink);
}

.admin-shell .button.delete,
.admin-shell .reservation-actions button.cancel {
  border-color: var(--admin-danger);
  background: var(--admin-danger);
  color: white;
}

.admin-shell .reservation-actions button.confirm {
  border-color: var(--admin-green);
  background: var(--admin-green);
}

.admin-shell .reservation-actions button.restore {
  border-color: var(--admin-gold);
  background: var(--admin-gold);
  color: #fff;
}

.admin-shell .grid-two {
  gap: 22px;
}

.admin-shell .stats {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.admin-shell .stat {
  border: 1px solid var(--admin-line);
  border-radius: 4px;
  background: var(--admin-cream);
}

.admin-shell .stat strong {
  color: var(--admin-green);
}

.admin-shell .table-wrap {
  overflow-x: auto;
}

.admin-shell table {
  width: 100%;
  border-collapse: collapse;
}

.admin-shell th,
.admin-shell td {
  padding: 12px;
  border-bottom: 1px solid var(--admin-line);
  text-align: left;
}

.admin-shell th {
  background: var(--admin-green-pale);
  color: var(--admin-ink);
  font-size: 0.82rem;
}

.admin-shell .reservation-card {
  gap: 20px;
  margin-bottom: 14px;
  padding: 22px 24px;
}

.admin-shell .reservation-details {
  gap: 5px;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.admin-shell .reservation-details strong {
  color: var(--admin-ink);
  font-size: 1.05rem;
}

.admin-shell .reservation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-shell .reservation-actions button {
  margin: 0;
}

.admin-shell .no-reservations {
  padding: 34px;
  color: var(--admin-muted);
  text-align: center;
}

.admin-shell .container {
  width: min(1180px, 100%);
  align-self: center;
  gap: 22px;
  padding: 30px 24px 64px;
}

.admin-shell .left-panel,
.admin-shell .right-panel {
  width: auto;
  min-width: 0;
}

.admin-shell .left-panel {
  flex: 0 1 360px;
}

.admin-shell .right-panel {
  flex: 1 1 600px;
}

.admin-shell .form-group {
  margin-bottom: 16px;
}

.admin-shell .form-group label {
  color: var(--admin-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-shell .staff-list {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.admin-shell .staff-card {
  min-height: 300px;
  border: 1px solid var(--admin-line);
  border-radius: 4px;
  background: #fbfaf6;
  box-shadow: none;
}

.admin-shell .staff-card strong {
  color: var(--admin-ink);
}

.admin-shell .hours-calendar table td,
.admin-shell .hours-calendar table th {
  border: 1px solid var(--admin-line);
}

.admin-shell .switch input:checked + .slider {
  background: var(--admin-green);
}

.admin-shell footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--admin-line);
  background: var(--admin-paper);
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.admin-shell .page-container {
  width: min(900px, calc(100% - 36px));
  margin: 38px auto 64px;
  padding: 0;
}

.admin-shell .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
}

.admin-shell .page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.admin-shell .page-header .btn-secondary {
  color: var(--admin-green);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-shell .page-header .btn-secondary:hover {
  text-decoration: underline;
}

.admin-shell .page-container .card {
  padding: clamp(22px, 4vw, 38px);
}

.admin-shell .page-container .staff-form {
  max-width: 650px;
}

.admin-shell .page-container .form-group {
  margin-bottom: 20px;
}

.admin-shell .page-container .form-group label {
  display: block;
  margin-bottom: 7px;
}

.admin-shell .page-container .form-group input,
.admin-shell .page-container .form-group textarea {
  width: 100%;
  padding: 11px 13px;
}

.admin-shell .page-container .photo-preview img {
  width: 124px;
  height: 124px;
  border: 2px solid var(--admin-line);
  border-radius: 50%;
  object-fit: cover;
}

.admin-shell .page-container small {
  color: var(--admin-muted);
}

@media (max-width: 700px) {
  .admin-shell .banner,
  .admin-shell .admin-navbar {
    padding-inline: 18px;
  }

  .admin-navbar ul {
    justify-content: center;
    gap: 1px;
  }

  .admin-navbar a {
    padding: 9px 10px;
  }

  .admin-shell .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 20px;
  }

  .admin-shell .dashboard-content {
    padding: 22px 16px 42px;
  }

  .admin-shell .reservation-card {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .admin-shell .container {
    flex-direction: column;
    padding: 22px 16px 42px;
  }

  .admin-shell .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-shell .left-panel,
  .admin-shell .right-panel {
    width: 100%;
    flex-basis: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
