:root {
  color-scheme: light;
  --ink: #15161b;
  --muted: #667085;
  --soft: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #fffdfa;
  --line: rgba(30, 33, 40, 0.1);
  --gold: #b9873d;
  --gold-2: #d8b56d;
  --deep: #11151d;
  --teal: #1c7870;
  --sage: #8ba38f;
  --rose: #bc7268;
  --sky: #6f91b8;
  --shadow: 0 20px 70px rgba(20, 22, 30, 0.13);
  --shadow-soft: 0 12px 35px rgba(20, 22, 30, 0.09);
  --radius: 8px;
  --sidebar: 280px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(250, 247, 240, 0.94), rgba(238, 242, 241, 0.96)),
    #f7f3ec;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.auth-card {
  width: min(100%, 460px);
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #424751;
  font-size: 0.82rem;
  font-weight: 710;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.auth-message,
.auth-note {
  padding: 12px;
  border: 1px solid rgba(185, 135, 61, 0.22);
  border-radius: 10px;
  color: #71501f;
  background: rgba(216, 181, 109, 0.12);
  line-height: 1.5;
}

.auth-switch {
  justify-self: start;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px;
  color: #f7f2e9;
  background:
    linear-gradient(180deg, rgba(17, 21, 29, 0.98), rgba(22, 27, 38, 0.96)),
    #11151d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 7px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1a1712;
  background: linear-gradient(145deg, var(--gold-2), #f0d994);
  box-shadow: 0 10px 30px rgba(216, 181, 109, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 760;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: rgba(247, 242, 233, 0.62);
  font-size: 0.78rem;
}

.trip-pill {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.trip-pill strong {
  display: block;
  font-size: 0.88rem;
}

.trip-pill span {
  display: block;
  margin-top: 5px;
  color: rgba(247, 242, 233, 0.62);
  font-size: 0.78rem;
}

.account-pill {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.account-pill span {
  color: rgba(247, 242, 233, 0.62);
  font-size: 0.74rem;
}

.account-pill strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button,
.mobile-nav select {
  border: 0;
}

.nav button {
  width: 100%;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  color: rgba(247, 242, 233, 0.72);
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav button:hover,
.nav button.active {
  color: #fff8eb;
  background: rgba(255, 255, 255, 0.09);
}

.nav button.active {
  box-shadow: inset 3px 0 0 var(--gold-2);
}

.nav-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #18130d;
  background: var(--gold-2);
  font-size: 0.72rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  color: rgba(247, 242, 233, 0.7);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  line-height: 1.45;
}

.content {
  min-width: 0;
  padding: 30px clamp(18px, 3vw, 42px) 44px;
}

.mobile-nav {
  display: none;
  margin-bottom: 16px;
}

.mobile-nav select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-solid);
  box-shadow: var(--shadow-soft);
}

.custom-menu {
  position: relative;
  width: 100%;
}

.custom-menu-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid rgba(30, 33, 40, 0.09);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(18, 20, 28, 0.07);
}

.custom-menu-current,
.custom-menu-popover button span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.custom-menu-button > .icon:last-child {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.custom-menu.open .custom-menu-button > .icon:last-child {
  transform: rotate(180deg);
}

.custom-menu-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(30, 33, 40, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 55px rgba(18, 20, 28, 0.14);
  animation: menuFloat 160ms ease both;
}

.custom-menu-popover button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.custom-menu-popover button:hover,
.custom-menu-popover button.active {
  background: rgba(216, 181, 109, 0.13);
}

.custom-menu-popover button strong {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #18130d;
  background: var(--gold-2);
  font-size: 0.72rem;
  text-align: center;
}

@keyframes menuFloat {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.save-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h2,
.page-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.topbar p,
.page-head p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(17, 21, 29, 0.1);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 24px rgba(18, 20, 28, 0.06);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 28px rgba(18, 20, 28, 0.1);
}

.btn.primary {
  color: #fff9ec;
  background: linear-gradient(145deg, #151923, #293140);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn.gold {
  color: #21170b;
  background: linear-gradient(145deg, var(--gold-2), #f0d78e);
  border-color: rgba(185, 135, 61, 0.25);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #8a2d25;
  border-color: rgba(188, 114, 104, 0.34);
  background: rgba(255, 248, 246, 0.9);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.concierge-panel {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 20px;
  padding: clamp(22px, 4vw, 40px);
  color: #fff8ea;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(17, 21, 29, 0.97), rgba(23, 37, 42, 0.86)),
    #121721;
  box-shadow: var(--shadow);
}

.concierge-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 181, 109, 0.65), transparent);
}

.concierge-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.concierge-copy h3 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.concierge-copy p {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 248, 234, 0.72);
  line-height: 1.65;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.trip-art {
  position: relative;
  min-height: 280px;
  align-self: stretch;
}

.map-card {
  position: absolute;
  inset: 18px 4px 4px 20px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.98), rgba(236, 244, 240, 0.95)),
    #f8f1e2;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  transform: rotate(-1.5deg);
}

