:root {
  --page-bg: #F7E5D7;
  --card: #ffffff;
  --accent: #3E0076;
  --text: #1f2933;
  --radius: 14px;
  --line: rgba(0,0,0,0.045);
  --input-border: rgba(15,15,15,0.2);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--page-bg);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden; /* do not let the page itself scroll sideways */
}

/* ========== HEADER / NAV (match index) ========== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* menu on left, logo on right */
  width: 100%;
  padding: 8px 24px;
  background-color: var(--page-bg); /* same tan as the site */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Logo on the right */
.logo {
  height: 56px;
  width: auto;
  display: block;
}

/* Nav on the left */
.navigation {
  margin-left: 0;
  flex: 0 0 auto;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  align-items: center;
}

.navigation ul li {
  margin: 0;
  padding: 0;
}

.navigation ul li a {
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #333;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Active link */
.navigation ul li a.active {
  background-color: #3E0076;
  color: #ffffff;
}

/* Hover state */
.navigation ul li a:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #111;
}

/* Menu button is hidden on desktop */
.menu-button {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

/* Mobile header layout */
@media (max-width: 768px) {
  .site-header {
    justify-content: center;
    padding: 10px 16px;
  }

  .logo {
    height: 48px;
  }

  .menu-button {
    display: block;
    position: absolute;
    left: 12px;
    top: 12px;
  }

  .navigation {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none; /* hidden by default on mobile */
    background-color: var(--page-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
  }

  /* Shown when .open is added by JS */
  .navigation.open {
    display: block;
  }

  .navigation ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 4px 12px;
  }

  .navigation ul li a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
  }
}

/* ========== SHELL ========== */

.dashboard-shell {
  max-width: 1150px;
  margin: 26px auto 60px;
  padding: 0 16px;
  width: 100%;
}

/* ========== CARDS ========== */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  padding: 18px 18px 14px;
  width: 100%;
  max-width: 100%;      /* do not let card be wider than viewport */
  overflow: hidden;     /* if a child is wider, card will not stretch */
}

/* ========== LAYOUT ========== */

.layout {
  display: grid;
  grid-template-columns: 1.05fr 1.6fr;
  gap: 18px;
  align-items: flex-start;
}
@media (max-width: 950px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ========== TEXT ========== */

.welcome-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 650;
}
.welcome-subtitle {
  margin: 0 0 14px;
  font-size: 0.74rem;
  color: rgba(0,0,0,0.55);
  line-height: 1.35;
}

/* ========== FORM ========== */

.event-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row.two .form-field {
  flex: 1;
}
.form-row.one .form-field {
  width: 100%;
}
@media (max-width: 520px) {
  .form-row {
    flex-direction: column;
  }
}
.form-field label {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--input-border);
  font-size: 0.78rem;
  background: #fff;
  outline: none;
  -webkit-appearance: none;
}
.form-field input:focus,
.form-field select:focus {
  border-color: rgba(255,107,53,0.8);
  box-shadow: 0 0 0 2.5px rgba(255,107,53,0.12);
}

.time-fields {
  display: flex;
  gap: 6px;
  align-items: center;
}
.time-fields select {
  flex: 1;
  min-width: 0;
}
@media (max-width: 480px) {
  .time-fields {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .time-fields select {
    font-size: 0.75rem;
  }
}

/* ========== TABLE ACTION BUTTONS ========== */

.actions-cell {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.table-edit-btn,
.table-delete-btn,
.table-dup-btn {
  border: none;
  background: rgba(0,0,0,0.04);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}

.table-delete-btn {
  background: rgba(255, 77, 77, 0.1);
  color: #c72424;
}

.table-dup-btn {
  background: rgba(48, 141, 255, 0.1);
  color: #1f6ad5;
}

@media (max-width: 550px) {
  .actions-cell {
    flex-direction: row;
  }
  .table-container table {
    min-width: 100%;
  }
}

/* nicer dropdown look */
.dropdown {
  background-image:
    linear-gradient(45deg, transparent 50%, #999 50%),
    linear-gradient(135deg, #999 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 4px),
    calc(100% - 9px) calc(50% - 4px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

/* ========== BUTTONS ========== */

.form-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.05s ease-out;
}
.primary-btn:active {
  transform: translateY(1px);
}
.ghost-btn {
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #333;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ========== TABLES ========== */

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.section-header h3 {
  margin: 0;
  font-size: 0.9rem;
}
.spacer-top {
  margin-top: 20px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,107,53,0.08);
  color: #3E0076;
  font-size: 0.7rem;
  font-weight: 500;
}

.table-wrap {
  margin-top: 6px;
}

/* Inner scroll area so the card stays full width but the table can scroll */

.table-container {
  width: 100%;
  overflow-x: auto;              /* scroll only inside */
  -webkit-overflow-scrolling: touch;
  margin: 0 -8px;                /* let the table reach close to card edges */
  padding: 0 8px 6px;
}

/* desktop table */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  min-width: 760px; /* was 620px - extra room for Zip */
}
@media (min-width: 1300px) {
  table {
    min-width: 820px;
  }
}
th, td {
  padding: 6px 6px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
}
th {
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.65);
  background: rgba(247,229,215,0.3);
}
.link-cell a {
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-state {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.5);
  padding: 6px 0 10px;
}

.table-edit-btn,
.table-delete-btn {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.68rem;
  cursor: pointer;
  margin-right: 4px;
}
.table-delete-btn {
  background: rgba(255, 70, 70, 0.1);
  border-color: rgba(255, 70, 70, 0.25);
}

/* ========== FLOATING LOGOUT BUTTON ========== */

.logout-floating {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #1f2933;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 50;
}

/* ========== MOBILE REFINEMENTS ========== */

@media (max-width: 600px) {
  .dashboard-shell {
    padding: 0 10px;
  }

  .card {
    padding: 14px 10px 12px;
  }

  /* layout stacked */
  .layout {
    gap: 16px;
  }

  /* smaller table but still scrollable */
  table {
    min-width: 520px;
  }

  /* smaller buttons */
  .table-edit-btn,
  .table-delete-btn {
    padding: 2px 6px;
    font-size: 0.64rem;
  }

  .site-header {
    padding: 10px 12px;
  }

  .logout-floating {
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 380px) {
  table {
    min-width: 460px;
  }
  .table-container {
    margin: 0 -6px;
    padding: 0 6px 6px;
  }
}