:root {
  --blue-900: #0d1b3e;   /* deep blue  — sidebar deep bg          */
  --blue-800: #1a2a52;   /* mid blue   — sidebar gradient end      */
  --blue-700: #0b74de;   /* accent     — primary buttons & links   */
  --blue-600: #0960b8;   /* accent-dk  — hover / pressed           */
  --blue-500: #5B8FE0;   /* brand      — focus rings & borders     */
  --blue-100: #bdd6f7;   /* blue-tint  — light border accents      */
  --blue-50:  #e6f4ff;   /* blue-pale  — background tints          */
  --white: #ffffff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--slate-900);
  background: radial-gradient(circle at top left, rgba(11, 116, 222, 0.06), transparent 45%),
    linear-gradient(120deg, var(--blue-50), var(--white));
  min-height: 100vh;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.is-hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  align-items: start;
}

.main {
  justify-self: stretch;
  align-self: start;
  transition: opacity 0.15s ease;
}

.sidebar {
  background: linear-gradient(180deg, var(--blue-900), var(--blue-800));
  color: var(--white);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
.sidebar > .card {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: #6FA8FF;
  text-decoration: none;
}
.brand span { color: #5B8FE0; }
.brand-ie {
  color: #8A8A8A !important;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.7;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--white);
}
.sidebar-profile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  flex-shrink: 0;
}
.sidebar-profile-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-profile-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -16px;
}

.nav-section {
  margin-top: 8px;
  padding: 6px 14px 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  display: none;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.86);
  transition: 0.2s ease;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

.nav-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 8px 0;
}

/* ── Page tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 24px;
  width: fit-content;
}
.tab-btn {
  padding: 12px 28px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tab-btn.active {
  color: var(--white);
  background: var(--blue-700);
  box-shadow: 0 2px 8px rgba(11, 116, 222, 0.25), 0 1px 3px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.tab-btn:hover:not(.active) {
  color: var(--slate-700);
  background: rgba(255,255,255,0.6);
}

.tab-content > .card,
.tab-content > .grid > .card {
  margin-bottom: 20px;
}
.tab-content > .card:last-child,
.tab-content > .grid:last-child {
  margin-bottom: 0;
}

.action-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.summary-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
}

.section-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 0.9rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 18px 12px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.empty-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.table .empty-state {
  text-align: left;
}

.table .empty-inline {
  justify-content: flex-start;
}

.reminder-list-card {
  margin-bottom: 24px;
}

.reminder-contacts-subtext {
  margin-bottom: 12px;
}


.hamburger {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
}

.hamburger span {
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--white);
  position: relative;
}

.hamburger span::before,
.hamburger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--white);
}

.hamburger span::before {
  top: -5px;
}

.hamburger span::after {
  top: 5px;
}

.sidebar .card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.main {
  padding: 28px 36px 48px;
  align-self: start;
}

.page-property-detail .card,
.page-property-detail .subtext,
.page-property-detail h1,
.page-property-detail h3,
.page-property-detail .stat {
  text-align: left;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
}

.topbar .actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.button {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--blue-700);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.button.secondary {
  background: var(--white);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
  box-shadow: none;
}

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

.button.success {
  background: var(--success);
  color: var(--white);
}

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

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

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

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

.card {
  background: var(--white);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.stat {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-800);
}

.subtext {
  color: var(--slate-600);
  font-size: 0.9rem;
}

.subtext.success {
  color: var(--success);
}

.subtext.error {
  color: var(--danger);
}

.receipt-inline {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--slate-200);
  border-radius: 12px;
  background: #f8fafc;
}

#expense-receipt-progress {
  margin-top: 6px;
}

#receipt-uploader .uppy-Dashboard {
  border-radius: 14px;
  border: 1px dashed var(--slate-200);
  box-shadow: none;
  background: #f8fafc;
}

#receipt-uploader {
  min-height: 90px;
}

#receipt-uploader .uppy-Dashboard-inner {
  border-radius: 14px;
  min-height: 0;
}

#receipt-uploader .uppy-Dashboard-AddFiles {
  border-radius: 10px;
  padding: 10px 12px;
}

#receipt-uploader .uppy-Dashboard-innerWrap,
#receipt-uploader .uppy-Dashboard-AddFilesPanel {
  min-height: 0;
}

#receipt-uploader .uppy-Dashboard-AddFiles-title {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

#receipt-uploader .uppy-Dashboard-AddFiles-info {
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  #receipt-uploader {
    min-height: 64px;
  }

  #receipt-uploader .uppy-Dashboard {
    border-radius: 12px;
  }

  #receipt-uploader .uppy-Dashboard-inner {
    border-radius: 12px;
    min-height: 0 !important;
  }

  #receipt-uploader .uppy-Dashboard-AddFiles {
    padding: 6px 8px;
  }

  #receipt-uploader .uppy-Dashboard-AddFiles-title {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  #receipt-uploader .uppy-Dashboard-AddFiles-info {
    display: none;
  }

  #receipt-uploader .uppy-Dashboard-innerWrap,
  #receipt-uploader .uppy-Dashboard-AddFilesPanel,
  #receipt-uploader .uppy-DashboardContent {
    min-height: 0 !important;
  }

  #receipt-uploader .uppy-Dashboard-files {
    max-height: 110px;
    overflow-y: auto;
  }

  #receipt-uploader .uppy-Dashboard-Item-name {
    max-width: 120px;
  }
}

.lease-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lease-card .button {
  margin-top: 10px;
  align-self: flex-start;
  position: static;
  clear: both;
}

#tenant-lease-doc {
  display: block;
  width: fit-content;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--slate-200);
}

.table th {
  color: var(--slate-600);
  font-weight: 600;
}


.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.badge.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.auth-card {
  max-width: 520px;
  margin: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tab {
  border: 1px solid var(--blue-100);
  background: var(--white);
  color: var(--slate-700);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--blue-700);
  color: var(--white);
  border-color: var(--blue-700);
}

.auth-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.auth-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--slate-600);
  font-size: 0.9rem;
}

.auth-card .form {
  gap: 20px;
}

.auth-card #register-fields,
.auth-card #register-otp {
  display: grid;
  gap: 20px;
}

.auth-card #forgot-fields,
.auth-card #forgot-otp,
.auth-card #forgot-reset,
.auth-card #tenant-forgot-fields,
.auth-card #tenant-code-panel,
.auth-card #tenant-reset-panel {
  display: grid;
  gap: 20px;
}

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

.auth-step {
  font-size: 0.85rem;
  color: var(--slate-600);
  font-weight: 600;
  margin-bottom: 0;
}

.auth-card .row {
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: end;
}

.auth-card input {
  padding: 12px 14px;
}

.auth-switch {
  margin-top: 12px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue-700);
  font-weight: 600;
  cursor: pointer;
}

.link-inline {
  color: var(--blue-700);
  font-weight: 600;
  text-decoration: underline;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.checkbox input {
  width: 16px;
  height: 16px;
}

.password-field .button.secondary {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.otp-send {
  display: flex;
  align-items: stretch;
}

.otp-send .button {
  width: 100%;
}



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

#expense-form {
  padding-top: 4px;
}

.inline-form {
  display: none;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.inline-form.is-visible {
  display: block;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.form-actions.align-start {
  justify-content: flex-start;
}

.form-hint {
  font-size: 0.9rem;
  color: var(--slate-500);
}

.form-hint.success {
  color: var(--success);
}

.form-hint.error {
  color: var(--danger);
}

.file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e1f0;
  color: #1f3a68;
  font-size: 13px;
  text-decoration: none;
  background: #f6f9ff;
}

.file-chip:hover {
  border-color: #1f3a68;
}

/* ── Banner / alert ──────────────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.banner a { font-weight: 600; text-decoration: underline; }
.banner-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #6d4c00;
}
.banner-warning a { color: #6d4c00; }

/* ── Existing file attachment display ─────────────────────────────────────── */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: var(--slate-50);
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.file-attachment-name {
  flex: 1;
  font-weight: 500;
  color: var(--slate-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-attachment-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.file-attachment-actions .button {
  padding: 4px 10px;
  font-size: 0.78rem;
}

/* ── Unified file upload area ─────────────────────────────────────────────── */

.file-upload-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--slate-200);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  background: var(--slate-50);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  min-height: 80px;
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--blue-700);
  background: var(--blue-50);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.file-upload-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
}

