@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0d0d14;
  --bg2: #161625;
  --bg3: #141420;
  --bg4: #181828;
  --text: #e0e0ea;
  --text2: #8a8a9a;
  --text3: #6a6a7a;
  --text4: #4a4a5a;
  --border: rgba(255, 255, 255, .06);
  --border2: rgba(255, 255, 255, .04);
  --border3: rgba(255, 255, 255, .08);
  --surface: rgba(255, 255, 255, .04);
  --surface2: rgba(255, 255, 255, .02);
  --surface3: rgba(255, 255, 255, .06);
  --accent: #e8a838;
  --accent2: #d4883a;
  --green: #6ab89a;
  --red: #d45555;
  --purple: #b09ada;
  --header-bg: linear-gradient(180deg, rgba(20, 20, 30, 1), rgba(13, 13, 20, 1));
  --stat1: linear-gradient(135deg, #161625, #1a1a2e);
  --stat2: linear-gradient(135deg, #2a1f3d, #1f2a3d);
  --stat3: linear-gradient(135deg, #1a2e2a, #1a2a3a);
  --card-bg: linear-gradient(135deg, #141420, #181828);
  --modal-bg: #161625;
  --field-bg: #0d0d14;
  --overlay: rgba(0, 0, 0, .7);
  --btn-sec-bg: rgba(255, 255, 255, .06);
  --btn-sec-color: #c0c0ca;
  --spinner-track: #222;
}

[data-theme="light"] {
  --bg: #f0f1f5;
  --bg2: #ffffff;
  --bg3: #f8f8fb;
  --bg4: #ffffff;
  --text: #1a1a2e;
  --text2: #5a5a6e;
  --text3: #7a7a8e;
  --text4: #aaa;
  --border: rgba(0, 0, 0, .08);
  --border2: rgba(0, 0, 0, .05);
  --border3: rgba(0, 0, 0, .12);
  --surface: rgba(0, 0, 0, .04);
  --surface2: rgba(0, 0, 0, .02);
  --surface3: rgba(0, 0, 0, .06);
  --accent: #d4883a;
  --accent2: #c07830;
  --green: #2d8f65;
  --red: #c0392b;
  --purple: #7c5cbf;
  --header-bg: linear-gradient(180deg, #ffffff, #f8f8fb);
  --stat1: linear-gradient(135deg, #eef0ff, #e8ebf8);
  --stat2: linear-gradient(135deg, #f5eeff, #eee8f8);
  --stat3: linear-gradient(135deg, #e8f5f0, #e8f0f5);
  --card-bg: #ffffff;
  --modal-bg: #ffffff;
  --field-bg: #f0f1f5;
  --overlay: rgba(0, 0, 0, .4);
  --btn-sec-bg: rgba(0, 0, 0, .05);
  --btn-sec-color: #4a4a5e;
  --spinner-track: #ddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right)
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8a838, #d4883a);
  color: #0d0d14;
  font-size: 20px
}

.header h1 {
  font-size: 18px;
  font-weight: 700
}

.header-sub {
  display: flex;
  align-items: center;
  gap: 8px
}

.header p {
  font-size: 12px;
  color: var(--text3)
}

.conn-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(106, 184, 154, .1);
  color: var(--green)
}

.header-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s, transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
  background: linear-gradient(135deg, #e8a838, #d4883a);
  color: #0d0d14
}

.btn-secondary {
  background: var(--btn-sec-bg);
  color: var(--btn-sec-color);
  border: 1px solid var(--border3)
}

.btn-cancel {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border3)
}

.btn-pdf {
  background: #c0392b;
  color: #fff
}

.btn-xml {
  background: #27ae60;
  color: #fff
}

.btn-sm {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  background: var(--surface);
  color: var(--text2);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
  display: inline-flex;
  align-items: center
}

.btn-sm:hover {
  background: var(--surface3)
}

.btn-sm.danger {
  color: var(--red)
}

.btn-sm.warn {
  color: var(--accent)
}

.btn-sm.info {
  color: var(--green)
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px 24px
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12)
}

.stat-card:nth-child(1) {
  background: var(--stat1)
}

.stat-card:nth-child(2) {
  background: var(--stat2)
}

.stat-card:nth-child(3) {
  background: var(--stat3)
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700
}

.stat-card:nth-child(1) .stat-icon {
  background: rgba(106, 184, 154, .1);
  color: var(--green)
}

.stat-card:nth-child(2) .stat-icon {
  background: rgba(232, 168, 56, .15);
  color: var(--accent)
}

.stat-card:nth-child(3) .stat-icon {
  background: rgba(106, 184, 154, .15);
  color: var(--green)
}

.stat-value {
  font-size: 22px;
  font-weight: 800
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px 12px;
  flex-wrap: wrap
}

.tab {
  padding: 7px 16px;
  border: 1px solid var(--border3);
  border-radius: 7px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer
}

.tab.active {
  background: rgba(232, 168, 56, .12);
  color: var(--accent);
  border-color: rgba(232, 168, 56, .3);
  font-weight: 600
}

.filter-panel {
  display: none;
  padding: 10px 24px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
  margin-bottom: 8px
}

.filter-panel.open {
  display: block
}

.fp-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.fp-group {
  min-width: 130px
}

.fp-group label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px
}

.fp-group select {
  width: 100%;
  padding: 6px 8px;
  background: var(--field-bg);
  border: 1px solid var(--border3);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit
}

.fp-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px
}

.fp-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer
}

.fp-check input {
  accent-color: #e8a838
}

.fp-type-btn {
  padding: 6px 12px;
  border: 1px solid var(--border3);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap
}

.fp-type-btn:hover {
  background: var(--surface3);
  color: var(--text)
}

.ftype-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border2);
  animation: fadeIn .15s ease
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.list {
  padding: 0 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border2);
  transition: border-color .2s, transform .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s;
}

