
/* ===== 1. CSS Variables & Fonts ===== */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18211f;
  --muted: #69746f;
  --line: #dfe6ec;
  --accent: #0f766e;
  --accent-2: #b8860b;
  --danger: #b42318;
  --nav: #172554;
  --nav-soft: #172554;
  --sale: #176b5b;
  --rent: #1d4f8f;
  --inactive: #1447E6;
  --soft: #edf7f3;
  --ui-glass-strength: 0;
  --btn-glass-strength: 0;
  --ui-glass-bubble-fill: 0.65;
  --btn-glass-bubble-fill: 0.65;
  --ui-glass-bubble-border: 0.2;
  --btn-glass-bubble-border: 0.2;
  --ui-glass-blur-px: 5px;
  --btn-glass-blur-px: 5px;
  --ui-glass-saturate: 120%;
  --btn-glass-saturate: 120%;
  --ui-glass-highlight: 0.7;
  --btn-glass-highlight: 0.7;
  --app-font-size: 14px;
  --data-font-size: 14px;
  --sidebar-font-size: 13px;
  --sidebar-btn-text: #f4f7f5;
  --sidebar-btn-text-hover: #0f766e;
  --title-box-bg: #f8fafc;
  --title-text-color: #69746f;
  --icon-color: #69746f;
  --icon-bg: transparent;
  --button-font-size: 13px;
  --font-mono: "Courier New", monospace;
  --select-color: #4a7ad4;
  --compare-color: #0f766e;
  --accent2: #6b7280;
  --surface: color-mix(in srgb, var(--panel, #ffffff) calc(100% - var(--ui-glass-strength) * 38%), transparent);
  --shadow: 0 18px 42px rgba(16, 24, 32, 0.10);
  --shadow-sm: 0 8px 22px rgba(16, 24, 32, 0.07);
  color-scheme: light dark;
}

@font-face {
  font-family: "AppPyidaungsu";
  src: url("assets/fonts/Pyidaungsu-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "AppPyidaungsu";
  src: url("assets/fonts/Pyidaungsu-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
}

@font-face {
  font-family: "AppHelvetica";
  src: url("assets/fonts/Helvetica.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "AppHelvetica";
  src: url("assets/fonts/Helvetica-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
}



/* ===== 2. Base / Reset ===== */
* {
  box-sizing: border-box;
}
.hidden {
  display: none !important;
}
html, body {
  min-height: 100vh;
  margin: 0;
}

/* --- Login Screen --- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 110;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(15, 122, 107, 0.24), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(199, 134, 45, 0.22), transparent 28%),
    #111827;
}

body.login-panel-open {
  overflow: hidden;
}

.login-backdrop-hint {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.88);
  color: #f8fafc;
  font-size: 13px;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.login-panel {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  display: grid;
  gap: 14px;
  border: 1px solid #d9dfd8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.login-panel .brand-mark {
  margin-bottom: 2px;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel p,
.login-panel small {
  color: var(--muted);
}

.login-panel small {
  min-height: 18px;
  color: var(--danger);
}


/* ===== 3. Body ===== */
body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(225deg, rgba(184, 134, 11, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: "AppPyidaungsu", "Pyidaungsu", "Myanmar Text", "AppHelvetica", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--app-font-size);
  letter-spacing: 0;
}

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


/* ===== 4. Buttons ===== */
button,
.file-btn {
  border: var(--btn-border-width, 1px) var(--btn-border-style, solid) var(--btn-border, var(--btn-solid, var(--accent)));
  background: var(--btn-bg, var(--btn-solid, var(--accent)));
  color: var(--btn-color, var(--btn-text, #fff));
  min-height: 38px;
  padding: 8px 13px;
  font-size: var(--button-font-size);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 700;
  box-shadow: var(--btn-shadow, 0 6px 14px rgba(15, 118, 110, 0.14));
  position: relative;
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    transform 160ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    color 180ms ease,
    backdrop-filter 220ms ease,
    font-size 220ms ease;
  }

  .btn-sm {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .btn-sm-row {
    gap: 6px;
    margin-bottom: 10px;
  }

  .btn-sm-row button {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .storage-actions .file-btn {
  width: 100%;
}

.water-ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 55%, transparent 70%);
  animation: waterRippleDrop 980ms ease-out forwards;
  z-index: 2;
}

@keyframes waterRippleDrop {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(14);
  }
}

button:hover,
.file-btn:hover {
    transform: translateY(-1px);
    font-size: calc(var(--button-font-size) * (1 + var(--btn-glass-strength) * 0.12));
}
button:where(:not(.nav-btn):not(.ghost):not(.subtle):not(.home-icon-btn):not(.home-view-btn):not(.sort-btn):not(.filter-btn):not(.filter-clear):not(.log-tab)):hover,
.file-btn:hover {
  background: var(--btn-solid-hover, var(--btn-bg, var(--btn-solid, var(--accent))));
  color: var(--btn-text-hover, var(--btn-color, var(--btn-text, #fff)));
}
.nav-btn:hover,
.profile-chip:hover {
  font-size: calc(var(--sidebar-font-size) * (1 + var(--btn-glass-strength) * 0.12));
}

button:where(.nav-btn, .profile-chip, .subtle, .ghost):hover,
.file-btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-bubble-fill)));
    border-color: rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-bubble-border)));
    backdrop-filter: blur(var(--btn-glass-blur-px)) saturate(var(--btn-glass-saturate));
    -webkit-backdrop-filter: blur(var(--btn-glass-blur-px)) saturate(var(--btn-glass-saturate));
    box-shadow:
      0 10px 28px rgba(15, 23, 42, calc(var(--btn-glass-strength) * 0.12)),
       inset 0 1px 1px rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-highlight))),
       inset 0 -1px 1px rgba(255, 255, 255, calc(var(--btn-glass-strength) * 0.2));
}

.nav-btn:hover {
  color: var(--sidebar-btn-text-hover, var(--ink));
}

.network-status {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: #fff;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.network-online {
  background: rgba(40, 167, 69, 0.14);
  color: #198754;
  border-color: rgba(40, 167, 69, 0.3);
}

.network-offline {
  background: rgba(220, 53, 69, 0.14);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.3);
}

button#saveToLocalDbFileBtn {
  margin-top: 0.5rem;
}

button.danger,
.row-actions .danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

button.inactive-action,
.row-actions .inactive-action {
  border-color: var(--inactive);
  background: var(--inactive);
  color: #fff;
}

.row-actions .sold-action {
    background: var(--sale);
    border-color: var(--sale);
    color: #fff;
}

.row-actions .rent-action {
    background: var(--rent);
    border-color: var(--rent);
    color: #fff;
}

.row-actions .edit-action {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== 5. Layout � App Shell & Sidebar ===== */
.app-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  transition: grid-template-columns 0.4s ease;
  overflow-x: clip;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 60px 1fr;
}

.sidebar-toggle {
  position: absolute;
  left: 220px;
  top: 0;
  bottom: 0;
  width: 14px;
  z-index: 100;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 0;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.4s ease, background 0.2s;
}

.sidebar-toggle:hover {
  background: var(--nav);
  color: #fff;
}

.sidebar-toggle .toggle-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  pointer-events: none;
  font-size: 7px;
  line-height: 1;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  left: 60px;
}

.app-shell.sidebar-collapsed .sidebar-toggle .toggle-arrow {
  transform: rotate(180deg);
}

/* collapsed sidebar: hide labels/text, keep icons */
.app-shell.sidebar-collapsed .sidebar .brand > div:last-child,
.app-shell.sidebar-collapsed .sidebar .brand p,
.app-shell.sidebar-collapsed .sidebar .nav-label,
.app-shell.sidebar-collapsed .sidebar .profile-chip span:not(.user-icon),
.app-shell.sidebar-collapsed .sidebar .user-panel .subtle,
.app-shell.sidebar-collapsed .sidebar .sidebar-lang {
  opacity: 0;
  max-width: 0;
  max-height: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
}

.sidebar-version {
  margin-top: auto;
  font-size: 11px;
  opacity: 0.5;
  text-align: center;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.app-shell.sidebar-collapsed .sidebar .sidebar-inner {
  padding: 20px 5px;
}

.app-shell.sidebar-collapsed .sidebar .brand {
  border-bottom-color: transparent;
  padding-bottom: 6px;
  gap: 0;
}

.app-shell.sidebar-collapsed .sidebar .brand-mark {
  width: 36px !important;
  height: 36px !important;
  margin: 0 auto;
}

.app-shell.sidebar-collapsed .sidebar .nav {
  gap: 4px;
}

.app-shell.sidebar-collapsed .sidebar .nav-btn {
  position: relative;
  display: block;
  padding: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 auto;
  border-radius: 8px;
}

.app-shell.sidebar-collapsed .sidebar .nav-btn .nav-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-shell.sidebar-collapsed .sidebar .nav-btn.active {
  background: var(--accent-2);
  border-color: transparent;
}

.app-shell.sidebar-collapsed .sidebar .profile-chip {
  position: relative;
  display: block;
  padding: 0;
  min-height: 36px;
  width: 36px;
  margin: 0 auto;
  border-radius: 8px;
}

.app-shell.sidebar-collapsed .sidebar .profile-chip .user-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-shell.sidebar-collapsed .sidebar .user-panel {
  align-items: center;
  gap: 4px;
}

.app-shell.sidebar-collapsed .sidebar .user-icon {
  margin: 0;
}

.sidebar-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 10px;
  transition: padding 0.4s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%),
    var(--nav);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 12px 0 40px rgba(16, 24, 32, 0.14);
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  display: grid;
  gap: 8px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: gap 0.4s ease, border-bottom-color 0.4s ease, padding-bottom 0.4s ease;
}

