.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 16.5px;
  font-weight: 700;
}

.panel-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  border: 1px solid var(--line);
}

.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

/* أزرار الشريط العلوي */
.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.icon-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pill-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
  color: var(--ink);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
}

.text-btn:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

/* شريط الأيام */
.days-scroller {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
}

.scroll-arrow {
  width: 32px;
  height: 54px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.scroll-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.days-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 2px 6px;
}

.days-track::-webkit-scrollbar {
  display: none;
}

.day-card {
  flex: 0 0 84px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 9px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.day-card:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.day-card.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.day-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.day-weekday {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 600;
}

.day-card.selected .day-weekday,
.day-card.selected .day-month {
  color: var(--accent-ink);
  opacity: 0.88;
}

.day-number {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.day-month {
  font-size: 11px;
  color: var(--ink-muted);
}

.day-tag {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--bad);
}

/* الأوقات المقسمة صباحاً ومساءً */
.slots-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.slots-meta h3 {
  font-size: 15px;
  font-weight: 700;
}

.slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slot-group-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 8px;
}

.slot-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.slot-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.slot-btn:disabled {
  cursor: not-allowed;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  border-color: var(--line);
  text-decoration: line-through;
  opacity: 0.65;
}

.slot-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
}

.slot-btn.selected .slot-sub {
  color: var(--accent-ink);
  opacity: 0.9;
}

.slots-empty {
  padding: 24px 16px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  font-size: 14px;
}

.slots-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 8px;
}

.slots-skeleton span {
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  animation: pulseSkel 1.2s ease-in-out infinite;
}

.slot-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-muted);
}

.slot-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--line-strong);
}

.swatch-open { background: var(--surface); }
.swatch-selected { background: var(--accent); border-color: var(--accent); }
.swatch-taken { background: var(--surface-subtle); opacity: 0.7; }

/* نموذج البيانات وأزرار سبب الزيارة */
.selected-pill {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.helper-hint {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.req {
  color: var(--bad);
}

.opt {
  font-weight: 400;
  color: var(--ink-muted);
}

.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 10px 12px;
  font-size: 14.5px;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.field input[dir="ltr"] {
  text-align: right;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field [aria-invalid="true"] {
  border-color: var(--bad);
}

.field textarea {
  resize: vertical;
  min-height: 78px;
}

.field-err {
  font-size: 12px;
  color: var(--bad);
  min-height: 16px;
}

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

.reason-chip {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.reason-chip:hover {
  border-color: var(--accent);
}

.reason-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  font-weight: 500 !important;
  color: var(--ink) !important;
  cursor: pointer;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-alert {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
}

.form-actions {
  margin-top: 16px;
}

/* الأزرار الأساسية */
.btn-primary {
  width: 100%;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.14s ease, transform 0.1s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-compact {
  width: auto;
  height: 40px;
  font-size: 13.5px;
  padding: 0 16px;
}

.btn-outline {
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn-danger-outline {
  border-color: var(--bad);
  color: var(--bad);
}

.btn-danger-outline:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

/* بطاقة الملخص الجانبية */
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary-head h3 {
  font-size: 15.5px;
  font-weight: 700;
}

.summary-duration {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.summary-list dt {
  color: var(--ink-muted);
}

.summary-list dd {
  font-weight: 700;
  text-align: end;
}

.summary-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.summary-notes {
  padding-inline-start: 18px;
  color: var(--ink-muted);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* شريط الموبايل السفلي */
.mobile-bar {
  display: none;
}

@media (max-width: 880px) {
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }

  .mobile-bar-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.3;
  }

  .mobile-bar-info span {
    color: var(--accent);
    font-weight: 700;
  }
}

/* تذكرة التأكيد */
.done-wrap {
  padding-top: 10px;
  padding-bottom: 56px;
  flex: 1;
}

.ticket-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.ticket-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.ticket-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ticket-head h2 {
  font-size: 20px;
  font-weight: 800;
}

.ref-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.ref-caption {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ref-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ticket-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.ticket-details dt {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ticket-details dd {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

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

.ticket-actions .btn-primary {
  width: auto;
  flex: 1 1 170px;
  height: 42px;
  font-size: 14px;
}

/* نافذة حجوزاتي */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 19, 21, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-booking-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-booking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* إشعار خفيف */
.toast {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 80;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

@media (max-width: 620px) {
  .panel {
    padding: 16px;
  }

  .field-grid,
  .ticket-details {
    grid-template-columns: 1fr;
  }

  .days-scroller {
    grid-template-columns: 1fr;
  }

  .scroll-arrow {
    display: none;
  }
}