.card:hover {
  border-color: var(--border3);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.card.inactive {
  opacity: .6
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px
}

.card-name {
  font-size: 15px;
  font-weight: 700
}

.card-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 3px
}

.card-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent)
}

.card-amount-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  margin-top: 2px
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text2)
}

.tag.days-active {
  background: rgba(106, 184, 154, .1);
  color: var(--green);
  font-weight: 600
}

.tag.type {
  background: rgba(150, 120, 200, .1);
  color: var(--purple)
}

.tag.multi-rate {
  background: rgba(232, 168, 56, .1);
  color: var(--accent)
}

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

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.skeleton {
  background: var(--surface3);
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

/* Resident avatar initials */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  margin-bottom: 16px;
  color: var(--text4);
  display: flex;
  justify-content: center;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text4);
  font-size: 14px
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(4px)
}

.overlay.hidden {
  display: none
}

.modal {
  background: var(--modal-bg);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto
}

.modal.wide {
  max-width: 700px
}

.modal.hist-modal {
  max-width: 420px
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px
}

.form-row {
  display: flex;
  gap: 12px;
  margin-top: 0
}

.form-row>div {
  flex: 1
}

.field-label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 4px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: .03em
}

.field {
  width: 100%;
  padding: 9px 12px;
  background: var(--field-bg);
  border: 1px solid var(--border3);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s
}

.field:focus {
  border-color: rgba(232, 168, 56, .4)
}

select.field option {
  background: var(--modal-bg);
  color: var(--text)
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  justify-content: flex-end;
  flex-wrap: wrap
}

.period-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.period-btn {
  padding: 6px 14px;
  border: 1px solid var(--border3);
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer
}

.period-btn.active {
  background: rgba(232, 168, 56, .12);
  color: var(--accent);
  font-weight: 600
}

.period-dates {
  display: none;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap
}

.period-dates.visible {
  display: flex
}

.period-dates input {
  padding: 6px 10px;
  background: var(--field-bg);
  border: 1px solid var(--border3);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit
}

.period-info {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 6px;
  border: 1px solid var(--border2)
}

.report-section {
  margin-bottom: 20px
}

.report-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
  text-transform: uppercase
}

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

.report-header,
.report-row {
  display: flex;
  padding: 8px 12px;
  align-items: center
}

.report-header {
  background: var(--surface2);
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase
}

.report-row {
  border-top: 1px solid var(--border2);
  font-size: 13px
}

.report-total {
  margin-top: 20px;
  padding: 14px;
  background: rgba(232, 168, 56, .08);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(232, 168, 56, .15)
}

.rpt-hidden {
  display: none !important
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
  color: var(--text3)
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--spinner-track);
  border-top-color: #e8a838;
  border-radius: 50%;
  animation: spin .8s linear infinite
}

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

.rate-change-box {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(232, 168, 56, .05);
  border-radius: 8px;
  border: 1px solid rgba(232, 168, 56, .15)
}

.rate-change-box label {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px
}

.rh-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border2)
}

.rh-title {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 8px
}

.rh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border2)
}

.rh-row:last-child {
  border: none
}

.rh-row span {
  color: var(--text2)
}

.rh-row strong {
  color: var(--accent)
}

.rh-del {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px
}

.fm-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 3px 4px 3px 0;
  padding: 3px 8px;
  background: var(--surface);
  border-radius: 5px;
  font-size: 11px;
  color: var(--text2)
}

.fm-tag button {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px
}