.brand > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #d7b46a;
  color: #17251f;
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
  transition: width 0.4s ease, height 0.4s ease;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.form-section h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.25;
  color: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.brand p,
.topbar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.sidebar .brand p {
  color: #b9c7bd;
  font-size: 12px;
  line-height: 1.5;
  max-width: none;
}

.nav {
  display: grid;
  align-content: start;
  gap: 4px;
  transition: gap 0.4s ease;
}

.nav-btn {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-btn-text, #f4f7f5);
  font-weight: 700;
  font-size: var(--sidebar-font-size);
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: width 0.4s ease, height 0.4s ease, min-height 0.4s ease, padding 0.4s ease, border-radius 0.4s ease;
}

.nav-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.nav-label,
.brand > div:last-child,
.brand p,
.profile-chip span:not(.user-icon),
.user-panel .subtle,
.sidebar-lang {
  max-width: 9999px;
  max-height: 9999px;
  transition: opacity 0.4s ease, max-width 0.4s ease, max-height 0.4s ease, min-width 0.4s ease, min-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
  overflow: hidden;
}

.nav-btn[hidden] {
  display: none !important;
}

.nav-btn.active {
  color: #fff;
  font-weight: 800;
  background: var(--nav-soft);
  border: 1px solid var(--accent-2);
  box-shadow: none;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-btn.glass-press,
.profile-chip.glass-press,
.subtle.glass-press {
  transform: scale(0.97);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 14px rgba(0, 0, 0, 0.2);
}

.storage-panel,
.storage-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.storage-actions {
  margin-top: 0;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.user-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  display: grid;
  gap: 8px;
  transition: gap 0.4s ease;
}

.user-panel.customer-mode,
.user-panel.staff-mode {
  grid-template-columns: 1fr;
}

.user-panel .profile-chip,
.user-panel .subtle {
  opacity: 1;
  pointer-events: auto;
  border-radius: 999px;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    backdrop-filter 220ms ease,
    transform 220ms ease;
}

#publicLoginBtn,
#logoutBtn {
  justify-content: center;
}

.app-shell:has(.user-panel.customer-mode) .staff-only {
  display: none !important;
}

html.glass-off .nav-btn:hover,
html.glass-off .nav-btn:focus-visible {
  background: var(--nav-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

/* Outline button style — like Google Map / Google Earth buttons */
html.btn-outline {
  --btn-bg: color-mix(in srgb, var(--btn-outline, var(--accent)) 10%, transparent);
  --btn-color: var(--btn-outline, var(--accent));
  --btn-shadow: none;
}
html.btn-outline button:where(:not(.nav-btn):not(.profile-chip):not(.ghost):not(.subtle):not(.home-icon-btn):not(.home-view-btn):not(.sort-btn):not(.filter-btn):not(.filter-clear):not(.log-tab)):hover,
html.btn-outline .file-btn:hover {
  background: var(--btn-outline-hover, var(--btn-outline, var(--accent)));
  color: var(--btn-text-hover, #fff);
}

/* Outline style for colored action buttons */
html.btn-outline button.danger,
html.btn-outline .row-actions .danger {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}
html.btn-outline button.danger:hover,
html.btn-outline .row-actions .danger:hover {
  background: var(--danger-hover, var(--danger));
  color: var(--btn-text-hover, #fff);
}
html.btn-outline button.inactive-action,
html.btn-outline .row-actions .inactive-action {
  background: color-mix(in srgb, var(--inactive) 10%, transparent);
  color: var(--inactive);
  border-color: var(--inactive);
  box-shadow: none;
}
html.btn-outline button.inactive-action:hover,
html.btn-outline .row-actions .inactive-action:hover {
  background: var(--inactive-hover, var(--inactive));
  color: var(--btn-text-hover, #fff);
}

.user-panel span {
  color: #dce6df;
  font-size: 13px;
}

.sidebar-lang {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.sidebar-lang select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.sidebar-lang select option {
  background: #101820;
  color: #fff;
}

.profile-chip,
.subtle {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  color: #fff;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: width 0.4s ease, min-height 0.4s ease, padding 0.4s ease, border-radius 0.4s ease;
}

.subtle {
  border-color: transparent;
}

.user-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #d7b46a;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.user-icon::before,
.user-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #17251f;
}

.user-icon::before {
  width: 7px;
  height: 7px;
  top: 5px;
  border-radius: 999px;
}

.user-icon::after {
  width: 13px;
  height: 7px;
  bottom: 5px;
  border-radius: 999px 999px 4px 4px;
}

.storage-panel input[type="file"],
.storage-actions input[type="file"] {
  display: none;
}

.file-btn input[type="file"] {
/* ===== 6. Workspace & Views ===== */
  display: none;
}


.workspace {
  background: var(--bg);
  font-size: var(--data-font-size);
  overflow-x: hidden;
  padding: 5px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  overflow-x: hidden;
}

/* Topbars and section headers use Page Font Size instead */
.workspace .topbar {
  font-size: var(--app-font-size);
}
.workspace section.panel > h3,
.workspace .form-section > h3 {
  font-size: var(--app-font-size);
}

/* List View only: fill viewport and scroll table internally */
@media (min-width: 901px) {
  .app-shell:has(#homeView.active #homeListWrap:not(.hidden)) {
    height: 100vh;
    overflow: hidden;
  }

  .app-shell:has(#homeView.active #homeListWrap:not(.hidden)) .workspace {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-bottom: 3px;
  }
}

#homeView.active:has(#homeListWrap:not(.hidden)) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#homeView.active:has(#homeListWrap:not(.hidden)) .metric-row,
#homeView.active:has(#homeListWrap:not(.hidden)) .filters,
#homeView.active:has(#homeListWrap:not(.hidden)) .home-view-toolbar,
#homeView.active:has(#homeListWrap:not(.hidden)) .home-compare-bar:not(.hidden),
#homeView.active:has(#homeListWrap:not(.hidden)) #dashboardAlerts:not([hidden]),
#homeView.active:has(#homeListWrap:not(.hidden)) .statusbar {
  flex-shrink: 0;
  margin-top: 6px;
  margin-bottom: 0;
  min-height: 28px;
}

#homeView.active:has(#homeListWrap:not(.hidden)) #homeListWrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* Property List view: fill viewport and scroll table internally */
@media (min-width: 901px) {
  .app-shell:has(#listView.active) {
    height: 100vh;
    overflow: hidden;
  }

  .app-shell:has(#listView.active) .workspace {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-bottom: 8px;
  }
}

#listView.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#listView.active .topbar,
#listView.active .filters,
#listView.active .statusbar {
  flex-shrink: 0;
}

/* ===== 7. Panel / Surface Styles ===== */
#listView.active .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.topbar,
.filters,
.form-grid,
.panel,
.metric-card,
.table-wrap,
.detail-modal,
.app-dialog-box {
/* ===== 8. Home View � Tables ===== */
  background: var(--surface);
  border: 1px solid rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  -webkit-backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  box-shadow: 0 8px 32px rgba(16, 24, 32, calc(0.07 + var(--ui-glass-strength) * 0.08));
}

/* Home / CRM list tables: page color container, card-style rows */
#homeListWrap.table-wrap,
.crm-matches-table-wrap.table-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#homeListWrap.table-wrap {
  max-height: none;
}

#homeListTable tbody tr,
#crmMatchesTable tbody tr {
  background: var(--surface);
}

#homeListTable,
#crmMatchesTable {
  border-spacing: 0 8px;
}

#homeListTable thead th,
#crmMatchesTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 4px;
  border-bottom: none;
}


#homeListTable tbody tr,
#crmMatchesTable tbody tr {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  z-index: 1;
}
#homeListTable tbody tr:hover,
#crmMatchesTable tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 2;
  cursor: default;
}

#homeListTable tbody tr:hover,
#homeListTable tbody tr:hover td {
  background: #ffffff;
}

#crmMatchesTable tbody tr:hover {
  background: #eaf3ff;
}
#homeListTable tbody tr td,
#crmMatchesTable tbody tr td {
  border-bottom: none;
}

