.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-main {
  /* Grid items don't shrink below their content's natural width by default,
     so the wide appointments table would otherwise force this whole column
     (and the page) to scroll sideways instead of just the table itself. */
  min-width: 0;
}

.admin-sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-sidebar .brand {
  padding: 0 8px 20px;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.admin-nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.admin-nav-btn.active { background: rgba(201,162,39,0.12); color: var(--gold-light); }

.admin-sidebar .spacer { flex: 1; }

.admin-main {
  padding: 32px 40px;
  max-width: 1100px;
}

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

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-alt);
}

tr:last-child td { border-bottom: none; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }

.services-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hours-form-row {
  display: grid;
  grid-template-columns: 120px 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.hours-form-row:last-child { border-bottom: none; }

.blocked-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.blocked-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
}

.blocked-row span { min-width: 0; overflow-wrap: break-word; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
}

.service-admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.service-admin-card.inactive { opacity: 0.55; }

.service-admin-card .row-actions { margin-top: 14px; }

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
  }

  .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }
  .admin-shell.sidebar-open .sidebar-backdrop { display: block; }

  .hamburger-btn { display: flex; }
  .admin-main { padding: 24px 16px; }
}

@media (max-width: 600px) {
  .admin-topbar h2 { font-size: 1.3rem; }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-group { min-width: 0; width: 100%; }
  .filter-bar button { width: 100%; }

  .hours-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
  }

  .hours-form-row > strong,
  .hours-form-row > label { flex: 1 1 100%; }

  .hours-form-row .open-time,
  .hours-form-row .close-time {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    width: auto;
  }
}
