:root {
  --primary: #4361ee;
  --primary-dark: #304aca;
  --secondary: #805dca;
  --success: #00ab55;
  --danger: #e7515a;
  --warning: #e2a03f;
  --info: #2196f3;
  --dark: #0e1726;
  --sidebar: #ffffff;
  --body: #fafafa;
  --panel: #ffffff;
  --muted: #888ea8;
  --text: #3b3f5c;
  --heading: #0e1726;
  --border: #e0e6ed;
  --soft: #f1f2f3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 24px rgba(31, 45, 61, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body);
  color: var(--text);
  font-family: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 465px) 1fr;
  background: linear-gradient(135deg, #f7f8fb, #eef2ff);
}

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
  padding: 46px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.login-panel::after {
  content: "";
  position: fixed;
  inset: 0 0 0 465px;
  background: var(--login-wallpaper, url("/brand/airms_login_background.png")) center/cover no-repeat;
  opacity: 0.95;
  pointer-events: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 22px rgba(67, 97, 238, 0.22);
}

.app-logo {
  display: block;
  object-fit: contain;
}

.login-logo {
  width: min(100%, 360px);
  height: auto;
  margin-bottom: 26px;
}

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

.login-panel h1 {
  margin: 0 0 7px;
  color: var(--heading);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
}

.login-panel p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.form-stack,
.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

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

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

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

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

.field span {
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.inline-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inline-help summary {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.inline-help summary::-webkit-details-marker {
  display: none;
}

.inline-help-popover {
  position: absolute;
  top: 28px;
  left: 0;
  z-index: 80;
  width: min(460px, calc(100vw - 64px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(14, 23, 38, 0.18);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.inline-help-popover strong {
  display: block;
  margin-bottom: 8px;
  color: var(--heading);
}

.inline-help-popover p {
  margin: 8px 0;
  color: var(--text);
}

.inline-help-popover ol {
  margin: 8px 0 8px 18px;
  padding: 0;
}

.inline-help-popover code,
.help-content code {
  padding: 2px 4px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--heading);
  overflow-wrap: anywhere;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.12);
}

.btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #eaf1ff;
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.16s, background 0.16s, box-shadow 0.16s;
}

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

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
}

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

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  background: #fff5f5;
  color: var(--danger);
}

.btn.icon-only {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid rgba(67, 97, 238, 0.25);
  background: #fff;
}

.btn.icon-only.active {
  background: var(--primary);
  color: #fff;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: #eaf1ff;
  color: var(--primary);
  transition: transform 0.16s, background 0.16s;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(67, 97, 238, 0.16);
}

.icon-btn.danger {
  background: #fff5f5;
  color: var(--danger);
}

.icon-btn.danger:hover {
  background: rgba(231, 81, 90, 0.14);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  box-shadow: 5px 0 25px rgba(94, 92, 154, 0.08);
  transition: width 0.18s ease, padding 0.18s ease;
}

.sidebar::before {
  content: "";
  height: 84px;
  border-radius: 8px;
  margin-bottom: 14px;
  background:
    linear-gradient(135deg, rgba(67, 97, 238, 0.92), rgba(128, 93, 202, 0.76)),
    url("/vendor/vristo/menu-header.jpg") center/cover;
}