#listTable {
  border-collapse: separate;
  border-spacing: 0;
}
#listTable td[data-field="propertyId"] {
  white-space: nowrap;
}
#listTable tbody tr {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  z-index: 1;
}
#listTable tbody tr:hover {
  background: #eaf3ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 2;
  cursor: default;
}
#listTable tbody tr td:first-child {
  border-radius: 6px 0 0 6px;
}
#listTable tbody tr td:last-child {
  border-radius: 0 6px 6px 0;
}
#homeListTable tbody tr td:first-child,
#crmMatchesTable tbody tr td:first-child {
  border-radius: 8px 0 0 8px;
  position: relative;
}

#homeListTable .home-compare-check {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  z-index: 2;
}

#homeListTable tbody tr td:last-child,
#crmMatchesTable tbody tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
  border-radius: 8px;
  padding: 5px 10px;
}

.topbar h2 {
  font-size: 26px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
/* ===== 9. Metric Cards ===== */
  align-items: center;
  justify-content: flex-end;
}

.actions.left {
  justify-content: flex-start;
  margin: 12px 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card {
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 5px 14px;
}

.metric-card.sale {
  border-left-color: var(--sale);
}

.metric-card.rent {
  border-left-color: var(--rent);
}

.metric-card.inactive {
  border-left-color: var(--inactive);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: var(--data-font-size);
  margin-bottom: 7px;
}

.metric-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.filters {
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 5px;
}

.filters label {
  justify-items: start;
}
.filters input,
.filters select {
  height: 30px;
  min-height: 30px;
  width: auto;
  min-width: 15ch;
  border-color: #6b7a73;
}



.form-grid,
.panel {
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filters.flat {
  box-shadow: none;
  margin-bottom: 12px;
}

.grid-7,
.grid-8,
.grid-6,
.grid-4 {
  display: grid;
/* ===== 10. Filters ===== */
  gap: 10px;
}

.grid-7 {
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.filters.grid-6 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.filters.grid-6 > label {
  min-width: 0;
}
.filters.grid-6 > label input,
.filters.grid-6 > label select {
  width: 100%;
}

.filters.grid-7 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.filters.grid-7 > label {
  min-width: 0;
}
.filters.grid-7 > label.span-2 {
  grid-column: span 2;
}
.filters.grid-7 > label input,
.filters.grid-7 > label select {
  width: 100%;
}

.filters.grid-6 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.filters.grid-6 > label {
  min-width: 0;
}
.filters.grid-6 > label.span-2 {
  grid-column: span 2;
}
.filters.grid-6 > label input,
.filters.grid-6 > label select {
  width: 100%;
}

.grid-8 {
  grid-template-columns: repeat(8, 1fr);
}

/* All sizes: grid with minimum 295px per column */
.filters.grid-8 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.filters.grid-8 > label {
  min-width: 0;
}
.filters.grid-8 > label input,
.filters.grid-8 > label select {
  width: 100%;
}
.filter-btn-col {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
}
.filter-btn-col .filter-reset-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 16px;
}

/* ≤700px: always 2 equal columns */
@media (max-width: 700px) {
  .filters.grid-8,
  .filters.grid-7,
  .filters.grid-6,
  .report-selector {
    grid-template-columns: 1fr 1fr;
  }
  .home-view-toolbar {
    gap: 6px;
    padding: 2px 0;
  }
  .home-view-toolbar #homeNewRecordBtn {
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* Tablet: 701px–900px → 4 columns */
@media (min-width: 701px) and (max-width: 900px) {
  .filters.grid-8,
  .filters.grid-7,
  .filters.grid-6 {
    grid-template-columns: repeat(4, 1fr);
  }
  .sale-panel .form-fields {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

/* Laptop: 901px–1600px → 5 columns */
@media (min-width: 901px) and (max-width: 1600px) {
  .filters.grid-8,
  .filters.grid-7,
  .filters.grid-6 {
    grid-template-columns: repeat(5, 1fr);
  }
}
/* ===== 11. Data Entry Forms ===== */

.grid-6 {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

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

.price-range-panel {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(160px, 220px);
  gap: 12px;
}

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

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background-color: color-mix(in srgb, var(--panel) calc(100% - var(--ui-glass-strength) * 30%), var(--bg));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  min-width: 0;
/* ===== 12. Form Fields ===== */
  overflow: hidden;
}

.form-section h3,
.panel h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

.form-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

label {
  display: grid;
  gap: 5px;
  color: #39443d;
  font-size: var(--data-font-size);
}

label small {
  color: #6f7b75;
  font-size: 11px;
  line-height: 1.2;
}

.inline-input-pair {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(130px, 0.38fr);
  gap: 8px;
}

.sale-panel .form-fields label {
  align-content: start;
}

.sale-panel .form-fields input {
  width: 100%;
  min-width: 15ch;
}
.sale-panel .form-fields select {
  width: auto;
  min-width: 15ch;
}
.sale-panel .form-fields input[type="date"] {
  min-width: 0;
}

#saleSoldDate {
  width: 100%;
  min-width: 0;
}

#priceUnit,
#minimumPriceUnit,
#rentPriceUnit,
#saleSoldPriceUnit,
#rentRentPriceUnit,
#rentDepositUnit,
#customerBudgetPriceUnit,
#customerBudgetPriceUnit2 {
  width: 10ch;
  min-width: 10ch;
}

#saleSoldTime,
#saleSoldPrice {
  width: 100%;
  min-width: 0;
}

.price-link-toggle {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  color: var(--ink);
}

.price-link-toggle input {
  width: 18px;
  min-height: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #6b7a73;
  background: rgba(255, 255, 255, calc(1 - var(--ui-glass-strength) * 0.2));
  color: var(--ink);
  border-radius: 7px;
  padding: 2px 5px;
  min-height: 25px;
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, 0.02);
}

select {
  width: auto;
  min-width: 15ch;
  border: 1px solid #6b7a73;
  background: rgba(255, 255, 255, calc(1 - var(--ui-glass-strength) * 0.2));
  color: var(--ink);
  border-radius: 7px;
  padding: 2px 5px;
  min-height: 25px;
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, 0.02);
}

/* ===== 13. Form Elements ===== */
.form-fields input,
.form-fields select,
.form-fields textarea {
  border-color: #aab5b0;
}

.form-fields input[type="datetime-local"] {
  min-width: 0;
}

.form-fields input[list]::-webkit-calendar-picker-indicator {
  display: none;
}
.form-fields input[list]::-webkit-list-button {
  display: none;
}

input[readonly] {
  background: #f2f6f8;
  color: #51606b;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(23, 107, 91, 0.12);
}

/* Small filter icon button used in home filters */
.filter-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(17,24,39,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
}
.filter-btn svg { display: block; }
.filter-btn:hover { background: rgba(15,118,110,0.08); color: var(--accent); border-color: rgba(15,118,110,0.18); }
.sort-btn { width: 34px; height: 34px; min-width: 34px; padding: 6px; border-radius: 8px; background: var(--icon-bg); border: 1px solid rgba(17,24,39,0.06); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--icon-color); }

.sort-btn svg { display: block; }

.price-range-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.price-range-row input {
  width: 100%;
  min-width: 0;
  flex: 1 1 0;
}
.price-range-dash {
  color: var(--muted);
  font-weight: 400;
  flex-shrink: 0;
  font-size: 14px;
  align-self: center;
}
.filter-reset-btn {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 6px;
  background: var(--icon-bg);
  border: 1px solid rgba(17,24,39,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--icon-color);
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.filter-reset-btn:hover {
  background: rgba(15,118,110,0.08);
  color: var(--accent);
  border-color: rgba(15,118,110,0.18);
}
.sort-btn:hover { background: rgba(15,118,110,0.08); color: var(--accent); border-color: rgba(15,118,110,0.18); }

/* Compact popup for filter controls (contains Sort select) */
.filter-popup {
  position: absolute;
  display: none;
  min-width: 180px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(17,24,39,0.12);
  padding: 10px;
  border-radius: 8px;
  z-index: 1200;
}
.filter-popup label { margin: 0; display: block; }
.filter-popup.visible { display: block; }

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

.span-4 {
  grid-column: span 4;
}

/* ===== 14. Home Toolbar & Compare ===== */
.home-view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px;
  padding-bottom: 5px;
}


.home-view-toolbar #homeSortBtn {
  margin-left: auto;
}

.home-list-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-presets {
  margin-top: 16px;
}
.theme-presets-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.theme-preset-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  min-width: 60px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.theme-preset-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.theme-preset-card.active {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.theme-preset-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(0,0,0,0.1);
}


.home-list-zoom-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-list-zoom input[type="range"] {
  width: 96px;
  accent-color: var(--accent);
  cursor: pointer;
}

#homeListZoomValue {
  min-width: 38px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.theme-preset-actions {
  margin-bottom: 12px;
}

.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 18px;
}

.theme-color-group {
  display: grid;
  gap: 8px;
}

.theme-color-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.theme-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.theme-swatch {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid rgba(17, 24, 39, 0.08);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.theme-swatch:hover {
  transform: translateY(-1px);
}

.theme-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.theme-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  min-width: 100px;
  cursor: pointer;
}

.theme-range-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 32px;
  text-align: center;
}

.theme-swatch-custom {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f4f6f8 45%, #dfe6ec 45% 55%, #0f766e 55%);
}

