:root {
  --bg: #fffaf6;
  --panel: #fffdfb;
  --ink: #351013;
  --muted: #8b6860;
  --line: #ead5c7;
  --red: #7b0920;
  --red-2: #9f1230;
  --gold: #d6a74c;
  --gold-soft: #f5dfaf;
  --shadow: 0 18px 50px rgba(63, 15, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(214, 167, 76, 0.18), transparent 34rem),
    linear-gradient(180deg, #fffdf9 0%, var(--bg) 100%);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--red-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 48px 18px 28px;
}

.brand-header {
  display: grid;
  gap: 18px;
  justify-items: center;
  margin-bottom: 28px;
}

.logo {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.top-links,
.footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  color: var(--red-2);
  font-size: 14px;
}

.notice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #fff1dd;
  color: #913c00;
  margin-bottom: 26px;
}

.notice-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-top: 2px;
  border-radius: 50%;
  background: #c96b11;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.notice p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.is-hidden {
  display: none !important;
}

.language-card,
.success-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.95);
  box-shadow: var(--shadow);
  text-align: center;
}

.language-kicker {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.language-card h1,
.success-card h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(26px, 5vw, 38px);
}

.language-actions {
  display: grid;
  width: 100%;
  gap: 10px;
}

.language-button {
  min-height: 52px;
  border: 1px solid #efc7bf;
  border-radius: 6px;
  background: #fffaf7;
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
}

.language-button:hover {
  border-color: var(--gold);
  background: #fff1dd;
}

.success-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #351013;
  font-size: 34px;
  font-weight: 900;
}

.success-card p {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.wide-button {
  width: min(100%, 280px);
}

.reservation-card,
.admin-panel,
.admin-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow);
}

.reservation-card {
  overflow: hidden;
}

.field-group,
.form-row {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.field-title,
.form-row label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--red);
  font-weight: 700;
}

.field-icon {
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.people-button {
  min-height: 42px;
  border: 1px solid #efc7bf;
  border-radius: 6px;
  background: #fffaf7;
  color: var(--red);
  cursor: pointer;
  transition: 0.18s ease;
}

.people-button:hover,
.people-button.is-active {
  border-color: var(--red-2);
  background: var(--red-2);
  color: white;
}

.form-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  align-items: center;
}

.form-row small {
  color: var(--muted);
  font-weight: 400;
}

.form-row input,
.form-row textarea,
.form-row select,
.admin-toolbar input {
  width: 100%;
  border: 1px solid #e9cfc5;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.form-row input,
.form-row select,
.admin-toolbar input {
  min-height: 44px;
}

.form-row textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus,
.admin-toolbar input:focus {
  outline: 3px solid rgba(214, 167, 76, 0.26);
  border-color: var(--gold);
}

.form-message {
  min-height: 22px;
  margin: 12px 16px 0;
  color: var(--muted);
}

.form-message.is-error {
  color: #b00020;
}

.form-message.is-success {
  color: #116b3a;
}

.primary-button,
.secondary-button,
.ghost-button,
.delete-button,
.edit-button,
.whatsapp-button,
.present-button,
.absent-button,
.call-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  display: block;
  width: calc(100% - 32px);
  min-height: 48px;
  margin: 14px 16px 16px;
  background: linear-gradient(135deg, var(--red-2), var(--red));
  color: white;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.footer-links {
  margin-top: 22px;
  flex-wrap: wrap;
  font-size: 12px;
}

[dir="rtl"] .form-row label,
[dir="rtl"] .field-title {
  justify-content: flex-start;
}

[dir="rtl"] .notice {
  grid-template-columns: 1fr 24px;
}

[dir="rtl"] .notice-icon {
  order: 2;
}

.admin-page {
  width: min(100%, 980px);
}

.admin-login {
  display: grid;
  place-items: center;
  min-height: 48vh;
}

.admin-login-card {
  display: grid;
  width: min(100%, 420px);
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.96);
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 26px;
}

.admin-login-card label {
  color: var(--red);
  font-weight: 700;
}

.admin-login-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e9cfc5;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.admin-login-card input:focus {
  outline: 3px solid rgba(214, 167, 76, 0.26);
  border-color: var(--gold);
}

.admin-login-card .primary-button {
  width: 100%;
  margin: 4px 0 0;
}

