:root {
  --deep-navy: #173f95;
  --teal: #2f7f74;
  --luxury-red: #9d3d2b;
  --warm-gold: #c99749;
  --ink: #1d2430;
  --fog: #f7f4ee;
  --paper: #ffffff;
  --panel: #ffffff;
  --panel-border: #dfe4ee;
  --panel-shadow: 0 12px 30px rgba(23, 63, 149, 0.08);
  --page-bg: linear-gradient(160deg, #f8f6f1 0%, #eef2f8 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font-family: "Segoe UI Variable", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto;
  height: 380px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 20%, rgba(47, 127, 116, 0.12), transparent 52%),
    radial-gradient(circle at 82% 25%, rgba(23, 63, 149, 0.14), transparent 56%);
  filter: blur(1px);
}

.app-header {
  background: linear-gradient(120deg, var(--deep-navy), #0f326f 58%, #0a1f44);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 4px solid var(--warm-gold);
  box-shadow: 0 10px 24px rgba(10, 31, 68, 0.08);
}

.brand-block h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
}

.brand-block p {
  margin: 4px 0 0;
  opacity: 0.82;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 80px);
}

.side-panel {
  background: linear-gradient(180deg, #11244f 0%, #0a1835 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  font-size: 0.95rem;
  font-weight: 700;
}

.tab-btn:hover {
  transform: translateX(2px);
  box-shadow: 0 10px 18px rgba(10, 31, 68, 0.18);
}
.tab-btn.active { background: linear-gradient(120deg, var(--teal), #4b9a8f); color: #fff; font-weight: 700; }

.content { padding: 20px; }
.tab-view { display: none; animation: fadeSlide 220ms ease; }
.tab-view.active { display: block; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--panel-shadow);
  border: 1px solid var(--panel-border);
  border-top: 4px solid var(--teal);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(23, 63, 149, 0.16);
}

.card h4 { margin: 0 0 8px; color: #334; }
.card p { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--deep-navy); }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--panel-shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(23, 63, 149, 0.14);
}

.panel h2 {
  margin: 4px 0 12px;
  font-size: 1.1rem;
}

/* Checkbox grid used for selecting featured rooms/menu items */
.multi-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid #e6eef8;
}
.multi-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.actions-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* Keep controls inside actions-row usable on small screens by letting
   the text inputs grow while keeping buttons on a single line. */
.actions-row input[type="search"], .actions-row select {
  flex: 1 1 280px;
  min-width: 140px;
}

.category-chip-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 12px;
}