.file-upload-hint {
  font-size: 0.78rem;
  color: var(--slate-600);
  margin-top: 2px;
}

.file-upload-selected {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-top: 6px;
  display: none;
}

.file-upload-selected.has-files {
  display: block;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.notice-section {
  display: none;
  margin-top: 12px;
}

.notice-section.is-active {
  display: block;
}

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

.button.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  gap: 16px;
}
.list-toolbar-search {
  flex: 1;
  max-width: 360px;
}

.property-form {
  max-width: 720px;
}

.tenant-form .form-section {
  position: relative;
  padding: 16px 0;
}

.tenant-form .form-section::before {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  top: 0;
  height: 1px;
  background: var(--slate-200);
}

.tenant-form .form-section:first-of-type {
  padding-top: 0;
}

.tenant-form .form-section:first-of-type::before {
  display: none;
}

.secondary-tenant-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  margin-bottom: 12px;
}

.secondary-tenant-card .row {
  margin-bottom: 10px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 10px 0;
  border-radius: 16px;
  background: transparent;
}

.form-section-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--slate-900);
}

.form-section-header .subtext {
  margin-top: 4px;
}

.form .row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.iti {
  width: 100% !important;
  display: block !important;
}

.iti input,
.iti input[type="tel"] {
  width: 100% !important;
  box-sizing: border-box;
}

.iti__selected-flag {
  padding: 0 12px;
}

.iti--allow-dropdown input {
  padding-left: 52px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  font-family: inherit;
  font-size: 0.95rem;
}

select {
  padding: 8px 8px;
}

.select-like {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}

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

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--slate-600);
  margin-bottom: 6px;
}

