:root {
  color-scheme: light;
  --page: #f5f2fb;
  --page-deep: #fbfaff;
  --canvas: #fbfaff;
  --surface: #ffffff;
  --surface-soft: #f8f6ff;
  --ink: #241a38;
  --muted: #8b849b;
  --line: #eeeaf7;
  --line-strong: #e2dcf1;
  --brand: #7357cf;
  --brand-dark: #5638ae;
  --pink: #ef5da8;
  --green: #35c889;
  --yellow: #ded866;
  --ok: #ebfbf4;
  --ok-ink: #13784b;
  --warn: #fff8d7;
  --warn-ink: #756500;
  --danger: #fff0f6;
  --danger-ink: #b01760;
  --shadow-sm: 0 8px 22px rgba(54, 43, 89, .06);
  --shadow-md: 0 18px 44px rgba(54, 43, 89, .10);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  padding: clamp(10px, 2vw, 22px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--page), var(--page-deep));
  color: var(--ink);
  letter-spacing: 0;
}

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

.app-frame {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  width: min(1240px, 100%);
  min-height: calc(100vh - clamp(20px, 4vw, 44px));
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid rgba(226, 220, 241, .8);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(54, 43, 89, .10);
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  padding: 22px 18px;
  background: rgba(255, 255, 255, .86);
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand {
  gap: 10px;
}

.sidebar-brand span {
  font-size: .98rem;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 760;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(115, 87, 207, .22);
}

.side-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f45da7, #d74493);
  color: #fff;
  box-shadow: 0 16px 28px rgba(239, 93, 168, .24);
}

.side-card strong {
  font-size: .98rem;
}

.side-card span {
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  line-height: 1.35;
}

.workspace {
  min-width: 0;
  background: var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 330px) auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px clamp(18px, 3vw, 28px);
  background: rgba(251, 250, 255, .9);
  border-bottom: 1px solid rgba(238, 234, 247, .86);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: none;
}

.top-search {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}

.top-search::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: auto;
  border: 2px solid #716985;
  border-radius: 50%;
  box-shadow: 5px 5px 0 -3px #716985;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-weight: 760;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.topnav a:hover {
  color: var(--brand-dark);
  background: var(--surface);
  border-color: var(--line);
}

.shell {
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px);
}

.hero,
.admin-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  gap: 18px;
  margin: 0 0 20px;
}

.hero.compact {
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  line-height: 1.04;
}

h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

p {
  color: var(--muted);
}

.search,
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.search:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(115, 87, 207, .68);
  box-shadow: 0 0 0 4px rgba(115, 87, 207, .12);
}

.search {
  max-width: 320px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.hero-tools {
  display: grid;
  gap: 10px;
}

.search.wide {
  max-width: none;
  margin-bottom: 14px;
}

.grid-list,
.stock-list,
.admin-list {
  display: grid;
  gap: 14px;
}

.grid-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hotel-card,
.stock-card,
.admin-row,
.form-card,
.empty,
.stats > div {
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.hotel-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.hotel-card .row-actions {
  align-self: end;
}

.hotel-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--pink);
}

.hotel-card:hover {
  transform: translateY(-2px);
  border-color: #ddd3fa;
  box-shadow: var(--shadow-md);
}

.hotel-name {
  font-size: 1.16rem;
  font-weight: 850;
}

.muted {
  color: var(--muted);
}

.arrow {
  align-self: end;
  color: var(--brand-dark);
  font-weight: 850;
}

.stock-card {
  padding: 16px;
  border-left: 5px solid var(--green);
}

.stock-card.warn {
  border-left-color: var(--yellow);
  background: #fffdf8;
}

.stock-card.danger {
  border-left-color: var(--pink);
  background: #fff9fc;
}

.stock-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .75rem;
  font-weight: 850;
  white-space: nowrap;
}

.status.ok {
  background: var(--ok);
  color: var(--ok-ink);
}

.status.warn {
  background: var(--warn);
  color: var(--warn-ink);
}

.status.danger,
.flash.danger {
  background: var(--danger);
  color: var(--danger-ink);
}

.stock-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.stock-meta div {
  min-width: 0;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

dt {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 760;
}

dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 820;
}

.notes {
  margin: 12px 0 0;
}

.stock-card .row-actions {
  margin-top: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #d8cdf9;
  box-shadow: var(--shadow-sm);
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 24px rgba(115, 87, 207, .24);
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.danger-outline {
  border-color: #f2bfd7;
  color: var(--danger-ink);
}

.back {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brand-dark);
  font-weight: 800;
}

.form-page {
  max-width: 720px;
  margin: 18px auto;
}

.form-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 760;
}

label input,
label textarea,
label select {
  color: var(--ink);
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.admin-row p {
  margin: 5px 0 0;
}

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

.stats > div {
  padding: 18px;
}

.stats strong {
  display: block;
  color: var(--brand-dark);
  font-size: 2rem;
}

.stats span {
  color: var(--muted);
  font-weight: 760;
}

.empty,
.flash {
  padding: 16px;
  margin: 14px 0;
}

.flash.success {
  background: var(--ok);
  color: var(--ok-ink);
}

@media (max-width: 860px) {
  body {
    padding: 0;
    background: var(--canvas);
  }

  .app-frame {
    display: block;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    padding: 12px 14px;
  }

  .mobile-brand {
    display: inline-flex;
    justify-content: center;
  }

  .mobile-brand img {
    width: 58px;
    height: 44px;
  }

  .top-search {
    display: none;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    width: 100%;
    gap: 8px;
  }

  .topnav a {
    min-height: 38px;
    padding: 8px 10px;
    background: #fff;
    border-color: var(--line);
  }

  .shell {
    padding: 14px;
  }

  .hero,
  .admin-head,
  .admin-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .hero-tools {
    grid-template-columns: 1fr;
  }

  .stock-main {
    display: grid;
  }

  .status {
    width: fit-content;
    white-space: normal;
  }

  .actions .button,
  .admin-head .button {
    width: 100%;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    width: 100%;
  }
}

@media (max-width: 360px) {
  .stock-meta {
    grid-template-columns: 1fr;
  }
}
