:root {
  --bg: #f3f7f4;
  --surface: #ffffff;
  --surface-soft: #edf5f1;
  --ink: #14211b;
  --muted: #66736d;
  --line: #dfe8e2;
  --brand: #0f766e;
  --brand-dark: #0a514b;
  --brand-soft: #dff1ec;
  --danger: #bd423d;
  --danger-soft: #fde9e7;
  --amber: #a86c17;
  --amber-soft: #fff2d9;
  --green: #247b56;
  --green-soft: #e2f3e9;
  --shadow: 0 22px 70px rgba(20, 33, 27, 0.1);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.1), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 3px;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; letter-spacing: -0.045em; }
p { color: var(--muted); }
a { color: inherit; }

.loading-screen, .auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.loading-screen img { width: 180px; }
.auth-card {
  width: min(1020px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}
.auth-intro {
  min-height: 590px;
  padding: clamp(34px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, var(--surface-soft), #ffffff 65%);
}
.auth-intro img { width: 190px; }
.auth-intro h1 { max-width: 560px; font-size: clamp(2.7rem, 6vw, 5.6rem); line-height: 0.92; }
.auth-form-wrap { padding: clamp(34px, 6vw, 72px); align-self: center; }
.auth-form-wrap h2 { font-size: 2rem; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 0.86rem; font-weight: 800; }
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(15, 118, 110, 0.5); box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1); }
textarea { resize: vertical; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
}
.button.primary { color: #fff; background: var(--brand); box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--brand-dark); background: var(--brand-soft); }
.button.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.button.danger { color: var(--danger); background: var(--danger-soft); }
.button.full { width: 100%; }
.demo-box { margin-top: 24px; padding: 16px; background: var(--surface-soft); border-radius: 16px; }
.demo-box p { margin: 0 0 10px; font-size: 0.84rem; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.message { min-height: 22px; margin: 8px 0 0; font-size: 0.86rem; }
.message.error { color: var(--danger); }
.message.success { color: var(--green); }
.eyebrow { margin: 0 0 6px; color: var(--brand-dark); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; }

.shell { display: grid; grid-template-columns: 278px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.84);
  border-right: 1px solid rgba(20, 33, 27, 0.08);
  backdrop-filter: blur(20px);
}
.brand img { display: block; width: 168px; }
.nav { display: grid; gap: 7px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 999px;
}
.nav button.active, .nav button:hover { color: var(--brand-dark); background: var(--brand-soft); }
.nav-badge { display: grid; place-items: center; width: 30px; height: 30px; color: var(--brand-dark); background: #fff; border: 1px solid var(--line); border-radius: 50%; font-size: 0.72rem; font-weight: 900; }
.user-card { margin-top: auto; padding: 16px; background: var(--ink); color: #fff; border-radius: 18px; }
.user-card p { margin: 4px 0 12px; color: rgba(255, 255, 255, 0.64); font-size: 0.82rem; }
.user-card .button { min-height: 36px; width: 100%; color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.main { min-width: 0; padding: 24px clamp(16px, 3vw, 42px) 48px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 28px; }
.topbar h1 { font-size: clamp(1.8rem, 3vw, 3rem); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.menu-button { display: none; }
.view { display: none; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h2 { max-width: 800px; font-size: clamp(2rem, 4.5vw, 4.4rem); line-height: 0.96; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric, .panel, .property-card, .ticket-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(20, 33, 27, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 14px 42px rgba(20, 33, 27, 0.055);
}
.metric { min-height: 142px; padding: 19px; }
.metric span { color: var(--muted); font-size: 0.84rem; }
.metric strong { display: block; margin-top: 20px; font-size: clamp(2.1rem, 4vw, 3.4rem); letter-spacing: -0.07em; line-height: 0.9; }
.metric small { display: block; margin-top: 12px; color: var(--muted); }
.panel { padding: 20px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 14px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.list { display: grid; gap: 10px; }
.ticket-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; box-shadow: none; }
.ticket-card p { margin: 4px 0 0; }
.ticket-card small { color: var(--muted); }
.tag { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; font-size: 0.74rem; font-weight: 900; }
.tag.urgent { color: var(--danger); background: var(--danger-soft); }
.tag.high { color: var(--amber); background: var(--amber-soft); }
.tag.closed { color: var(--green); background: var(--green-soft); }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.property-card { padding: 22px; }
.property-card h3 { margin-top: 15px; font-size: 1.45rem; }
.property-card p { margin-bottom: 0; }
.property-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.empty { padding: 32px; color: var(--muted); text-align: center; background: rgba(255,255,255,.65); border: 1px dashed var(--line); border-radius: var(--radius); }

.modal { position: fixed; inset: 0; z-index: 20; display: none; }
.modal.open { display: block; }
.modal-scrim { position: absolute; inset: 0; background: rgba(12, 21, 17, 0.36); backdrop-filter: blur(5px); }
.drawer { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(500px, calc(100% - 24px)); overflow-y: auto; padding: 24px; background: #fff; border-radius: 28px; box-shadow: var(--shadow); }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.drawer-header h2 { font-size: 2rem; }
.file-help { margin: 6px 0 0; font-size: 0.78rem; }
.file-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.file-list a { color: var(--brand-dark); }

@media (max-width: 1040px) {
  .shell { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding: 18px 11px; align-items: center; }
  .brand img { width: 58px; }
  .nav button { justify-content: center; padding: 12px; font-size: 0; }
  .user-card { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; gap: 48px; }
  .auth-form-wrap { width: 100%; }
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: 278px; align-items: stretch; transform: translateX(-103%); transition: transform 180ms ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .brand img { width: 168px; }
  .nav button { justify-content: flex-start; font-size: inherit; }
  .user-card { display: block; }
  .menu-button { display: inline-flex; }
  .topbar, .page-heading { align-items: stretch; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  .metrics, .property-grid { grid-template-columns: 1fr; }
  .ticket-card { grid-template-columns: 1fr; }
  .ticket-card .tag { justify-self: start; }
}