.theme-swatch-custom::after {
  content: "+";
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.theme-swatch-custom.active::after {
  content: "\2713";
  font-size: 14px;
}

.theme-swatch-custom input[type="color"] {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

.theme-hex-input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  text-align: center;
}

.home-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
}

.home-icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 8px;
  background: var(--icon-bg);
  border: 1px solid transparent;
  color: var(--icon-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-icon-btn:hover,
.home-view-btn:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.18);
}

.home-icon-btn.active,
.home-view-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.home-compare-bar {
  display: flex;
  align-items: center;
  margin: -4px 0 12px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
  white-space: nowrap;
}

#homeCompareRunBtn,
#homeCompareClearBtn {
  padding: 3px 10px;
}
.home-compare-bar span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.home-compare-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.home-compare-actions button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 180ms, color 180ms, border-color 180ms;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.home-compare-actions button:hover {
  background: var(--btn-solid-hover, var(--accent));
  color: var(--btn-text-hover, #fff);
  border-color: var(--accent);
}

.home-compare-actions button:disabled {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: default;
  opacity: 0.6;
}

.home-compare-cell {
  display: none;
}

.home-compare-selected {
  border-radius: 8px;
}

#homeListTable .home-compare-selected td,
#crmMatchesTable .home-compare-selected td {
  background: color-mix(in srgb, var(--compare-color, #0f766e) 50%, transparent);
}

.property-card.home-compare-selected {
  background: color-mix(in srgb, var(--compare-color, #0f766e) 50%, transparent);
}

.row-clicked {
  border-radius: 8px;
}

#homeListTable .row-clicked td {
/* ===== 15. CRM View ===== */
  background: color-mix(in srgb, var(--select-color, #4a7ad4) 30%, transparent);
}

.property-card.row-clicked {
  background: color-mix(in srgb, var(--select-color, #4a7ad4) 30%, transparent);
}

.home-list-row {
  position: relative;
}

.home-compare-pick {
  display: none;
  align-items: center;
  margin-right: 6px;
}

.home-compare-mode .home-compare-pick {
  display: inline-flex;
}

body:not(.home-compare-mode) #homeListTable .home-compare-cell {
  display: none;
}

body:not(.crm-compare-mode) #crmMatchesTable .home-compare-cell {
  display: none;
}

.crm-matches {
  display: grid;
  gap: 10px;
}

.crm-matches-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-matches-toolbar h4 {
  margin: 0;
  font-size: 15px;
}

.crm-matches-table-wrap {
  max-height: 420px;
}

.crm-matches-status {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.crm-matches-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.crm-matches-panel {
  grid-row: span 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.crm-matches-panel #customerMatches {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.crm-matches-panel .crm-matches-table-wrap {
  flex: 1;
  max-height: none;
  min-height: 0;
}

#crmMatchesTable {
  width: max-content;
  min-width: 100%;
}

#crmMatchesTable th,
#crmMatchesTable td {
  white-space: nowrap;
  padding: 5px;
/* ===== 16. Timeline & Alerts ===== */
}

.timeline-item,
.alert-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  margin-bottom: 8px;
  background: var(--panel);
}

.alert-item.unread {
  border-color: var(--accent);
  background: var(--soft);
}

.timeline-item strong,
.alert-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.timeline-item p,
.alert-item p {
  margin: 4px 0;
  font-size: 13px;
}

.timeline-item small,
.alert-item small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-list,
.alert-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 12px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.timeline-actions {
  display: flex;
  gap: 4px;
}

.card-head-side {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}

/* ===== 17. Compare View ===== */
#compareView.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 10px);
  overflow-y: auto;
}

#compareBody {
  flex: 1;
  display: grid;
  padding: 16px;
  margin: 0;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  -webkit-backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  box-shadow: 0 8px 32px rgba(16, 24, 32, calc(0.07 + var(--ui-glass-strength) * 0.08));
}

#compareBody .compare-table-wrap {
  overflow: auto;
  max-height: none;
}

.compare-table {
  table-layout: fixed;
  width: 100%;
  height: auto;
}

.compare-table th,
.compare-table td {
  vertical-align: top;
  word-break: break-word;
  border-bottom: 1px solid var(--line);
}

.compare-table th:first-child,
.compare-table td:first-child {
  width: 140px;
  min-width: 140px;
}

.compare-table thead th small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.compare-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.home-list-row {
  cursor: pointer;
}

.home-list-row:hover {
  background: #ffffff;
}

.home-list-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}

.home-list-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  --home-list-zoom: 1;
}

#homeListTable {
  width: max-content;
  min-width: 100%;
  zoom: var(--home-list-zoom);
}

#homeListTable th,
#homeListTable td,
#crmMatchesTable th,
#crmMatchesTable td {
  white-space: nowrap;
  border-bottom: none;
}
#homeListTable th {
  padding: 5px;
}

.home-list-remark {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.home-list-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.home-list-map-btn:hover {
  background: var(--accent);
  color: #fff;
}

.display-field-list {
  display: grid;
  gap: 8px;
}

.display-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.display-field-item label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0;
  background: none;
}

.display-field-order {
  display: inline-flex;
  gap: 4px;
}

.display-field-move {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  background: #f7f9f7;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
}

.display-field-move:hover {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.08);
}

input[type="color"] {
  width: 100%;
  min-height: 40px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
/* ===== 18. Property Cards ===== */

.property-grid {
  display: grid;
  grid-template-columns: repeat(var(--card-columns, 3), minmax(0, 1fr));
  gap: 5px;
}

.property-card {
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow: hidden;
  background: var(--surface);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.property-card:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.property-card h3 {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.property-address-line,
.detail-address-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.type-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.type-pill {
  background: #f1eadb;
  color: #6d471b;
}

.status-pill {
  background: #edf3ef;
  color: #2f4c3e;
}

.status-pill.sold {
  background: #ecf6f1;
  color: var(--sale);
}

.status-pill.rented {
  background: #edf4fb;
  color: var(--rent);
}

.status-pill.inactive {
  background: #f3edff;
  color: var(--inactive);
}

.price-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--accent);
  font-weight: 800;
}

.price-line .min-price {
  color: #8a5b16;
}

.property-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.property-facts div {
  border-top: var(--row-line-width, 1px) var(--row-line-style, solid) var(--row-line-color, var(--line));
  padding-top: 8px;
}

.property-facts dt {
  font-size: 11px;
}

.property-facts dd {
  margin: 2px 0 0;
  font-size: 13px;
}

.remark {
  margin: 0;
  color: #3f4942;
  font-size: 13px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-height: 112px;
}

.photo-strip img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.photo-strip.empty-photo {
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
/* ===== 19. Maps & Attachments ===== */
}

.map-preview {
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #edf2f7;
}

.earth-preview {
  height: 220px;
}

.map-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map-embed-preview {
  display: grid;
  grid-template-rows: 1fr auto;
}

.map-image-preview {
  display: block;
  color: inherit;
  text-decoration: none;
}

.map-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-link-preview {
  display: grid;
  place-items: center;
  padding: 16px;
}

.map-link-preview a,
.map-open-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.map-open-link {
  display: block;
  text-align: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.attachment-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.attachment-preview > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.attachment-preview strong {
  display: block;
  margin-bottom: 6px;
}

.attachment-link {
  display: inline-flex;
  max-width: 100%;
  margin: 2px 5px 2px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.rate-suffix {
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
}

.user-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  float: left;
  margin-right: 8px;
  border: 1px solid var(--line);
}

.card-actions,
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.card-actions {
  margin-top: auto;
  min-height: 34px;
}

.card-actions button,
.row-actions button {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
}

.card-actions button {
  min-width: 64px;
}

.row-actions.compact {
  min-width: 220px;
}

#listTable .row-actions.compact button[data-action="saleForm"],
#listTable .row-actions.compact button[data-action="rentForm"],
#listTable .row-actions.compact button[data-action="edit"],
#listTable .row-actions.compact button[data-action="map"],
#listTable .row-actions.compact button[data-action="earth"],
#listTable .row-actions.compact button[data-action="delete"] {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
  max-height: calc(100vh - 255px);
}

.table-wrap.small {
  max-height: 390px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.panel table {
  min-width: 430px;
}

th,
td {
  padding: 5px;
  border-bottom: var(--row-line-width, 1px) var(--row-line-style, solid) var(--row-line-color, var(--line));
  text-align: left;
  vertical-align: top;
  font-size: var(--data-font-size);
}

th {
  background: var(--title-box-bg);
  color: var(--title-text-color);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--accent);
}

td strong,
td small {
  display: block;
}

td small {
  color: var(--muted);
  margin-top: 3px;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  height: 28px;
  min-height: 0;
}

.statusbar .home-list-zoom { gap: 4px; }
.statusbar .home-list-zoom-label,
.statusbar #homeListZoomValue { font-size: 10px; }
.statusbar #homeListZoomValue { min-width: 28px; }
#listCount, #homeCount { font-size: 14px; font-weight: 700; }
#listView .statusbar { height: 18px; }
.statusbar .home-list-zoom input[type="range"] {
/* ===== 20. System / Settings ===== */
  height: 14px;
  width: 120px;
  padding: 0;
  margin: 0;
}

.system-grid,
.report-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 5px;
}

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

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