.sidebar .brand {
  position: absolute;
  top: 34px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  position: absolute;
  top: 34px;
  right: 24px;
  border-radius: 6px;
  display: grid;
  place-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sidebar-toggle span {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar .brand strong,
.sidebar .brand span {
  display: block;
}

.sidebar .brand strong {
  font-size: 17px;
  font-weight: 800;
}

.sidebar .brand span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.sidebar .brand .app-logo.mark {
  width: 42px;
  height: 42px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  background: transparent;
  color: #506690;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 700;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
}

.nav button.active,
.nav button:hover {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.sidebar-bottom-nav {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer {
  margin-top: 0;
  padding: 10px 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.main {
  min-width: 0;
  min-height: 100vh;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.18s ease;
}

.sidebar-collapsed .sidebar {
  width: 76px;
  padding-inline: 10px;
}

.sidebar-collapsed .sidebar::before {
  height: 58px;
}

.sidebar-collapsed .sidebar .brand {
  top: 30px;
  left: 21px;
}

.sidebar-collapsed .sidebar .brand strong,
.sidebar-collapsed .sidebar .brand span,
.sidebar-collapsed .sidebar-footer,
.sidebar-collapsed .nav button span {
  display: none;
}

.sidebar-collapsed .sidebar .brand .app-logo.mark {
  width: 34px;
  height: 34px;
}

.sidebar-collapsed .sidebar-toggle {
  top: 88px;
  right: 21px;
  color: var(--primary);
  background: rgba(67, 97, 238, 0.1);
}

.sidebar-collapsed .nav {
  margin-top: 38px;
}

.sidebar-collapsed .nav button {
  min-height: 44px;
  padding: 0;
  justify-content: center;
  text-align: center;
}

.sidebar-collapsed .nav button .nav-icon {
  display: none;
}

.sidebar-collapsed .nav button::before {
  content: attr(data-short);
  display: block;
  width: 100%;
  height: 18px;
  font-size: 15px;
  line-height: 18px;
  text-align: center;
}

.sidebar-collapsed .main {
  margin-left: 76px;
}

.topbar {
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 16px;
}

.topbar-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle,
.mobile-sidebar-backdrop {
  display: none;
}

.mobile-menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  place-content: center;
  gap: 4px;
  flex: 0 0 auto;
  background: #eef2ff;
  color: var(--primary);
}

.mobile-menu-toggle span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.global-search {
  width: min(420px, 34vw);
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
}

.global-search > span {
  position: absolute;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  color: var(--muted);
}

.global-search svg {
  width: 16px;
  height: 16px;
}

.global-search .input {
  min-height: 38px;
  padding-left: 38px;
  padding-right: 42px;
  background: rgba(255, 255, 255, 0.82);
}

.global-search .icon-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  position: absolute;
  right: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.topbar h1 {
  margin: 0;
  color: var(--heading);
  font-size: 20px;
  font-weight: 800;
}

.topbar-title-separator,
.topbar-balance-inline {
  font: inherit;
  color: inherit;
  font-weight: 800;
}

.topbar .account {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.property-title-stack {
  min-width: 0;
}

.property-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-account-inline {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar-currencies {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-currencies span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.content {
  padding: 24px 26px 42px;
  display: grid;
  gap: 22px;
}

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

.property-overview-grid {
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(116px, auto));
}

.metric,
.section {
  background: var(--panel);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 116px;
  padding: 20px;
  border-left: 4px solid var(--primary);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--heading);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.section {
  overflow: hidden;
}

.collapsible-section {
  display: block;
}

.collapsible-section > summary {
  cursor: pointer;
  list-style: none;
}

.collapsible-section > summary::-webkit-details-marker {
  display: none;
}

.collapsible-section > summary::after {
  content: '+';
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #eef2ff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.collapsible-section > summary .pill {
  margin-left: auto;
}

.collapsible-section[open] > summary::after {
  content: '-';
}

.ledger-controls {
  gap: 8px;
}

.ledger-controls .btn {
  padding: 8px 10px;
  min-height: 34px;
  font-size: 12px;
}

.section-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 800;
}

.topbar-gear {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #eef2ff;
  color: var(--primary);
}

.topbar-gear .nav-icon {
  width: 18px;
  height: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 23, 38, 0.42);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--panel);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(14, 23, 38, 0.24);
}

.property-create-modal {
  width: min(1180px, 100%);
}

.modal-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 800;
}

.property-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #fbfcff;
}

.section-body {
  padding: 18px;
}

.report-adjustments {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfbfd;
}

.report-adjustments-title {
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

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

.help-toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 22px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcff;
}

.help-toc a {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.help-toc a:hover {
  background: rgba(67, 97, 238, 0.1);
}

.help-content h3 {
  margin: 20px 0 8px;
  color: var(--heading);
  font-size: 16px;
}

.help-content h3:first-child {
  margin-top: 0;
}

.help-content p {
  margin: 8px 0;
  color: var(--text);
  line-height: 1.55;
}

.help-content ol {
  margin: 8px 0 16px 22px;
  padding: 0;
  color: var(--text);
  line-height: 1.55;
}

.help-content pre {
  margin: 8px 0 18px;
  padding: 12px;
  overflow-x: auto;
  border-radius: 6px;
  background: #f3f4f6;
}

.calendar-filter-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.calendar-property-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-property-filter label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--property-color);
  border-radius: 6px;
  background: #fff;
  font-weight: 800;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--heading);
  font-size: 12px;
  font-weight: 800;
}