.fm-label {
  font-size: 10px;
  color: var(--text3);
  margin: 8px 0 4px;
  text-transform: uppercase
}

.hist-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
  font-size: 13px
}

.hist-row:last-child {
  border: none
}

.hist-period {
  color: var(--text2);
  font-size: 11px;
  margin-top: 2px
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border3);
  background: var(--surface);
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.theme-toggle:hover {
  background: var(--surface3)
}

/* Settings theme row */
.theme-row {
  display: flex;
  gap: 8px;
  margin-top: 6px
}

.theme-option {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid var(--border3);
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s
}

.theme-option:hover {
  border-color: var(--text3)
}

.theme-option.active {
  border-color: var(--accent);
  background: rgba(232, 168, 56, .08)
}

.theme-option .theme-icon {
  font-size: 24px;
  margin-bottom: 4px
}

/* Auth screen */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px
}

.auth-box {
  width: 100%;
  max-width: 400px;
  text-align: center
}

.auth-logo {
  font-size: 48px;
  margin-bottom: 12px
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 32px
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: 8px;
  padding: 4px
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer
}

.auth-tab.active {
  background: var(--accent);
  color: #0d0d14
}

.auth-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--field-bg);
  border: 1px solid var(--border3);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 10px;
  transition: border-color .2s
}

.auth-field:focus {
  border-color: rgba(232, 168, 56, .4)
}

.auth-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity .2s
}

.auth-btn:hover {
  opacity: .85
}

.auth-btn.primary {
  background: linear-gradient(135deg, #e8a838, #d4883a);
  color: #0d0d14
}

.auth-btn.google {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text3);
  font-size: 12px
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border)
}

.auth-error {
  color: var(--red);
  font-size: 12px;
  margin-bottom: 10px;
  min-height: 16px
}

.auth-footer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text3)
}

/* Export dialog */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0
}

.export-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid var(--border3);
  cursor: pointer;
  transition: all .2s
}

.export-opt:hover {
  border-color: var(--accent)
}

.export-opt.selected {
  border-color: var(--accent);
  background: rgba(232, 168, 56, .08)
}

.export-opt input[type=radio] {
  accent-color: #e8a838
}

.export-opt-icon {
  font-size: 20px
}

.export-opt-text {
  font-size: 13px;
  font-weight: 600
}

.export-opt-desc {
  font-size: 11px;
  color: var(--text3)
}

.export-formats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center
}

/* Custom confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  padding: 24px 16px;
  backdrop-filter: blur(3px);
  overflow-y: auto
}

.confirm-box {
  background: var(--modal-bg);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
  text-align: center
}

.confirm-icon {
  font-size: 36px;
  margin-bottom: 12px
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px
}

.confirm-msg {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
  line-height: 1.5
}

.confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center
}

.confirm-btns button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .2s
}

.confirm-btns button:hover {
  opacity: .85
}

.confirm-btns .c-cancel {
  background: var(--surface3);
  color: var(--text2)
}

.confirm-btns .c-ok {
  background: linear-gradient(135deg, #e8a838, #d4883a);
  color: #0d0d14
}

.confirm-btns .c-danger {
  background: #c0392b;
  color: #fff
}

/* Forgot password link */
.auth-forgot {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-align: right;
  margin-top: -4px;
  margin-bottom: 8px
}

.auth-forgot:hover {
  text-decoration: underline
}

.pass-wrap {
  position: relative
}

.pass-wrap input {
  width: 100%;
  padding-right: 40px;
  box-sizing: border-box
}

.pass-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text3);
  padding: 4px
}

.pass-eye:hover {
  color: var(--text)
}

/* User menu */
.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  position: relative
}

.user-badge .user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8a838, #d4883a);
  color: #0d0d14;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center
}

.user-menu {
  display: none;
  position: fixed;
  right: 16px;
  top: auto;
  margin-top: 6px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  z-index: 200
}

.user-menu.open {
  display: block
}

.user-menu-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 4px
}

.user-menu-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text)
}

.user-menu-email {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left
}

.user-menu-item:hover {
  background: var(--surface)
}

.user-menu-item.danger {
  color: var(--red)
}

.user-menu-item.danger:hover {
  background: rgba(212, 85, 85, .08)
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px;
  border-top: 1px solid var(--border2)
}

.pg-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 8px;
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s
}

.pg-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #0d0d14;
  border-color: var(--accent)
}

.pg-btn.active {
  background: var(--accent);
  color: #0d0d14;
  border-color: var(--accent);
  font-weight: 700
}

.pg-btn:disabled {
  opacity: .25;
  cursor: default
}

.pg-dots {
  color: var(--text4);
  font-size: 12px;
  padding: 0 2px
}

