:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #f8fafc;
  background-color: #050a1a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: #050a1a;
}
.hidden {
  display: none !important;
}
.app-shell {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(99, 102, 241, 0.3), transparent 55%),
    radial-gradient(circle at 10% 40%, rgba(129, 140, 248, 0.2), transparent 35%),
    #050a1a;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: rgba(5, 10, 26, 0.9);
  border-bottom: 1px solid rgba(226, 232, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 2.5rem;
  background: rgba(79, 70, 229, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  color: rgba(226, 232, 255, 0.95);
}
.admin-impersonation-banner strong {
  color: #f8fafc;
}
.button-link {
  color: #c7d2fe;
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(99, 102, 241, 0.12);
  transition: background 150ms ease, border-color 150ms ease;
}
.button-link:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}
.app-brand {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.app-brand {
  color: inherit;
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
}
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(99, 102, 241, 0.12);
  color: #f8fafc;
  text-decoration: none;
}
.logout-trigger:hover {
  text-decoration: line-through;
  color: rgba(226, 232, 255, 0.8);
}
.profile-trigger span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(99, 102, 241, 0.15);
  color: #f8fafc;
}
.profile-pill {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.header-pill {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.35);
}
.app-body {
  display: flex;
  min-height: calc(100vh - 70px);
}
.main-area {
  flex: 1;
  display: flex;
  gap: 1rem;
}
.sidebar {
  width: 220px;
  background: rgba(11, 17, 38, 0.95);
  border-right: 1px solid rgba(226, 232, 255, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: width 200ms ease, padding 200ms ease;
}
.sidebar h2 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(226, 232, 255, 0.6);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar a {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 500;
  transition: background 120ms ease, transform 120ms ease;
}
.sidebar a:hover,
.sidebar a.is-active {
  background: rgba(99, 102, 241, 0.18);
}
.sidebar--collapsed {
  width: 64px;
  padding: 1.25rem 0.6rem;
  overflow: hidden;
}
.sidebar--collapsed:hover {
  width: 220px;
}
.sidebar--collapsed nav {
  overflow: visible;
}
.sidebar--collapsed nav a {
  white-space: nowrap;
  overflow: visible;
  position: relative;
  filter: blur(1px);
  opacity: 0.85;
  transition: filter 150ms ease, opacity 150ms ease;
}
.sidebar--collapsed:hover nav a {
  filter: none;
  opacity: 1;
}
.sidebar:not(.sidebar--collapsed) nav a {
  filter: none;
  opacity: 1;
}
.content-area {
  flex: 1;
  padding: 2.5rem;
}
.content-area.full-height {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 90px);
}
.admin-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-tabs {
  display: flex;
  gap: 0.75rem;
}
.admin-tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f8fafc;
  text-decoration: none;
  font-weight: 600;
}
.admin-tab.is-active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.45);
}
.admin-card {
  background: rgba(11, 17, 38, 0.9);
  border-radius: 20px;
  padding: 1.75rem;
  border: 1px solid rgba(226, 232, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.admin-table-wrapper {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.admin-table th.actions,
.admin-table td.actions {
  text-align: center;
}
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.status-pill {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
}
.status-pill.status {
  background: rgba(16, 185, 129, 0.15);
  color: #bef264;
}
.status-pill.error {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inline-form.compact {
  flex-wrap: wrap;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1.5rem;
}
.admin-sidebar {
  background: rgba(10, 15, 34, 0.9);
  border: 1px solid rgba(226, 232, 255, 0.08);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-sidebar .admin-tab {
  width: 100%;
  text-align: center;
}
.admin-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.metric-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(226, 232, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: rgba(226, 232, 255, 0.7);
}
.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.login-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.login-panel {
  background: rgba(17, 25, 51, 0.95);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(226, 232, 255, 0.08);
  box-shadow: 0 25px 50px rgba(5, 10, 26, 0.6);
}

.login-brand h1 {
  margin: 0.4rem 0;
  font-size: clamp(2rem, 2.4vw, 2.5rem);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.8);
}

.login-form input {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 255, 0.2);
  background: rgba(14, 19, 41, 0.8);
  color: #f8fafc;
  font-size: 1rem;
}

.login-help {
  margin-top: 1rem;
  color: rgba(248, 250, 252, 0.6);
}

.login-hero {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(5, 8, 25, 0.95));
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 25px 60px rgba(5, 10, 26, 0.5);
}

.login-hero ul {
  padding-left: 1.2rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(248, 250, 252, 0.8);
  font-size: 0.95rem;
}

.login-hero li::marker {
  color: #a855f7;
}

.login-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.login-hero-grid div {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.75rem, 2vw, 2rem);
}
.inline-form {
  margin: 0;
}
.matcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.matcher-card {
  background: rgba(11, 17, 38, 0.85);
  border-radius: 20px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.matcher-card header h2 {
  margin: 0;
  font-size: 1.5rem;
}
.matcher-card details summary {
  cursor: pointer;
  color: #c7d2fe;
  font-weight: 600;
}
.matcher-card pre {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(14, 19, 41, 0.8);
  color: rgba(226, 232, 255, 0.9);
  font-size: 0.85rem;
  overflow-x: auto;
}
.matcher-loading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  margin-bottom: 1rem;
}
.matcher-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #c7d2fe;
  animation: matcherSpin 0.9s linear infinite;
}
.matcher-progress-overlay {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(79, 70, 229, 0.18);
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.5);
  margin-bottom: 1rem;
  overflow: hidden;
}
.matcher-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.95), rgba(129, 140, 248, 0.7));
  transition: width 0.3s ease;
  z-index: -1;
}
.matcher-progress-overlay.is-active .matcher-progress-bar {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.95), rgba(147, 197, 253, 0.6));
}
.matcher-log {
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  background: rgba(18, 20, 50, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.matcher-log ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: rgba(226, 232, 255, 0.75);
}
.matcher-log summary {
  font-weight: 600;
  cursor: pointer;
  color: #c7d2fe;
}
.matcher-log[open] {
  background: rgba(18, 20, 50, 0.95);
}
.matcher-tabs {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
}
.matcher-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 19, 41, 0.8);
  color: #f8fafc;
  font-weight: 600;
}
.matcher-tab.is-active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}
.tab-badge {
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.2);
  color: #bbf7d0;
}
.matcher-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.matcher-panel {
  display: none;
}
.matcher-panel.is-active {
  display: block;
}
.matcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.matcher-grid--rejected {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.matcher-card--matched {
  border-color: rgba(16, 185, 129, 0.4);
}
.matcher-card--rejected {
  border-color: rgba(248, 113, 113, 0.4);
}
.matcher-inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.inbox-entry {
  background: rgba(11, 17, 38, 0.85);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-entry header h3 {
  margin: 0;
  font-size: 1rem;
}
.inbox-entry--matched {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.08);
}
.inbox-entry--rejected {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.08);
}
.inbox-entry--already {
  border-color: rgba(196, 197, 203, 0.6);
  background: rgba(196, 197, 203, 0.08);
}
.matcher-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.matcher-table th,
.matcher-table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.matcher-table thead {
  background: rgba(255, 255, 255, 0.04);
}
.matcher-table--matched tr {
  border-left: 4px solid rgba(16, 185, 129, 0.7);
}
.matcher-table--rejected tr {
  border-left: 4px solid rgba(248, 113, 113, 0.7);
}
.matcher-table details summary {
  cursor: pointer;
  font-weight: 600;
}