.calendar-legend i,
.calendar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
}

.calendar-dot {
  margin-right: 8px;
}

.portfolio-calendar-shell {
  padding: 14px;
  overflow-x: auto;
}

#portfolio-calendar {
  min-width: 760px;
  color: var(--text);
}

#portfolio-calendar .fc {
  font-family: inherit;
}

#portfolio-calendar .fc-toolbar-title {
  color: var(--heading);
  font-size: 20px;
  font-weight: 900;
}

#portfolio-calendar .fc-button-primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: none;
  font-weight: 800;
}

#portfolio-calendar .fc-button-primary:not(:disabled):hover,
#portfolio-calendar .fc-button-primary:not(:disabled).fc-button-active {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

#portfolio-calendar .fc-daygrid-event,
#portfolio-calendar .fc-list-event {
  border-radius: 5px;
  font-weight: 800;
}

#portfolio-calendar .fc-daygrid-day-number {
  color: var(--heading);
  font-weight: 800;
}

#portfolio-calendar .fc-col-header-cell-cushion {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-scroll {
  overflow-x: auto;
}

.calendar-weekdays {
  border: 1px solid var(--border);
  border-bottom: 0;
  background: #f6f8fb;
}

.calendar-weekdays div {
  padding: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-grid {
  border: 1px solid var(--border);
  border-top: 0;
}

.calendar-day {
  min-height: 128px;
  padding: 8px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.muted-month {
  background: #fbfcff;
}

.calendar-day-number {
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 900;
}

.muted-month .calendar-day-number {
  color: var(--muted);
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  padding: 5px 6px;
  border-left: 4px solid var(--event-color);
  border-radius: 5px;
  background: color-mix(in srgb, var(--event-color) 12%, #fff);
  color: var(--heading);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
}

.calendar-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.calendar-event strong {
  color: var(--event-color);
  font-size: 10px;
  text-transform: uppercase;
}

.contacts-toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.vristo-contacts-app {
  overflow: visible;
}

.vristo-contacts-toolbar {
  min-height: 72px;
  border-bottom: 0;
  padding: 0 0 18px;
}

.contacts-toolbar h2 {
  margin: 0;
  color: var(--heading);
  font-size: 20px;
}

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

.icon-btn.active {
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
}

.vristo-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.vristo-icon.sm {
  width: 16px;
  height: 16px;
}

.vristo-add-contact .vristo-icon {
  margin-left: -2px;
}

.contact-search {
  position: relative;
  min-width: 280px;
  display: block;
}

.contact-search .input {
  padding-right: 40px;
}

.contact-search span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.vristo-contact-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.contacts-table .contact-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contacts-table {
  min-width: 860px;
}

.contacts-table th {
  background: #f8fafc;
  color: var(--heading);
  font-size: 13px;
  text-transform: none;
}

.contacts-table td {
  vertical-align: middle;
}

.contacts-table.table-striped tbody tr:nth-child(even) td {
  background: #fbfcff;
}

.contacts-table.table-hover tbody tr:hover td {
  background: #f7f9ff;
}

.contacts-table .actions-col {
  text-align: center;
}

.vristo-contact-actions {
  justify-content: center;
}

.vristo-contact-actions .btn svg {
  margin-left: -2px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.contact-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(31, 45, 61, 0.05);
}

.contact-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-card-head strong,
.contact-card-head span {
  display: block;
}

.contact-card-head strong {
  color: var(--heading);
  font-size: 15px;
}

.contact-card-head span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.contact-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.contact-modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  resize: both;
}

.vristo-contact-modal {
  overflow: hidden;
  border-radius: 8px;
}

.vristo-contact-modal .modal-head {
  flex: 0 0 auto;
  background: #fbfbfb;
}

.vristo-contact-modal > .section-body {
  min-height: 0;
  overflow: auto;
}

.contact-form-grid {
  align-items: start;
}

.contact-modal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.report-adjustments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.adjustment-table {
  min-width: 900px;
}

.compact-input {
  min-width: 130px;
}

.transfer-table td:not(:first-child),
.transfer-table th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.transfer-table .notes-cell,
.transfer-table th:last-child {
  max-width: 360px;
  text-align: left;
  white-space: pre-line;
}

.transfer-table .total-row td {
  background: #f6f8fb;
  font-weight: 800;
}

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

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f6f8fb;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

td strong {
  color: var(--heading);
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-row td {
  background: #fbfcff;
}

.edit-row .form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f7f8ff;
}

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

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

.detail-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  background: #fbfbfd;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.detail-item strong {
  color: var(--heading);
  font-size: 15px;
}

.detail-item p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.apex-chart {
  min-height: 390px;
}

.chart-row {
  display: grid;
  grid-template-columns: 82px 1fr 120px;
  align-items: center;
  gap: 12px;
}

.chart-row > span {
  color: var(--muted);
  font-weight: 800;
}

.chart-row > strong {
  color: var(--heading);
  text-align: right;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: #eef2ff;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.chart-bar.negative {
  background: var(--danger);
}

.ledger-tree {
  display: grid;
  gap: 10px;
}

.ledger-tree details {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.ledger-tree details.month-group {
  margin: 10px;
}

.ledger-tree summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  cursor: pointer;
  background: #f6f8fb;
}

.ledger-tree summary strong {
  color: var(--heading);
}

.ledger-tree summary > span {
  color: var(--primary);
  font-weight: 800;
}

.ledger-summary-metrics {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text);
  text-align: right;
}

