/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: var(--space-2);
  min-height: var(--button-height);
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover {
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(249, 178, 51, 0.55);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(249, 178, 51, 0.16), 0 0 22px rgba(249, 178, 51, 0.42);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-purple) 100%);
  color: #fff;
  box-shadow: var(--button-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-brand-accent) 0%, var(--color-purple) 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(249, 178, 51, 0.2), 0 0 24px rgba(249, 178, 51, 0.55), var(--button-shadow-hover);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-purple-soft);
  border-color: rgba(84, 32, 111, 0.28);
  color: var(--color-purple-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(130, 76, 177, 0.14), 0 0 20px rgba(130, 76, 177, 0.32), var(--shadow-sm);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #912018;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15), 0 0 18px rgba(180, 35, 24, 0.38), var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(84, 32, 111, 0.08);
  color: var(--color-ink);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(249, 178, 51, 0.2);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
}

.btn-icon svg,
.btn-icon i {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.btn-sm {
  min-height: var(--button-height-sm);
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-grid {
  display: grid;
  gap: var(--space-5);
}

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

@media (min-width: 720px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid .full-width {
    grid-column: 1 / -1;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-ink);
}

.form-label .required {
  color: var(--color-brand);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-ink-muted);
}

.price-summary {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafb;
}

.price-summary-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ink);
}

.price-summary-total {
  font-size: var(--text-base);
  color: var(--color-brand);
}

/* Invoice document (view / print) */
.invoice-document {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  color: var(--color-ink);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.invoice-document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 150px;
  padding: 24px 34px 36px;
  color: #fff;
  background: var(--color-purple);
  border-radius: 0 0 45% 5% / 0 0 18% 10%;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-document-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.invoice-document-logo {
  width: auto;
  height: 56px;
  max-width: 150px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border-radius: 4px;
}

.invoice-document-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.invoice-document-system {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.86);
}

.invoice-document-meta {
  text-align: right;
}

.invoice-document-meta h1 {
  margin: 0 0 0.35rem;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #fff;
}

.invoice-document-number {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.invoice-document-date,
.invoice-document-ref {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 8px 12px 20px;
}

.invoice-party h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  color: #555;
}

.invoice-party p {
  margin: 0.15rem 0;
  color: #686868;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.invoice-party .invoice-party-name {
  font-weight: 600;
  color: #3f3f3f;
}

.invoice-party-from {
  text-align: right;
}

.invoice-document-section {
  margin: 0 12px 20px;
}

.invoice-document-section h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink-muted);
}

.invoice-document-section > h2,
.invoice-document-note h2,
.invoice-document-payment h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #555;
}

.invoice-stay-details {
  padding: 12px;
  background: #f5f7f8;
  border-left: 4px solid var(--color-purple);
}

.invoice-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 0;
}

.invoice-detail-row {
  display: contents;
}

.invoice-detail-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-ink-muted);
}

.invoice-detail-row dd {
  margin: 0;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.invoice-charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.invoice-charges-table th,
.invoice-charges-table td {
  padding: 0.62rem 0.7rem;
  border: 1px solid #b9b9b9;
  text-align: left;
}

.invoice-charges-table th {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-purple);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-charges-table th:nth-child(n+2),
.invoice-charges-table td:nth-child(n+2) {
  text-align: right;
}

.invoice-item-detail {
  display: block;
  margin-top: 3px;
  color: #707070;
  font-size: 0.72rem;
}

.invoice-document-totals {
  width: min(360px, 58%);
  margin: 12px 0 0 auto;
}

.invoice-document-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border: 1px solid #b9b9b9;
  border-bottom: 0;
  font-size: 0.84rem;
}

.invoice-document-totals > div:last-child {
  border-bottom: 1px solid #b9b9b9;
}

.invoice-document-totals .invoice-document-grand-total {
  color: #fff;
  background: var(--color-purple);
  border-color: var(--color-purple);
  font-size: 0.95rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-document-total {
  font-size: var(--text-lg);
  color: var(--color-brand);
}

.invoice-document-payment {
  min-width: 0;
}

.invoice-document-note {
  min-width: 0;
}

.invoice-document-note p,
.invoice-document-payment p {
  margin: 0 0 5px;
  color: #686868;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.invoice-document-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 0 12px 14px;
  padding-top: 12px;
  border-top: 1px solid #d3d3d3;
}

.invoice-document-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 0;
  color: var(--color-purple-dark);
}