.matcher-table--sorted tr {
  border-left: 4px solid rgba(99, 102, 241, 0.6);
}
.matcher-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.matcher-actions form {
  margin: 0;
}
.matcher-discard {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}
.matcher-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.matcher-modal.hidden {
  display: none;
}
.matcher-modal-content {
  background: rgba(10, 14, 36, 0.95);
  border-radius: 18px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  border: 1px solid rgba(226, 232, 255, 0.15);
  box-shadow: 0 20px 60px rgba(3, 6, 15, 0.65);
  position: relative;
  max-height: 90vh;
  overflow: auto;
}
.matcher-modal-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.matcher-modal-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
}
.matcher-modal-form input,
.matcher-modal-form select {
  margin-top: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.95rem;
}

.tenant-search-list {
  margin-top: 0.35rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 180px;
  overflow: auto;
  display: none;
  flex-direction: column;
}
.tenant-search-list.is-visible {
  display: flex;
}
.tenant-search-list button {
  border: none;
  background: none;
  color: rgba(248, 250, 252, 0.85);
  text-align: left;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.tenant-search-list button:hover,
.tenant-search-list button:focus-visible {
  background: rgba(126, 34, 206, 0.2);
}
.matcher-modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
.matcher-modal-details {
  margin-top: 1rem;
  background: rgba(14, 19, 41, 0.85);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.matcher-modal-details summary {
  color: #c7d2fe;
  font-weight: 600;
  cursor: pointer;
}
.matcher-modal-details pre {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(248, 250, 252, 0.9);
}
.matcher-log {
  background: rgba(14, 19, 41, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.matcher-log ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: rgba(226, 232, 255, 0.75);
  font-size: 0.85rem;
}
@keyframes matcherSpin {
  to {
    transform: rotate(360deg);
  }
}
.matcher-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.matcher-summary {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.matcher-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: rgba(248, 250, 252, 0.6);
}
.matcher-details div {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}
.matcher-details dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.6);
}
.matcher-details dd {
  margin: 0;
  font-weight: 600;
}

.saved-signins {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(14, 19, 41, 0.8);
  border: 1px solid rgba(226, 232, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.saved-signins-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.saved-signins-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.saved-signin-pill {
  border: 1px solid rgba(226, 232, 255, 0.25);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 0.85rem;
  cursor: pointer;
}
.saved-signin-pill.is-primary {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}
.saved-signin-pill:hover {
  background: rgba(255, 255, 255, 0.15);
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.8);
}
.checkbox input {
  width: 1rem;
  height: 1rem;
}
.button.ghost.small {
  padding: 0.25rem 0.9rem;
  font-size: 0.75rem;
}

.button.primary {
  width: 100%;
  text-align: center;
}
.sub-sidebar {
  width: 220px;
  background: rgba(13, 19, 46, 0.95);
  border: 1px solid rgba(226, 232, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.5);
  min-height: fit-content;
}
.with-sub-sidebar .sub-sidebar {
  animation: slideInset 0.4s ease both;
}

@keyframes slideInset {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.sub-sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(226, 232, 255, 0.65);
}
.sub-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sub-sidebar a {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}
.sub-sidebar a:hover,
.sub-sidebar a.is-active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}
.panel {
  background: rgba(17, 25, 51, 0.95);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(226, 232, 255, 0.08);
  box-shadow: 0 20px 60px rgba(5, 10, 26, 0.5);
}
.users-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sent-messages-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(9, 12, 30, 0.6);
}

