:root {
  color-scheme: light;
  --bg: #edf2f7;
  --panel: #ffffff;
  --panel-2: #f9fbff;
  --ink: #111827;
  --muted: #66758a;
  --line: #d7e0ec;
  --brand: #1f4fd8;
  --brand-dark: #183a9e;
  --teal: #0f9488;
  --cyan: #0b7fb0;
  --gold: #b7791f;
  --rose: #be3455;
  --charcoal: #172033;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --violet: #6d28d9;
  --shadow: 0 24px 60px rgba(31, 45, 68, .16);
  --shadow-soft: 0 12px 28px rgba(31, 45, 68, .10);
  --inner-shine: inset 0 1px 0 rgba(255,255,255,.92);
  --radius: 8px;
  --radius-sm: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(15,148,136,.12), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(183,121,31,.10), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.86) 0 20%, rgba(222,232,242,.76) 20% 48%, rgba(247,249,252,.94) 48% 100%),
    repeating-linear-gradient(90deg, rgba(31,79,216,.038) 0 1px, transparent 1px 92px),
    var(--bg);
  color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }
code { font-family: "JetBrains Mono", "SF Mono", Consolas, monospace; font-size: .9em; }

.app-shell { display: flex; min-height: 100vh; perspective: 1800px; }
.sidebar {
  width: 264px;
  min-width: 264px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 22%),
    linear-gradient(150deg, #121827 0%, #172033 48%, #0c2b30 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  box-shadow: 24px 0 55px rgba(15,23,42,.25), inset -1px 0 0 rgba(255,255,255,.1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 20px;
  font-weight: 800;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #1f4fd8, #0f9488 58%, #b7791f);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(15,148,136,.28), inset 0 1px 0 rgba(255,255,255,.38);
}
.nav-list { padding: 14px; display: grid; gap: 6px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a8b4c7;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  position: relative;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(3px); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #1f4fd8, #0f9488 66%, #b7791f);
  box-shadow: 0 16px 30px rgba(15,148,136,.26), inset 0 1px 0 rgba(255,255,255,.24);
}
.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 14px rgba(0,0,0,.12);
}
.nav-icon::before,
.nav-icon::after {
  content: none !important;
  display: none !important;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.14));
}
.nav-item.active .nav-icon {
  background: rgba(255,255,255,.16);
}
.user-card {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
}
.user-card img { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; background: #263246; }
.user-card strong, .user-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card span { color: #91a0b8; font-size: 12px; text-transform: capitalize; }
.logout-link { grid-column: 1 / -1; color: #c7d2e4; text-align: center; padding: 9px; border-radius: var(--radius-sm); }
.logout-link:hover { color: #fff; background: rgba(220,38,38,.14); }

.main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: 66px;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(215,224,236,.82);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 12;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(31,45,68,.08);
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar-date {
  margin-left: auto;
  color: #425166;
  font-size: 13px;
  font-weight: 750;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  box-shadow: var(--inner-shine), 0 8px 20px rgba(31,45,68,.07);
}
.content { width: min(1280px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 46px; }

.page-heading { margin-bottom: 22px; }
.page-heading.with-actions { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.page-heading h2 { margin: 0 0 5px; font-size: 28px; letter-spacing: 0; }
.page-heading p, .muted { color: var(--muted); margin: 0; }
.action-row, .inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel, .report-frame {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,252,.98)),
    var(--panel);
  border: 1px solid rgba(215,224,236,.9);
  border-radius: var(--radius);
  box-shadow: var(--inner-shine), 0 14px 32px rgba(31,45,68,.10), 0 1px 0 rgba(255,255,255,.88);
  transform-style: preserve-3d;
}
.panel {
  padding: 20px;
  margin-bottom: 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--inner-shine), 0 24px 52px rgba(31,45,68,.14);
  border-color: rgba(180,194,213,.95);
}
.panel.wide { min-width: 0; }
.panel.narrow { max-width: 760px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-title.compact { margin-top: 26px; }
.panel-title h3 { margin: 0; font-size: 18px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  background:
    linear-gradient(145deg, #ffffff 0%, #f9fbfd 48%, #edf4f8 100%);
  border: 1px solid rgba(215,224,236,.94);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 116px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--inner-shine), 0 18px 34px rgba(31,45,68,.12), 8px 10px 0 rgba(23,32,51,.035);
  transform-style: preserve-3d;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(31,79,216,.08), transparent 34%, rgba(15,148,136,.07) 66%, rgba(183,121,31,.07));
  opacity: .72;
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-5px) rotateX(2deg);
  box-shadow: var(--inner-shine), 0 28px 46px rgba(31,45,68,.16);
  border-color: rgba(138,153,177,.72);
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.stat-card strong { display: block; font-size: 25px; line-height: 1.15; letter-spacing: 0; }
.stat-card small { display: block; color: var(--muted); margin-top: 9px; }

.hero-panel {
  background:
    linear-gradient(145deg, rgba(255,255,255,.14), transparent 34%),
    linear-gradient(135deg, #1f4fd8, #0f9488 55%, #b7791f);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 34px 78px rgba(13,27,64,.24), inset 0 1px 0 rgba(255,255,255,.26);
  border: 1px solid rgba(255,255,255,.22);
  transform-style: preserve-3d;
}
.hero-panel h2 { margin: 0 0 6px; font-size: 28px; }
.hero-panel p { margin: 0 0 22px; color: rgba(255,255,255,.82); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats div {
  min-width: 150px;
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 14px 26px rgba(13,27,64,.16);
  backdrop-filter: blur(10px);
}
.hero-stats span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.75); }
.hero-stats strong { display: block; margin-top: 5px; font-size: 20px; }

.previous-tenant-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
  padding: 30px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 36%),
    linear-gradient(125deg, #172033, #1f4fd8 48%, #0f9488);
  box-shadow: 0 34px 78px rgba(13,27,64,.22), inset 0 1px 0 rgba(255,255,255,.24);
  position: relative;
  overflow: hidden;
}
.previous-tenant-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -110px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
}
.previous-tenant-hero > * { position: relative; z-index: 1; }
.previous-tenant-hero h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}
.previous-tenant-hero p:not(.login-kicker) {
  max-width: 660px;
  margin: 14px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.6;
}
.previous-tenant-badge {
  min-width: 190px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 18px 34px rgba(0,0,0,.14);
}
.previous-tenant-badge span,
.previous-tenant-badge strong {
  display: block;
}
.previous-tenant-badge span {
  color: rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.previous-tenant-badge strong {
  margin-top: 7px;
  font-size: 24px;
}
.stay-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stay-timeline article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #fff, #f1f7fb);
  box-shadow: var(--inner-shine), 0 14px 28px rgba(31,45,68,.08);
}
.stay-timeline span {
  display: inline-flex;
  margin-bottom: 18px;
  color: #1f3f9d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stay-timeline strong,
.stay-timeline small {
  display: block;
}
.stay-timeline strong {
  font-size: 22px;
  color: var(--ink);
}
.stay-timeline small {
  margin-top: 8px;
  color: var(--muted);
}
.previous-note {
  background: #eef4ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
}

.button, button, input, select, textarea { font: inherit; }
.button, button.button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  box-shadow: var(--inner-shine), 0 10px 20px rgba(31,45,68,.1);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover, button.button:hover { transform: translateY(-2px); box-shadow: var(--inner-shine), 0 16px 28px rgba(31,45,68,.14); }
.button:active, button.button:active { transform: translateY(0); box-shadow: var(--inner-shine), 0 7px 14px rgba(31,45,68,.1); }
.button.primary { background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff; }
.button.primary:hover { background: linear-gradient(135deg, var(--brand-dark), #0c756d); color: #fff; }
.button.secondary { background: #fff; color: #334155; border: 1px solid var(--line); }
.button.secondary:hover { background: #f8fafc; color: #111827; }
.button.warning { background: linear-gradient(135deg, var(--amber), #b45309); color: #fff; }
.button.accent { background: #7c3aed; color: #fff; width: max-content; }
.button.dark { background: #111827; color: #fff; }
.button.ghost { background: transparent; color: var(--brand); padding: 8px 10px; }
.button.ghost.danger { color: #b91c1c; }
.button.compact { min-height: 0; padding: 6px 8px; font-size: .82rem; border-radius: 6px; }
.button.full { width: 100%; }
.link-button { border: 0; background: transparent; color: var(--brand); padding: 0; cursor: pointer; font-weight: 750; }
.icon-button { border: 0; background: transparent; color: inherit; font-size: 24px; cursor: pointer; }
.mobile-only { display: none; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd7e7;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(31,45,68,.05), 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(66,84,244,.58);
  box-shadow: 0 0 0 4px rgba(66,84,244,.12), inset 0 1px 2px rgba(31,45,68,.04);
  outline: none;
}
textarea { resize: vertical; }
label span { display: block; font-size: 13px; font-weight: 750; color: #334155; margin-bottom: 6px; }
.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  margin: -20px -20px 16px;
  background: linear-gradient(180deg, #fbfdff, #eef4f8);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar input[type="search"] { max-width: 280px; }
.toolbar select { width: auto; min-width: 160px; }
.total-pill, .pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef4ff, #e5f8f4);
  color: #1f3f9d;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; background: #f5f8fc; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 13px 14px; border-bottom: 1px solid #edf1f7; vertical-align: middle; }
tbody tr { transition: background .14s ease, transform .14s ease, box-shadow .14s ease; }
tbody tr:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 rgba(66,84,244,.45);
}
td small { display: block; color: var(--muted); margin-top: 3px; }
.table-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.empty, .empty-panel { color: var(--muted); text-align: center; padding: 28px; }
.empty-panel { border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; }
.positive { color: var(--green); }
.negative, .danger-text { color: var(--red); }

.status, .priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}
.status.paid, .status.completed, .status.occupied { background: linear-gradient(180deg, #dcfce7, #bbf7d0); color: #166534; }
.status.pending, .status.submitted, .status.vacant { background: linear-gradient(180deg, #f8fafc, #e2e8f0); color: #475569; }
.status.overdue, .status.emergency, .status.rejected { background: linear-gradient(180deg, #fee2e2, #fecaca); color: #991b1b; }
.status.unverified, .status.in_progress { background: linear-gradient(180deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.status.maintenance { background: linear-gradient(180deg, #fef3c7, #fde68a); color: #92400e; }
.priority.low { background: linear-gradient(180deg, #f8fafc, #e2e8f0); color: #475569; }
.priority.medium { background: linear-gradient(180deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.priority.high { background: linear-gradient(180deg, #ffedd5, #fed7aa); color: #9a3412; }
.priority.emergency { background: linear-gradient(180deg, #fee2e2, #fecaca); color: #991b1b; }

.bar-chart {
  height: 320px;
  display: grid;
  grid-template-columns: repeat(12, minmax(24px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px 4px 0;
}
.bar-chart.report { grid-template-columns: repeat(auto-fit, minmax(18px, 1fr)); }
.bar-group { display: grid; gap: 8px; justify-items: center; height: 100%; min-width: 0; }
.bars { height: 260px; display: flex; align-items: end; gap: 3px; width: 100%; justify-content: center; border-bottom: 1px solid #e2e8f0; }
.bars.dual { gap: 5px; }
.bar {
  width: 10px;
  border-radius: 5px 5px 0 0;
  min-height: 4px;
  box-shadow: inset 1px 0 rgba(255,255,255,.34), 6px 0 12px rgba(31,45,68,.1);
}
.bar.income, .dot.income { background: linear-gradient(180deg, #2dd4bf, #0f9488); }
.bar.pending, .dot.pending { background: linear-gradient(180deg, #cbd5e1, #64748b); }
.bar.expense, .dot.expense { background: linear-gradient(180deg, #f59e0b, #b7791f); }
.chart-legend { display: flex; gap: 14px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }

.list-stack { display: grid; gap: 11px; }
.list-stack.compact { gap: 6px; }
.notice {
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 4px;
}
.notice.danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice.large { max-width: 760px; padding: 24px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f7; padding-bottom: 8px; }
.announcement {
  border-left: 4px solid var(--brand);
  padding: 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(180deg, #fbfdff, #f1f6f9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}
.announcement p { color: #475569; margin: 5px 0; }
.announcement-board { display: grid; gap: 12px; }
.announcement-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.broadcast-stat { background: #eef4ff; border: 1px solid #dbeafe; color: #1e3a8a; }
.action-list { display: grid; gap: 10px; }
.action-list a {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-weight: 800;
  color: #334155;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--inner-shine), 0 10px 22px rgba(31,45,68,.07);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.action-list a:hover { border-color: rgba(66,84,244,.52); background: #eef2ff; color: #2634a4; transform: translateY(-3px); box-shadow: var(--inner-shine), 0 18px 30px rgba(31,45,68,.12); }
.mini-card { margin-top: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f8fbff); border-radius: var(--radius-sm); padding: 15px; box-shadow: var(--inner-shine), 0 10px 22px rgba(31,45,68,.07); }
.mini-card h3 { margin-top: 0; }

.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person img { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; background: #e2e8f0; }
.person strong, .person small { display: block; }
.person small { color: var(--muted); }

.request-list { display: grid; gap: 13px; }
.request-card {
  background: linear-gradient(145deg, #fff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--inner-shine), 0 13px 28px rgba(31,45,68,.09);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.request-card:hover { transform: translateY(-3px); box-shadow: var(--inner-shine), 0 22px 38px rgba(31,45,68,.14); border-color: rgba(180,194,213,.95); }
.request-main { display: flex; gap: 14px; min-width: 0; }
.request-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.request-title h3 { margin: 0; font-size: 17px; }
.request-main p { margin: 0 0 8px; color: #475569; }
.request-icon { width: 42px; height: 42px; border-radius: 999px; background: linear-gradient(145deg, #fff, #e2e8f0); flex: 0 0 auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 20px rgba(31,45,68,.1); }
.request-icon.completed { background: #bbf7d0; }
.request-icon.in_progress { background: #fde68a; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.ai-note { color: #7c3aed; display: block; margin-top: 7px; }
.request-status { min-width: 150px; display: flex; justify-content: flex-end; align-items: center; }

.document-list { margin: -20px; }
.group-header { background: linear-gradient(180deg, #f8fafc, #eef3f8); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 18px; font-weight: 850; color: #475569; }
.group-header:first-child { border-top: 0; }
.document-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid #edf1f7; }
.document-row h3 { margin: 0 0 3px; font-size: 15px; }
.document-row p { margin: 0; color: var(--muted); font-size: 12px; }
.file-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center; background: linear-gradient(145deg, #eef4ff, #ccfbf1); color: #1f3f9d; font-size: 11px; font-weight: 900; box-shadow: inset 0 1px 0 rgba(255,255,255,.84), 0 10px 18px rgba(31,45,68,.09); }
.upload-stack { display: grid; gap: 15px; }
.upload-card { display: grid; gap: 12px; background: linear-gradient(145deg, #fff, #f3f8fc); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--inner-shine), 0 14px 28px rgba(31,45,68,.08); }
.upload-card h3, .upload-card p { margin: 0; }
.upload-card p { color: var(--muted); }

.amount-due { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: linear-gradient(135deg, #eef4ff, #ccfbf1); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--inner-shine), 0 16px 30px rgba(31,45,68,.09); }
.amount-due span { color: #1f3f9d; font-weight: 800; }
.amount-due strong { font-size: 30px; }
.bank-box { background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; box-shadow: var(--inner-shine), 0 12px 24px rgba(31,45,68,.08); }
.bank-box h3 { margin-top: 0; }
.bank-box dl { margin: 0; display: grid; gap: 8px; }
.bank-box dl div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.bank-box dt { color: var(--muted); }
.bank-box dd { margin: 0; font-weight: 800; text-align: right; }
.preview-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #f8fafc; }
.preview-box img { max-height: 180px; border-radius: 6px; display: block; }
.hidden { display: none !important; }

.report-frame { padding: 22px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(241,246,251,.96)); }
.report-head { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.report-head h2, .report-head p { margin: 0; }
.report-brand { font-weight: 900; font-size: 20px; color: #1f3f9d; text-align: right; }
.report-brand span { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.report-footer { color: var(--muted); text-align: center; margin: 22px 0 0; }

.chat-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 72vh; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--inner-shine), var(--shadow-soft); }
.thread-list { background: #f8fafc; border-right: 1px solid var(--line); overflow-y: auto; }
.thread-item { display: grid; gap: 4px; padding: 15px; border-bottom: 1px solid #edf1f7; color: #334155; border-left: 4px solid transparent; }
.thread-item.active { background: #eef2ff; border-left-color: var(--brand); }
.thread-item span { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-item small { color: #94a3b8; }
.chat-panel { display: flex; flex-direction: column; min-height: 0; background: #fff; }
.chat-panel.single { height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--inner-shine), var(--shadow-soft); }
.chat-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; background: #fff; }
.chat-head span { color: var(--muted); font-size: 12px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #fbfcfe; }
.chat-row { display: flex; justify-content: flex-start; }
.chat-row.mine { justify-content: flex-end; }
.bubble { max-width: min(620px, 78%); background: linear-gradient(180deg, #f8fafc, #e8eef6); border-radius: 16px 16px 16px 4px; padding: 12px; color: #253044; box-shadow: var(--inner-shine), 0 10px 22px rgba(31,45,68,.09); }
.chat-row.mine .bubble { background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff; border-radius: 16px 16px 4px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 13px 26px rgba(31,79,216,.22); }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble small { display: block; margin-top: 7px; opacity: .72; font-size: 11px; }
.chat-form { display: grid; grid-template-columns: 210px 1fr auto; gap: 10px; align-items: center; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.empty-chat { margin: auto; color: var(--muted); text-align: center; }
.attachment img { display: block; max-height: 260px; border-radius: 8px; margin-bottom: 8px; }
.attachment-video { max-height: 260px; max-width: 100%; border-radius: 8px; margin-bottom: 8px; }
.attachment-file { display: inline-flex; padding: 10px; border-radius: 8px; background: #fff; color: var(--brand); margin-bottom: 8px; font-weight: 800; }
.attachment-file.mine { background: rgba(255,255,255,.14); color: #fff; }

.modal { position: fixed; inset: 0; background: rgba(15,23,42,.58); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; backdrop-filter: blur(10px); }
.modal.open { display: flex; }
.modal-card { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: linear-gradient(180deg, #fff, #f8fbff); border-radius: var(--radius); box-shadow: 0 36px 90px rgba(15,23,42,.32), var(--inner-shine); padding: 20px; border: 1px solid rgba(255,255,255,.75); transform: translateY(0) rotateX(0deg); }
.modal-card.large { width: min(820px, 100%); }
.modal-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-title h3 { margin: 0; }
.modal-title button { border: 0; background: transparent; font-size: 28px; cursor: pointer; color: #64748b; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.occupant-builder { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 9px; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.occupant-list { display: grid; gap: 8px; }
.occupant-list .occ-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px; background: #f8fafc; border-radius: 8px; }
.settlement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settlement-grid input[readonly] {
  background: #f1f5f9;
  color: #475569;
}
.settlement-summary {
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef4ff, #ccfbf1);
  border: 1px solid rgba(15,148,136,.18);
  box-shadow: var(--inner-shine), 0 14px 28px rgba(31,45,68,.08);
}
.settlement-summary span,
.settlement-summary strong,
.settlement-summary small {
  display: block;
}
.settlement-summary span {
  color: #1f3f9d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.settlement-summary strong {
  margin-top: 5px;
  font-size: 30px;
}
.settlement-summary small {
  margin-top: 6px;
  color: #475569;
}

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; box-shadow: var(--inner-shine), 0 12px 24px rgba(31,45,68,.08); }
.alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.login-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(116deg, #07111f 0%, #132033 44%, #173c3a 100%);
  color: #fff;
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(120deg, transparent, #000 16%, #000 70%, transparent);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .72fr);
  align-items: stretch;
}
.login-hero {
  position: relative;
  min-height: 100vh;
  padding: clamp(24px, 4vw, 54px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  perspective: 1400px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  position: relative;
  z-index: 3;
}
.login-copy {
  align-self: center;
  max-width: 680px;
  position: relative;
  z-index: 3;
  text-shadow: 0 18px 36px rgba(0,0,0,.28);
}
.login-kicker {
  color: #8ee4d2;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-copy h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: .96;
  letter-spacing: 0;
}
.login-copy p:not(.login-kicker) {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(226,239,245,.82);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
}
.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
  position: relative;
  z-index: 3;
}
.login-metrics div {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 18px 38px rgba(0,0,0,.18);
}
.login-metrics strong,
.login-metrics span {
  display: block;
}
.login-metrics strong {
  font-size: 18px;
  color: #fff;
}
.login-metrics span {
  margin-top: 4px;
  color: rgba(226,239,245,.68);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.login-scene {
  --scene-scale: 1;
  position: absolute;
  right: max(4vw, 30px);
  bottom: 0;
  width: min(58vw, 720px);
  height: min(66vh, 620px);
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-34deg) translate3d(0, 0, 0) scale(var(--scene-scale));
  transform-origin: 54% 72%;
  animation: scene-float 9s ease-in-out infinite;
  opacity: .92;
}
.scene-floor {
  position: absolute;
  inset: 14% 0 0 0;
  transform: translateZ(-24px);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(45,212,191,.18) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148,163,184,.18) 1px, transparent 1px),
    linear-gradient(135deg, rgba(15,23,42,.88), rgba(18,50,62,.68));
  background-size: 48px 48px;
  box-shadow: 0 70px 120px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.12);
}
.building {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 28%),
    linear-gradient(135deg, #1f4fd8, #0f9488 72%);
  box-shadow:
    22px 22px 0 rgba(2,6,23,.38),
    42px 46px 68px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.24);
  transform-style: preserve-3d;
}
.building::before,
.building::after {
  content: "";
  position: absolute;
  background: inherit;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.building::before {
  inset: 0 -28px 0 auto;
  width: 28px;
  transform: rotateY(90deg);
  transform-origin: left;
  filter: brightness(.7);
}
.building::after {
  inset: auto 0 -28px 0;
  height: 28px;
  transform: rotateX(90deg);
  transform-origin: top;
  filter: brightness(.62);
}
.building span {
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(254,243,199,.95), rgba(45,212,191,.6));
  box-shadow: 0 0 22px rgba(45,212,191,.38), inset 0 1px 0 rgba(255,255,255,.7);
  animation: window-glow 3.4s ease-in-out infinite;
}
.building span:nth-child(3n + 2) { animation-delay: .5s; }
.building span:nth-child(4n) { animation-delay: 1.1s; }
.tower-main {
  width: 230px;
  min-height: 270px;
  right: 29%;
  bottom: 24%;
  transform: translateZ(160px);
}
.tower-left {
  width: 178px;
  min-height: 210px;
  right: 62%;
  bottom: 20%;
  transform: translateZ(96px);
  background:
    linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.02) 30%),
    linear-gradient(135deg, #214062, #b7791f 84%);
}
.tower-right {
  width: 170px;
  min-height: 190px;
  right: 13%;
  bottom: 15%;
  transform: translateZ(70px);
  background:
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 30%),
    linear-gradient(135deg, #1d3557, #be3455 90%);
}
.login-orbit {
  position: absolute;
  border: 1px solid rgba(142,228,210,.32);
  border-radius: 999px;
  transform-style: preserve-3d;
  animation: orbit-spin 11s linear infinite;
}
.orbit-one {
  width: 360px;
  height: 360px;
  right: 20%;
  bottom: 23%;
  transform: translateZ(210px) rotateX(68deg);
}
.orbit-two {
  width: 260px;
  height: 260px;
  right: 37%;
  bottom: 33%;
  animation-duration: 15s;
  animation-direction: reverse;
  transform: translateZ(250px) rotateX(68deg);
}
.login-panel {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 54px);
  position: relative;
  z-index: 4;
  background:
    linear-gradient(90deg, rgba(7,17,31,0), rgba(7,17,31,.58) 18%, rgba(7,17,31,.86));
}
.login-card,
.setup-card {
  width: min(440px, 100%);
  margin-left: auto;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.94));
  border-radius: var(--radius);
  box-shadow: 0 34px 90px rgba(0,0,0,.28), var(--inner-shine);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.8);
}
.login-card {
  transform-style: preserve-3d;
  animation: login-card-enter .7s cubic-bezier(.2, .8, .2, 1) both;
}
.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.login-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, var(--brand), var(--teal) 62%, var(--gold));
  box-shadow: 0 18px 38px rgba(15,148,136,.25), inset 0 1px 0 rgba(255,255,255,.34);
}
.login-card h2,
.setup-card h1 {
  margin: 0 0 4px;
  font-size: 32px;
  letter-spacing: 0;
}
.login-card p,
.setup-card p {
  color: var(--muted);
  margin: 0;
}
.login-form {
  gap: 16px;
}
.password-control {
  position: relative;
  display: block;
}
.password-control input {
  padding-right: 76px;
}
.password-control button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 60px;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: #eef4ff;
  color: #1f3f9d;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}
.form-error:empty {
  display: none;
}
.login-submit {
  min-height: 48px;
  justify-content: space-between;
  padding-inline: 16px;
}
.setup-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #0b1220, #111827 48%, #0d2f35);
  padding: 20px;
}
.setup-card { margin: 0; }

@keyframes login-card-enter {
  from { opacity: 0; transform: translateY(24px) rotateX(8deg) scale(.98); }
  to { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1); }
}
@keyframes scene-float {
  0%, 100% { transform: rotateX(58deg) rotateZ(-34deg) translate3d(0, 0, 0) scale(var(--scene-scale)); }
  50% { transform: rotateX(56deg) rotateZ(-31deg) translate3d(0, -14px, 20px) scale(var(--scene-scale)); }
}
@keyframes window-glow {
  0%, 100% { opacity: .58; filter: saturate(.9); }
  50% { opacity: 1; filter: saturate(1.25); }
}
@keyframes orbit-spin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@media print {
  .sidebar, .topbar, .page-heading, .alert { display: none !important; }
  .app-shell, .main, .content { display: block; width: 100%; padding: 0; margin: 0; }
  .report-frame { border: 0; box-shadow: none; }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 54vh; padding-bottom: 170px; }
  .login-copy h1 { max-width: 540px; }
  .login-scene { width: 92vw; height: 420px; right: -16vw; bottom: -48px; opacity: .62; }
  .login-panel {
    min-height: auto;
    padding-top: 0;
    background: linear-gradient(180deg, rgba(7,17,31,0), rgba(7,17,31,.92) 18%);
  }
  .login-card { margin: -80px auto 28px; }
  .app-shell { perspective: none; }
  body.sidebar-open { overflow: hidden; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    overflow: hidden;
    z-index: 40;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 35; }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
  .content { width: min(100% - 24px, 1240px); padding-top: 18px; }
  .previous-tenant-hero { flex-direction: column; align-items: stretch; }
  .stay-timeline { grid-template-columns: 1fr; }
  .page-heading.with-actions, .report-head { flex-direction: column; align-items: stretch; }
  .grid-two, .chat-layout { grid-template-columns: 1fr; }
  .chat-layout { height: auto; }
  .thread-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-panel, .chat-panel.single { min-height: 520px; height: 68vh; }
  .stat-grid, .stat-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid.three, .occupant-builder, .chat-form, .settlement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .login-hero { min-height: 50vh; padding: 22px 18px 116px; }
  .login-copy { align-self: end; }
  .login-copy h1 { font-size: 42px; }
  .login-copy p:not(.login-kicker) { font-size: 15px; }
  .login-metrics { display: none; }
  .login-scene { --scene-scale: .72; width: 760px; height: 360px; right: -420px; bottom: -64px; }
  .login-card, .setup-card { padding: 24px; }
  .login-card h2, .setup-card h1 { font-size: 28px; }
  .stat-grid, .stat-grid.five { grid-template-columns: 1fr; }
  .page-heading h2 { font-size: 24px; }
  .hero-panel { padding: 20px; }
  .hero-stats div { width: 100%; }
  .bar-chart { gap: 4px; overflow-x: auto; }
  .bar-group { min-width: 32px; }
  .document-row { grid-template-columns: 40px 1fr; }
  .document-row .button { grid-column: 2; width: max-content; }
  .modal-actions, .action-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.reject-form { gap: .45rem; align-items: center; }
.reject-form input { min-width: 12rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: .6rem; }
