:root {
  --bg: #f7f1e8;
  --paper: rgba(255, 251, 244, 0.88);
  --ink: #1f2933;
  --muted: #667085;
  --accent: #cc5a1b;
  --accent-deep: #9b3f12;
  --teal: #0c6a6c;
  --line: rgba(31, 41, 51, 0.12);
  --danger: #ad2e24;
  --shadow: 0 20px 45px rgba(58, 39, 18, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(204, 90, 27, 0.15), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(12, 106, 108, 0.14), transparent 32%),
    linear-gradient(180deg, #efe7dc 0%, #f7f1e8 55%, #f3ede5 100%);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.45;
  pointer-events: none;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: -60px;
  right: -40px;
  background: rgba(204, 90, 27, 0.14);
}

.orb-b {
  width: 240px;
  height: 240px;
  left: -60px;
  bottom: 5%;
  background: rgba(12, 106, 108, 0.1);
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.topbar,
.panel,
.hero,
.login-card {
  background: var(--paper);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 28px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.brand-mark {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.92rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topnav a,
.ghost-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.panel,
.hero {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}

.is-hidden {
  display: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.hero h1,
.panel h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.04;
}

.hero p,
.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.form-actions,
.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #df7b32);
  color: white;
}

.secondary-button {
  background: rgba(12, 106, 108, 0.12);
  color: var(--teal);
}

.ghost-button {
  background: rgba(31, 41, 51, 0.08);
  color: var(--ink);
}

.ghost-button.small {
  min-height: 36px;
  padding: 0 12px;
}

.danger-button {
  background: rgba(173, 46, 36, 0.12);
  color: var(--danger);
}

.filters,
.settings-grid,
.property-form,
.import-form {
  display: grid;
  gap: 16px;
}

.import-panel {
  margin-top: -4px;
}

.import-status {
  min-height: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.import-status[data-kind="success"] {
  color: var(--teal);
}

.import-status[data-kind="error"] {
  color: var(--danger);
}

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

.filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  min-width: 0;
}

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

.field {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field small,
.field-note {
  color: var(--muted);
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  min-height: 46px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
}

input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  padding: 14px;
  min-height: 128px;
  resize: vertical;
}

input[readonly] {
  background: rgba(31, 41, 51, 0.05);
}

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

.panel-head.stacked {
  align-items: flex-start;
}

.panel-head h2 {
  margin: 0 0 6px;
}

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

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

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.form-section:first-child {
  border-top: none;
  padding-top: 0;
}

.section-tip {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

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

.property-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.property-table th,
.property-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
  text-align: left;
  vertical-align: top;
}

.property-table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(204, 90, 27, 0.05);
}

.table-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.table-link:hover {
  text-decoration: underline;
}

.table-action {
  white-space: nowrap;
}

.sub-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.flash-success {
  background: rgba(12, 106, 108, 0.12);
  color: var(--teal);
}

.flash-error {
  background: rgba(173, 46, 36, 0.12);
  color: var(--danger);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px 18px;
}

.align-right {
  text-align: right;
}

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

.login-wrap {
  width: min(520px, 100%);
}

.login-card {
  border-radius: 28px;
  padding: 30px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .hero,
  .topbar,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 640px) {
  .shell {
    padding: 14px 12px 32px;
  }

  .panel,
  .hero,
  .login-card,
  .topbar {
    padding: 18px;
    border-radius: 20px;
  }

  input,
  select,
  textarea,
  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    min-height: 48px;
  }

  .property-table {
    min-width: 760px;
  }

  .hero {
    padding: 16px 18px;
  }

  .hero-actions,
  .filter-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions > *,
  .filter-actions > *,
  .form-actions > * {
    width: 100%;
  }

  .import-status {
    width: 100%;
  }
}