.sent-messages-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sent-messages-controls {
  display: flex;
  align-items: center;
}

.sent-messages-badge {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 255, 0.5);
  color: #f8fafc;
}

.sent-messages-table-wrapper {
  overflow-x: auto;
}

.sent-messages-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.sent-messages-table th,
.sent-messages-table td {
  padding: 0.75rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.sent-messages-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.75);
  border-bottom: 1px solid rgba(248, 250, 252, 0.15);
}

.sent-messages-table tbody tr + tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sent-messages-table td {
  font-size: 0.85rem;
  color: #f8fafc;
}

.message-body {
  display: block;
  max-height: 3.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-line;
  color: rgba(248, 250, 252, 0.88);
}

.sent-messages-controls {
  margin-bottom: 1rem;
  display: flex;
  justify-content: flex-end;
}

.search-form {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 16px;
  padding: 0.25rem 0.35rem;
  min-width: 230px;
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  padding: 0.65rem 1rem;
  color: #f8fafc;
  font-size: 0.95rem;
}

.search-form button {
  border: none;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  color: #fff;
  font-weight: 600;
  transition: transform 120ms ease;
}

.search-form button:hover {
  transform: translateY(-1px);
}

.sent-messages-controls .search-form {
  max-width: 460px;
}

.search-form button {
  border: none;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 16px;
  padding: 0.75rem 1.35rem;
  color: #fff;
  font-weight: 600;
  transition: transform 120ms ease;
}

.search-form button:hover {
  transform: translateY(-1px);
}

