:root {
  --bg: #f5f7f4;
  --ink: #18201d;
  --muted: #69736f;
  --card: #ffffff;
  --line: #d8dfd9;
  --accent: #0f766e;
  --accent-dark: #0c4f49;
  --amber: #d97706;
  --danger: #b42318;
  --success: #15803d;
  --shadow: 0 18px 42px rgba(24, 32, 29, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #fbfcfa 0%, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: clamp(36px, 7vw, 56px);
}

.auth-card p {
  color: var(--muted);
  line-height: 1.45;
}

.login-error {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--danger) !important;
  font-weight: 800;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 28px;
  overflow: auto;
  background: #17231f;
  color: #f7fbf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #7dd3c7;
  color: #17231f;
  font-weight: 900;
}

.brand small,
.sidebar-card small {
  display: block;
  color: rgba(255, 250, 241, 0.68);
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
  color: rgba(255, 250, 241, 0.76);
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 250, 241, 0.12);
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 250, 241, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.08);
}

.sidebar-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.session-card {
  margin-top: 0;
}

.session-card .ghost {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: rgba(255, 250, 241, 0.08);
}

.main {
  padding: 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(237, 250, 247, 0.84)),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(15, 118, 110, 0.04) 16px 32px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5.8vw, 72px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 18px;
}

.hero p {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions,
.button-row,
.pill-row,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  justify-content: flex-end;
}

.primary,
.secondary,
.ghost,
.danger-button,
.tab {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  font-weight: 800;
}

.small {
  padding: 9px 12px;
  font-size: 13px;
}

.primary {
  color: white;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #f7d574;
  color: #342407;
}

.ghost,
.tab {
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.72);
  color: var(--ink);
}

.tab.active {
  color: white;
  background: var(--accent);
}

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

.stats-grid,
.cards-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 24px 0;
}

.stat-card,
.panel,
.entity-card,
.form-card,
.table-wrap,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(32, 32, 25, 0.08);
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 18px;
}

.section-head.compact {
  margin-top: 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel,
.entity-card {
  padding: 24px;
}

.accent-panel {
  color: #fff;
  background: linear-gradient(145deg, #123b36, #0f766e);
}

.timeline {
  display: grid;
  gap: 14px;
  padding-left: 24px;
  line-height: 1.45;
}

.form-card {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.wide-form {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.report-form {
  grid-template-columns: repeat(3, minmax(140px, 220px));
}

input,
select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
}

input[type="file"] {
  padding: 10px;
}

.recognition-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 14px;
  background: rgba(15, 118, 110, 0.08);
}

.recognition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.recognition-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.72);
}

.recognition-grid span,
.recognition-grid small,
.recognition-panel summary,
.recognition-panel details p {
  color: var(--muted);
}

.recognition-panel details p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.entity-card {
  position: relative;
  overflow: hidden;
}

.entity-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}

.selected-card {
  outline: 2px solid var(--accent);
}

.property-detail {
  margin-top: 20px;
}

.tab-body {
  margin-top: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.info-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.info-grid span,
.meta,
.muted {
  color: var(--muted);
}

.info-grid strong {
  display: block;
  margin-top: 6px;
}

.meta {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent-dark);
  background: rgba(15, 118, 110, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.pill.warn {
  color: #8a4b06;
  background: rgba(217, 119, 6, 0.15);
}

.pill.danger {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.12);
}

.pill.success {
  color: var(--success);
  background: rgba(21, 128, 61, 0.12);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.muted-row {
  opacity: 0.55;
}

.stack {
  display: grid;
  gap: 12px;
}

.notice {
  display: grid;
  gap: 6px;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 14px;
  background: rgba(217, 119, 6, 0.1);
}

.notice.danger {
  border-left-color: var(--danger);
  background: rgba(180, 35, 24, 0.1);
}

.receipt {
  margin-top: 16px;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--muted);
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
}

.file-link {
  width: fit-content;
  text-decoration: none;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.manager-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 190px auto;
  gap: 12px;
  margin-bottom: 18px;
}

.process-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.process-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 32, 25, 0.06);
}

.process-card span,
.process-card small {
  color: var(--muted);
}

.process-card strong {
  font-size: 30px;
}

.process-card.warn {
  border-color: rgba(217, 119, 6, 0.32);
}

.process-card.danger {
  border-color: rgba(180, 35, 24, 0.32);
}

.report-breakdown {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 18px;
  margin: 18px 0;
}

.breakdown-list {
  display: grid;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.manager-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.property-rail,
.manager-property-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.property-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 12px;
  padding: 16px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.rail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.rail-head strong {
  color: var(--ink);
}

.property-rail-list {
  display: grid;
  gap: 8px;
}

.rail-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #f7faf7;
}

.rail-item:hover,
.rail-item.active {
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(15, 118, 110, 0.08);
}

.rail-item span,
.rail-item b {
  overflow-wrap: anywhere;
}

.rail-item small {
  color: var(--muted);
}

.rail-item b {
  color: var(--accent-dark);
  font-size: 12px;
}

.rail-item b.warn {
  color: var(--amber);
}

.rail-item b.danger {
  color: var(--danger);
}

.rail-item b.success {
  color: var(--success);
}

.manager-property-card {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.property-card-top {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.property-card-top h2 {
  max-width: 780px;
}

.property-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.property-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbf9;
}

.property-kpis span,
.compact-block h3,
.activity-list time,
.property-filter-summary {
  color: var(--muted);
}

.property-kpis strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(20px, 2vw, 30px);
}

.manager-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 20px;
}

.compact-block {
  min-width: 0;
}

.compact-block h3,
.activity-panel h3 {
  margin-bottom: 10px;
}

.activity-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 0 0 16px 22px;
  border-left: 2px solid var(--line);
}

.activity-list li:last-child {
  padding-bottom: 0;
}

.activity-list li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.activity-list li.warn::before {
  background: var(--amber);
}

.activity-list li.ok::before {
  background: var(--success);
}

.activity-list li.muted::before {
  background: #94a3b8;
}

.activity-list span {
  color: var(--muted);
  line-height: 1.4;
}

.property-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: -8px 0 14px;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .form-card,
  .wide-form {
    grid-template-columns: 1fr 1fr;
  }

  .manager-filters,
  .manager-workspace,
  .manager-card-grid {
    grid-template-columns: 1fr;
  }

  .property-rail {
    position: static;
    max-height: none;
  }

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

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .hero {
    padding: 24px;
    border-radius: 8px;
  }

  .form-card,
  .wide-form,
  .report-form,
  .nav,
  .manager-filters,
  .property-kpis,
  .property-rail-list {
    grid-template-columns: 1fr;
  }

  .property-card-top,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .manager-property-card {
    padding: 18px;
  }
}
