* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #f5efe7;
  --surface: rgba(255, 251, 246, 0.95);
  --surface-soft: #f7f1e8;
  --text: #221d18;
  --text-soft: #675b4f;
  --line: rgba(126, 102, 72, 0.16);
  --accent: #c48a36;
  --accent-deep: #8d5a18;
  --dark: #161311;
  --success: #1e8a3a;
  --warning: #856000;
  --danger: #b91c1c;
  --danger-deep: #991b1b;
  --shadow: 0 18px 40px rgba(45, 31, 14, 0.08);
  --shadow-strong: 0 28px 70px rgba(16, 12, 8, 0.18);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 247, 236, 0.72), transparent 28%),
    linear-gradient(180deg, #fbf8f3 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 40px;
  background: rgba(22, 19, 17, 0.94);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-eyebrow,
.section-eyebrow,
.dialog-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
}

.header-eyebrow,
.section-eyebrow {
  color: #e1b86d;
}

.admin-header h1,
.panel-section h2,
.dialog-card h2,
.agenda-title-row h3 {
  font-family: "Cormorant Garamond", serif;
}

.admin-header h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 0.95;
  margin-block: 6px 8px;
}

.header-subtitle {
  color: rgba(255, 240, 220, 0.8);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.lang-btn {
  min-width: 44px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 248, 240, 0.82);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-btn:hover {
  color: white;
}

.lang-btn.is-active {
  background: rgba(242, 202, 132, 0.18);
  color: #ffe5b6;
  box-shadow: inset 0 0 0 1px rgba(242, 202, 132, 0.34);
}

.admin-container {
  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;
  background: #f7edd8;
  border: 1px solid #ead7b3;
  color: #6c4f16;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.panel-process-status.success {
  background: #e5f4e9;
  border-color: #b7dec2;
  color: #176b2c;
}

.panel-process-status.error {
  background: #fde7e7;
  border-color: #f3c2c2;
  color: #9b1c1c;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.summary-card {
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid rgba(190, 157, 112, 0.16);
  box-shadow: var(--shadow);
}

.summary-card h2 {
  font-size: 1.05rem;
  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);
  font-size: 0.92rem;
}

.highlight-card {
  background: linear-gradient(135deg, #fff5e4 0%, #f3dfbb 100%);
}

.panel-section {
  margin-bottom: 28px;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(190, 157, 112, 0.16);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-section h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 0.95;
  margin-block: 8px 10px;
}

.section-description {
  max-width: 720px;
  color: var(--text-soft);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(180px, 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 #d7d1c7;
  background: #faf7f2;
  color: var(--text);
  font: inherit;
}

.control-field input:focus,
.control-field select:focus {
  outline: 2px solid rgba(196, 138, 54, 0.22);
  border-color: var(--accent);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid #eee5d9;
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid #e9e2d9;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: #faf7f2;
  color: #6b635a;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:hover {
  background: #fffaf3;
}

td small {
  color: var(--text-soft);
}

.estado {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: capitalize;
}

.estado.pendiente {
  background: #fff0c2;
  color: var(--warning);
}

.estado.confirmada {
  background: #d7f5df;
  color: #176b2c;
}

.estado.rechazada {
  background: #ffd8d8;
  color: #9b1c1c;
}

.estado.cancelada {
  background: #e6e0f8;
  color: #5b468c;
}

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

.actions-empty {
  color: #7a756e;
  font-size: 0.84rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  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, #f2ca84 0%, #c98e37 100%);
  color: #20160c;
}

.btn.accept {
  background: var(--success);
  color: white;
}

.btn.reject,
.btn.danger,
.btn-cancelar-reserva {
  background: var(--danger);
  color: white;
}

.btn.reject:hover,
.btn.danger:hover,
.btn-cancelar-reserva:hover {
  background: var(--danger-deep);
}

.btn.estado-abierto {
  background: var(--danger);
  color: white;
}

.btn.estado-cerrado {
  background: var(--success);
  color: white;
}

.btn.secondary {
  background: transparent;
  color: white;
  border-color: rgba(225, 184, 109, 0.54);
}

.btn.light {
  background: #f7f1e8;
  color: #4b3b1c;
}

.btn-cancelar-reserva {
  border: none;
}

.control-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #faf7f2, #f1e6d4);
  border: 1px solid #eadfcd;
}

.control-card h3 {
  margin-bottom: 8px;
  color: #312819;
}

.control-card p {
  color: #5f5447;
}

.agenda-header {
  align-items: center;
}

.day-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.agenda-title-row {
  margin-bottom: 18px;
}

.agenda-title-row h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  text-transform: capitalize;
}

.agenda-list {
  display: grid;
  gap: 18px;
}

.agenda-slot {
  border: 1px solid #eee2d2;
  border-radius: 20px;
  background: #fffdfa;
  overflow: hidden;
}

.agenda-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fbf5ec;
  border-bottom: 1px solid #eee2d2;
}

.agenda-slot-header h4 {
  font-size: 1.1rem;
}

.agenda-slot-header span {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.agenda-slot-content {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.agenda-reservation-card {
  padding: 18px;
  border-radius: 18px;
  background: #fff8ef;
  border: 1px solid #efdfc8;
}

.agenda-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.agenda-card-top h5 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.agenda-meta,
.agenda-comments,
.agenda-meta-grid p {
  color: var(--text-soft);
}

.agenda-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.agenda-comments {
  margin-top: 12px;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: #faf7f2;
  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%, 440px);
  padding: 26px;
  border-radius: 24px;
  background: #fffdfa;
  box-shadow: var(--shadow-strong);
}

.access-card {
  width: min(100%, 480px);
}

.dialog-card h2 {
  font-size: 2rem;
  margin-block: 8px 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: 900px) {
  .admin-header,
  .section-header,
  .control-card,
  .agenda-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-grid,
  .agenda-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-header {
    padding: 24px 18px;
  }

  .admin-container {
    width: min(100% - 24px, 1240px);
    padding-top: 24px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-section,
  .summary-card {
    padding: 22px 18px;
  }

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

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