.invoice-document-footer strong {
  font-size: 1.4rem;
  font-weight: 400;
}

.invoice-document-footer span {
  color: #68737a;
  font-size: 0.68rem;
}

.invoice-document-stamp {
  display: block;
  width: 145px;
  max-width: 28%;
  height: auto;
  object-fit: contain;
}

.invoice-document-receipt .invoice-document-header,
.invoice-document-receipt .invoice-charges-table th,
.invoice-document-receipt .invoice-document-totals .invoice-document-grand-total {
  background-color: var(--color-purple);
}

.invoice-document-receipt .invoice-stay-details {
  border-left-color: var(--color-purple);
}

.invoice-document-receipt .invoice-document-header {
  border-radius: 16px 16px 0 0;
  min-height: 130px;
}

.table-row-clickable {
  cursor: pointer;
}

.table-row-clickable:hover {
  background: #f8fafb;
}

@media (max-width: 640px) {
  .invoice-detail-list {
    grid-template-columns: 1fr;
  }

  .invoice-document-meta {
    width: 100%;
    text-align: left;
  }

  .invoice-document-header {
    flex-wrap: wrap;
    padding: 22px 20px 30px;
  }

  .invoice-document-meta h1 {
    font-size: 1.5rem;
  }

  .invoice-parties,
  .invoice-document-bottom {
    grid-template-columns: 1fr;
  }

  .invoice-party-from {
    text-align: left;
  }

  .invoice-document-totals {
    width: 100%;
  }

  .invoice-charges-table th,
  .invoice-charges-table td {
    padding: 0.45rem 0.35rem;
  }

  .invoice-document-footer {
    align-items: center;
    flex-wrap: wrap;
  }

  .invoice-document-footer span {
    flex: 1 1 100%;
  }

  .invoice-document-stamp {
    width: 125px;
    max-width: 40%;
  }
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:hover {
  border-color: #b8c4cd;
}

.form-control:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(232, 117, 24, 0.16);
  outline: none;
}

.form-control.is-invalid {
  border-color: var(--color-danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  min-height: 1em;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.form-check input {
  margin-top: 0.3rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-brand);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Panels / surfaces used for interactive forms */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.panel-header {
  margin-bottom: var(--space-6);
}

.panel-header h2,
.panel-header h1 {
  margin-bottom: var(--space-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-pending {
  background: var(--color-warning-soft);
  color: var(--status-pending);
}

.badge-approved {
  background: var(--color-info-soft);
  color: var(--status-approved);
}

.badge-rejected {
  background: var(--color-danger-soft);
  color: var(--status-rejected);
}

.badge-cancellation {
  background: #ffedd5;
  color: var(--status-cancellation);
}

.badge-cancelled {
  background: #f2f4f7;
  color: var(--status-cancelled);
}

.badge-checked-in {
  background: var(--color-success-soft);
  color: var(--status-checked-in);
}

.badge-checked-out {
  background: #eef2f6;
  color: var(--status-checked-out);
}

.badge-available {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-occupied {
  background: var(--color-info-soft);
  color: var(--color-info);
}

.badge-maintenance {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 640px;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table th {
  background: var(--color-surface-muted);
  font-weight: 650;
  color: var(--color-ink);
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: var(--color-brand-soft);
  transition: background var(--transition);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown-trigger {
  cursor: pointer;
  list-style: none;
}

.action-dropdown-trigger::-webkit-details-marker {
  display: none;
}

.action-dropdown-trigger::after {
  margin-left: var(--space-2);
  content: '\25BE';
}

.action-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-1));
  right: 0;
  display: grid;
  min-width: 12rem;
  max-height: min(70vh, 24rem);
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--elevation-floating);
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action-dropdown-item:hover,
.action-dropdown-item:focus-visible {
  background: var(--color-purple-soft);
  color: var(--color-purple-dark);
  text-decoration: none;
}

.action-dropdown-item-danger {
  color: var(--color-danger);
}

.action-dropdown-item-danger:hover,
.action-dropdown-item-danger:focus-visible {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.action-dropdown-check {
  gap: var(--space-2);
}

.action-dropdown-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.action-dropdown[open] {
  z-index: 20;
}

/* Toast */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  animation: toast-in 180ms ease;
}

.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-danger);
}

.toast-info {
  border-left: 4px solid var(--color-info);
}

.toast-message {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-ink);
  margin: 0;
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-ink-muted);
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 33, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1500;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.modal-lg {
  width: min(720px, 100%);
}

.modal-header,
.modal-footer {
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-header {
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  border-top: 1px solid var(--color-border);
  justify-content: flex-end;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--color-ink-muted);
  line-height: 1;
  padding: var(--space-1);
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 51, 0.28);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.admin-main {
  position: relative;
}

.admin-main > .loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
}