.pg-info {
  font-size: 11px;
  color: var(--text3);
  margin: 0 6px
}

.pg-select {
  padding: 4px 6px;
  background: var(--field-bg);
  border: 1px solid var(--border3);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit
}

/* Multi select */
.select-bar {
  display: none;
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.select-bar.active {
  display: flex
}

.select-bar label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text2)
}

.select-bar .sel-count {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700
}

.sel-check {
  width: 18px;
  height: 18px;
  accent-color: #e8a838;
  cursor: pointer;
  flex-shrink: 0
}

.card-select {
  display: flex;
  align-items: flex-start;
  gap: 8px
}

.card-select .sel-check {
  margin-top: 4px
}

/* Properties */
.prop-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px
}

.prop-name {
  font-weight: 700;
  font-size: 14px
}

.prop-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px
}

.prop-spots {
  display: flex;
  gap: 6px;
  align-items: center
}

.prop-spot-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600
}

.prop-spot-tag.free {
  background: rgba(106, 184, 154, .1);
  color: var(--green)
}

.prop-spot-tag.full {
  background: rgba(212, 85, 85, .1);
  color: var(--red)
}

.prop-spot-tag.total {
  background: var(--surface);
  color: var(--text2)
}

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

/* Collapsible sections */
.section-title {
  font-size: 14px;
  font-weight: 700;
  padding: 16px 24px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none
}

.section-title:hover {
  opacity: .85
}

.section-toggle {
  font-size: 12px;
  color: var(--text3);
  transition: transform .2s;
  margin-left: 6px
}

.section-title.collapsed .section-toggle {
  transform: rotate(-90deg)
}

.section-content {
  overflow: hidden;
  transition: max-height .3s ease
}

.section-content.collapsed {
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden
}

.section-title button {
  font-size: 12px
}

.prop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 24px 16px
}

/* Finance summary */
.fin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px 24px 8px
}

.fin-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--card-bg)
}

.fin-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0
}

.fin-stat-value {
  font-size: 16px;
  font-weight: 800
}

.fin-stat-label {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px
}

.fin-cat-tab {
  padding: 5px 10px;
  font-size: 12px
}

@media(max-width:600px) {
  .fin-summary {
    grid-template-columns: 1fr 1fr;
    padding: 12px 16px 8px
  }
  .stats {
    grid-template-columns: 1fr 1fr
  }

  .header {
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    flex-wrap: wrap;
    gap: 8px
  }

  .header-left {
    flex: 0 0 auto;
    max-width: 50%
  }

  .header-left .logo {
    width: 28px;
    height: 28px;
    font-size: 16px
  }

  .header h1 {
    font-size: 14px
  }

  .header p {
    font-size: 10px
  }

  .conn-status {
    font-size: 9px;
    padding: 1px 5px
  }

  .header-right {
    flex: 0 0 auto;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto
  }

  .header-right .btn {
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap
  }

  .user-badge {
    padding: 4px 6px;
    gap: 4px;
    font-size: 11px;
    max-width: 120px
  }

  #user-name {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
  }

  #theme-btn {
    width: 28px;
    height: 28px;
    font-size: 14px
  }

  .list {
    padding: 0 16px 40px
  }

  .tabs {
    padding: 0 16px 12px
  }

  .prop-list {
    padding: 0 16px 16px
  }

  .modal {
    margin: 8px;
    max-height: calc(100vh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))
  }
}

/* Room Structure */
.room-list{display:flex;flex-wrap:wrap;gap:2px;align-items:center}
.room-chip{transition:opacity .15s}
.room-chip:hover{opacity:.85}

/* Calendar */
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border2);border:1px solid var(--border2);border-radius:8px;overflow:hidden}
.cal-header{background:var(--surface2);padding:6px 4px;text-align:center;font-size:11px;font-weight:700;color:var(--text3)}
.cal-day{background:var(--surface);padding:4px;min-height:70px;font-size:11px;cursor:default}
.cal-day.empty{background:var(--surface2);min-height:0}
.cal-day.today{background:rgba(232,168,56,.06)}
.cal-day-num{font-weight:600;font-size:12px;margin-bottom:2px;color:var(--text2)}
.cal-day-num.today{color:var(--accent);font-weight:800}
.cal-booking{padding:2px 4px;margin:1px 0;border-radius:3px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-left:2px solid var(--accent)}
.cal-booking:hover{opacity:.8}
@media(max-width:600px){.cal-day{min-height:50px;padding:2px}.cal-day-num{font-size:10px}.cal-booking{font-size:9px;padding:1px 2px}.cal-header{font-size:10px;padding:4px 2px}}