:root {
  --bg: #faf8f4;
  --panel: #fffdf9;
  --line: #ebe3d8;
  --ink: #191714;
  --muted: #70695f;
  --gold: #a98245;
  --gold-dark: #7c5d2f;
  --black: #10120f;
  --green: #dff1df;
  --blue: #e3f0fb;
  --amber: #fbebc9;
  --red: #f7dddd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px 13px;
  color: var(--ink);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 650;
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--black);
  color: #f7efe3;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-transform: uppercase;
  color: #d6b77a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  padding-bottom: 22px;
}

.brand span {
  font-family: Georgia, serif;
  font-size: 32px;
  letter-spacing: 7px;
}

.brand small {
  font-family: Georgia, serif;
  letter-spacing: 5px;
  font-size: 14px;
}

.brand em {
  color: #e9dec9;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 12px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav a,
.logout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 6px;
  color: #f5efe6;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover {
  background: rgba(169, 130, 69, 0.25);
}

.nav-icon {
  color: #d4ad6d;
  width: 22px;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
}

.hotel-mark {
  text-align: center;
  font-family: Georgia, serif;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #f8f3eb;
}

.hotel-mark small {
  display: block;
  margin-top: 8px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 2px;
}

.hotel-mark.mantra {
  font-family: Arial, sans-serif;
  text-transform: lowercase;
  letter-spacing: 0;
  font-size: 30px;
}

.main {
  padding: 36px 42px 56px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 6px;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  margin: 0;
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 24px;
}

h3 {
  margin-top: 24px;
  font-size: 18px;
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 28px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.notification-menu {
  position: relative;
}

.notification-bell {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}

.notification-bell b {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #9b2c2c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  width: min(360px, calc(100vw - 32px));
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 38px rgba(16, 18, 15, 0.16);
  padding: 14px;
}

.notification-popover[hidden] {
  display: none;
}

.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.notification-popover-head span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 16px;
  cursor: pointer;
  min-height: 42px;
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.button.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.user-pill {
  color: var(--muted);
  font-size: 13px;
}

.panel,
.metric-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  padding: 22px;
  margin-bottom: 22px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.metric-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.metric-card strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 40px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
}

.metric-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-dark);
  background: #f2eadf;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
}

.table-wrap {
  overflow-x: auto;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 650;
}

.badge {
  background: #eef2f3;
  color: #45616b;
}

.status.new-enquiry {
  background: var(--blue);
  color: #356384;
}

.status.pending {
  background: var(--amber);
  color: #8a631e;
}

.status.rate-submitted {
  background: var(--green);
  color: #3d7342;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 8px;
  background: #eef2f3;
  color: #45616b;
  font-size: 12px;
  font-weight: 650;
}

.timer-badge.warning {
  background: #fff3df;
  color: #946015;
}

.timer-badge.overdue {
  background: #fff1f1;
  color: #9b2c2c;
}

.reminder-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-top: 14px;
  background: #fffaf1;
}

.reminder-card.soon {
  background: #fff3df;
  border-color: #e5a34a;
}

.reminder-card.urgent {
  background: #fff1f1;
  border-color: #e05c5c;
}

.reminder-card.soon b {
  color: #946015;
}

.reminder-card.urgent b {
  color: #9b2c2c;
}

.reminder-card span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.notification-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  margin-top: 12px;
  background: #fff;
}

.notification-card:hover {
  border-color: var(--gold);
}

.notification-card span,
.notification-card small {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(130px, 1fr)) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.reminder-form [hidden] {
  display: none;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs a {
  padding: 10px 13px;
  border-radius: 6px;
  color: var(--muted);
}

.tabs a.active {
  background: #f0e8dc;
  color: var(--ink);
}

.tabs b {
  margin-left: 4px;
  color: var(--gold-dark);
}

.month-filter {
  display: flex;
  gap: 10px;
  align-items: center;
}

.month-filter select {
  min-width: 180px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.report-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.report-summary strong {
  font-family: Georgia, serif;
  font-size: 28px;
}

.pagination,
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.pagination span {
  margin-right: auto;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 20px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin: 22px 0;
}

.subpanel h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 16px;
}

legend {
  font-weight: 650;
}

.radio {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin-right: 18px;
  font-weight: 500;
}

.radio input {
  width: auto;
}

.commission-rate {
  margin-top: 14px;
}

.stay-rows {
  display: grid;
  gap: 10px;
}

.more-details-field {
  margin-top: 16px;
}

.stay-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.stay-head {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
}

.alert {
  background: #fff1f1;
  border: 1px solid #efbaba;
  color: #8b3434;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.field-error {
  color: #8b3434;
  font-size: 13px;
  font-weight: 600;
}

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

.summary-card {
  padding: 18px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
}

.detail-list {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 13px 20px;
  margin: 0;
}

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

.detail-list dd {
  margin: 0;
  font-weight: 600;
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attachment-list a {
  color: var(--gold-dark);
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.status-form select {
  width: auto;
  min-width: 150px;
}

.rate-input {
  max-width: 140px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline div {
  border-left: 3px solid var(--gold);
  padding-left: 14px;
}

.timeline span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.chat-panel {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  margin: 18px 0;
}

.chat-messages article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.chat-messages article.mine {
  background: #f5eadb;
}

.chat-messages p {
  margin: 8px 0;
}

.chat-messages span {
  color: var(--muted);
  font-size: 12px;
}

.chat-form {
  display: grid;
  gap: 10px;
}

.confirmed-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.reminder-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  display: grid;
  gap: 18px;
}

.login-brand {
  border-bottom: 0;
  padding-bottom: 0;
}

.login-brand span,
.login-brand small {
  color: var(--gold-dark);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-spacer,
  .hotel-mark {
    display: none;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    position: static;
    height: auto;
  }

  .metric-grid,
  .summary-grid,
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main {
    padding: 24px 16px 36px;
  }

  .topbar,
  .panel-head,
  .inline-form,
  .confirmed-tools {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .top-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 30px;
  }

  .metric-grid,
  .summary-grid,
  .report-summary,
  .form-grid.two,
  .filters,
  .stay-row,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .month-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }
}