.message-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.message-modal-content {
  background: rgba(13, 19, 46, 0.95);
  border-radius: 18px;
  padding: 2rem;
  max-width: 640px;
  width: 100%;
  border: 1px solid rgba(226, 232, 255, 0.15);
  box-shadow: 0 20px 60px rgba(5, 10, 26, 0.6);
}

.message-modal pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-modal .modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  border: none;
  background: none;
  font-size: 1.25rem;
  color: rgba(248, 250, 252, 0.6);
  cursor: pointer;
}

.message-modal.hidden {
  display: none;
}
.landing-page {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #f8fafc;
  background: radial-gradient(circle at top, rgba(99, 102, 241, 0.3), transparent 45%), #030615;
  min-height: 100vh;
  padding: 3rem clamp(1rem, 3vw, 3rem) 4rem;
}

.landing-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  background: rgba(13, 19, 48, 0.9);
  border-radius: 28px;
  padding: clamp(2rem, 3vw, 3rem);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 30px 60px rgba(3, 6, 15, 0.6);
  margin-bottom: 3rem;
}

.hero-content h1 {
  font-size: clamp(2.25rem, 3vw, 3.5rem);
  margin: 0.5rem 0 1rem;
}

.hero-subtitle {
  max-width: 520px;
  color: rgba(248, 250, 252, 0.78);
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-stats div {
  min-width: 110px;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-panel-card {
  background: rgba(5, 10, 26, 0.85);
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-panel-card.two {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(15, 23, 42, 0.9));
}

.hero-panel-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-top: 0.6rem;
}

.hero-panel-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-radius: inherit;
}

.landing-features {
  margin-bottom: 3rem;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.feature-grid article {
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 10, 30, 0.8);
  box-shadow: 0 15px 30px rgba(3, 6, 15, 0.4);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.2);
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
}