.eircode-input {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.property-search {
  max-width: 360px;
}

.tenant-search {
  max-width: 360px;
}

.expense-search {
  max-width: 360px;
}

.rent-search {
  max-width: 360px;
}

@media (max-width: 900px) {
  .property-search {
    max-width: none;
  }

  .tenant-search {
    max-width: none;
  }

  .expense-search {
    max-width: none;
  }

  .rent-search {
    max-width: none;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal#receipt-modal {
  z-index: 4000;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: min(560px, 100%);
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

#receipt-modal .modal-content {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  z-index: 4001;
}

.receipt-pdf {
  margin-top: 12px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  overflow: hidden;
  background: var(--slate-50);
}

.receipt-pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--slate-200);
  flex-wrap: wrap;
  background: var(--white);
}

.receipt-pdf-canvas-wrap {
  max-height: min(70vh, 780px);
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.receipt-pdf-canvas-wrap canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  object-fit: contain;
}

#receipt-viewer {
  margin-top: 12px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-close {
  justify-content: center;
}

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

.flow .pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-800);
  font-weight: 600;
  border: 1px solid var(--blue-100);
}

.hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(255, 255, 255, 0.8));
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.section-title {
  margin: 28px 0 14px;
  font-size: 1.2rem;
}

@media (max-width: 1100px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    row-gap: 0;
    min-height: auto;
    align-content: start;
  }

  .sidebar {
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    position: relative;
    top: auto;
    z-index: 10;
    height: auto;
    overflow-y: visible;
    padding-bottom: 16px;
  }

  .nav {
    display: none;
    flex-direction: column;
    gap: 6px;
  }

  .sidebar.open .nav {
    display: flex;
  }

  .nav a {
    font-size: 0.9rem;
    padding: 8px 12px;
    white-space: normal;
  }

  .hamburger {
    display: inline-flex;
  }

  .sidebar-profile {
    display: none;
  }

  .sidebar.open .sidebar-profile {
    display: flex;
    position: static;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: auto;
    gap: 10px;
  }

  .sidebar.open .sidebar-profile:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .sidebar.open .sidebar-profile-info {
    display: block;
  }

  .sidebar-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .sidebar .card {
    display: none;
  }

  .main {
    padding: 0 24px 32px;
    margin-top: 0;
    padding-top: 8px !important;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 0;
  }

  .topbar .actions {
    width: 100%;
    flex-wrap: wrap;
  }

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

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

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table .empty-state {
    white-space: normal;
  }

  .table th,
  .table td {
    padding: 10px 8px;
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .main {
    padding: 20px 16px 32px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .card {
    padding: 16px;
    max-width: 100%;
  }

  .dash-greeting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }

  .dash-greeting-row > div {
    width: 100%;
    text-align: left;
  }

  .dash-greeting-row .button {
    width: 100%;
  }

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

  .list-toolbar-search {
    max-width: 100%;
  }

  .list-toolbar .button {
    width: 100%;
  }

  .dash-greeting {
    font-size: 1.6rem;
    text-align: left;
  }

  .dash-date {
    text-align: left;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    padding: 4px;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .profile-plan-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-plan-info {
    width: 100%;
  }

  .property-form {
    max-width: 100%;
  }

  .form-section {
    padding: 12px;
  }

  .topbar h1 {
    font-size: 1.6rem;
  }

  .stat {
    font-size: 1.6rem;
  }

  .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .actions .button {
    width: auto;
  }

  .empty-inline {
    width: 100%;
  }

  .empty-inline .button {
    width: 100%;
    margin: 0;
  }

  .grid {
    gap: 14px;
  }

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

  .hero {
    padding: 18px;
  }

  .flow .pill {
    flex: 1 1 160px;
    text-align: center;
  }

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

  .modal-close span {
    display: none;
  }

  .modal-close::before {
    content: "×";
    font-size: 1.4rem;
    line-height: 1;
  }

  #confirm-modal .modal-close,
  #payment-confirm-modal .modal-close,
  #reminder-confirm-modal .modal-close {
    display: none;
  }

  .receipt-pdf-toolbar {
    gap: 4px;
    padding: 6px;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .receipt-pdf-toolbar .button,
  .receipt-pdf-toolbar a.button {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: auto;
    border-radius: 6px;
    box-shadow: none;
  }

  #receipt-modal .modal-content {
    width: 100%;
    max-height: 92vh;
    padding: 14px;
  }
}