.map-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ticket-card {
  position: absolute;
  left: 0;
  bottom: 18px;
  width: min(72%, 270px);
  padding: 16px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.ticket-card span {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.16rem;
}

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

.stat-card,
.card,
.metric-panel,
.entity-card,
.form-panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.stat-card {
  min-height: 132px;
  padding: 18px;
}

.stat-card .stat-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-value {
  margin-top: 18px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
  font-weight: 780;
}

.stat-value.stat-money {
  font-size: clamp(1.45rem, 2.35vw, 2rem);
  font-weight: 720;
}

.countdown-card {
  min-height: 132px;
  grid-column: span 2;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.countdown-unit {
  min-width: 0;
  min-height: 76px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.countdown-unit strong {
  display: block;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  line-height: 1;
}

.countdown-unit span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.card {
  padding: 18px;
}

.compact-flight-card {
  display: grid;
  gap: 16px;
}

.compact-flight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.compact-flight-card h3 {
  margin-bottom: 2px;
}

.compact-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
}

.compact-route strong {
  color: var(--ink);
}

.flight-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flight-time-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.flight-time-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.flight-time-grid strong {
  font-size: 1.05rem;
}

.seat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: var(--muted);
}

.seat-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.seat-list strong {
  color: var(--ink);
}

.card h3,
.metric-panel h3,
.form-panel h3,
.table-panel h3 {
  margin: 0 0 14px;
  font-size: 1.02rem;
}

.stack {
  display: grid;
  gap: 14px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 18px;
}

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

.entity-card {
  overflow: hidden;
  display: grid;
  min-height: 230px;
}

.flight-card {
  cursor: pointer;
}

.entity-card .band {
  min-height: 76px;
  padding: 18px;
  color: #fff9ee;
  background: linear-gradient(145deg, #17212a, #28433f);
}

.entity-card .band.gold-band {
  color: #241608;
  background: linear-gradient(145deg, #d8b56d, #f0d890);
}

.entity-card .band.rose-band {
  color: #fff9ee;
  background: linear-gradient(145deg, #633b43, #b66b60);
}

.entity-card .body {
  padding: 18px;
}

.flight-documents {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.flight-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.flight-document-row > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.flight-document-row strong,
.flight-document-row span {
  overflow-wrap: anywhere;
}

.flight-document-row > div > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.entity-card h3 {
  margin: 0;
  font-size: 1.18rem;
}

.entity-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.meta-row,
.mini-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.meta-row strong,
.mini-row strong {
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(185, 135, 61, 0.22);
  border-radius: 999px;
  color: #71501f;
  background: rgba(216, 181, 109, 0.16);
  font-size: 0.76rem;
  font-weight: 690;
}

.badge.dark {
  color: #f7f0df;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
}

.badge.green {
  color: #1d665b;
  border-color: rgba(28, 120, 112, 0.18);
  background: rgba(28, 120, 112, 0.1);
}

.badge.red {
  color: #8a342c;
  border-color: rgba(188, 114, 104, 0.2);
  background: rgba(188, 114, 104, 0.1);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.searchbar {
  position: relative;
  min-width: min(100%, 320px);
  flex: 1 1 280px;
}

.searchbar input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  transition:
    border 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.searchbar input {
  min-height: 44px;
  padding: 0 14px 0 42px;
}

.searchbar .icon {
  position: absolute;
  left: 14px;
  top: 13px;
  color: var(--muted);
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
}

.searchbar input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(185, 135, 61, 0.55);
  box-shadow: 0 0 0 4px rgba(216, 181, 109, 0.13);
  background: #fff;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 18px rgba(18, 20, 28, 0.08);
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.timeline-day {
  display: grid;
  gap: 12px;
}

.day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.day-title h3 {
  margin: 0;
  font-size: 1.1rem;
}

.activity-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.83);
  box-shadow: 0 8px 24px rgba(18, 20, 28, 0.06);
}

.activity-card[draggable="true"] {
  cursor: grab;
}

.activity-card.drag-over {
  outline: 2px solid rgba(216, 181, 109, 0.55);
}

.planning-flight-card {
  background: rgba(255, 251, 242, 0.9);
}

.planning-flight-card .time-block {
  background: linear-gradient(145deg, #151923, #28433f);
}

.time-block {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  color: #fff9ee;
  background: #151923;
  font-weight: 780;
  text-align: center;
}

.activity-card h4 {
  margin: 0;
  font-size: 1rem;
}

.activity-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.mini-actions {
  display: flex;
  gap: 6px;
}

.cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: 18px;
}

.metric-panel {
  padding: 18px;
}

.ring-wrap {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.ring {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) 0deg, var(--teal) 0deg);
}

.ring::after {
  content: "";
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel-solid);
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 22, 27, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold-2));
}