.landing-testimonial {
  background: rgba(7, 11, 32, 0.95);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.testimonial-metrics {
  display: flex;
  gap: 2rem;
}

.testimonial-metrics div {
  text-align: right;
}

.landing-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(15, 23, 42, 0.9));
  border-radius: 26px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.landing-cta-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.widget-card {
  background: rgba(5, 10, 26, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 1.25rem;
  min-height: 140px;
  box-shadow: 0 10px 25px rgba(5, 10, 26, 0.45);
}
.widget-card h2 {
  margin: 0.35rem 0;
  font-size: 2rem;
}
.widget-card p {
  margin: 0;
}
.stat-grid {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.stat-grid h2 {
  font-size: 2rem;
}
.panel-header h1 {
  margin: 0;
  font-size: 2rem;
}
.report-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.report-card {
  background: rgba(5, 10, 26, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(5, 10, 26, 0.35);
}
.report-card h3 {
  margin: 0 0 0.35rem;
}
.report-summary-panel .report-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding-bottom: 1rem;
}
.report-filter-range {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.report-filter-range label {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.4rem;
  color: #cbd5f5;
}
.report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.report-description {
  margin-top: 0.5rem;
}
.report-metrics {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.metric-card {
  background: rgba(10, 18, 40, 0.9);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.metric-card h3 {
  margin: 0.35rem 0;
  font-size: 1.75rem;
}
.metric-card--loss h3 {
  color: #f87171;
}
.metric-card--loss .muted {
  color: #fecdd3;
}
.report-table-wrapper {
  margin-top: 1.5rem;
  background: rgba(10, 18, 40, 0.9);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.65rem 0.5rem;
  text-align: left;
  color: rgba(226, 232, 255, 0.7);
}
.report-table th.right {
  text-align: right;
}
.report-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(226, 232, 255, 0.1);
}
.report-table tr:last-child td {
  border-bottom: none;
}
.report-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.report-table .positive {
  color: #22c55e;
}
.report-table .negative {
  color: #f87171;
}
.report-filter-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.receipt-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1rem;
}
.receipt-filter label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.4rem;
  color: #cbd5f5;
}
.receipt-filter select,
.receipt-filter input {
  width: 100%;
}
.write-off-form {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.write-off-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.write-off-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #cbd5f5;
}
.receipt-header {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.receipt-actions {
  margin-top: 0.5rem;
}
.receipt-summary {
  margin-top: 0.75rem;
}
.receipt-table {
  border-spacing: 0;
}
.receipt-table td {
  padding: 0.65rem 0.5rem;
}
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.summary-item {
  background: rgba(5, 10, 26, 0.75);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.summary-item--alert {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.1);
}
.summary-value {
  font-size: 1.5rem;
  font-weight: 600;
}
.dashboard-lists {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.dashboard-lists.two-column-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}
.list-card {
  background: rgba(10, 18, 40, 0.9);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.5);
}
.list-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.list-card ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.list-card li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(226, 232, 255, 0.08);
}
.list-card li:last-child {
  border-bottom: none;
}
.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.list-card-header .list-card-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.list-card-link {
  color: #c7d2fe;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rent-alerts-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.rent-alert-row {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(226, 232, 255, 0.08);
}
.rent-alert-row:last-child {
  border-bottom: none;
}
.rent-alert-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 130px;
}
.template-editor-toggle {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}
.template-editor {
  margin-top: 0.75rem;
}
.template-hints {
  font-size: 0.85rem;
  color: rgba(229, 231, 235, 0.8);
  margin: 0.5rem 0 0;
}
.template-hints code {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-family: inherit;
}
.template-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.template-toolbar button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.85);
  color: #e0e7ff;
  padding: 0.25rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.template-toolbar button:hover {
  border-color: rgba(99, 102, 241, 0.6);
}
.button.edit-link {
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
  color: #a5b4fc;
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.button.edit-link span {
  font-size: 1.1rem;
}
.button.edit-link:hover,
.button.edit-link:focus-visible {
  color: #f8fafc;
  text-decoration: none;
}
.button.edit-link span {
  display: none;
}
.emphasize-send {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.emphasize-send form,
.emphasize-send button {
  width: auto;
  min-width: 0;
}
.rent-increase-row {
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.75rem;
}
.rent-increase-row strong {
  font-size: 1rem;
}
.rent-increase-row .muted {
  font-size: 0.85rem;
}
.tenant-profile-panel .tenant-profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.tenant-profile-hero .headline {
  font-size: 1.25rem;
  margin: 0;
}
.tenant-profile-pill-group {
  display: flex;
  gap: 0.5rem;
}
.tenant-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  color: #e0e7ff;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.tab-button.is-active {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.6);
}
.tenant-tab-content {
  display: none;
}
.tenant-tab-content.is-active {
  display: block;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.tenant-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.table-scroll {
  overflow-x: auto;
}
.sub-table {
  width: 100%;
  border-collapse: collapse;
}
.sub-table th,
.sub-table td {
  text-align: left;
  padding: 0.45rem;
  border-bottom: 1px solid rgba(226, 232, 255, 0.1);
}
.communication-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.communication-list li {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
}
.rent-increase-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.35rem 0;
  text-decoration: none;
  color: inherit;
}
.rent-increase-link:hover {
  background: rgba(99, 102, 241, 0.08);
  border-radius: 8px;
}
.rent-increase-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: inherit;
}
.increase-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.increase-pill {
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
}
.increase-pill--up {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}
.increase-pill--down {
  background: rgba(248, 113, 113, 0.15);
  color: #fecdd3;
  border-color: rgba(248, 113, 113, 0.35);
}
.list-card span.stat {
  color: rgba(99, 102, 241, 0.9);
  font-weight: 600;
}
.tenant-profile-shell {
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(5, 10, 26, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 15px 45px rgba(2, 6, 23, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.tenant-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.tenant-profile-header h1 {
  margin: 0.1rem 0 0.15rem;
  font-size: 2rem;
}
.tenant-profile-header .muted.small {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(226, 232, 255, 0.6);
}
.tenant-profile-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.pill-group {
  display: flex;
  gap: 0.4rem;
}
.status-pill {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.badge-pill {
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.tenant-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.info-stack,
.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.info-card {
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.contact-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(226, 232, 255, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.contact-icon::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
}
.contact-icon--email::before {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='14' viewBox='0 0 20 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 2H19V12H1V2Z' stroke='%23FFFFFF' stroke-width='1.5'/%3E%3Cpath d='M1 2L9.5 8L19 2' stroke='%23FFFFFF' stroke-width='1.5'/%3E%3C/svg%3E");
}
.contact-icon--phone::before {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.5 11.2C11.9 11.2 11.4 11 11 10.6L9.1 12.5C7.6 11.9 6.1 11 4.7 9.6C3.3 8.2 2.4 6.7 1.9 5.2L3.7 3.4C3.9 3.2 4 2.9 4 2.6V1C4 0.4 3.6 0 3 0H1C0.4 0 0 0.4 0 1C0 7.5 8.5 16 15 16C15.6 16 16 15.6 16 15V13C16 12.4 15.6 12 15 12H13.4C13.1 12 12.8 12.1 12.6 12.3L12.5 11.2Z' fill='%23FFFFFF'/%3E%3C/svg%3E");
}
.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0;
  color: rgba(226, 232, 255, 0.6);
}
.info-card p,
.notes-card p,
.info-grid p {
  margin: 0.25rem 0 0;
}
.meta-row {
  display: flex;
  gap: 1.2rem;
}
.notes-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(10,18,40,0.95));
}
.notes-card .muted {
  color: rgba(226, 232, 255, 0.75);
  line-height: 1.5;
}
.tenant-tabs {
  display: flex;
  gap: 0.5rem;
}
.tab-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: #e0e7ff;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.tab-button.is-active {
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.6);
}
.tenant-tab-content {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}
.tenant-tab-content.is-active {
  display: flex;
}
.tab-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.table-scroll {
  overflow-x: auto;
}
.sub-table {
  width: 100%;
  border-collapse: collapse;
}
.sub-table th,
.sub-table td {
  text-align: left;
  padding: 0.35rem;
  border-bottom: 1px solid rgba(226, 232, 255, 0.08);
}
.communication-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.communication-list li {
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(10, 18, 40, 0.85);
}
.communication-list strong {
  display: block;
  margin-bottom: 0.25rem;
}
.communication-list .muted.small {
  margin: 0.25rem 0 0;
}
.message-body {
  margin-top: 1rem;
  background: rgba(15, 23, 42, 0.95);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.tenant-profile-panel {
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(10, 18, 40, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.5);
}
.tenant-profile-panel .muted {
  color: rgba(226, 232, 255, 0.7);
}
.tenant-profile-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  align-items: center;
}
.contact-pill {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
}
.contact-icon {
  font-size: 1.2rem;
}
.notes-block {
  min-height: 120px;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}
.tenant-profile-panel .headline {
  margin: 0;
  font-size: 1.25rem;
}
.muted {
  margin: 0.2rem 0 0;
  color: rgba(226, 232, 255, 0.7);
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shortfalls-filter select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  color: #e0e7ff;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}
.form-panel {
  max-width: 520px;
  margin: 3.5rem auto;
}
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.form-note {
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(226, 232, 255, 0.1);
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.toggle-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}
.toggle-label {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(226, 232, 255, 0.7);
}
.payment-mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 999px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(226, 232, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}
.mode-option {
  border: none;
  background: transparent;
  color: #cbd5f5;
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.mode-option.active {
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
}
.mode-option:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.7);
  outline-offset: 2px;
}
input,
textarea,
select {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f172a;
  color: #fff;
}
textarea {
  min-height: 140px;
  resize: vertical;
}
button,
.button {
  border: none;
  border-radius: 12px;
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover,
.button:hover {
  background: #7c3aed;
}
.button.secondary {
  background: transparent;
  color: #e0e7ff;
  border: 1px solid rgba(226, 232, 255, 0.4);
}
.button.ghost {
  background: transparent;
  border: 1px solid rgba(226, 232, 255, 0.4);
  color: #f8fafc;
  padding: 0.55rem 1rem;
}
button.full-width,
.button.full-width {
  width: 100%;
  justify-content: center;
}
.button.tiny {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}
.inline-form {
  margin: 0;
}
.user-table-wrapper {
  overflow-x: auto;
  padding: 0.75rem;
  background: rgba(11, 17, 38, 0.78);
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 255, 0.08);
}
.user-table-wrapper.hidden {
  padding: 0;
  border: none;
  box-shadow: none;
}
.inbox-loader {
  margin: 1.5rem auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(99, 102, 241, 0.4);
  border-top-color: #6366f1;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.user-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.35rem;
  min-width: 640px;
}
.user-table thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: rgba(226, 232, 255, 0.6);
  padding-bottom: 0.35rem;
  text-align: left;
}
.user-table tbody tr {
  background: rgba(10, 18, 40, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  transition: transform 120ms ease, background 120ms ease;
  position: relative;
  z-index: 0;
}
.user-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
  z-index: 1;
}
.user-table td {
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  vertical-align: middle;
  color: #f8fafc;
}
.actions-column {
  width: 60px;
}
.unit-actions {
  padding: 0.2rem 0.5rem 0.2rem 0.5rem;
  position: relative;
  text-align: right;
}
.ellipsis {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.ellipsis-trigger {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 255, 0.2);
  background: rgba(5, 10, 26, 0.6);
  color: #f8fafc;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.ellipsis-trigger:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
}
.ellipsis-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  padding: 0.5rem;
  background: rgba(5, 10, 26, 0.95);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 255, 0.15);
  box-shadow: 0 10px 25px rgba(5, 10, 26, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 5;
}
.ellipsis-menu.is-flipped {
  top: auto;
  bottom: calc(100% + 0.35rem);
}
.ellipsis-menu.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.ellipsis-menu button {
  border: none;
  background: transparent;
  color: #f8fafc;
  padding: 0.25rem 0.35rem;
  text-align: left;
  font-size: 0.9rem;
  border-radius: 10px;
  transition: background 120ms ease;
  cursor: pointer;
}
.ellipsis-menu button:hover {
  background: rgba(99, 102, 241, 0.2);
}
.ellipsis-menu__danger {
  color: #fecdd3;
}
.payment-row {
  cursor: pointer;
}
.payment-details-row {
  display: none;
}
.payment-details-row.active {
  display: table-row;
}
.payment-details-card {
  background: rgba(5, 10, 26, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1rem 1.25rem;
  box-shadow: 0 12px 30px rgba(5, 10, 26, 0.6);
}
.payment-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.detail-item p {
  margin: 0;
}
.detail-value {
  font-size: 1rem;
  font-weight: 600;
}
.details-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.details-actions .detail-action {
  border-radius: 10px;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(226, 232, 255, 0.4);
  background: rgba(99, 102, 241, 0.2);
  color: #f8fafc;
  transition: background 120ms ease, transform 120ms ease;
}
.details-actions .detail-action:hover {
  background: rgba(99, 102, 241, 0.35);
}
.details-actions .detail-action--danger {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecdd3;
}
.details-actions .detail-action--danger:hover {
  background: rgba(248, 113, 113, 0.35);
}
.type-cell {
  width: 120px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.status-pill--payment {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
.status-pill--refund {
  background: rgba(248, 113, 113, 0.15);
  color: #fecdd3;
  border-color: rgba(248, 113, 113, 0.45);
}
.status-pill--write-off {
  background: rgba(168, 85, 247, 0.1);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.35);
}
.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  font-weight: 500;
  font-size: 0.85rem;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}
.pill {
  border: 1px solid rgba(226, 232, 255, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #e0e7ff;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}
.pill:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.65);
  outline-offset: 2px;
}
.variables-grid {
  margin-bottom: 1rem;
}
.username-col {
  width: 18%;
  font-weight: 600;
}
.clearance-col {
  width: 12%;
}
.actions-col {
  width: 12%;
  text-align: right;
}
.contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 260px;
}
.contact-email {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-phone {
  font-size: 0.9rem;
  color: rgba(226, 232, 255, 0.7);
}
.clearance-pill {
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.clearance-low {
  background: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}
.clearance-medium {
  background: rgba(129, 140, 248, 0.25);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.4);
}
.clearance-high {
  background: rgba(166, 85, 247, 0.25);
  color: #fce7f3;
  border: 1px solid rgba(166, 85, 247, 0.45);
}
.tenant-search-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
.tenant-search-form input {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  padding: 0.65rem 1rem;
  min-width: 220px;
}
.company-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
}
.company-pill--muted {
  background: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 255, 0.7);
  border-color: rgba(148, 163, 184, 0.35);
}
.tenant-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.tenant-pill.is-active {
  background: rgba(34, 197, 94, 0.22);
  color: #bdf7c1;
}
.tenant-pill.is-inactive {
  background: rgba(248, 113, 113, 0.2);
  color: #ffc6c6;
}
.tenant-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 1.5rem;
}
.back-button-row {
  grid-column: 1 / -1;
}
.tenant-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.detail-card {
  background: rgba(10, 18, 40, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.6);
}
.detail-card dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.detail-card dt {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(226, 232, 255, 0.6);
}
.detail-card dd {
  margin: 0;
  font-weight: 600;
}
.occupancy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.occupancy-list li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.occupancy-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.payment-summary {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
.payment-summary th,
.payment-summary td {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  text-align: left;
}
.payment-summary thead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(226, 232, 255, 0.6);
}
.payment-summary tbody tr {
  border-top: 1px solid rgba(226, 232, 255, 0.05);
}
.history-table-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
}
.history-table th,
.history-table td {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  text-align: left;
}
.history-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 255, 0.6);
}
.history-table tbody tr {
  border-bottom: 1px solid rgba(226, 232, 255, 0.08);
}
.history-table tbody tr:last-child {
  border-bottom: none;
}
.history-table tbody tr.active {
  background: rgba(99, 102, 241, 0.15);
}
.history-table tbody tr.active td {
  font-weight: 600;
}
.hidden-history {
  display: none;
}
.hidden-history.visible {
  display: table-row;
}
.history-toggle {
  margin-top: 0.75rem;
  padding: 0.45rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 255, 0.4);
  background: transparent;
  color: #f8fafc;
  font-size: 0.85rem;
}
.history-table td {
  vertical-align: middle;
}
.history-delete-button {
  border-radius: 10px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid rgba(226, 232, 255, 0.4);
  background: transparent;
  color: #f8fafc;
  transition: background 120ms ease;
}
.history-delete-button:hover {
  background: rgba(248, 113, 113, 0.15);
}
.tenant-detail-form {
  background: rgba(10, 18, 40, 0.75);
  border-radius: 18px;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.rent-history-card {
  margin-top: 1.5rem;
}
.tenant-table tbody tr[data-tenant-url] {
  cursor: pointer;
}
.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.checkbox-field input {
  width: unset;
  margin: 0;
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 1.4px solid rgba(226, 232, 255, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  transition: background 120ms ease, border 120ms ease;
  position: relative;
}
.checkbox-field input::after {
  content: "";
  position: absolute;
  width: 0.45rem;
  height: 0.75rem;
  border: solid #f8fafc;
  border-width: 0 2px 2px 0;
  transform: translate(0.2rem, 0.2rem) rotate(45deg);
  opacity: 0;
}
.checkbox-field input:checked {
  background: #6366f1;
  border-color: #6366f1;
}
.checkbox-field input:checked::after {
  opacity: 1;
}
.empty-state {
  padding: 1rem;
  color: #e2e8f0;
}
.error {
  padding: 0.75rem 1rem;
  background: #881b4a;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.success-message {
  padding: 0.65rem 1rem;
  background: rgba(34, 211, 238, 0.2);
  border-radius: 10px;
  color: #e0f2fe;
  margin-bottom: 1rem;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-form label {
  color: #cbd5f5;
}
.settings-form input {
  width: 100%;
}
.settings-preview {
  background: rgba(10, 18, 40, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.5);
}
.settings-preview h2 {
  margin-top: 0.25rem;
  font-size: 1.3rem;
}
.settings-preview dl {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.65rem;
}
.settings-list-panel {
  padding: 2rem;
}
.settings-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 255, 0.2);
  background: rgba(11, 17, 38, 0.85);
  box-shadow: 0 10px 30px rgba(5, 10, 26, 0.55);
  text-decoration: none;
  color: inherit;
}
.settings-card .muted {
  margin: 0;
}
.settings-card.disabled {
  opacity: 0.5;
  cursor: default;
}
.settings-preview dt {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(226, 232, 255, 0.5);
}
.settings-preview dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
@media (max-width: 900px) {
  .app-body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    background: transparent;
    border-right: none;
    border-bottom: 1px solid rgba(226, 232, 255, 0.08);
  }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar a {
    padding: 0.35rem 0.75rem;
    margin-right: 0.5rem;
  }
  .tenant-detail-grid {
    grid-template-columns: 1fr;
  }
}