#crmView .settings-grid {
  grid-template-columns: 0.7fr 2fr;
}

#crmView .form-fields.two-col > * {
  min-width: 0;
}

#crmView .form-fields.two-col .span-2 {
  grid-column: 1 / -1;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-sections .panel h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.95em;
}

.glass-setting {
  display: grid;
  gap: 8px;
}

.glass-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.glass-setting-row input[type="range"] {
  flex: 1;
}

.glass-setting-row span {
  min-width: 42px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.glass-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 45%),
    linear-gradient(225deg, rgba(184, 134, 11, 0.1), transparent 40%),
    var(--bg);
}

.glass-preview-card {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  -webkit-backdrop-filter: blur(calc(var(--ui-glass-strength) * 16px));
  box-shadow: 0 8px 32px rgba(16, 24, 32, calc(0.07 + var(--ui-glass-strength) * 0.08));
}

.device-management-list {
  margin-top: 8px;
}

.device-table {
  width: 100%;
}

.device-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.device-badge.current {
  background: #e6f4f1;
  color: #0f766e;
}

.device-badge.remote {
  background: #fff4e5;
  color: #9a6700;
}

button.small {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}

.glass-preview-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.glass-preview-card strong {
  display: inline-block;
  font-size: calc(15px + var(--ui-glass-strength) * 2px);
  transition: font-size 220ms ease;
}

.glass-preview-btn {
  pointer-events: none;
  font-size: calc(1em + var(--btn-glass-strength) * 0.12em);
  transition: font-size 220ms ease, background 220ms ease, backdrop-filter 220ms ease, box-shadow 220ms ease;
  background: rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-bubble-fill)));
  border-color: rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-bubble-border)));
  backdrop-filter: blur(var(--btn-glass-blur-px)) saturate(var(--btn-glass-saturate));
  -webkit-backdrop-filter: blur(var(--btn-glass-blur-px)) saturate(var(--btn-glass-saturate));
  box-shadow:
    0 10px 28px rgba(15, 23, 42, calc(var(--btn-glass-strength) * 0.12)),
    inset 0 1px 1px rgba(255, 255, 255, calc(var(--btn-glass-strength) * var(--btn-glass-highlight))),
    inset 0 -1px 1px rgba(255, 255, 255, calc(var(--btn-glass-strength) * 0.2));
}

.glass-preview-ui,
.glass-preview-btn-wrap {
  justify-content: flex-start;
}

.glass-preview-btn-wrap {
  min-height: 52px;
  align-items: center;
}

.theme-glass-bottom {
  grid-column: 1 / -1;
}

button:where(:not(.nav-btn):not(.profile-chip):not(.subtle):not(.ghost):not(.danger):not(.inactive-action):not(.home-icon-btn):not(.home-view-btn):not(.sort-btn):not(.filter-btn):not(.filter-clear)),
.file-btn {
  background: var(--btn-plain-bg, var(--bg));
  color: var(--btn-plain-text, var(--ink));
  border-color: var(--line);
  box-shadow: none;
}
button:where(:not(.nav-btn):not(.profile-chip):not(.subtle):not(.ghost):not(.danger):not(.inactive-action):not(.home-icon-btn):not(.home-view-btn):not(.sort-btn):not(.filter-btn):not(.filter-clear)):hover,
.file-btn:hover {
  background: var(--btn-solid-hover, var(--accent));
  color: var(--btn-text-hover, #fff);
  border-color: var(--accent);
}

.panel {
  margin: 0;
  min-width: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-form.two {
  grid-template-columns: 1fr 130px auto;
}

.form-fields.two-col,
.user-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.verification-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.verification-row button {
  font-size: 12px;
  padding: 4px 8px;
}

.verification-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.verification-status.verified {
  color: var(--accent);
}

.google-drive-auth-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.google-drive-auth-row button {
  font-size: 12px;
  padding: 4px 8px;
}

.span-2 {
  grid-column: span 2;
}

.span-2 .form-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.perm-select-all-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  padding: 6px 0;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 4px;
}

.perm-select-all-check input {
  width: auto;
  min-height: 0;
}

.perm-split-layout {
  display: flex;
  gap: 16px;
  min-height: 400px;
  margin-top: 12px;
}

.perm-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perm-sidebar-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.perm-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  border-bottom: 1px solid var(--line);
}

.perm-sidebar-header h4 {
  margin: 0;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

.perm-sidebar-header button.subtle {
  font-size: 0.8em;
  padding: 2px 10px;
  width: auto;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: none;
  justify-content: center;
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.perm-sidebar-header button.subtle:hover {
  opacity: 0.85;
}

.perm-list {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.perm-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.88em;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.12s;
}

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

.perm-list-item:hover {
  background: rgba(0,0,0,0.04);
}

.perm-list-item.active {
  background: var(--accent);
  color: #fff;
}

.perm-list-item .perm-list-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 600;
  flex-shrink: 0;
}

.perm-list-item .perm-list-icon.user-icon-item {
  background: var(--accent);
  color: #fff;
}

.perm-list-item .perm-list-icon.group-icon-item {
  background: var(--accent2, #6b7280);
  color: #fff;
}

.perm-list-item .perm-list-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perm-list-item .perm-list-meta {
  font-size: 0.78em;
  opacity: 0.6;
}

.perm-sidebar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 4px;
}

.perm-sidebar-actions button.subtle,
.sidebar-restore-label.subtle {
  font-size: 0.78em;
  padding: 5px 12px;
  width: 100%;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 0;
  font-weight: 500;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.perm-sidebar-actions button.subtle:hover,
.sidebar-restore-label.subtle:hover {
  opacity: 0.85;
}

.sidebar-restore-label input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  overflow: hidden;
  z-index: -1;
}

.perm-main {
  flex: 1;
  min-width: 0;
}

.perm-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 300px;
}

.perm-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--muted);
  font-size: 0.95em;
}

.perm-editor-form {
  padding: 16px;
}

.perm-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.perm-editor-header h3 {
  margin: 0;
  font-size: 1.05em;
}

.perm-editor .user-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.perm-editor .inline-form {
  margin-bottom: 14px;
}

.display-field-dual {
  margin-top: 10px;
}
.dual-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.dual-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dual-column .dual-label {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 4px;
  padding: 4px 6px;
  background: rgba(223,230,236,0.4);
  border-radius: 4px;
  text-align: center;
}
.dual-column select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  background: #fff;
  font-size: 13px;
}
.dual-column select option {
  padding: 3px 5px;
}
.dual-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 2px;
}
.dual-buttons button {
  min-width: 36px;
  min-height: 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.dual-buttons button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.dual-order {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  justify-content: flex-end;
}
.dual-order button {
  min-width: 32px;
  min-height: 28px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.dual-order button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.display-apply-btn {
  margin-left: auto;
  align-self: center;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.permission-grid.compact {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

#userPermissionChecks,
#groupPermissionChecks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

#groupPermissionChecks .perm-category-items {
  grid-template-columns: repeat(2, 1fr);
}

.permission-grid label:not(.perm-item):not(.perm-category-toggle) {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.permission-grid input:not(.perm-item input):not(.perm-category-toggle input) {
  width: auto;
  min-height: 0;
}

.perm-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
}

.perm-category-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  border-bottom: 1px solid var(--line);
}

.perm-category-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9em;
}

.perm-category-toggle input {
  width: auto;
  min-height: 0;
}

.perm-category-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 12px;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.88em;
  transition: background 0.15s;
}

.perm-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.perm-item input {
  width: auto;
  min-height: 0;
  flex-shrink: 0;
}

.perm-item span {
  line-height: 1.3;
}

.perm-group-inherited {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.02);
}

.perm-group-badge {
  font-size: 0.72em;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  margin-left: auto;
}

.field-selector {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 12px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  padding: 6px 10px;
  font-size: 12px;
}

.selected-chip button {
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
}

.utility-picker {
  align-items: end;
}

.system-info {
  margin: 0;
  display: grid;
  gap: 12px;
}

.system-info div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.system-info dt {
  color: var(--muted);
  font-size: 12px;
}

.system-info dd {
  margin: 3px 0 0;
  word-break: break-word;
}

.database-path-form {
  margin-top: 14px;
}

.settings-note,
.warning-text {
  color: var(--danger);
  font-size: 12px;
}

.backup-settings {
  margin-top: 14px;
}

.backup-settings label:has(input[type="checkbox"]) {
  align-content: end;
/* ===== 21. Report View ===== */
}

.backup-settings input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}

.report-block {
  display: none;
}

.report-block.active {
  display: block;
}

.alert-panel ul,
.alert-list,
.timeline-list,
.match-list {
  display: grid;
  gap: 8px;
}

.alert-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.match-item,
.timeline-item,
.alert-item,
.map-pin {
  display: grid;
  gap: 3px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
}