.ledger-summary-metrics span {
  display: grid;
  gap: 2px;
  color: var(--primary);
  font-weight: 800;
}

.ledger-summary-metrics em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.table-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  margin: 1px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.pill.success {
  background: rgba(0, 171, 85, 0.1);
  color: var(--success);
}

.pill.danger {
  background: rgba(231, 81, 90, 0.12);
  color: var(--danger);
}

.pill.warning {
  background: rgba(226, 160, 63, 0.14);
  color: var(--warning);
}

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

.notice {
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 13px 15px;
  background: #eef2ff;
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.notice.error {
  border-left-color: var(--danger);
  background: #fff5f5;
  color: var(--danger);
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.notification-item.unread {
  border-left: 4px solid var(--primary);
  background: #f8faff;
}

.notification-line {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(220px, 1fr) minmax(140px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.notification-line > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-line span {
  color: var(--text);
}

.property-group-row td {
  background: #f6f8fb;
  color: var(--heading);
  font-weight: 800;
  letter-spacing: 0;
}

.property-group-row.drop-target td {
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
}

.property-group-row.drag-over td {
  border-color: var(--primary);
  background: #eef2ff;
}

.draggable-property-row {
  cursor: grab;
}

.draggable-property-row.dragging {
  opacity: 0.55;
}

.property-group-row .muted {
  margin-left: 8px;
  font-weight: 700;
}

.turnover-check-list,
.turnover-task-list,
.turnover-template-list {
  display: grid;
  gap: 10px;
}

.turnover-check-row,
.turnover-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.turnover-task-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.turnover-check-row.complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.turnover-check-row span,
.turnover-task-row div {
  display: grid;
  gap: 3px;
}

.turnover-check-row small,
.turnover-task-row small {
  color: var(--muted);
}

.turnover-calendar-panel {
  overflow: hidden;
}

.turnover-calendar-panel summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.turnover-calendar-panel summary::-webkit-details-marker {
  display: none;
}

.turnover-calendar-panel summary span:first-child {
  display: grid;
  gap: 3px;
}

.turnover-calendar-panel summary strong {
  color: var(--heading);
  font-size: 16px;
}

.turnover-calendar-panel summary small {
  color: var(--muted);
  font-weight: 700;
}

.turnover-calendar-panel[open] summary {
  border-bottom: 1px solid var(--border);
}

.todo-app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  min-height: 520px;
}

.todo-sidebar,
.todo-main-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.todo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
}

.todo-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.todo-sidebar-title h2 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
}

.todo-sidebar-divider {
  height: 1px;
  margin: 8px 0;
  background: var(--border);
}

.todo-menu-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 800;
}

