:root {
  --bg: #eef5ff;
  --surface: #ffffff;
  --surface-alt: #f8fbff;
  --text: #10233b;
  --muted: #5f758e;
  --primary: #3f71f0;
  --primary-dark: #1e3fc4;
  --success: #1f8f5c;
  --danger: #c43b4a;
  --border: rgba(16, 35, 59, 0.08);
  --shadow: 0 24px 60px rgba(16, 35, 59, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, rgba(79, 128, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #eef5ff 0%, #f7fbff 100%);
  color: var(--text);
}

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

button {
  border: none;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.app-main {
  min-height: calc(100vh - 170px);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 420px) minmax(180px, 240px);
  gap: 22px;
  align-items: center;
  padding: 20px 26px;
  margin-bottom: 26px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 35, 59, 0.06);
  box-shadow: 0 32px 80px rgba(16, 35, 59, 0.08);
  position: relative;
}

@media (max-width: 768px) {
  .app-header {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px 18px;
  }
}

.brand {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  transition: all 200ms ease;
}

.brand:hover {
  background: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
  .brand {
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .subheading {
    display: none;
  }
}

.brand-logo {
  width: 140px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 16px rgba(63, 113, 240, 0.15));
  transition: all 200ms ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
  filter: drop-shadow(0 12px 24px rgba(63, 113, 240, 0.25));
}

@media (max-width: 768px) {
  .brand-logo {
    width: 100px;
    height: auto;
  }
}

.brand h1 {
  margin: 0;
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--primary), #4f95ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.subheading {
  margin: 8px 0 0;
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 768px) {
  .top-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(16, 35, 59, 0.06);
    border-radius: 0 0 26px 26px;
    padding: 12px;
    margin-top: 6px;
    box-shadow: 0 28px 64px rgba(16, 35, 59, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
    z-index: 100;
  }

  .top-nav.active {
    max-height: 300px;
    gap: 8px;
    padding: 12px;
  }

  .top-nav.active .nav-link {
    width: 100%;
    text-align: left;
  }
}

.nav-link {
  padding: 12px 18px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 180ms ease;
  border: 1px solid transparent;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(63, 113, 240, 0.12);
  color: var(--primary-dark);
  border-color: rgba(63, 113, 240, 0.16);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

@media (max-width: 768px) {
  .header-actions {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(16, 35, 59, 0.06);
    border-radius: 0 0 26px 0;
    padding: 12px;
    margin-top: 6px;
    gap: 10px;
    box-shadow: 0 28px 64px rgba(16, 35, 59, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
    z-index: 100;
  }

  .app-header.menu-open .header-actions {
    max-height: 300px;
  }
}

.user-label {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .user-label {
    display: none;
  }
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 200ms ease;
}

.hamburger-menu:hover {
  background: rgba(63, 113, 240, 0.1);
}

.hamburger-line {
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 300ms ease;
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
    order: -1;
  }

  .hamburger-menu[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
  }

  .hamburger-menu[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
  }
}

.hero-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: center;
  padding: 36px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,248,255,0.9));
  border: 1px solid rgba(16, 35, 59, 0.06);
  box-shadow: 0 32px 80px rgba(16, 35, 59, 0.08);
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 18px;
  }

  .hero-copy h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
  }

  .hero-image {
    min-height: 280px;
  }
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.02;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-image {
  min-height: 360px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(16, 35, 59, 0.16);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card {
  background: var(--surface);
  border-radius: 26px;
  border: 1px solid rgba(16, 35, 59, 0.06);
  box-shadow: 0 30px 70px rgba(16, 35, 59, 0.06);
  padding: 26px;
}

.grid-2 {
  display: grid;
  gap: 24px;
}

.workspace-column {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1.45fr 0.95fr;
  }
}

.toggle-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.toggle-buttons button {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(16, 35, 59, 0.08);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
}

.tab-nav {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.tab-button {
  flex: 1;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(16, 35, 59, 0.08);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: all 160ms ease;
}

.tab-button.active,
.tab-button:hover {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 18px 36px rgba(63, 113, 240, 0.16);
}

.tab-panel {
  margin-top: 18px;
}

.tab-panel.hidden {
  display: none;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 35, 59, 0.08);
  box-shadow: 0 28px 64px rgba(16, 35, 59, 0.07);
}

.page-tabs .tab-button {
  flex: 1;
  min-width: 160px;
  border-radius: 16px;
  font-weight: 700;
}

.page-tabs .tab-button.active,
.page-tabs .tab-button:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 16px 34px rgba(63, 113, 240, 0.16);
}

.room-toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.room-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.room-toolbar input,
.room-toolbar select {
  width: 100%;
}

@media (min-width: 720px) {
  .room-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.details-toggle-button,
.room-form-actions button.danger-button {
  min-width: 140px;
}

.room-detail-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(63, 113, 240, 0.08);
  border: 1px solid rgba(63, 113, 240, 0.12);
}

.room-detail-panel p {
  margin: 10px 0;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(16, 35, 59, 0.08);
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(63, 113, 240, 0.36);
  box-shadow: 0 0 0 4px rgba(63, 113, 240, 0.1);
}

textarea {
  resize: vertical;
}

button.primary-button,
button.secondary-button {
  padding: 14px 20px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button.primary-button {
  background: linear-gradient(135deg, var(--primary), #4f95ff);
  color: #fff;
  box-shadow: 0 20px 40px rgba(63, 113, 240, 0.18);
}

button.primary-button:hover {
  transform: translateY(-1px);
}

button.secondary-button {
  background: #fff;
  border: 1px solid rgba(16, 35, 59, 0.08);
  color: var(--text);
}

button.secondary-button:hover {
  background: var(--surface-alt);
}

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

.rooms-list,
.message-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.room-card,
.message-card {
  border: 1px solid rgba(16, 35, 59, 0.08);
  border-radius: 28px;
  background: #fff;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.room-card:hover,
.message-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 50px rgba(16, 35, 59, 0.08);
}

.room-card {
  display: grid;
}

.room-card-media {
  min-height: 240px;
  overflow: hidden;
}

.room-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.room-card:hover .room-card-media img {
  transform: scale(1.03);
}

.room-card-footer {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.room-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.room-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.room-chip {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(63, 113, 240, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.property-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
}

.property-detail-list span {
  display: inline-flex;
  gap: 6px;
}

.room-actions,
.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #2253a0;
  font-size: 0.92rem;
}

.status-banner {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid transparent;
  font-weight: 600;
}

.status-success {
  background: #f0fbf3;
  border-color: #8ce0a2;
  color: #1f6f40;
}

.status-error {
  background: #fff2f4;
  border-color: #f5b2b8;
  color: #a21327;
}

.hidden {
  display: none;
}

.message-card p,
.room-card p {
  margin: 10px 0 0;
  color: var(--text);
}

.room-form-row {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.room-form-row textarea {
  min-height: 90px;
}

.room-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

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

@media (max-width: 960px) {
  .app-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .top-nav,
  .header-actions {
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .hero-card,
  .page-tabs {
    grid-template-columns: 1fr;
  }

  .page-tabs,
  .room-toolbar {
    grid-template-columns: 1fr;
  }

  .room-toolbar {
    gap: 12px;
  }
}