@media (max-width: 600px) {
  .table {
    display: block;
    border: 0;
  }

  .table thead {
    display: none;
  }

  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--white);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  }

  .table tr:has(.empty-state) {
    box-shadow: none;
    border: none;
  }

  .table .empty-state {
    white-space: normal;
    text-align: center;
    border-bottom: none;
    padding: 18px 8px;
  }

  .table .empty-state::before {
    display: none;
  }

  .table td {
    display: block;
    padding: 6px 0;
    border-bottom: 1px dashed var(--slate-200);
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    margin-bottom: 4px;
  }

  .table td[data-label="Action"],
  .table td[data-label="Document"],
  .table td[data-label="Documents"] {
    border-bottom: 0;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .table td[data-label="Action"]::before,
  .table td[data-label="Document"]::before,
  .table td[data-label="Documents"]::before {
    display: none;
  }

  .table td[data-label="Action"] .button,
  .table td[data-label="Document"] .button,
  .table td[data-label="Document"] a.button,
  .table td[data-label="Documents"] .button,
  .table td[data-label="Documents"] a.button {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .table td[data-label="Action"] .flow,
  .table td[data-label="Action"] .table-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .table td[data-label="Action"] .flow .button,
  .table td[data-label="Action"] .flow a.button {
    flex: 1;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .table-actions .table-action-primary {
    width: 100%;
    flex-basis: 100%;
  }

  .table td:last-child {
    border-bottom: 0;
  }

  .secondary-tenant-remove {
    padding-top: 8px;
  }
}

/* ── Documents page – section jump nav ──────────────────────────────────────── */
.docs-jumpnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.docs-jumpnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  box-shadow: 0 2px 6px rgba(15,23,42,0.06);
}

.docs-jumpnav a:hover {
  background: var(--blue-50);
  border-color: var(--blue-500);
  color: var(--blue-700);
}

/* ── Export date range filter ────────────────────────────────────────────────── */
.export-date-range {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.export-date-range > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.export-date-sep {
  margin-bottom: 10px;
  color: var(--slate-500);
  font-size: 1rem;
  line-height: 1;
}
.export-date-hint {
  align-self: flex-end;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--slate-500);
}

/* ── Export category tabs ────────────────────────────────────────────────────── */
.export-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.export-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.export-tab:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
  background: var(--blue-50);
}

.export-tab.is-active {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(29,78,216,0.25);
}

/* ── Document export cards ───────────────────────────────────────────────────── */
.doc-export-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.doc-export-card {
  background: var(--white);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 14px rgba(15,23,42,0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.doc-export-card:hover {
  box-shadow: 0 8px 24px rgba(15,23,42,0.11);
  border-color: var(--blue-100);
}

.doc-export-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.doc-export-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0;
  line-height: 1.3;
}

.doc-export-desc {
  font-size: 0.8rem;
  color: var(--slate-600);
  line-height: 1.45;
  flex: 1;
}

.doc-export-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.doc-export-card .button {
  font-size: 0.82rem;
  padding: 7px 14px;
}

@media (max-width: 1100px) {
  .doc-export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .doc-export-grid {
    grid-template-columns: 1fr;
  }

  .docs-jumpnav {
    gap: 6px;
  }

  .docs-jumpnav a {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

/* ── Accordion generators ────────────────────────────────────────────────────── */
.doc-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-accordion-item {
  background: var(--white);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 14px rgba(15,23,42,0.07);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.doc-accordion-item.is-open {
  box-shadow: 0 8px 28px rgba(15,23,42,0.11);
  border-color: var(--blue-100);
}

.doc-accordion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.doc-accordion-header:hover {
  background: var(--blue-50);
}

.doc-accordion-item.is-open .doc-accordion-header {
  background: var(--blue-50);
  border-bottom: 1px solid var(--blue-100);
}

.doc-acc-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.doc-acc-text {
  flex: 1;
  min-width: 0;
}

.doc-acc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0 0 2px;
}

.doc-acc-subtitle {
  font-size: 0.82rem;
  color: var(--slate-600);
  line-height: 1.4;
  white-space: normal;
}

.doc-acc-chevron {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--slate-600);
  transition: transform 0.2s ease;
}

.doc-accordion-item.is-open .doc-acc-chevron {
  transform: rotate(180deg);
}

.doc-accordion-body {
  display: none;
  padding: 20px;
}

.doc-accordion-item.is-open .doc-accordion-body {
  display: block;
}

/* ── Notice type picker (replaces select on desktop) ─────────────────────────── */
.notice-type-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.notice-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.notice-type-btn:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
  background: var(--blue-50);
}

.notice-type-btn.is-active {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(29,78,216,0.3);
}

/* ── Loading / generating state on buttons ───────────────────────────────────── */
.button.is-loading {
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}

.button.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  margin-left: 8px;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
}

.button.secondary.is-loading::after {
  border-color: rgba(29,78,216,0.3);
  border-top-color: var(--blue-700);
}

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

/* ── Legal hint box ──────────────────────────────────────────────────────────── */
.legal-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--blue-50);
  border-left: 3px solid var(--blue-500);
  font-size: 0.83rem;
  color: var(--slate-700);
  line-height: 1.5;
}

.legal-hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Section label with count ────────────────────────────────────────────────── */
.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 14px;
}

.section-title-row .section-title {
  margin: 0;
}

.section-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-600);
  background: var(--slate-100);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ── Notice form card ────────────────────────────────────────────────────────── */
.notice-form-card {
  padding: 20px;
}

.notice-form-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notice-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.notice-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-700);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-step-body {
  flex: 1;
  min-width: 0;
}

