:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #657282;
  --line: #dbe2ea;
  --brand: #1d5f91;
  --brand-2: #15496f;
  --ok: #167849;
  --warn: #9a6a00;
  --danger: #b3261e;
  --info: #205da8;
  --shadow: 0 10px 28px rgba(23, 35, 50, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  background: #e9eef5;
  color: var(--ink);
  font-weight: 650;
}

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

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

button.danger {
  background: #fde8e6;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  background: #e9eef5;
  color: var(--ink);
  font-weight: 650;
}

.photo-actions {
  justify-content: flex-end;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

textarea {
  min-height: 96px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(120deg, #eef4f7 0%, #f9fbfc 58%, #eef6f0 100%);
}

.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-2);
  color: white;
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: 254px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #142235;
  color: white;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar .brand {
  margin: 0 4px 8px;
}

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

.nav button {
  text-align: left;
  background: transparent;
  color: #dce8f2;
  border-radius: 6px;
  padding: 11px 12px;
}

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

.action-main {
  width: 100%;
  text-align: center;
}

.sidebar-section {
  color: #94a6ba;
  font-size: 12px;
  font-weight: 800;
  padding: 14px 12px 4px;
  text-transform: uppercase;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 13px 24px;
}

.global-search {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  z-index: 5;
  overflow: hidden;
}

.search-results button {
  width: 100%;
  text-align: left;
  background: #fff;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.search-group {
  padding: 9px 12px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f5f7fa;
}

.content {
  padding: 24px;
  overflow: auto;
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

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

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

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

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.indicator {
  min-height: 96px;
  display: grid;
  gap: 8px;
}

.indicator strong {
  font-size: 30px;
}

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

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.operation-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.operation-option.planned {
  background: #f8fafc;
}

.operation-option p {
  margin: 6px 0 10px;
}

.inline-linker {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) auto;
  gap: 8px;
  min-width: min(560px, 100%);
}

.linked-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.linked-list .badge {
  gap: 6px;
}

.linked-list button {
  padding: 0 5px;
  min-height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.65);
}

.property-link-details {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e7eef6;
  color: var(--info);
}

.badge.ok {
  background: #e5f5ec;
  color: var(--ok);
}

.badge.warn {
  background: #fff4d7;
  color: var(--warn);
}

.badge.danger {
  background: #fde8e6;
  color: var(--danger);
}

.wizard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

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

.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.step.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(29, 95, 145, 0.12);
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-thumb {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.photo-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.timeline {
  border-left: 2px solid var(--line);
  margin-left: 8px;
  padding-left: 18px;
  display: grid;
  gap: 14px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.tabs button {
  background: transparent;
  border-radius: 6px 6px 0 0;
}

.tabs button.active {
  color: var(--brand-2);
  box-shadow: inset 0 -3px 0 var(--brand-2);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 13px 15px;
  background: #142235;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .layout,
  .wizard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: 1fr;
  }

  .page-title,
  .section-heading,
  .list-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}