.alert-item.unread {
  border-color: var(--accent-2);
  background: #fff8e7;
}

.timeline-item p,
.alert-item p {
  margin: 0;
}

.map-visual {
  min-height: 180px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    #f8faf9;
  background-size: 28px 28px;
}

.map-pin {
  position: relative;
  padding-left: 30px;
}

.map-pin::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

.trend-chart {
  min-height: 180px;
  margin-top: 14px;
}

.trend-bars {
  min-height: 170px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

.trend-bar {
  min-width: 54px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #74b3a8);
  color: #fff;
}

.trend-bar span,
.trend-bar small {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.sale-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.sale-tabs button {
  background: #f7f9f7;
  border-color: var(--line);
  color: var(--ink);
}

.sale-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sale-tabs button.right {
  margin-left: auto;
}

.sale-panel {
  display: none;
}

.sale-panel.active {
  display: block;
}

.transaction-summary {
  margin-top: 14px;
}

.text-list,
.export-picker {
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.report-split-layout {
  display: flex;
  gap: 10px;
  min-height: 400px;
}

.report-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 200px;
  min-width: 0;
  flex-shrink: 0;
}

.report-sidebar-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.report-sidebar-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
  border-bottom: 1px solid var(--line);
}

.report-sidebar-header h4 {
  margin: 0;
  font-weight: 600;
}

.report-type-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-type-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 8px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--data-font-size);
  cursor: pointer;
  min-height: auto;
  box-shadow: none;
  transform: none;
}

.report-type-item:hover {
  transform: none !important;
  box-shadow: none !important;
  font-size: var(--data-font-size) !important;
}

.report-type-item:hover:not(.active) {
  background: transparent !important;
  color: var(--ink) !important;
}

.report-type-item:last-child {
  border-bottom: none;
}

.report-type-wrap {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.report-type-wrap:last-child {
  border-bottom: none;
}

.report-type-toggle {
  font-size: 10px;
  margin-left: 6px;
}

.report-type-fields {
  padding: 8px 12px 8px 20px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-type-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--data-font-size);
  cursor: pointer;
  padding: 3px 0;
}

.report-type-fields input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.report-status-options input[type="radio"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.report-type-item.active {
  background: var(--accent);
  color: #fff;
}

.report-main {
  flex: 1;
  min-width: 0;
}

.property-history-content {
  font-size: 15px;
}

.property-history-content table th,
.property-history-content table td {
  padding: 8px 12px;
}

.history-table {
  width: 100%;
  min-width: 0;
}

.history-table th,
.history-table td {
  white-space: nowrap;
  font-size: 15px;
  padding: 8px 12px;
}

.trans-row {
  cursor: pointer;
}

.trans-row:hover {
  background: var(--soft);
}

.history-table td:first-child {
  width: 140px;
  font-weight: 600;
  color: var(--ink);
}

.property-history-content .attachment-link {
  font-size: 14px;
}

.report-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.report-selector > label {
  min-width: 0;
}

.report-selector > label.span-2 {
  grid-column: span 2;
}
.report-selector > label input,
.report-selector > label select {
  width: 100%;
  min-width: 0;
}

.select-clear {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.report-date-input {
  width: 100%;
}

.filter-clear {
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #f7f9f7;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.filter-clear:hover {
  border-radius: 7px;
  transform: none;
  box-shadow: none;
}

.panel-toggle {
  width: 100%;
  justify-content: space-between;
}

.report-field-panel {
  padding: 10px;
  margin-bottom: 15px;
}

.report-field-panel .panel-toggle {
  min-height: 46px;
  border-radius: 7px !important;
  background: rgba(247, 249, 247, 0.86) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  border-left: 4px solid var(--accent) !important;
  box-shadow: none !important;
}

.report-field-panel .panel-toggle:hover {
  border-radius: 7px !important;
  transform: none !important;
  box-shadow: none !important;
}

.report-field-panel .permission-grid label:not(.perm-item):not(.perm-category-toggle) {
  border-radius: 7px;
  background: #fff;
}

.panel-toggle::after {
  content: "Show";
  font-size: 12px;
  opacity: 0.84;
}

.report-field-panel:not(.collapsed) .panel-toggle::after {
  content: "Hide";
}

.report-field-panel.collapsed #reportFieldChecks {
  display: none;
}

.report-summary-row {
  display: none !important;
}

.report-block .table-wrap {
  max-height: calc(100vh - 175px);
  overflow-x: auto;
}

.report-block table {
  min-width: max(900px, 100%);
  table-layout: auto;
}

.report-block th,
.report-block td {
  white-space: nowrap;
  min-width: 105px;
  padding: 5px;
  font-size: var(--data-font-size);
  line-height: 1.45;
}

.report-block h3 {
  margin-bottom: 10px;
}

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

.display-tab {
  background: #f7f9f7;
  color: var(--ink);
  border-color: var(--line);
}

.display-tab small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
}

.display-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.display-tab.active small {
  color: rgba(255, 255, 255, 0.9);
}

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

.display-tab-panel.active {
  display: block;
}

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

.system-tab {
  background: var(--system-tab-bg, #f7f9f7);
  color: var(--ink);
  border-color: var(--line);
}

.system-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.system-tab-panel.active {
  display: block;
}

.summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 8px;
  color: #39443d;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.summary-toggle input {
  width: 18px;
  min-height: 18px;
}

.report-type-item {
  background: #f7f9f7;
  border-color: var(--line);
  color: var(--ink);
}

.report-type-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.export-picker label {
  display: flex;
  align-items: center;
/* ===== 22. Modals & Dialogs ===== */
  gap: 6px;
}

.export-picker input,
.permission-grid input {
  width: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  padding: 18px;
}

#importMappingModal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.45);
}
#importMappingModal.hidden { display: none; }
#importMappingModal .modal-content {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
#importMappingModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
#importMappingModal .modal-header h3 {
  margin: 0;
  font-size: 18px;
}
#importMappingModal .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
#importMappingModal .modal-close:hover { color: var(--ink); }
#importMappingModal .modal-body { padding: 16px 20px; }
#importMappingModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.import-mapping-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.import-mapping-row:last-child { border-bottom: none; }
.import-mapping-row .excel-header {
  font-weight: 500;
  color: var(--ink);
}
.import-mapping-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}
.import-mapping-row .mapping-status {
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
}

.app-dialog-box {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px 22px 18px;
  border-radius: 12px;
}

.app-dialog-box h3 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}

.app-dialog-box p {
  margin: 0;
  white-space: pre-line;
  color: #34423d;
  line-height: 1.55;
  font-size: 14px;
}

.app-dialog-box input:not(.hidden) {
  margin-top: 2px;
}