.notice-step-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.notice-step-divider {
  height: 1px;
  background: var(--slate-200);
  margin: 4px 0 20px;
}

/* ── Notices history table enhancements ──────────────────────────────────────── */
.notices-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--slate-600);
}

.notices-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.notices-empty-text {
  font-size: 0.9rem;
}


/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════════════════════ */

/* Greeting row */
.dash-greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.dash-greeting {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
}
.dash-date {
  font-size: 0.87rem;
  color: var(--slate-600);
  margin-top: 4px;
}

/* Period filter */
.dash-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.dash-filter-label {
  font-size: 0.84rem;
  color: var(--slate-600);
  font-weight: 500;
}
.dash-month-input {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--slate-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--slate-900);
}
.dash-month-input:focus {
  outline: none;
  border-color: var(--blue-500);
}

/* KPI grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .dash-kpi-grid { grid-template-columns: 1fr 1fr; }
}
.kpi-card {
  background: var(--white);
  border-radius: 14px;
  border: 1.5px solid var(--slate-100);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}
.kpi-icon {
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-green .kpi-icon  { background: #d1fae5; }
.kpi-orange .kpi-icon { background: #ffedd5; }
.kpi-blue .kpi-icon   { background: var(--blue-100); }
.kpi-purple .kpi-icon { background: #ede9fe; }

.kpi-body { min-width: 0; }
.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-green .kpi-value  { color: #059669; }
.kpi-orange .kpi-value { color: #ea580c; }
.kpi-blue .kpi-value   { color: var(--blue-600); }
.kpi-purple .kpi-value { color: #7c3aed; }

.kpi-label {
  font-size: 0.78rem;
  color: var(--slate-600);
  margin-top: 4px;
  font-weight: 500;
}
.kpi-sub {
  font-size: 0.73rem;
  color: var(--slate-600);
  margin-top: 2px;
  opacity: 0.8;
}

/* Alert strip */
.dash-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.dash-alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1.5px solid transparent;
}
.dash-alert-item.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.dash-alert-item.info {
  background: var(--blue-50);
  border-color: var(--blue-100);
  color: #1e40af;
}
.dash-alert-item.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.dash-alert-icon { font-size: 1rem; flex-shrink: 0; }
.dash-alert-link {
  margin-left: auto;
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.75;
  text-decoration: underline;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-alert-link:hover { opacity: 1; }

/* Quick actions */
.dash-quickactions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .dash-quickactions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .dash-quickactions { grid-template-columns: repeat(2, 1fr); }

  .main {
    padding: 16px 12px 24px;
  }

  .card {
    padding: 12px;
  }

  .dash-greeting {
    font-size: 1.4rem;
  }

  .kpi-card {
    padding: 12px;
    gap: 10px;
  }

  .kpi-icon {
    font-size: 1.2rem;
  }

  .kpi-value {
    font-size: 1.4rem;
  }

  .kpi-label {
    font-size: 0.7rem;
  }

  .modal-content {
    padding: 16px;
  }

  .profile-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
  }

  .profile-header-name,
  .profile-header-email {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
  }

  .profile-upgrade-btn {
    width: 100%;
  }

  .profile-save-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-save-row .button {
    width: 100%;
  }

  .profile-save-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-save-footer .button {
    width: 100%;
  }

  .plan-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    max-width: 100%;
    word-break: break-word;
  }

  .password-field {
    flex-wrap: nowrap;
    max-width: 100%;
  }

  .password-field input {
    min-width: 0;
    flex: 1;
  }

  .password-toggle {
    flex-shrink: 0;
    padding: 8px 12px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .form .row > div {
    max-width: 100%;
  }

  .card {
    max-width: 100%;
    overflow-x: hidden;
  }
}
.dash-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px 14px;
  background: var(--white);
  border: 1.5px solid var(--slate-100);
  border-radius: 14px;
  text-decoration: none;
  color: var(--slate-700);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.dash-action-card:hover {
  border-color: var(--blue-500);
  color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

/* ── Dashboard Widgets ─────────────────────────────────────────────────────── */

.dash-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 720px) {
  .dash-widgets { grid-template-columns: 1fr; }
}

.dash-widget {
  padding: 20px;
}

.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dash-widget-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 0;
}