.modal-backdrop,
.admin-sidebar.is-open {
  z-index: 1500;
}

.loading-overlay[hidden] {
  display: none;
}

@media (min-width: 960px) {
  .admin-main > .loading-overlay {
    left: 0;
  }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-inline {
  width: 16px;
  height: 16px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 190px;
  min-height: 190px;
  justify-content: center;
  padding: var(--space-6);
  border: 2px solid var(--color-brand);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 234, 250, 0.96));
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  overflow: hidden;
  animation: loading-card-colors 3.5s ease-in-out infinite;
}

.loading-orbit {
  position: relative;
  width: 66px;
  height: 66px;
  border: 3px solid var(--color-purple);
  border-top-color: var(--color-brand);
  border-right-color: var(--color-brand-accent);
  border-radius: 50%;
  animation: loading-orbit-spin 1.2s linear infinite;
}

.loading-orbit::before,
.loading-orbit::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid var(--color-brand);
  border-left-color: transparent;
  border-radius: 50%;
  opacity: 0.65;
  animation: loading-orbit-spin 2.4s linear reverse infinite;
}

.loading-orbit::after {
  inset: -17px;
  border-color: var(--color-purple);
  border-bottom-color: transparent;
  opacity: 0.35;
  animation-duration: 3.2s;
}

.loading-core {
  position: absolute;
  inset: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}

.loading-orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-brand-accent);
}

.loading-orbit-dot:nth-child(1) { top: -4px; left: 28px; }
.loading-orbit-dot:nth-child(2) { right: 0; bottom: 9px; }
.loading-orbit-dot:nth-child(3) { bottom: 2px; left: 10px; }

.loading-title {
  color: var(--color-purple-dark);
  letter-spacing: 0.12em;
}

@keyframes loading-orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-card-colors {
  0%, 100% {
    border-color: var(--color-brand);
    box-shadow: 0 18px 50px rgba(232, 114, 30, 0.22);
  }
  50% {
    border-color: var(--color-purple);
    box-shadow: 0 18px 50px rgba(84, 32, 111, 0.24);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .loading-card,
  .loading-orbit,
  .loading-orbit::before,
  .loading-orbit::after {
    transition: none;
    animation: none;
  }
}

.empty-state {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--color-ink-muted);
}

.empty-state h3 {
  color: var(--color-ink);
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

/* Shared responsive and premium component layer. */
.btn,
button,
[role="button"] {
  min-height: var(--button-height);
}

.badge {
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 27, 0.05);
}