.todo-menu-button:hover,
.todo-menu-button.active {
  background: #f3f6ff;
  color: var(--primary);
}

.todo-menu-button span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.todo-menu-button em {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: var(--heading);
  font-style: normal;
  text-align: center;
}

.todo-sidebar-label {
  padding: 4px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.todo-property-chip {
  padding: 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--heading);
  font-weight: 800;
}

.todo-main-panel {
  overflow: hidden;
}

.todo-main-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.todo-search {
  position: relative;
  width: min(420px, 100%);
}

.todo-search .input {
  padding-right: 42px;
}

.todo-search span {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.todo-task-list {
  display: grid;
  gap: 0;
}

.turnover-status-legend {
  display: grid;
  gap: 7px;
  padding: 4px 2px;
}

.turnover-status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.turnover-status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  flex: 0 0 auto;
}

.turnover-status-dot.green {
  background: var(--success);
}

.turnover-status-dot.yellow {
  background: #f59e0b;
}

.turnover-status-dot.red {
  background: var(--danger);
}

.turnover-status-dot.blue {
  background: var(--primary);
}

.turnover-instance-list {
  display: grid;
  border-bottom: 1px solid var(--border);
}

.todo-instance-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
}

.todo-instance-card:hover,
.todo-instance-card.selected {
  background: #f7f9ff;
}

.todo-instance-card span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.todo-instance-card strong {
  color: var(--heading);
}

.todo-instance-card small {
  color: var(--muted);
}

.todo-instance-card em {
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.turnover-instance-detail {
  display: grid;
}

.turnover-instance-detail-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfcff;
}

.turnover-instance-detail-head h3 {
  margin: 0 0 3px;
  color: var(--heading);
  font-size: 17px;
}

.turnover-modal {
  width: min(980px, 100%);
  overflow: hidden;
}

.turnover-modal-head {
  align-items: flex-start;
}

.turnover-modal-head > div:first-child {
  min-width: 0;
}

.turnover-modal-head .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.turnover-modal-body {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.turnover-modal .todo-task-card:last-child {
  border-bottom: 0;
}

.todo-task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.todo-task-card:hover {
  background: #fbfcff;
}

.todo-task-card.complete {
  background: #f7fdf9;
}

.todo-task-check {
  padding-top: 2px;
}

.todo-task-check input {
  position: absolute;
  opacity: 0;
}

.todo-task-check span {
  width: 20px;
  height: 20px;
  display: block;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.todo-task-check input:checked + span {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 4px #fff;
}

.todo-task-content {
  display: grid;
  gap: 6px;
}

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

.todo-task-title strong {
  color: var(--heading);
  font-size: 15px;
}

.todo-task-state-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.todo-notes-toggle {
  width: 28px;
  height: 28px;
  color: var(--muted);
}

.todo-notes-toggle .vristo-icon {
  width: 16px;
  height: 16px;
}

.todo-notes-toggle.active {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.08);
  border-color: rgba(67, 97, 238, 0.22);
}

.todo-task-content p {
  margin: 0;
  color: var(--text);
}

.todo-note-label {
  color: var(--heading);
  font-size: 12px;
}

.todo-task-notes {
  display: grid;
  gap: 6px;
}

.todo-task-notes-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcff;
}

.todo-task-notes span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.todo-task-notes textarea {
  min-height: 74px;
  resize: vertical;
}

.todo-task-actions {
  display: flex;
  justify-content: flex-end;
}

.todo-task-content small {
  color: var(--muted);
}