.app-busy {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.app-busy-card {
  min-width: min(320px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 24px 28px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(16, 24, 32, 0.22);
}

.app-busy-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid #d9e2ec;
  border-top-color: var(--accent);
  animation: appBusySpin 0.85s linear infinite;
}

.app-busy-card p {
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

@keyframes appBusySpin {
  to { transform: rotate(360deg); }
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-dialog-actions button:not(.primary) {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.app-dialog-actions button.primary {
  min-width: 108px;
}

.detail-modal {
  width: min(820px, 100%);
  max-height: min(780px, 92vh);
  overflow: auto;
  border-radius: 8px;
  padding: 14px;
}

.detail-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -14px -14px 7px;
  padding: 12px 14px;
}

.detail-toolbar-left {
  display: flex;
  align-items: center;
}

.detail-row-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 0 0;
  box-shadow: none;
  margin-top: 4px;
}

[data-price-type].hidden { display: none; }

.detail-modal h2 {
  margin: 0 0 6px;
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.property-id-badge {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  white-space: nowrap;
  background: #eef6f5;
  cursor: pointer;
  user-select: all;
  transition: background-color 0.2s, transform 0.1s;
}

.property-id-badge:hover {
  background-color: #d9e9e6;
}

.property-id-badge:active {
  transform: scale(0.98);
}

.detail-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  flex-wrap: wrap;
}

.log-tabs,
.system-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.log-tab {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
/* ===== 23. About View ===== */
.log-tab:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.log-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.14);
}

.about-panel,
.about-content {
  display: grid;
  gap: 18px;
}

.about-content-block {
  margin: 0;
}

.about-content-text {
  color: #33413b;
  line-height: 1.75;
}

.about-content-text p,
.about-rich-editor p {
  margin: 0 0 12px;
}

.about-content-heading h2,
.about-content-heading h3,
.about-rich-editor h2,
.about-rich-editor h3 {
  margin: 0 0 10px;
}

.about-content-image {
  margin: 0;
}

.about-content-image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.about-content-image.align-left {
  text-align: left;
}

.about-content-image.align-center {
  text-align: center;
}

.about-content-image.align-right {
  text-align: right;
}

.about-content-divider,
.about-divider-preview {
  border: 0;
  border-top: 1px solid #d9dee5;
  margin: 8px 0;
}

.about-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.about-contact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.about-contact:hover {
  border-color: #b8c5c1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.about-contact-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.about-contact-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.about-contact strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.about-contact-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.about-contact-icon svg {
  width: 22px;
  height: 22px;
}

.about-contact-icon-phone {
  background: #ecfdf5;
  color: #0f766e;
}

.about-contact-icon-email {
  background: #eff6ff;
  color: #2563eb;
}

.about-contact-icon-address {
  background: #fff7ed;
  color: #ea580c;
}

.about-cms h4 {
  margin: 18px 0 8px;
  font-size: 14px;
}

.about-cms h4:first-of-type {
  margin-top: 0;
}

.about-cms-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.about-cms-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(240px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.about-cms-preview {
  position: sticky;
  top: 12px;
}

.about-preview-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 500px;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.about-preview-topbar {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.about-preview-topbar strong {
  display: block;
  font-size: 18px;
}

.about-preview-topbar p {
  margin: 4px 0 0;
  font-size: 13px;
}

.about-preview-body {
  padding: 16px;
  min-height: 220px;
}

.about-blocks-editor {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.about-block-card {
  border: 1px solid #d9dee5;
  border-radius: 10px;
  overflow: hidden;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.about-block-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f4f7f6;
  border-bottom: 1px solid #e6ecea;
  font-size: 13px;
}

.about-block-card-actions {
  display: flex;
  gap: 6px;
}

.about-block-card-actions button {
  min-width: 32px;
  padding: 4px 8px;
  font-size: 12px;
}

.about-drag-handle {
  cursor: grab;
  color: #9aa6b2;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  user-select: none;
  touch-action: none;
}
.about-drag-handle:active { cursor: grabbing; }

.about-block-card.dragging {
  opacity: 0.3;
  border-style: dashed;
}

.about-block-card.drag-over {
  border-top: 3px solid var(--accent);
}
.about-block-card.drag-over ~ .about-block-card.drag-over {
  border-top: 3px solid transparent;
}
.about-block-card.drag-over-bottom {
  border-bottom: 3px solid var(--accent);
}

.about-block-card-body {
  padding: 12px;
}

.about-block-note {
  margin-bottom: 10px;
  font-size: 12px;
}

.about-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.about-contact-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.about-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #e6ecea;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 13px;
}

.contact-drag-handle {
  cursor: grab;
  color: #9aa6b2;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
  touch-action: none;
}
.contact-drag-handle:active { cursor: grabbing; }

.about-contact-item.dragging {
  opacity: 0.3;
  border-style: dashed;
}
.about-contact-item.drag-over {
  border-top: 3px solid var(--accent);
}
.about-contact-item.drag-over ~ .about-contact-item.drag-over {
  border-top: 3px solid transparent;
}
.about-contact-item.drag-over-bottom {
  border-bottom: 3px solid var(--accent);
}

.about-contact-item .contact-type {
  font-weight: 600;
  color: var(--accent);
  min-width: 70px;
  font-size: 12px;
  text-transform: uppercase;
}

.about-contact-item .contact-value {
  flex: 1;
  color: var(--ink);
  word-break: break-all;
}

.about-contact-item button {
  min-width: 28px;
  min-height: 26px;
  padding: 2px 6px;
  font-size: 11px;
}

.about-contact-add {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.about-contact-add select {
  width: 100px;
  flex: none;
}
.about-contact-add input {
  flex: 1;
  min-width: 150px;
}
.about-contact-add button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.about-map-embed {
  margin-top: 10px;
}
.about-map-embed iframe {
  display: block;
}

.about-desc-label {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.about-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px;
  border: 1px solid #e6ecea;
  border-radius: 8px;
  background: #f8fafc;
}

.about-rich-toolbar button {
  min-width: 34px;
  padding: 4px 8px;
  font-size: 12px;
}

.about-rich-editor {
  min-height: 88px;
  padding: 12px;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
}

.about-rich-editor:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.about-image-editor {
  display: grid;
  gap: 10px;
}

.about-image-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.about-image-empty {
  min-height: 100px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #667085;
  background: #f8fafc;
}

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

.about-image-actions .file-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d9dee5;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.about-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-social-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 12px 10px 10px;
  border-radius: 12px;
  border: 1px solid #e6ecea;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background-color: rgba(248, 250, 252, calc(1 - var(--ui-glass-strength) * 0.3));
  border-color: rgba(223, 230, 236, calc(1 - var(--ui-glass-strength) * 0.5));
}

.about-social-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.about-social-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
}

.about-social-badge svg {
  width: 24px;
  height: 24px;
}

.about-social-badge-facebook { background: #1877f2; }
.about-social-badge-telegram { background: #26a5e4; }
.about-social-badge-viber { background: #7360f2; }
.about-social-badge-whatsapp { background: #25d366; }
.about-social-badge-website { background: #0f766e; color: #fff; }

.about-social-icon small {
  margin-top: 8px;
  font-size: 11px;
  color: #667085;
  font-weight: 600;
}

.print-preview-modal {
  width: min(1100px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 12px;
  padding: 16px 18px 22px;
}

.print-preview-body {
  margin-top: 12px;
}

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

.print-preview-body th,
.print-preview-body td {
  border: 1px solid #d9dee5;
  padding: 8px;
  font-size: 12px;
}

.property-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.property-detail-grid div {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.property-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.property-detail-grid dd {
  margin: 3px 0 0;
}

.empty-state {
/* ===== 24. Media Queries ===== */
  border-radius: 8px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
}

@media (max-width: 1600px) {
  .form-grid > .form-section.span-2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .property-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .grid-7,
  .grid-6,
  .form-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-fields {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

.mobile-menu-toggle {
  display: none;
}

.brand-mark-wrap {
  display: flex;
  align-items: center;
}

.mobile-top-left,
.mobile-top-center,
.mobile-top-right,
.mobile-profile {
  display: none;
}

.profile-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  padding: 0;
  transition: background 0.2s;
}

.profile-trigger:hover {
  background: rgba(255,255,255,0.12);
}

.profile-trigger .user-icon {
  width: 28px;
  height: 28px;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #1e2b26;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px;
  z-index: 300;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.profile-dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  border-radius: 7px;
  text-align: left;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.08);
}

.dropdown-item svg {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 16px;
    height: auto;
    justify-content: flex-start;
    align-items: center;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 46px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
  }

  .mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.1);
  }

  .brand {
    flex: 1;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: none;
    min-width: 0;
  }

  .brand .brand-mark-wrap {
    display: flex;
    align-items: center;
  }

  .brand > div:last-child {
    text-align: center;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .brand h1 {
    font-size: 15px;
    margin: 0;
  }

  .brand p {
    display: none;
  }

  .mobile-profile {
    display: none;
    align-items: center;
    position: relative;
    margin-left: auto;
  }

  .mobile-menu-open .mobile-profile {
    display: flex;
  }

  .nav {
    width: 100%;
    display: none;
    grid-template-columns: repeat(4, minmax(128px, 1fr));
    padding: 10px 0 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 10px;
  }

  .mobile-menu-open .nav {
    display: grid;
  }

  .user-panel {
    width: 100%;
    display: none;
    padding-top: 8px;
  }

  .mobile-menu-open .user-panel {
    display: flex;
  }

  .user-panel .profile-chip {
    display: none;
  }

  .user-panel {
    display: none;
  }

  .storage-actions,
  .price-range-panel,
  .perm-split-layout {
    flex-direction: column;
  }
  .perm-sidebar {
    width: 100%;
  }
  .perm-list {
    max-height: 160px;
  }
  .grid-6,
  .grid-4,
  .form-grid,
  .system-grid,
  .report-grid,
  .settings-grid,
  .permission-grid,
  .field-selector,
  .user-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-fields {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  #userPermissionChecks .perm-category-items,
  #groupPermissionChecks .perm-category-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .span-4 {
    grid-column: span 2;
  }

  /* Mobile view: show labels/text regardless of collapsed state */
  .app-shell.sidebar-collapsed .sidebar .brand > div:last-child,
  .app-shell.sidebar-collapsed .sidebar .brand p,
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar .profile-chip span:not(.user-icon),
  .app-shell.sidebar-collapsed .sidebar .user-panel .subtle,
  .app-shell.sidebar-collapsed .sidebar .sidebar-lang {
    opacity: 1;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .report-sidebar {
    width: 50px;
    min-width: 50px;
    overflow: hidden;
    transition: width 0.3s ease;
    white-space: nowrap;
  }
  .report-sidebar:hover {
    width: 200px;
  }

}

@media (max-width: 620px) {
  .topbar,
  .statusbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .nav-btn {
    min-height: 58px;
    align-items: center;
  }

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

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

  .about-cms-preview {
    position: static;
  }

  .about-cms-head {
    flex-direction: column;
  }

  .property-grid,
  .storage-actions,
  .price-range-panel,
  .attachment-preview,
  .grid-7,
  .grid-8,
  .grid-6,
  .system-grid,
  .report-grid,
  .inline-form,
  .inline-form.two,
  .settings-grid,
  .permission-grid,
  .field-selector,
  .user-editor,
  .perm-editor .user-editor,
  #crmView .settings-grid {
    grid-template-columns: 1fr;
  }
  .metric-row {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4 label input,
  .grid-4 label select {
    width: 100%;
  }
  #crmView .panel {
    padding: 5px;
  }
  #crmView .form-fields {
    gap: 5px;
  }
  #crmView .form-fields.two-col {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  #userPermissionChecks .perm-category-items,
  #groupPermissionChecks .perm-category-items {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
  .span-4 {
    grid-column: span 2;
  }
  .span-2 .form-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-2 .form-fields > * {
    min-width: 0;
  }
  .crm-matches-panel {
    grid-row: auto;
  }
}



.app-print-sheet {
  position: fixed;
  left: -10000px;
/* ===== 25. Print Styles ===== */
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media print {
  body.printing-app-sheet,
  body.printing-property-detail {
    background: #fff;
  }

  body.printing-app-sheet .app-shell,
  body.printing-app-sheet .sidebar,
  body.printing-app-sheet .workspace,
  body.printing-app-sheet .view,
  body.printing-app-sheet .login-screen,
  body.printing-app-sheet .app-dialog-backdrop,
  body.printing-app-sheet .modal-backdrop {
    display: none !important;
  }

  body.printing-app-sheet #appPrintSheet {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    overflow: visible;
    opacity: 1;
    display: block !important;
    pointer-events: auto;
  }

  body.printing-app-sheet .print-table table {
    min-width: 0;
    width: 100%;
  }

  body.printing-app-sheet .print-table th,
  body.printing-app-sheet .print-table td {
    font-size: 11px;
    padding: 6px 8px;
  }

  body.printing-app-sheet h1 {
    font-size: 20px;
    margin: 0 0 12px;
  }

  body.printing-property-detail {
    background: #fff;
  }

  body.printing-property-detail .app-shell,
  body.printing-property-detail .sidebar,
  body.printing-property-detail .workspace,
  body.printing-property-detail .view,
  body.printing-property-detail .modal-close,
  body.printing-property-detail .detail-toolbar,
  body.printing-property-detail .detail-actions,
  body.printing-property-detail .detail-row-actions {
    display: none !important;
  }

  body.printing-property-detail #propertyDetailModal {
    position: static;
    inset: auto;
    display: block !important;
    background: #fff;
    padding: 0;
  }

  body.printing-property-detail .detail-modal {
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: #fff;
    backdrop-filter: none;
  }

  body.printing-property-detail #propertyDetailBody {
    display: block !important;
  }

  body.printing-property-detail .photo-strip {
    grid-template-columns: repeat(4, 1fr);
    min-height: 0;
  }

  body.printing-property-detail .photo-strip img {
    max-height: 180px;
  }

  body.printing-property-detail .map-preview {
    height: 220px;
  }

  body.printing-property-detail .map-preview iframe {
    display: none;
  }

  body.printing-property-detail .property-detail-grid {
    gap: 0;
  }

  body.printing-property-detail .property-detail-grid div {
    border-bottom: 1px solid #d0d5dd;
    padding: 6px 4px;
  }

  body.printing-property-detail .property-detail-grid div:last-child {
    border-bottom: none;
  }

  .sidebar,
  .topbar,
  .filters,
  .text-list,
  .export-picker,
  .statusbar,
  .card-actions,
  .row-actions {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .view:not(.active) {
    display: none;
  }

  .table-wrap {
    border: 0;
    max-height: none;
    overflow: visible;
  }

  table {
    min-width: 0;
  }
}
/* Property Detail View ထဲက ခလုတ်တွေရဲ့ နောက်ခံ အဖြူရောင်ဘောင်ကို ဖျောက်ခြင်း */
.detail-toolbar, 
.detail-actions {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  backdrop-filter: none !important;
  padding-bottom: 0 !important; /* လိုအပ်ရင် အကွာအဝေးကို ညှိရန် */
}

/* ခလုတ်တွေ ပုံမပျက်ဘဲ မူလနေရာမှာပဲ သီးသန့်ပေါ်နေစေရန် */
.detail-toolbar button,
.detail-actions button {
  /* ခလုတ်တစ်ခုချင်းစီရဲ့ အရောင်ကို သီးသန့် ပေါ်လွင်အောင် ထားပေးခြင်း */
/* ===== 26. Animations & Misc ===== */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

#propertyDetailModal .detail-toolbar {
  margin-top: -5px !important;   /* ခလုတ်များကို အပေါ်သို့ တိုးတင်ပေးရန် (စိတ်ကြိုက် ကစားနိုင်ပါသည်) */
}

/* About Page Image Effects */
.about-content-image.effect-fade img,
.about-content-image-grid.effect-fade img,
.about-content-image-text.effect-fade img {
  animation: fadeIn 0.5s ease-in-out;
}

.about-content-image.effect-slide img,
.about-content-image-grid.effect-slide img,
.about-content-image-text.effect-slide img {
  animation: slideInLeft 0.5s ease-in-out;
}

.about-content-image.effect-slide.direction-left img,
.about-content-image-grid.effect-slide.direction-left img,
.about-content-image-text.effect-slide.direction-left img {
  animation: slideInLeft 0.5s ease-in-out;
}

.about-content-image.effect-slide.direction-right img,
.about-content-image-grid.effect-slide.direction-right img,
.about-content-image-text.effect-slide.direction-right img {
  animation: slideInRight 0.5s ease-in-out;
}

.about-content-image.effect-slide.direction-up img,
.about-content-image-grid.effect-slide.direction-up img,
.about-content-image-text.effect-slide.direction-up img {
  animation: slideInUp 0.5s ease-in-out;
}

.about-content-image.effect-slide.direction-down img,
.about-content-image-grid.effect-slide.direction-down img,
.about-content-image-text.effect-slide.direction-down img {
  animation: slideInDown 0.5s ease-in-out;
}

.about-content-image.effect-zoom img,
.about-content-image-grid.effect-zoom img,
.about-content-image-text.effect-zoom img {
  animation: zoomIn 0.5s ease-in-out;
}

.about-content-image.direction-up img {
  animation-direction: normal;
}

.about-content-image.direction-down img {
  animation-direction: reverse;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInDown {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.about-image-actions .custom-size-input.hidden,
.about-image-actions .effect-direction.hidden {
  display: none;
}

.about-image-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 12px;
  color: var(--muted);
}

.about-image-actions select,
.about-image-actions input[type="number"] {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  min-width: 80px;
}

.about-image-actions input[type="number"] {
  width: 60px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  line-height: normal;
  text-align: center;
}

.file-btn button {
  margin: 0;
}

.photo-zoom-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: 400px;
}

.photo-zoom-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.property-info-right {
  margin-left: auto;
}

/* About Page Image Grid */
.about-image-grid-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

.about-image-grid-preview .grid-item {
  position: relative;
}

.about-image-grid-preview .grid-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.about-image-grid-preview .grid-item img.shape-square {
  aspect-ratio: 1 / 1;
}

.about-image-grid-preview .grid-item img.shape-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.about-image-grid-preview .grid-item img.shape-rounded {
  border-radius: 16px;
}

.about-image-text-editor .about-image-preview.shape-square {
  aspect-ratio: 1 / 1;
}

.about-image-text-editor .about-image-preview.shape-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.about-image-text-editor .about-image-preview.shape-rounded {
  border-radius: 16px;
}

.about-content-image img.shape-square {
  aspect-ratio: 1 / 1;
}

.about-content-image img.shape-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.about-content-image img.shape-rounded {
  border-radius: 16px;
}

.about-image-grid-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}

.about-image-grid-editor {
  margin-bottom: 16px;
}

.about-content-image-grid img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

/* About Page Image + Text */
.about-image-text-editor {
  margin-bottom: 16px;
}

.about-image-text-layout {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.about-image-text-layout.layout-top,
.about-image-text-layout.layout-bottom {
  flex-direction: column;
}

.about-image-text-layout.layout-right {
  flex-direction: row-reverse;
}

.about-image-section {
  flex: 0 0 50%;
}

.about-image-section .about-image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.about-text-section {
  flex: 1;
}

.about-text-section .about-rich-editor {
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.about-content-image-text {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.about-content-image-text.layout-top,
.about-content-image-text.layout-bottom {
  flex-direction: column;
  align-items: center;
}

.about-content-image-text.layout-right {
  flex-direction: row-reverse;
}

.about-content-image-text img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.about-content-image-text > div {
  flex: 1;
}

/* Server connection warning bar */
.server-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #b42318;
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.server-warning.hidden {
  display: none;
}



/* Keep Settings > Display reorder controls visible. */
.display-field-dual .dual-order {
  flex-shrink: 0;
  min-height: 32px;
}

.display-field-dual .dual-order button,
.display-field-dual .dual-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--ink) !important;
}

.display-field-dual .dual-order button:hover,
.display-field-dual .dual-buttons button:hover {
  color: #fff !important;
}

.lang-both .mm-text {
  display: block;
  font-size: 0.85em;
  opacity: 0.65;
  line-height: 1.3;
}