.dash-widget-link {
  font-size: 0.75rem;
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

.dash-widget-link:hover { text-decoration: underline; }

.dash-empty {
  font-size: 0.82rem;
  color: var(--slate-400, #94a3b8);
  padding: 10px 0;
}

/* Reminder items */
.dash-reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}

.dash-reminder-item:last-child { border-bottom: none; }

.dash-reminder-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-reminder-type {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-800, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-reminder-prop {
  font-size: 0.75rem;
  color: var(--slate-400, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-reminder-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.dash-reminder-date {
  font-size: 0.75rem;
  color: var(--slate-500, #64748b);
}

.dash-reminder-soon {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
}

/* Setup task mobile layout */
@media (max-width: 600px) {
  .setup-task.dash-reminder-item {
    flex-wrap: wrap;
  }
  .setup-task .dash-reminder-right {
    flex-shrink: 1;
    width: 100%;
  }
  .setup-task .dash-reminder-right .button {
    width: 100%;
    text-align: center;
  }
}

.dash-reminder-soon.soon-today {
  background: #fee2e2;
  color: #dc2626;
}

.dash-reminder-soon.soon-week {
  background: #fff7ed;
  color: #ea580c;
}

.dash-reminder-soon.soon-later {
  background: #f0fdf4;
  color: #16a34a;
}

/* Maintenance items */
.dash-maint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}

.dash-maint-item:last-child { border-bottom: none; }

.dash-maint-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-maint-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-800, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-maint-prop {
  font-size: 0.75rem;
  color: var(--slate-400, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-maint-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: capitalize;
  flex-shrink: 0;
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-600, #475569);
}

.dash-maint-badge.urg-high {
  background: #fee2e2;
  color: #dc2626;
}

.dash-maint-badge.urg-med {
  background: #fff7ed;
  color: #ea580c;
}

.dash-maint-badge.urg-low {
  background: #f0fdf4;
  color: #16a34a;
}

.dash-rent-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.dash-rent-amount {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
}

.dash-rent-due {
  font-size: 0.72rem;
  color: var(--slate-400, #94a3b8);
}

.dash-action-icon { font-size: 1.6rem; }

/* ── Action Center ─────────────────────────────────────────────────────────── */

/* Section heading used where JS writes textContent directly */
.ac-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--blue-500, #5B8FE0);
}

/* Section heading row (title + count pill) — used where JS does NOT write textContent */
.ac-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--blue-500, #5B8FE0);
}

.ac-heading-row h2 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 0;
}

.ac-heading-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--slate-400, #94a3b8);
  margin-left: 6px;
}

/* Card sub-header (hint text + count pill) inside the upcoming-rent card */
.ac-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ac-card-hint {
  font-size: 0.8rem;
  color: var(--slate-400, #94a3b8);
}

/* ── Upgrade banner ─────────────────────────────────────────── */
.upgrade-banner {
  background: #fff8e1;
  border: 1px solid #f6c90e;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.upgrade-banner.is-hidden { display: none; }

.plan-expired-banner {
  background: #fff1f0;
  border: 1px solid #f87171;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: #991b1b;
}
.plan-expired-banner.is-hidden { display: none; }

.plan-renewal-date { margin-top: 4px; font-size: 0.82rem; color: var(--text-muted, #6b7280); }
.plan-renewal-date.is-hidden { display: none; }

/* ── Plan badge ─────────────────────────────────────────────── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  background: var(--blue-50);
  border: 1px solid var(--blue-500);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-top: 6px;
}
.plan-badge.plan-pro { background: var(--blue-50); border-color: var(--blue-700); color: var(--blue-700); }
.plan-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; }
.plan-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-card-info { font-size: 0.9rem; color: var(--subtext); margin-top: 4px; }

/* ── Profile page ───────────────────────────────────────────────── */

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue-700);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.profile-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-header-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-900);
}

.profile-upgrade-btn {
  flex-shrink: 0;
}

.profile-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-600);
  margin: 20px 0 8px;
}

.profile-card-header {
  margin-bottom: 14px;
}

.profile-card-header h3 {
  margin: 0 0 2px;
}

.profile-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.email-verify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.email-verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}

.email-verify-badge.verified {
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
}

.email-verify-badge.unverified {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
}

.profile-save-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 32px;
}

.profile-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-plan-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 2px;
}

/* ── Auth page redesign ─────────────────────────────────────────── */

.auth-body {
  background: var(--slate-50);
}

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

/* Left brand panel */
.auth-brand-panel {
  background: linear-gradient(180deg, var(--blue-900) 0%, var(--blue-800) 100%);
  color: var(--white);
  padding: 52px 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.auth-brand-logo {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #6FA8FF;
}
.auth-brand-logo span { color: #5B8FE0; }
.auth-brand-logo .brand-ie { color: #8A8A8A !important; font-size: 0.7em; font-weight: 700; opacity: 0.7; }

.auth-brand-tagline {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
}

.auth-brand-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-brand-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

.auth-brand-list li::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-brand-footer {
  margin-top: auto;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}

/* Right form panel */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--slate-50);
  min-height: 100vh;
}

.auth-form-inner {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mobile auth nav bar — hidden on desktop, shown on mobile */
.auth-mobile-nav {
  display: none;
}

.auth-mobile-nav-brand {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #6FA8FF;
}
.auth-mobile-nav-brand span { color: #5B8FE0; }
.auth-mobile-nav-brand .brand-ie { color: #8A8A8A !important; font-size: 0.7em; font-weight: 700; opacity: 0.7; }

.auth-mobile-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.auth-mobile-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.auth-mobile-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.auth-mobile-hamburger.is-open span:nth-child(2) { opacity: 0; }
.auth-mobile-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.auth-mobile-nav-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--blue-900);
  flex-direction: column;
  padding: 8px 20px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.auth-mobile-nav-links.is-open { display: flex; }

.auth-mobile-nav-links a {
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.auth-mobile-nav-links a:last-child { border-bottom: none; }
.auth-mobile-nav-links a:hover { color: var(--white); }

.auth-heading h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
  font-weight: 700;
}

.auth-heading p {
  margin: 0;
}

/* Tab switcher */
.auth-tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--slate-200);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.auth-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-tab.is-active {
  background: var(--white);
  color: var(--slate-900);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Override old auth-card sizing */
.auth-card {
  max-width: unset;
  margin: 0;
  padding: 24px;
}

/* Auth form inner spacing */
.auth-card .form {
  gap: 20px;
}

.auth-card .button {
  padding: 12px 20px;
}

/* Step indicator */
.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--slate-600);
  font-weight: 500;
  margin-bottom: 4px;
}

.auth-step-num {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--slate-600);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-step-num.is-active {
  background: var(--blue-700);
  color: var(--white);
}

.auth-step-sep {
  color: var(--slate-400);
  font-weight: 400;
  margin: 0 2px;
}

/* OTP prompt banner */
.otp-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  padding: 12px 14px;
}

