
:root {
  --bg-main: #f5f7fb;
  --bg-panel: #ffffff;
  --bg-sidebar: #f1f3f7;
  --border-color: #dde1ea;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --primary: #1776ff;
  --primary-dark: #0f5ec9;
  --danger: #dc2626;
  --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.08);
  --radius-lg: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top-navbar-wrapper {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.inner-navbar-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-header {
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  color: var(--text-main);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1776ff, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-right: 8px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 600;
  font-size: 15px;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-wrapper {
  display: flex;
  align-items: center;
}

.nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.nav > li {
  margin-left: 16px;
}

.nav > li > a {
  font-size: 14px;
  color: var(--text-muted);
}

.nav > li > a:hover {
  color: var(--text-main);
}

.navbar-right {
  margin-left: 32px;
}

.nav-current-address {
  font-size: 13px;
  color: var(--text-muted);
}

/* Layout */

.main-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  gap: 16px;
}

.sidebar {
  background-color: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.property-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-photo-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background-color: #e5e7eb;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.sidebar-address {
  flex: 1;
}

.sidebar-address-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-nav {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li {
  font-size: 13px;
}

.sidebar-nav li a {
  display: block;
  padding: 6px 16px;
  color: var(--text-muted);
}

.sidebar-nav li.active > a {
  background-color: #e3edff;
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-nav li a:hover {
  background-color: #e5e7eb;
  color: var(--text-main);
}

.sidebar-heading {
  padding: 8px 16px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Content */

.content {
  min-height: calc(100vh - 96px);
}

.content-section {
  max-width: 900px;
}

.page-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}

.page-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Panels */

.panel {
  background-color: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}

.panel-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.panel-body {
  padding: 12px 16px 16px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  margin-bottom: 4px;
}

.form-control {
  border-radius: 4px;
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(23, 118, 255, 0.15);
}

textarea.form-control {
  resize: vertical;
}

.form-help {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.input-with-select {
  display: flex;
  gap: 4px;
}

.select-narrow {
  max-width: 120px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.form-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

/* Tables */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  background-color: #f9fafb;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .table-total td {
  font-weight: 600;
  background-color: #f3f4f6;
}

.two-col-table th:nth-child(2),
.two-col-table td:nth-child(2) {
  text-align: right;
}

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

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

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

.margin-t-10 {
  margin-top: 10px;
}

.margin-t-20 {
  margin-top: 20px;
}

/* Lists */

.property-list-empty {
  font-size: 13px;
  color: var(--text-muted);
}

.property-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.property-list-item {
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.property-list-item:last-child {
  border-bottom: none;
}

.property-list-title {
  font-size: 14px;
  font-weight: 500;
}

.property-list-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Quick stats */

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.quick-stat {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.quick-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.quick-stat-value {
  font-size: 16px;
  font-weight: 600;
}

/* Metrics */

.metric-large {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.metric-large-label {
  font-size: 12px;
  color: var(--text-muted);
}

.metric-large-value {
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}

/* Alerts */

.alert {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

.alert-warning {
  background-color: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
}

/* Map */

.map-embed-container {
  width: 100%;
  height: 320px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: #e5e7eb;
}

/* Compare */

.compare-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
}

.compare-table th,
.compare-table td {
  font-size: 12px;
}

/* JSON */

.json-block {
  font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
  font-size: 12px;
  background-color: #111827;
  color: #e5e7eb;
  padding: 10px;
  border-radius: 6px;
  max-height: 360px;
  overflow: auto;
}

/* Address form */

.address-form-row {
  display: flex;
  gap: 8px;
}

.address-form-row .form-control {
  flex: 1;
}

/* Photos */

#photos-preview img {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin: 4px;
}

/* Responsive */

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }
}