.badge::before {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.skeleton {
  display: block;
  min-height: 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-neutral-200) 25%, var(--color-neutral-50) 50%, var(--color-neutral-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-row {
  height: 3.25rem;
  margin-bottom: var(--space-2);
}

@keyframes skeleton-shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 959px) {
  .admin-topbar .admin-menu-toggle {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 5.25rem;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(189, 123, 255, 0.5);
    border-radius: 0.8rem;
    background: linear-gradient(135deg, #6f35a6, #351b52);
    color: #fff;
    box-shadow: 0 0 18px rgba(156, 77, 235, 0.2);
    font-weight: 700;
  }

  .admin-topbar .admin-menu-toggle::before,
  .admin-topbar .admin-menu-toggle::after {
    display: block;
    width: 18px;
    height: 2px;
    flex: 0 0 18px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .admin-topbar .admin-menu-toggle::before {
    box-shadow: 0 -6px currentColor, 0 6px currentColor;
  }

  .admin-topbar .admin-menu-toggle[aria-expanded="true"]::before {
    transform: rotate(45deg);
    box-shadow: none;
  }

  .admin-topbar .admin-menu-toggle[aria-expanded="true"]::after {
    position: absolute;
    transform: rotate(-45deg);
  }

  .admin-topbar .admin-menu-toggle:hover:not(:disabled) {
    border-color: #dfb8ff;
    background: linear-gradient(135deg, #8249bc, #452264);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(189, 123, 255, 0.16), 0 0 24px rgba(156, 77, 235, 0.35);
    transform: translateY(-1px);
  }
}

@media (max-width: 767px) {
  .admin-content {
    min-width: 0;
    padding: var(--space-4) var(--space-3) 5.5rem;
  }

  .admin-topbar {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .admin-topbar > h1 {
    min-width: 0;
    flex: 1 1 8rem;
    font-size: clamp(1rem, 5vw, var(--text-lg)) !important;
    overflow-wrap: anywhere;
  }

  .admin-content .toolbar {
    align-items: stretch;
  }

  .admin-content .toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  .admin-content .toolbar > .btn {
    margin-left: 0 !important;
  }

  .admin-content .toolbar .form-group,
  .admin-content .toolbar .form-group.search {
    min-width: min(100%, 12rem);
  }

  .admin-content {
    padding-bottom: 5.5rem;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .table-wrap .table {
    display: block;
    min-width: 0;
  }

  .table-wrap .table thead {
    display: none;
  }

  .table-wrap .table tbody,
  .table-wrap .table tr,
  .table-wrap .table td {
    display: block;
  }

  .table-wrap .table tr {
    position: relative;
    margin-bottom: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--elevation-raised);
  }

  .table-wrap .table td {
    min-height: 2.25rem;
    padding: 0.4rem 0 0.4rem 7rem;
    border: 0;
    overflow-wrap: anywhere;
  }

  .table-wrap .table td::before {
    float: left;
    width: 6.25rem;
    margin-left: -7rem;
    color: var(--color-neutral-500);
    content: attr(data-label);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .action-dropdown-menu {
    min-width: min(12rem, calc(100vw - 2.5rem));
    max-width: calc(100vw - 2.5rem);
  }

  .action-dropdown-item {
    min-height: 44px;
  }

  .table-wrap .action-dropdown-menu {
    right: 0;
    left: auto;
  }

  .booking-progress {
    gap: var(--space-1);
  }

  .booking-progress li {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-1);
  }

  .table-wrap .table td[colspan] {
    padding: var(--space-4);
  }

  .table-wrap .table td[colspan]::before {
    display: none;
  }

  .table-actions,
  .button-group {
    gap: var(--space-2);
  }

  .table-actions .btn,
  .button-group .btn {
    min-width: 44px;
    min-height: 44px;
  }

  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: var(--space-6) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-neutral-200);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -8px 20px rgba(23, 32, 27, 0.08);
    backdrop-filter: blur(10px);
  }

  .form-actions .btn {
    flex: 1 1 0;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

.pagination-controls {
  display: flex;
  gap: var(--space-2);
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-5);
}

.toolbar .form-group {
  min-width: 160px;
  flex: 1;
}

.toolbar .form-group.search {
  flex: 2;
  min-width: 200px;
}

/* Alert boxes */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-info {
  background: var(--color-info-soft);
  border-color: #b2ccf6;
  color: #1849a9;
}

.alert-success {
  background: var(--color-success-soft);
  border-color: #a6d9c0;
  color: var(--color-success);
}

.alert-warning {
  background: var(--color-warning-soft);
  border-color: #f5d78e;
  color: var(--color-warning);
}

.alert-danger {
  background: var(--color-danger-soft);
  border-color: #f2b8b5;
  color: var(--color-danger);
}

.reference-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-brand-soft);
  border: 1px dashed var(--color-brand);
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
}

.reference-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-brand-dark);
  word-break: break-all;
}

.detail-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

.detail-list dt {
  font-size: var(--text-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink-muted);
  margin: 0;
}

.detail-list dd {
  margin: var(--space-1) 0 0;
  font-weight: 600;
  color: var(--color-ink);
}

@media (min-width: 560px) {
  .detail-list {
    grid-template-columns: 1fr 1fr;
  }
}