.todo-tag {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.todo-tag.primary {
  background: #eef2ff;
  color: var(--primary);
}

.todo-tag.success {
  background: #ecfdf5;
  color: var(--success);
}

.todo-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 4px;
  transform: rotate(45deg);
  background: var(--muted);
}

.todo-dot.primary {
  background: var(--primary);
}

.todo-empty {
  padding: 18px;
}

.notification-settings-list {
  display: grid;
  gap: 10px;
}

.notification-setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(140px, auto)) minmax(160px, 220px);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.notification-setting-row > div:first-child {
  display: grid;
  gap: 3px;
}

.notification-setting-row strong {
  color: var(--heading);
}

.notification-setting-row small {
  color: var(--muted);
}

.notification-setting-row[data-money-event="false"] {
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(140px, auto));
}

.check-option.compact {
  min-height: 38px;
  white-space: nowrap;
}

.compact-field {
  margin: 0;
}

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

.input-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.segmented-control {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f6f8fb;
}

.segmented-control button {
  min-height: 24px;
  border-radius: 4px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control button.active,
.segmented-control button:hover {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(31, 45, 61, 0.08);
}

.toggle-control {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f6f8fb;
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-control span {
  width: 36px;
  height: 22px;
  border-radius: 999px;
  background: #dce3ef;
  position: relative;
  transition: background 0.18s;
}

.toggle-control span::after {
  content: '';
  width: 18px;
  height: 18px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 45, 61, 0.18);
  transition: transform 0.18s;
}

.toggle-control input:checked + span {
  background: var(--primary);
}

.toggle-control input:checked + span::after {
  transform: translateX(14px);
}

.toggle-control strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toggle-control input:checked ~ strong {
  color: var(--primary);
}

.toggle-control.compact {
  min-height: 28px;
}

.toggle-control.compact span {
  width: 32px;
  height: 20px;
}

.toggle-control.compact span::after {
  width: 16px;
  height: 16px;
}

.toggle-control.compact input:checked + span::after {
  transform: translateX(12px);
}

.assignment-access-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.segmented-field {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text);
  font-weight: 700;
}

.segmented-field label,
.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.check-option {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.check-option span {
  display: grid;
  gap: 2px;
}

.check-option strong {
  color: var(--heading);
  font-size: 13px;
  line-height: 1.2;
}

.check-option small {
  color: var(--muted);
  font-size: 11px;
}

.form-actions {
  align-self: end;
}

.profile-chip {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(31, 45, 61, 0.08);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #eef2ff;
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
  object-fit: cover;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar.lg {
  width: 84px;
  height: 84px;
  font-size: 28px;
}

.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.profile-card h3 {
  margin: 0 0 5px;
  color: var(--heading);
  font-size: 24px;
}

.profile-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.property-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.property-admin-grid {
  display: grid;
  gap: 16px;
}

.property-info-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--border);
}

.property-info-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.property-info-tabs button.active,
.property-info-tabs button:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.property-photo-box {
  display: grid;
  gap: 12px;
}

.property-photo-box img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f8fafc;
}

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

.inline-upload .input {
  flex: 1 1 220px;
}

.inventory-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.inventory-import-form {
  justify-content: flex-end;
}

.inventory-import-form small {
  flex-basis: 100%;
  text-align: right;
}

.inventory-sheet {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
  background: #ffffff;
}

.inventory-grid-head,
.inventory-grid-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.2fr) minmax(90px, 0.45fr) minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(150px, 0.8fr);
  min-width: 980px;
}

.inventory-grid-head {
  background: #8f4b4b;
  color: #ffffff;
  font-weight: 900;
}

