﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #efebe4;
  --surface: rgba(251, 248, 244, 0.94);
  --surface-soft: #e5ded6;
  --surface-dark: #17181e;
  --text: #17151a;
  --text-soft: #625d66;
  --line: rgba(54, 49, 59, 0.13);
  --line-soft: rgba(255, 255, 255, 0.1);
  --accent: #cb8a90;
  --accent-soft: #ecc4c1;
  --accent-deep: #84535d;
  --success: #2a6a5d;
  --danger: #aa5058;
  --danger-deep: #8d3d45;
  --warning: #7b6450;
  --shadow-soft: 0 20px 48px rgba(28, 21, 26, 0.08);
  --shadow-strong: 0 38px 96px rgba(18, 15, 21, 0.24);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(203, 138, 144, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f4ef 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Sora", sans-serif;
}

.admin-header,
.panel-card h2,
.dialog-card h2,
.agenda-title-row h3 {
  font-family: "Prata", serif;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 40px;
  background: rgba(23, 24, 30, 0.94);
  color: white;
  border-bottom: 1px solid var(--line-soft);
}

.header-eyebrow,
.section-eyebrow,
.dialog-eyebrow,
.summary-card span {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
}

.header-eyebrow,
.section-eyebrow,
.dialog-eyebrow {
  color: var(--accent-soft);
}

.admin-header h1 {
  font-size: clamp(2.3rem, 4vw, 3.3rem);
  line-height: 0.96;
  margin: 8px 0 10px;
}

.header-subtitle {
  color: rgba(255, 241, 233, 0.74);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.language-button {
  min-width: 48px;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 241, 233, 0.8);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.language-button:hover {
  color: #fff8f2;
  transform: translateY(-1px);
}

.language-button.is-active {
  background: #fff4ec;
  color: #2a1914;
}

.admin-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.panel-process-status {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #ead8d9;
  background: #f8ecec;
  color: #6f4650;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.panel-process-status.success {
  background: #e7f4ee;
  border-color: #bfdcca;
  color: #186845;
}

.panel-process-status.error {
  background: #fde9e6;
  border-color: #f2c5bc;
  color: #972f24;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.summary-card,
.panel-card,
.agenda-slot,
.agenda-entry,
.dialog-card {
  border-radius: 26px;
}

.summary-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.summary-card h2 {
  font-size: 1.04rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.summary-card p {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
}

.summary-card span {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.92rem;
}

.summary-highlight {
  background: linear-gradient(135deg, #fff8f8 0%, #efd9db 100%);
}

.panel-card {
  margin-bottom: 28px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-card h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.96;
  margin: 8px 0 10px;
}

.section-copy {
  max-width: 740px;
  color: var(--text-soft);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(200px, 0.8fr);
  gap: 14px;
  margin-bottom: 20px;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.control-field input,
.control-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dacfc4;
  background: #fbf8f4;
  color: var(--text);
  font: inherit;
}

.control-field input:focus,
.control-field select:focus {
  outline: 2px solid rgba(184, 116, 80, 0.2);
  border-color: var(--accent);
}

.table-frame {
  overflow-x: auto;
  border: 1px solid #eadfd4;
  border-radius: 20px;
}

.pending-table-frame {
  max-height: calc(52px + (10 * 72px));
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid #ede4dc;
  text-align: left;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbf8f4;
  color: #70645d;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:hover {
  background: #fffaf5;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
}

.contact-cell {
  max-width: 170px;
}

.contact-primary,
.contact-secondary {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.pending {
  background: #f7ead6;
  color: var(--warning);
}

.status-pill.confirmed {
  background: #dff3e7;
  color: #176844;
}

.status-pill.rejected {
  background: #f9dcd6;
  color: #9b3025;
}

.status-pill.cancelled {
  background: #eee5f7;
  color: #5a4487;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.id-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 100%;
}

.actions-empty {
  color: #7b736d;
  font-size: 0.84rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #dba98d 0%, #b87450 100%);
  color: #180f0d;
}

.btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(226, 183, 156, 0.44);
}

.btn-light {
  background: #f6efe8;
  color: #4b3728;
}

.btn-accept {
  background: var(--success);
  color: white;
}

.btn-danger,
.btn-reject,
.btn-cancel {
  background: var(--danger);
  color: white;
}

.btn-id {
  min-height: 34px;
  padding: 6px 12px;
  background: #f7efe7;
  border-color: #e2d2c2;
  color: #5c4435;
  font-size: 0.8rem;
}

.inline-id {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3ece6;
  color: #5f534d;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.service-cell {
  min-width: 0;
}

.service-note {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-danger:hover,
.btn-reject:hover,
.btn-cancel:hover {
  background: var(--danger-deep);
}

.btn-open {
  background: var(--success);
  color: white;
}

.control-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #faf6f1, #f0e3d8);
  border: 1px solid #eaded4;
}

.control-band-copy {
  min-width: 0;
}

.control-band h3 {
  margin-bottom: 8px;
  color: var(--text);
}

.control-band p {
  color: var(--text-soft);
}

.control-band-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
}

.control-date-field {
  min-width: 190px;
}

.agenda-head {
  align-items: center;
}

.day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.agenda-title-row {
  margin-bottom: 18px;
}

.agenda-title-row h3 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  text-transform: capitalize;
}

.agenda-list {
  display: grid;
  gap: 18px;
}

.agenda-slot {
  overflow: hidden;
  border: 1px solid #ece1d7;
  background: #fffdfa;
}

.agenda-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fbf6f1;
  border-bottom: 1px solid #ece1d7;
}

.agenda-slot-head h4 {
  font-size: 1.08rem;
}

.agenda-slot-head span {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.agenda-slot-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.agenda-entry {
  padding: 18px;
  background: #fff8f2;
  border: 1px solid #efe2d5;
}

.agenda-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.agenda-entry-top h5 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.agenda-meta,
.agenda-note,
.agenda-grid p {
  color: var(--text-soft);
}

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.agenda-note {
  margin-top: 12px;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: #faf6f1;
  color: var(--text-soft);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 14, 10, 0.58);
  backdrop-filter: blur(8px);
}

.dialog-card {
  width: min(100%, 460px);
  padding: 28px;
  background: #fffdfa;
  box-shadow: var(--shadow-strong);
}

.access-card {
  width: min(100%, 500px);
}

.dialog-card h2 {
  font-size: 2rem;
  margin: 8px 0 12px;
}

.dialog-message {
  color: var(--text-soft);
}

.access-form {
  margin-top: 18px;
}

.access-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.access-message.error {
  color: var(--danger);
  font-weight: 700;
}

.access-message.success {
  color: var(--success);
  font-weight: 700;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 1080px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .admin-header,
  .panel-head,
  .control-band,
  .agenda-entry-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-grid,
  .agenda-grid {
    grid-template-columns: 1fr;
  }

  .control-band-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .admin-header {
    padding: 24px 18px;
  }

  .admin-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 24px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-card,
  .summary-card {
    padding: 22px 18px;
  }

  .header-actions,
  .day-actions,
  .dialog-actions {
    width: 100%;
  }

  .language-switch {
    width: 100%;
    justify-content: center;
  }

  .header-actions .btn,
  .day-actions .btn,
  .dialog-actions .btn {
    width: 100%;
  }
}