.admin-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-logo {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.back-link {
  justify-self: start;
  font-weight: 700;
}

.admin-kicker {
  justify-self: end;
  color: var(--muted);
  font-weight: 700;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px minmax(220px, 1fr) 140px;
  gap: 14px;
  align-items: end;
  padding: 16px;
}

.admin-toolbar label {
  color: var(--red);
  font-weight: 700;
}

.secondary-button {
  min-height: 44px;
  background: var(--gold);
  color: #2b1600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(63, 15, 24, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  color: var(--red);
  font-size: clamp(28px, 4vw, 42px);
}

.admin-panel {
  padding: 18px;
}

.popup-admin-panel {
  margin-bottom: 18px;
}

.popup-admin-form {
  display: grid;
  gap: 12px;
}

.popup-admin-form label,
.checkbox-field {
  color: var(--red);
  font-weight: 700;
}

.checkbox-field,
.switch-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field input,
.switch-field input {
  width: auto;
}

.switch-field {
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #e9cfc5;
  border-radius: 8px;
  background: #fffaf7;
}

.switch-field input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
}

.popup-admin-form input[type="date"],
.popup-admin-form input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e9cfc5;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

.popup-preview {
  width: min(100%, 320px);
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fffaf7;
}

.popup-control-panel {
  max-width: 680px;
  margin: 0 auto;
}

.popup-control-preview {
  width: min(100%, 460px);
  justify-self: center;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.panel-title h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(22px, 4vw, 32px);
}

.ghost-button,
.delete-button {
  min-height: 36px;
  padding: 0 12px;
  background: #fff3f1;
  color: var(--red);
  border: 1px solid #efc7bf;
}

.reservation-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.present-button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #138a4d;
  border-radius: 6px;
  background: #dff7e8;
  color: #07542b;
  text-decoration: none;
}

.present-button:hover {
  filter: brightness(1.03);
}

.present-button.is-disabled,
.present-button:disabled {
  border-color: #138a4d;
  background: #159957;
  color: white;
  cursor: default;
  filter: none;
}

.absent-button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #b92a2a;
  border-radius: 6px;
  background: #ffe5e2;
  color: #7b0920;
  text-decoration: none;
}

.absent-button:hover {
  filter: brightness(1.03);
}

.absent-button:disabled {
  border-color: #d7c8be;
  background: #eee3dc;
  color: #77675f;
  cursor: default;
  filter: none;
}

.whatsapp-button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #1f9d55;
  background: #25d366;
  color: #062d18;
  text-decoration: none;
}

.whatsapp-button:hover {
  text-decoration: none;
  filter: brightness(1.04);
}

.whatsapp-button.is-sent {
  border-color: #c79b3f;
  background: #fff1dd;
  color: #6b3f00;
}

.whatsapp-button.is-sent:hover {
  background: #f5dfaf;
}

.whatsapp-button.is-disabled,
.whatsapp-button:disabled {
  border-color: #d7c8be;
  background: #eee3dc;
  color: #77675f;
  cursor: default;
  filter: none;
}

.call-button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: #3c2200;
  text-decoration: none;
}

.call-button:hover {
  text-decoration: none;
  filter: brightness(1.03);
}

.edit-button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #6d82a8;
  border-radius: 6px;
  background: #eef3ff;
  color: #233d70;
  text-decoration: none;
}

.edit-button:hover {
  filter: brightness(1.03);
}

.sent-note {
  color: #116b3a !important;
  font-weight: 700;
}

.language-note {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid #e6c98d;
  border-radius: 999px;
  background: #fff7e8;
  color: #6b3f00 !important;
  font-size: 12px;
  font-weight: 800;
}

.present-note {
  color: #07542b !important;
  font-weight: 800;
}

.absent-note {
  color: #7b0920 !important;
  font-weight: 800;
}

.reservation-list {
  display: grid;
  gap: 10px;
}

.reservation-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}

.reservation-time {
  color: var(--red);
  font-size: 24px;
  font-weight: 800;
}

.reservation-details {
  display: grid;
  gap: 3px;
}

.reservation-details span,
.reservation-details a {
  color: var(--muted);
}

.reservation-comment {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff1dd;
  color: #7b0920 !important;
}

.date-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 12, 16, 0.72);
}

.date-popup-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(86vh, 760px);
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: white;
  box-shadow: 0 28px 80px rgba(63, 15, 24, 0.28);
}