.otp-prompt-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.otp-prompt .subtext {
  min-width: 0;
}

/* OTP digit input */
.otp-input {
  font-size: 1.7rem !important;
  letter-spacing: 0.35em !important;
  text-align: center !important;
  padding: 14px 16px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
}

/* Password strength bar */
.pw-strength {
  height: 4px;
  background: var(--slate-200);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.pw-strength-label {
  font-size: 0.78rem;
  margin-top: 4px;
  min-height: 1.1em;
  font-weight: 500;
}

/* Auth actions row equal columns */
.auth-actions {
  grid-template-columns: 1fr 1fr !important;
}

/* Responsive: collapse to single column on mobile */
@media (max-width: 800px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 56px;
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 100%);
    padding: 0 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  }

  .auth-form-panel {
    padding: 76px 20px 28px;
    align-items: flex-start;
  }
}

/* ── Upgrade Plan Modal ──────────────────────────────────────────────────────── */

.upgrade-modal-content {
  width: min(540px, 100%);
}

.upgrade-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.upgrade-plan-option {
  border: 2px solid var(--slate-200);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--white);
}

.upgrade-plan-option:hover {
  border-color: var(--blue-600);
}

.upgrade-plan-option.selected {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.upgrade-plan-option-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.upgrade-plan-option-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-600);
  margin-bottom: 4px;
}

.upgrade-plan-option-desc {
  font-size: 0.8rem;
  color: var(--slate-500);
}

.upgrade-selected-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.upgrade-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 8px;
  gap: 6px;
}

.upgrade-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #d1fae5;
  color: #059669;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.upgrade-success-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-900);
}

/* ── Upgrade interval toggle ── */
.upgrade-interval-toggle {
  display: flex;
  background: var(--slate-100);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 16px;
}
.interval-btn {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: all 0.15s;
}
.interval-btn:hover { color: var(--slate-700); }
.interval-btn.active {
  background: var(--white);
  color: var(--slate-900);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upgrade-pricing-cards {
  position: relative;
  min-height: 80px;
  margin-bottom: 4px;
}
.upgrade-price-card {
  display: none;
  text-align: center;
  padding: 16px 12px;
  border: 2px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
}
.upgrade-price-card.active {
  display: block;
  border-color: var(--blue-700);
  background: #f0f7ff;
}
.upgrade-price-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--slate-900);
}
.upgrade-price-amount span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-500);
}
.upgrade-price-equiv {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-top: 4px;
}
.upgrade-price-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 20px;
  background: #059669;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Financial Dashboard Styles ── */

.has-missing-data {
  border-left: 3px solid var(--warning);
  position: relative;
}

.has-missing-data::before {
  content: "ⓘ";
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--warning);
  cursor: help;
  font-size: 0.9rem;
}

.text-muted {
  color: var(--slate-600);
  font-size: 0.9rem;
}

.add-data-link {
  color: var(--blue-600);
  text-decoration: none;
  font-size: 0.85rem;
}

.add-data-link:hover {
  text-decoration: underline;
}

.projection-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--slate-200);
}

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

.projection-scenario-label {
  font-size: 0.8rem;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 600;
}

.projection-scenario-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.projection-scenario.conservative .projection-scenario-value {
  color: var(--danger);
}

.projection-scenario.expected .projection-scenario-value {
  color: var(--blue-700);
}

.projection-scenario.optimistic .projection-scenario-value {
  color: var(--success);
}

#projection-chart-container,
#trend-chart {
  min-height: 200px;
  margin-bottom: 16px;
}

canvas {
  max-width: 100%;
}

/* Modal styling (if not already present) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.is-hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--slate-200);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--slate-600);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--slate-100);
}

.modal form {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Mobile responsive for financial dashboard */
@media (max-width: 700px) {
  .projection-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .projection-scenario-value {
    font-size: 1.25rem;
  }
}