.category-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}
.category-group-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #213652;
  margin: 0;
}
.category-group-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.parent-chip {
  border: 1px solid #c9d6ea;
  background: #eef4ff;
  color: #214fa8;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.parent-chip:hover { background: #e1ebff; }
.parent-chip.active { background: linear-gradient(120deg, var(--deep-navy), #214fa8); color: #fff; border-color: #1f4a9d; }

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid #c9d6ea;
  background: #f5f8fd;
  color: #2f4062;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.filter-chip:hover {
  background: #e9f0fb;
}

.filter-chip.active {
  background: linear-gradient(120deg, var(--deep-navy), #214fa8);
  color: #fff;
  border-color: #1f4a9d;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  border: 1px solid #c6d0df;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

textarea { min-height: 76px; resize: vertical; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #e5e9ef;
  text-align: left;
  padding: 9px;
  font-size: 0.92rem;
}

th {
  color: #32415f;
  background: #f9fbff;
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status.confirmed { background: rgba(26, 188, 156, 0.18); color: #0c6050; }
.status.pending { background: rgba(212, 175, 55, 0.2); color: #715606; }
.status.cancelled, .status.failed { background: rgba(139, 0, 0, 0.15); color: #7d0909; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: 0 8px 18px rgba(23, 63, 149, 0.08);
  position: relative;
  overflow: hidden;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 0.96; }
.btn.primary { background: linear-gradient(120deg, var(--deep-navy), #214fa8); color: #fff; }
.btn.teal { background: linear-gradient(120deg, var(--teal), #4b9a8f); color: #fff; }
.btn.gold { background: linear-gradient(120deg, var(--warm-gold), #ddb86b); color: #2f2200; }
.btn.danger { background: linear-gradient(120deg, var(--luxury-red), #b24a38); color: #fff; }
.btn.full { width: 100%; }

.btn:focus-visible,
.tab-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 127, 116, 0.25);
  outline-offset: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.summary-item {
  background: #f7fafe;
  border: 1px solid #d8e4f7;
  padding: 9px;
  border-radius: 10px;
}

.summary-item strong { display: block; font-size: 0.78rem; color: #4f5f7e; }

/* Homepage editor layout and typography overrides */
.homepage-preview-grid .homepage-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.homepage-preview-grid .homepage-announcement-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.homepage-preview-grid .homepage-announcement-card textarea {
  width: 100%;
  min-height: 300px;
  flex: 1 1 auto;
}

.homepage-preview-grid .homepage-editor-grid .card .hint {
  margin-top: 8px;
  color: #000;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 30, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 10;
}

.modal.open { display: flex; }

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: 0 26px 60px rgba(10, 31, 68, 0.24);
}

/* Form Validation Styles */
.form-field-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field-wrapper input,
.form-field-wrapper textarea,
.form-field-wrapper select {
  font: inherit;
}

.form-field-wrapper input.form-error,
.form-field-wrapper textarea.form-error,
.form-field-wrapper select.form-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

.form-error-message {
  display: none;
  font-size: 0.85rem;
  color: #dc2626;
  font-weight: 500;
  padding: 4px 8px;
  background-color: #fee2e2;
  border-radius: 6px;
  margin-top: 2px;
}

.form-error-message.show {
  display: block;
  animation: slideIn 200ms ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-success-message {
  display: none;
  font-size: 0.85rem;
  color: #16a34a;
  font-weight: 500;
  padding: 4px 8px;
  background-color: #f0fdf4;
  border-radius: 6px;
  margin-top: 2px;
}

.form-success-message.show {
  display: block;
  animation: slideIn 200ms ease-out;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #0f234a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
  z-index: 15;
}

.toast.show { display: block; }

.fx-reveal {
  opacity: 0;
  transform: translateY(8px) scale(0.995);
}

.fx-reveal.fx-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 380ms ease, transform 380ms ease;
  transition-delay: var(--fx-delay, 0ms);
}

.fx-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  animation: rippleGrow 620ms ease-out forwards;
}

@keyframes rippleGrow {
  to {
    transform: translate(-50%, -50%) scale(16);
    opacity: 0;
  }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side-panel {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
  }
  .tab-btn { min-width: 130px; }

  .homepage-preview-grid .homepage-editor-grid {
    grid-template-columns: 1fr;
  }

  .homepage-preview-grid .homepage-announcement-card {
    grid-column: auto;
  }
}

@media (max-width: 1400px) {
  .homepage-preview-grid {
    grid-template-columns: 1fr;
  }

  .homepage-editor-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .homepage-featured-services-card,
  .homepage-featured-menu-card,
  .homepage-featured-rooms-card,
  .homepage-announcement-card {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-view,
  .btn,
  .card,
  .panel,
  .fx-reveal,
  .fx-reveal.fx-visible {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

.adminx-shell {
  display: grid;
  /* Single-column shell now that the left rail was removed. This lets the
     dashboard cards and charts fill the available width instead of being
     pushed into a narrow column. */
  grid-template-columns: 1fr;
  gap: 14px;
}

.adminx-left-rail {
  display: grid;
  gap: 12px;
  align-content: start;
}

.adminx-rail-card {
  background: #f7fbff;
  border: 1px solid #d9e5f5;
  border-radius: 14px;
  padding: 12px;
}

.adminx-rail-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #1b3360;
}

.adminx-rail-card p {
  margin: 6px 0 10px;
  color: #607192;
  font-size: 0.82rem;
}

.adminx-signal-list {
  display: grid;
  gap: 8px;
}

.adminx-signal-item {
  background: #fff;
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  padding: 8px;
}

.adminx-signal-item strong {
  display: block;
  font-size: 0.84rem;
  color: #1c2f52;
}

.adminx-signal-item small {
  display: block;
  color: #5e6f8d;
  font-size: 0.75rem;
  margin-top: 2px;
}

.adminx-energy-card p {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0a8c69;
}

.adminx-energy-card small {
  color: #51627f;
  font-size: 0.76rem;
}

.adminx-main {
  display: grid;
  gap: 12px;
}

.adminx-status-row {
  margin-bottom: 0;
}

.adminx-top-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.adminx-top-strip .card {
  border-top: 3px solid #2c4ea5;
  padding: 10px 12px;
  min-height: 86px;
}

.adminx-top-strip .card h4 {
  font-size: 0.74rem;
  color: #667697;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.adminx-top-strip .card p {
  font-size: 1.35rem;
  margin: 0;
}

.adminx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.adminx-card {
  grid-column: span 4;
  background: #fff;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(20, 47, 99, 0.07);
}

.adminx-card-lg {
  grid-column: span 8;
}

.adminx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.adminx-card-head h2 {
  margin: 0;
  font-size: 0.96rem;
  color: #20365f;
}

.adminx-pill {
  border: 1px solid #c8d7ed;
  background: #edf4ff;
  color: #285198;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.adminx-card table th,
.adminx-card table td {
  font-size: 0.82rem;
  padding: 7px;
}

.adminx-split-wrap {
  display: grid;
  gap: 8px;
}

.adminx-split-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #32496f;
  font-size: 0.83rem;
}

.adminx-split-row strong {
  color: #173f95;
  font-size: 0.95rem;
}

.adminx-progress {
  height: 10px;
  border-radius: 999px;
  background: #e6edf7;
  overflow: hidden;
}

.adminx-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #1d4ed8);
  transition: width 220ms ease;
}

@media (max-width: 1200px) {
  .adminx-shell {
    grid-template-columns: 1fr;
  }

  .adminx-left-rail {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 860px) {
  .adminx-card,
  .adminx-card-lg {
    grid-column: span 12;
  }
}