.date-popup-card img {
  display: block;
  width: 100%;
  max-height: min(74vh, 660px);
  object-fit: contain;
  background: white;
}

.date-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 38px;
  height: 38px;
  border: 1px solid #efc7bf;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.date-popup-action {
  display: block;
  width: calc(100% - 32px);
  min-height: 48px;
  margin: 0 16px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.date-popup-action:hover {
  filter: brightness(1.05);
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 12, 16, 0.68);
}

.edit-modal-card {
  width: min(720px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  box-shadow: 0 28px 80px rgba(63, 15, 24, 0.28);
}

.edit-modal-title {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 56px 18px 22px;
  border-bottom: 1px solid var(--line);
}

.edit-modal-title h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(24px, 4vw, 34px);
}

.edit-modal-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px;
}

.edit-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--red);
  font-weight: 800;
}

.edit-form-grid input,
.edit-form-grid select,
.edit-form-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e9cfc5;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.edit-form-grid textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.edit-form-grid input:focus,
.edit-form-grid select:focus,
.edit-form-grid textarea:focus {
  outline: 3px solid rgba(214, 167, 76, 0.26);
  border-color: var(--gold);
}

.edit-form-wide {
  grid-column: 1 / -1;
}

.edit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 22px;
}

.edit-modal-actions .primary-button {
  width: auto;
  min-width: 160px;
  margin: 0;
  padding: 0 18px;
}

.empty-state {
  padding: 32px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.all-reservations-page .stat-card {
  display: grid;
  align-content: center;
  gap: 8px;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: 1fr 240px 170px;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow);
}

.dashboard-toolbar div {
  display: grid;
  gap: 7px;
}

.dashboard-toolbar label {
  color: var(--red);
  font-weight: 800;
}

.dashboard-toolbar input,
.dashboard-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e9cfc5;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.dashboard-toolbar input:focus,
.dashboard-toolbar select:focus {
  outline: 3px solid rgba(214, 167, 76, 0.26);
  border-color: var(--gold);
}

.dashboard-stats {
  grid-template-columns: repeat(6, 1fr);
}

.dashboard-stats .stat-card {
  min-height: 118px;
}

.dashboard-stats .stat-card strong {
  font-size: clamp(24px, 3vw, 36px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-panel {
  min-width: 0;
}

.compact-list .reservation-item {
  grid-template-columns: 84px 1fr auto;
  padding: 12px;
}

.dashboard-reservation .reservation-time {
  display: grid;
  gap: 4px;
}

.dashboard-reservation .reservation-time span {
  color: var(--red);
  font-size: 24px;
  font-weight: 900;
}

.dashboard-reservation .reservation-time small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.top-clients-list {
  display: grid;
  gap: 10px;
}

.top-client-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.top-client-item:hover {
  border-color: var(--gold);
  background: #fff1dd;
}

.top-client-item strong {
  color: var(--red);
}

.top-client-item span,
.top-client-item small {
  color: var(--muted);
}

.all-reservations-table {
  display: grid;
  min-width: 920px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.all-reservations-head,
.all-reservations-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.3fr 0.7fr 1.1fr 1.3fr 1.3fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.all-reservations-head {
  background: #fff1dd;
  color: var(--red);
  font-weight: 800;
}

.all-reservations-row {
  border-top: 1px solid var(--line);
  background: #fffaf7;
  color: var(--ink);
}

.all-reservations-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.all-reservations-page .reservation-list {
  overflow-x: auto;
}

@media (max-width: 700px) {
  .page {
    padding-top: 22px;
  }

  .logo {
    width: 150px;
    height: 150px;
  }

  .people-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-row,
  .admin-toolbar,
  .dashboard-toolbar,
  .dashboard-grid,
  .stats-grid,
  .dashboard-stats,
  .admin-header,
  .reservation-item {
    grid-template-columns: 1fr;
  }

  .admin-kicker,
  .back-link {
    justify-self: center;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .edit-form-grid {
    grid-template-columns: 1fr;
  }

  .edit-modal-actions {
    display: grid;
  }

  .edit-modal-actions .primary-button,
  .edit-modal-actions .ghost-button {
    width: 100%;
  }

  .reservation-actions,
  .delete-button,
  .edit-button,
  .whatsapp-button,
  .present-button,
  .absent-button,
  .call-button {
    width: 100%;
  }

  .reservation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