/* Quick Action Buttons */
.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(32, 106, 62, 0.15);
  text-align: center;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(32, 106, 62, 0.25);
}

.quick-action-btn:active {
  transform: translateY(0);
}

/* Filter Tabs */
.filter-tab {
  padding: 8px 16px;
  background: transparent;
  border: 2px solid var(--slate-300);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
}

.filter-tab.active {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: white;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Deadline row filtering */
.deadline-row[data-type-category] {
  transition: opacity 0.2s, height 0.2s;
}

.deadline-row.filtered-out {
  display: none;
}

/* ── Rent Calculator ── */
.calc-form-inner {
  padding: 20px;
}
.calc-step {
  margin-bottom: 18px;
}
.calc-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.calc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-700);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.calc-step-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
}
.calc-step-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--slate-200);
}
.calc-rent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.calc-euro-wrap {
  position: relative;
}
.calc-euro-sign {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-600);
  font-weight: 600;
  font-size: 0.95rem;
  pointer-events: none;
}
.calc-euro-input {
  padding-left: 28px !important;
}
.calc-autofill-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}
.calc-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--slate-600);
}
.calc-button-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Rent Calculator Responsive Styles */
@media (max-width: 640px) {
  .calc-rent-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .calc-button-row {
    flex-direction: column !important;
  }

  .calc-button-row button {
    width: 100%;
    min-height: 48px;
  }

  #calculator-modal {
    padding: 0 !important;
  }

  #calculator-modal .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 100vh !important;
    height: 100vh;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
  }

  #calculator-modal .modal-header {
    border-radius: 0 !important;
    padding: 16px !important;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-bottom: 1px solid var(--slate-200);
  }

  #calculator-modal .modal-header h2 {
    font-size: 1.1rem;
  }

  #calculator-modal .modal-close {
    min-width: auto;
    flex-shrink: 0;
  }

  #calculator-modal form {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calc-form-inner {
    padding: 16px !important;
  }

  .calc-step-card {
    padding: 12px !important;
  }

  #calculator-results {
    padding: 0 16px 16px !important;
  }

  #calculator-modal .field {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px !important;
    min-height: 44px !important; /* Better touch target */
  }

  #calculator-modal select.field {
    padding: 12px !important;
  }

  .calc-euro-input {
    padding-left: 30px !important;
  }

  .calc-step {
    margin-bottom: 14px !important;
  }
}

/* ── AI Assistant Widget ──────────────────────────────────────────────────── */

.assistant-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--blue-700);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(11, 116, 222, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.assistant-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(11, 116, 222, 0.45);
}

.assistant-bubble.bounce {
  animation: assistant-bounce 2s ease infinite;
}

@keyframes assistant-bounce {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-8px); }
  40% { transform: translateY(0); }
  55% { transform: translateY(-4px); }
  70% { transform: translateY(0); }
}

.assistant-nudge {
  position: fixed;
  bottom: 82px;
  right: 24px;
  z-index: 9999;
  background: #fff;
  color: var(--slate-900);
  font-size: 13.5px;
  padding: 10px 32px 10px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}

.assistant-nudge.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.assistant-nudge::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(15, 23, 42, 0.08);
}

.assistant-nudge-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--slate-600);
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.assistant-bubble.open {
  opacity: 0;
  pointer-events: none;
}

.assistant-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.assistant-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--blue-700);
  color: #fff;
}

.assistant-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.assistant-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.8;
}

.assistant-close:hover {
  opacity: 1;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-msg {
  display: flex;
  max-width: 88%;
}

.assistant-msg.user {
  align-self: flex-end;
}

.assistant-msg.bot {
  align-self: flex-start;
}

.assistant-msg-content {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.assistant-msg.user .assistant-msg-content {
  background: var(--blue-700);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.assistant-msg.bot .assistant-msg-content {
  background: var(--slate-100);
  color: var(--slate-900);
  border-bottom-left-radius: 4px;
}

.assistant-msg-content code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}

.assistant-msg-content pre {
  background: var(--slate-900);
  color: #e2e8f0;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  margin: 6px 0;
}

.assistant-msg-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.assistant-msg-content ul {
  margin: 4px 0;
  padding-left: 18px;
}

.assistant-msg-content li {
  margin-bottom: 2px;
}

.assistant-link {
  color: var(--blue-700) !important;
  text-decoration: underline !important;
  font-weight: 500;
}

.assistant-msg.bot .assistant-link {
  color: var(--blue-600) !important;
}

.assistant-error {
  color: var(--danger);
}

.assistant-typing {
  color: var(--slate-600);
  font-style: italic;
}

.assistant-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--slate-200);
  background: #fff;
}

.assistant-input {
  flex: 1;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.assistant-input:focus {
  border-color: var(--blue-500);
}

.assistant-send {
  background: var(--blue-700);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.assistant-send:hover {
  background: var(--blue-600);
}

.assistant-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile */
@media (max-width: 600px) {
  .assistant-bubble {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .assistant-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .assistant-nudge {
    bottom: 72px;
    right: 16px;
  }
}