.inventory-grid-head span,
.inventory-grid-row > * {
  min-width: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.inventory-grid-head span {
  padding: 12px 10px;
  text-align: center;
}

.inventory-grid-row {
  background: #fff7f7;
}

.inventory-grid-row:nth-of-type(even) {
  background: #ffffff;
}

.inventory-grid-row .input,
.inventory-grid-row .select {
  width: 100%;
  height: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inventory-grid-row .input:focus,
.inventory-grid-row .select:focus {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.inventory-photo-cell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px;
}

.inventory-photo-link img {
  width: 56px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.inventory-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.inventory-empty {
  min-width: 980px;
  padding: 18px;
}

.inventory-audit-history {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.inventory-audit-history h3 {
  margin: 0;
  font-size: 16px;
}

.compact-filter {
  max-width: 150px;
}

.directory-assign-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.directory-assign-form .select {
  min-width: 180px;
}

.property-cohost-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcff;
}

.property-cohost-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.removable-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.removable-pill button {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 23, 38, 0.08);
  color: inherit;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.removable-pill button:hover {
  background: rgba(231, 81, 90, 0.16);
  color: var(--danger);
}

.property-cohost-add {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.large-notes {
  min-height: 170px;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-thread {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.chat-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  max-width: 760px;
}

.chat-message > div:last-child {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.chat-message.mine {
  justify-self: end;
}

.chat-message.mine > div:last-child {
  background: #eef2ff;
  border-color: rgba(67, 97, 238, 0.22);
}

.chat-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.chat-meta strong {
  color: var(--heading);
  font-size: 13px;
}

.chat-message p {
  margin: 6px 0 0;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.vristo-chat-app {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  overflow: hidden;
}

.chat-app-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--border);
  background: #fbfcff;
}

.chat-app-toolbar {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.chat-app-toolbar h2 {
  margin: 0;
  color: var(--heading);
  font-size: 20px;
}

.chat-search {
  min-width: 0;
}

.chat-conversation-list {
  overflow-y: auto;
  padding: 8px;
}

.chat-conversation {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.chat-conversation:hover,
.chat-conversation.active {
  background: #eef2ff;
}

.chat-conversation span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-conversation strong,
.chat-conversation small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversation strong {
  color: var(--heading);
}

.chat-conversation small,
.chat-conversation em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.chat-app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}

.chat-app-head {
  min-height: 66px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.chat-app-head .contact-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chat-app-head .contact-name span {
  display: block;
  margin-top: 2px;
}

.chat-app-thread {
  max-height: none;
  padding: 18px;
}

.chat-app-form {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.empty-panel {
  padding: 18px;
}

.chat-empty-state {
  align-self: center;
  justify-self: center;
  text-align: center;
}

.chat-empty-state h2 {
  margin: 0 0 6px;
  color: var(--heading);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-workspace {
  overflow: hidden;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.settings-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
  border-radius: 0;
  transition: color 0.2s ease;
}

.settings-tab::before {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 1px;
  background: var(--secondary);
  transition: left 0.7s ease, right 0.7s ease;
}

.settings-tab:hover,
.settings-tab.active {
  color: var(--secondary);
}

.settings-tab:hover::before,
.settings-tab.active::before {
  left: 0;
  right: 0;
}

.settings-tab .nav-icon {
  width: 18px;
  height: 18px;
}

.settings-tab-content {
  padding: 18px;
}

.settings-tab-panel {
  display: grid;
  gap: 18px;
}

.account-tab-panel {
  display: grid;
  gap: 18px;
  max-width: 960px;
}

.account-profile-panel {
  max-width: 820px;
}

.category-textarea {
  min-height: 180px;
}

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

.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.settings-panel-actions {
  justify-content: flex-end;
}

.report-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 10px;
}

.report-tabs button {
  min-height: 36px;
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 0 12px;
  background: #f6f8fb;
  color: var(--muted);
  font-weight: 800;
}

.report-tabs button.active,
.report-tabs button:hover {
  background: var(--primary);
  color: #fff;
}

.transfer-table th,
.transfer-table td {
  white-space: nowrap;
}

.transfer-table td:last-child {
  background: var(--heading);
  color: #fff;
}

.history-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(200px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.report-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 16px;
  align-items: end;
}

.settings-preview {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.settings-logo-preview,
.settings-wallpaper-preview {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #f8fafc;
}

.settings-logo-preview {
  padding: 14px;
  object-fit: contain;
}

.settings-wallpaper-preview {
  background-size: cover;
  background-position: center;
}

.settings-upload-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.settings-toggle {
  min-height: 54px;
}

.settings-diagnostics {
  margin-bottom: 14px;
}

.log-viewer {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0e1726;
  color: #d7e1ff;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

@media (max-width: 1050px) {
  .summary-grid,
  .grid-3,
  .property-work-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .property-overview-grid {
    grid-auto-flow: row;
    grid-template-rows: none;
  }

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

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

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

  .vristo-chat-app {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }

  .todo-app-shell {
    grid-template-columns: 1fr;
  }

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

  .todo-sidebar-title,
  .todo-sidebar-divider,
  .todo-sidebar-label,
  .todo-property-chip {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 32px 22px;
  }

  .login-panel::after {
    display: none;
  }

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

  .sidebar {
    width: min(306px, calc(100vw - 42px));
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    min-height: 100vh;
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 0.2s ease;
  }

  .sidebar-collapsed .sidebar {
    width: min(306px, calc(100vw - 42px));
    padding: 18px 14px;
    transform: translateX(-104%);
  }

  .sidebar-collapsed .sidebar::before,
  .sidebar::before {
    height: 84px;
  }

  .sidebar-collapsed .sidebar .brand,
  .sidebar .brand {
    top: 34px;
    left: 28px;
  }

  .sidebar-collapsed .sidebar .brand strong,
  .sidebar-collapsed .sidebar .brand span,
  .sidebar-collapsed .sidebar-footer,
  .sidebar-collapsed .nav button span {
    display: block;
  }

  .sidebar-collapsed .sidebar .brand .app-logo.mark {
    width: 42px;
    height: 42px;
  }

  .sidebar-collapsed .nav,
  .nav {
    grid-template-columns: 1fr;
    margin-top: 2px;
  }

  .sidebar-collapsed .nav button,
  .nav button {
    justify-content: flex-start;
    padding: 0 12px;
    text-align: left;
  }

  .sidebar-collapsed .nav button .nav-icon {
    display: block;
  }

  .sidebar-collapsed .nav button::before {
    content: none;
  }

  .sidebar-collapsed .sidebar-toggle,
  .sidebar-toggle {
    top: 34px;
    right: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
  }

  .app-shell:not(.sidebar-collapsed) .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(14, 23, 38, 0.42);
  }

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

  .contacts-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .contacts-actions,
  .contact-search {
    width: 100%;
  }

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

  .vristo-chat-app {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .chat-app-sidebar {
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .chat-app-main {
    min-height: 520px;
  }

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

  .contact-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    resize: none;
  }

  .todo-sidebar,
  .todo-main-toolbar,
  .turnover-calendar-panel summary,
  .turnover-modal-head .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .todo-sidebar {
    display: flex;
  }

  .todo-search {
    width: 100%;
  }

  .todo-task-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .todo-task-state-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .todo-instance-card,
  .turnover-instance-detail-head,
  .turnover-modal-head {
    align-items: flex-start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .todo-instance-card em {
    grid-column: 2;
    justify-self: start;
  }

  .turnover-instance-detail-head,
  .turnover-modal-head {
    display: grid;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 760px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .sidebar-collapsed .main {
    margin-left: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-title-wrap {
    width: 100%;
  }

  .global-search {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .content {
    padding: 16px;
  }

  .summary-grid,
  .grid-2,
  .grid-3,
  .property-work-grid,
  .detail-grid,
  .connector-grid,
  .checkbox-grid,
  .settings-grid,
  .settings-preview,
  .report-adjustments-grid,
  .history-filter-bar,
  .notification-setting-row,
  .notification-setting-row[data-money-event="false"],
  .notification-item,
  .notification-line,
  .report-date-row {
    grid-template-columns: 1fr;
  }

  .property-overview-grid {
    grid-auto-flow: row;
    grid-template-rows: none;
  }

  .notification-line > * {
    white-space: normal;
  }

  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 12px;
  }

  .settings-tab {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 14px;
  }

  .settings-tab-content {
    padding: 14px;
  }

  .profile-card,
  .chat-form {
    grid-template-columns: 1fr;
  }

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

  .chart-row > strong {
    text-align: left;
  }
}