.needed-documents-card {
  margin-top: 18px;
}

.needed-documents-card h3,
.needed-documents-card h4 {
  margin: 0;
}

.needed-documents-upcoming {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.needed-document-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.needed-document-row strong,
.needed-document-row small {
  display: block;
  overflow-wrap: anywhere;
}

.needed-document-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.doc-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.doc-preview {
  height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: #2a241a;
  background:
    linear-gradient(135deg, rgba(216, 181, 109, 0.16), rgba(28, 120, 112, 0.1)),
    #fbf8f1;
  cursor: pointer;
}

.doc-preview img,
.doc-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  pointer-events: none;
}

.pdf-thumb,
.generic-thumb,
.image-thumb-loading {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.pdf-thumb span,
.generic-thumb span,
.image-thumb-loading span,
.doc-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.pdf-thumb strong,
.generic-thumb strong,
.image-thumb-loading strong {
  font-size: 1.1rem;
}

.pdf-thumb small,
.generic-thumb small {
  max-width: 180px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.doc-card-body {
  display: grid;
  gap: 9px;
  padding: 15px;
}

.doc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.doc-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.doc-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 40px);
  gap: 8px;
  padding: 0 15px 15px;
}

.doc-actions .btn,
.doc-actions .icon-btn {
  min-height: 40px;
  box-shadow: none;
}

.danger-icon {
  color: #8a2d25;
}

.doc-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  background: rgba(13, 16, 22, 0.82);
}

.doc-viewer {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  color: #f8f4ec;
  background: #10141d;
}

.doc-viewer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.doc-viewer-head h2 {
  margin: 8px 0 4px;
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  line-height: 1.1;
}

.doc-viewer-head p {
  margin: 0;
  color: rgba(248, 244, 236, 0.68);
  overflow-wrap: anywhere;
}

.doc-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.doc-viewer .btn,
.doc-viewer .icon-btn {
  color: #f8f4ec;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.doc-viewer-canvas {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.doc-viewer-frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.doc-viewer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.doc-viewer-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 180ms ease;
}

.doc-viewer-canvas.zoomed .doc-viewer-frame img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  transform: scale(1.85);
  transform-origin: center;
}

.viewer-loading {
  display: grid;
  gap: 12px;
  place-items: center;
  padding: 24px;
  color: rgba(248, 244, 236, 0.74);
  text-align: center;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.36);
  font-size: 2rem;
}

.viewer-nav:disabled {
  opacity: 0.28;
}

.viewer-nav.prev {
  left: 12px;
}

.viewer-nav.next {
  right: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.admin-menu {
  align-self: start;
  width: min(100%, 360px);
}

.form-panel {
  padding: 18px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #424751;
  font-size: 0.8rem;
  font-weight: 710;
}

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.table-panel {
  overflow: hidden;
}

.table-panel h3 {
  padding: 18px 18px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table td:last-child,
.data-table th:last-child {
  text-align: right;
  white-space: nowrap;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(21, 22, 27, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 250px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 13px 14px;
  border: 1px solid rgba(216, 181, 109, 0.32);
  border-radius: 8px;
  color: #fff8ec;
  background: rgba(17, 21, 29, 0.94);
  box-shadow: var(--shadow);
  animation: rise 260ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 240ms ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .split-grid,
  .cost-layout,
  .concierge-panel {
    grid-template-columns: 1fr;
  }

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

  .trip-art {
    min-height: 260px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .stats-grid,
  .module-grid,
  .document-grid,
  .admin-layout,
  .form-grid,
  .ring-wrap {
    grid-template-columns: 1fr;
  }

  .admin-menu {
    width: 100%;
  }

  .activity-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .activity-card .mini-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .doc-viewer-head {
    display: grid;
  }

  .doc-viewer-actions {
    justify-content: stretch;
  }

  .doc-viewer-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 540px) {
  .content {
    padding: 18px 14px 32px;
  }

  .concierge-panel {
    padding: 20px;
  }

  .trip-art {
    min-height: 220px;
  }

  .ticket-card {
    width: 86%;
  }

  .control-row {
    align-items: stretch;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .doc-preview {
    height: 170px;
  }

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

  .doc-actions .btn {
    grid-column: 1 / -1;
  }

  .doc-actions .icon-btn {
    width: 100%;
  }

  .doc-viewer {
    min-height: 100dvh;
  }

  .doc-viewer-head {
    padding: 12px;
  }

  .viewer-nav {
    width: 38px;
    height: 50px;
  }

  .needed-document-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .needed-document-row .badge {
    justify-self: start;
    grid-column: 2;
  }

  .data-table {
    min-width: 620px;
  }

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