:root {
  --navy: #06283a;
  --navy-deep: #001d2d;
  --teal: #049c9a;
  --teal-2: #00b8ac;
  --green: #0aa568;
  --blue: #1479df;
  --orange: #ff8b25;
  --red: #f23c41;
  --ink: #0a1f38;
  --muted: #68788c;
  --line: #dde7ef;
  --soft: #f5f8fb;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #f4f7fb;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
}

.sidebar {
  color: #fff;
  padding: 22px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(12, 208, 194, 0.22), transparent 23%),
    linear-gradient(180deg, #062c41, #031c2e 58%, #021829);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #23dacd;
  background: rgba(5, 184, 168, 0.12);
  font-size: 30px;
}

.brand strong {
  font-size: 26px;
  line-height: 1;
}
.brand span {
  color: #28d8ca;
}
.brand small {
  display: block;
  color: #57cec8;
  font-size: 11px;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 7px;
}
.nav-item {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #eefaff;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}
.nav-item span {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
}
.nav-item b {
  margin-left: auto;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #08b276;
}
.nav-item:hover,
.nav-item.active {
  background: linear-gradient(135deg, #077e8e, #079e9a);
  box-shadow: 0 12px 24px rgba(4, 142, 137, 0.25);
}

.site-card {
  border: 1px solid rgba(202, 239, 239, 0.19);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
}
.site-card {
  margin-top: auto;
}
.site-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.site-card > span {
  color: #55d8d0;
  font-size: 28px;
}
.site-card strong {
  display: block;
  font-size: 13px;
}
.site-card small {
  display: block;
  margin: 4px 0 9px;
  color: #b8d0dc;
  font-size: 11px;
}
.site-card button {
  border: 0;
  padding: 0;
  color: #62dcd5;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  overflow-x: auto;
}
.topbar {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 10;
}
.menu-btn,
.icon-btn,
.date-select,
.ghost-btn,
.outline-btn,
.back-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.menu-btn,
.icon-btn {
  width: 36px;
  height: 36px;
}
.page-copy h1 {
  margin: 0;
  font-size: 18px;
}
.page-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.search {
  margin-left: auto;
  width: 230px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  background: #fff;
  color: #8b99aa;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
}
.date-select {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
}
.alert,
.mail,
.filter {
  position: relative;
}
.alert::after,
.mail::after {
  position: absolute;
  top: -8px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.alert::after {
  content: "3";
  background: var(--red);
}
.mail::after {
  content: "7";
  background: var(--green);
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #079c92, #073a57);
}
.profile small {
  display: block;
  color: var(--muted);
}

.view {
  display: none;
  padding: 22px 24px;
}
.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(23, 49, 70, 0.06);
}
.kpi-card {
  min-height: 108px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: 0.18s ease;
}
.kpi-card:hover,
.kpi-card.selected {
  transform: translateY(-2px);
  border-color: rgba(7, 156, 146, 0.45);
  box-shadow: 0 16px 30px rgba(7, 156, 146, 0.13);
}
.kpi-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 27px;
}
.building {
  background: linear-gradient(135deg, #0aa9a4, #047a7a);
}
.wallet {
  background: linear-gradient(135deg, #07b96f, #05854e);
}
.late {
  background: linear-gradient(135deg, #ff9e2e, #ff741f);
}
.repair {
  background: linear-gradient(135deg, #ff4d4d, #e71c30);
}
.kpi-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.kpi-card strong {
  display: block;
  margin: 4px 0;
  color: #061a31;
  font-size: 28px;
}
.kpi-card small {
  color: #50647a;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr 0.9fr;
  gap: 14px;
}
.panel {
  padding: 16px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel h2,
.panel-head h2 {
  margin: 0;
  font-size: 18px;
}
.panel a {
  color: #0b79d0;
  text-decoration: none;
  font-weight: 700;
}

.block-row {
  display: grid;
  grid-template-columns: 70px 1fr 48px 52px;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
}
.block-row div {
  height: 8px;
  border-radius: 99px;
  background: #e6eaef;
  overflow: hidden;
}
.block-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}
.block-row span {
  font-weight: 800;
}
.block-row em {
  color: var(--muted);
  font-style: normal;
}

.income-panel {
  grid-column: span 1;
}
.chart-legend {
  display: flex;
  gap: 28px;
  color: var(--muted);
}
.chart-legend i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--teal);
  margin-right: 7px;
}
.chart-legend .red {
  background: var(--red);
}
.bar-chart {
  height: 190px;
  margin-top: 14px;
  padding: 20px 10px 0;
  display: flex;
  align-items: end;
  justify-content: space-around;
  border-bottom: 1px solid var(--line);
}
.bar-chart div {
  height: 100%;
  display: grid;
  grid-template-columns: 22px 22px;
  align-items: end;
  gap: 10px;
  position: relative;
}
.bar-chart i,
.bar-chart b {
  display: block;
  width: 22px;
  border-radius: 5px 5px 0 0;
}
.bar-chart i {
  background: linear-gradient(180deg, #0bb99d, #078c80);
}
.bar-chart b {
  background: linear-gradient(180deg, #ff5758, #ef383e);
}
.bar-chart span {
  position: absolute;
  bottom: -25px;
  left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 22px;
  align-items: center;
}
.donut {
  width: 165px;
  height: 165px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) 0 82%, var(--orange) 82% 92%, #dce2e8 92% 100%);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 38px;
  border-radius: inherit;
  background: #fff;
}
.donut strong,
.donut small {
  position: relative;
  z-index: 1;
}
.donut strong {
  font-size: 36px;
  transform: translateY(15px);
}
.donut small {
  transform: translateY(-18px);
  color: var(--muted);
}
.donut-list p {
  color: var(--muted);
}
.donut-list i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--green);
  margin-right: 8px;
}
.donut-list .orange {
  background: var(--orange);
}
.donut-list .gray {
  background: #cbd2d9;
}
.donut-list b {
  display: block;
  margin-left: 24px;
  color: var(--ink);
}

.quick-panel {
  display: grid;
  gap: 12px;
}
.quick {
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  font-weight: 800;
}
.quick small {
  display: block;
  font-weight: 500;
  opacity: 0.9;
}
.quick.teal {
  background: linear-gradient(135deg, #05a39b, #05867e);
}
.quick.blue {
  background: linear-gradient(135deg, #1785e8, #086bd0);
}
.quick.orange {
  background: linear-gradient(135deg, #ff9b31, #ff7623);
}
.quick.green {
  background: linear-gradient(135deg, #08a968, #058a52);
}

.list-panel,
.announcement-panel,
.task-panel,
.service-panel {
  min-height: 280px;
}
.fault-row,
.mini-row,
.task-row,
.service-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2f6;
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  text-align: left;
}
.fault-row i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--red);
}
.fault-row.high i {
  background: var(--orange);
}
.fault-row.normal i {
  background: var(--blue);
}
.fault-row.low i {
  background: #aeb7c2;
}
.fault-row p,
.mini-row p,
.task-row p {
  margin: 0;
  flex: 1;
}
.fault-row small,
.mini-row small {
  display: block;
  color: var(--muted);
}
.fault-row b,
.mini-row b,
.task-row b,
.service-row b,
table b {
  padding: 5px 9px;
  border-radius: 7px;
  color: #0c8a4f;
  background: #e1f7eb;
  font-size: 12px;
}
.fault-row.critical b,
.unpaid,
.task-row.progress b {
  color: #dd3b35;
  background: #ffe8e4;
}
.fault-row.high b,
.service-row.warn b {
  color: #cb6708;
  background: #fff0dc;
}
.fault-row.normal b,
.task-row.wait b {
  color: #246fbd;
  background: #e9f2ff;
}
.service-row {
  justify-content: space-between;
  font-weight: 700;
}
.service-row span {
  color: #54708a;
}

.residents-layout {
  display: grid;
  grid-template-columns: 370px minmax(620px, 1fr) 315px;
  gap: 16px;
}
.apartment-panel h2 {
  margin-top: 0;
}
.select-line {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  text-align: left;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 12px 0;
}
.filter-tabs button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.filter-tabs .active {
  border-color: #75d2bd;
  color: var(--green);
  background: #f0fbf6;
}
.filter-tabs b {
  display: block;
}
.resident-search {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}
.resident-search input {
  width: 100%;
  border: 0;
  outline: 0;
}
.resident-list {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}
.resident-card {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  background: #fff;
  text-align: left;
}
.resident-card:hover,
.resident-card.active {
  border-color: #8bd9ca;
  background: #eefbf8;
}
.resident-card span {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #f0f3f6;
}
.resident-card p {
  margin: 0;
}
.resident-card strong {
  margin-right: 14px;
}
.resident-card small {
  display: block;
  color: var(--green);
  font-weight: 800;
}
.resident-card em {
  color: var(--ink);
  font-style: normal;
  text-align: right;
  font-size: 12px;
}
.resident-card b {
  color: var(--green);
}
.resident-card .late {
  color: #e1422e;
}
.load-more {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.resident-main {
  display: grid;
  gap: 16px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.profile-head h2 {
  margin: 0;
  flex: 1;
  font-size: 24px;
}
.profile-head span {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--green);
  background: #e3f7ec;
  font-size: 13px;
}
.back-btn {
  width: 38px;
  height: 38px;
}
.outline-btn {
  height: 38px;
  padding: 0 14px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 14px;
}
.person-card,
.info-card,
.family-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}
.avatar {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-size: 30px;
}
.person-card h3 span {
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--green);
  background: #e2f6ec;
  font-size: 12px;
}
.person-card p,
.info-card p,
.family-card p {
  color: var(--muted);
}
.info-card p,
.debt-card p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.family-card h3 {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
}
.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.finance-summary div {
  padding: 12px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: center;
}
.finance-summary div:last-child {
  border-right: 0;
}
.finance-summary span {
  color: var(--teal);
  font-size: 28px;
}
.finance-summary p {
  margin: 0;
  color: var(--muted);
}
.finance-summary strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}
.finance-summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf2f6;
  text-align: left;
}
th {
  color: #55677b;
}
td button {
  border: 1px solid var(--line);
  border-radius: 7px;
  height: 32px;
  padding: 0 12px;
  background: #fff;
  color: var(--teal);
  font-weight: 800;
}
tr.total td {
  font-weight: 800;
}
.dues-table-panel footer {
  margin-top: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.right-pay-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}
.whatsapp-preview h2 {
  font-size: 15px;
}
.whatsapp-preview h2 span {
  float: right;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 11px;
}
.message-card {
  border: 1px solid #b7dfcc;
  border-radius: 8px;
  padding: 14px;
  background: #eaf8f0;
  line-height: 1.45;
}
.message-card small {
  display: block;
  text-align: right;
  color: #558e96;
}
.pay-btn,
.primary-btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #07ac6d, #058c58);
  font-weight: 800;
  margin-top: 12px;
}
.drop-zone {
  min-height: 132px;
  border: 1px dashed #c8d7e4;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.debt-card strong {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.side-actions {
  display: grid;
  gap: 8px;
}
.side-actions button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.automation-layout {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 430px;
  gap: 16px;
}
.automation-head {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}
.automation-head div {
  margin-right: auto;
}
.automation-head h2 {
  margin: 4px 0 0;
  font-size: 25px;
}
.automation-head small {
  color: var(--muted);
}
.primary-btn {
  width: auto;
  border-radius: 8px;
  padding: 0 18px;
  margin: 0;
}
.flow-tabs {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  display: inline-flex;
}
.flow-tabs button {
  height: 46px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 22px;
  background: #f8fbfd;
  color: #51657a;
}
.flow-tabs .active {
  color: #075f5c;
  background: #fff;
  font-weight: 800;
}
.flow-canvas {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 8px;
  background-image: radial-gradient(#dce7ef 1px, transparent 1px);
  background-size: 14px 14px;
  position: relative;
}
.flow-canvas::before {
  content: "";
  position: absolute;
  left: 127px;
  right: 70px;
  top: 116px;
  border-top: 2px solid #9db0c4;
}
.flow-canvas::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 206px;
  height: 150px;
  border-left: 2px solid #9db0c4;
}
.node {
  width: 145px;
  min-height: 126px;
  border: 1px solid #b9d8c8;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  text-align: left;
  position: absolute;
  z-index: 1;
}
.node small {
  color: var(--green);
  font-weight: 800;
}
.node strong {
  display: block;
  margin: 13px 0;
}
.node em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.node:nth-child(1) {
  left: 24px;
  top: 62px;
}
.node:nth-child(2) {
  left: 208px;
  top: 62px;
  border-color: #c7b8e9;
}
.node:nth-child(3) {
  left: 392px;
  top: 62px;
  border-color: #99c5f8;
}
.node:nth-child(4) {
  left: 576px;
  top: 62px;
  border-color: #ffc89d;
}
.node:nth-child(5) {
  left: 760px;
  top: 62px;
  border-color: #c7b8e9;
}
.node:nth-child(6) {
  right: 24px;
  top: 62px;
  border-color: #99c5f8;
}
.node.lower {
  top: 315px;
}
.node:nth-child(7) {
  left: 430px;
}
.node:nth-child(8) {
  left: 610px;
}
.node:nth-child(9) {
  left: 790px;
}
.node.orange {
  border-color: #ffc89d;
}
.node:hover,
.node.selected {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(20, 77, 118, 0.12);
}

.channel-preview h2 {
  margin-top: 0;
}
.channel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.channel-chips button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  padding: 0 12px;
}
.channel-chips .active {
  color: #fff;
  background: var(--green);
}
.phone {
  border: 8px solid #09293b;
  border-radius: 28px;
  overflow: hidden;
  background: #f3eee7;
}
.phone-top {
  min-height: 58px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: #047c75;
}
.phone-top small {
  display: block;
  font-weight: 500;
}
.phone-body {
  padding: 20px;
}
.phone-body p {
  width: fit-content;
  max-width: 94%;
  padding: 11px 13px;
  border-radius: 8px;
  background: #fff;
}
.phone-body time {
  display: block;
  text-align: right;
  color: var(--muted);
}
.phone-input {
  margin: 0 14px 14px;
  border-radius: 999px;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.automation-bottom {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr 1fr 0.95fr;
  gap: 12px;
  margin-top: 16px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
}
.calendar-grid b,
.calendar-grid span {
  padding: 7px 0;
  border-radius: 999px;
}
.calendar-grid b {
  color: var(--muted);
}
.calendar-grid .active {
  color: #fff;
  background: var(--teal);
}
.board-stats,
.perf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.board-stats span,
.perf-stats span {
  padding: 10px;
  border-radius: 8px;
  background: #f6f9fb;
  color: var(--muted);
}
.board-stats b,
.perf-stats b {
  display: block;
  color: var(--ink);
  font-size: 20px;
}
.performance-panel svg {
  width: 100%;
  height: 150px;
}
.perf-stats {
  grid-template-columns: repeat(3, 1fr);
}

.selected,
tbody tr.selected {
  outline: 2px solid rgba(7, 156, 146, 0.28);
  outline-offset: -2px;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover,
.mini-row:hover,
.fault-row:hover,
.task-row:hover,
.service-row:hover {
  background: #f1fbf8;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: #05263d;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: 0.22s ease;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 228px 1fr;
  }
  .search {
    width: 260px;
  }
  .dashboard-grid,
  .residents-layout,
  .automation-layout,
  .automation-bottom {
    grid-template-columns: 1fr;
  }
  .automation-bottom {
    display: grid;
  }
}

@media (max-width: 900px) {
  body {
    background: #eef4f8;
    -webkit-text-size-adjust: 100%;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    padding: 14px 12px;
    gap: 12px;
  }
  .brand {
    padding: 0 2px 8px;
  }
  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }
  .brand strong {
    font-size: 21px;
  }
  .brand small {
    font-size: 10px;
  }
  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    gap: 7px;
    white-space: nowrap;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.09);
  }
  .nav-item span {
    width: 22px;
    height: 22px;
    border-radius: 999px;
  }
  .site-card {
    display: none;
  }
  .workspace {
    overflow-x: hidden;
  }
  .topbar {
    position: sticky;
    top: 0;
    padding: 12px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }
  .page-copy {
    min-width: 0;
    flex: 1;
  }
  .page-copy h1 {
    font-size: 20px;
  }
  .menu-btn,
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .date-select {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }
  .search {
    width: 100%;
    order: 3;
  }
  .profile {
    width: 100%;
    order: 4;
    justify-content: flex-start;
  }
  .view {
    padding: 14px 12px 28px;
  }
  .kpi-grid,
  .profile-grid,
  .finance-summary {
    grid-template-columns: 1fr;
  }
  .kpi-grid,
  .dashboard-grid,
  .residents-layout,
  .automation-layout,
  .automation-bottom {
    gap: 12px;
  }
  .kpi-card,
  .panel {
    border-radius: 14px;
  }
  .panel {
    padding: 14px;
  }
  .panel-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .panel h2,
  .panel-head h2 {
    font-size: 16px;
  }
  .block-row,
  .fault-row,
  .mini-row,
  .task-row,
  .service-row {
    min-width: 0;
  }
  .finance-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .finance-summary div:last-child {
    border-bottom: 0;
  }
  table {
    min-width: 560px;
  }
  .table-panel,
  .dues-table-panel {
    overflow-x: auto;
  }
  .automation-head {
    align-items: stretch;
    flex-direction: column;
  }
  .automation-head div {
    margin-right: 0;
  }
  .automation-head h2 {
    font-size: 20px;
  }
  .flow-tabs {
    display: flex;
    overflow-x: auto;
  }
  .flow-tabs button {
    flex: 0 0 auto;
    padding: 0 14px;
  }
  .flow-canvas {
    min-width: 0;
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: hidden;
    padding: 12px;
  }
  .flow-canvas::before,
  .flow-canvas::after {
    display: none;
  }
  .node,
  .node.lower,
  .node:nth-child(1),
  .node:nth-child(2),
  .node:nth-child(3),
  .node:nth-child(4),
  .node:nth-child(5),
  .node:nth-child(6),
  .node:nth-child(7),
  .node:nth-child(8),
  .node:nth-child(9) {
    position: static;
    width: auto;
    min-height: auto;
  }
  .node:hover,
  .node.selected {
    transform: none;
  }
  .phone {
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  .sidebar {
    padding: 12px 10px;
  }
  .topbar {
    padding: 10px;
  }
  .view {
    padding: 12px 10px 24px;
  }
  .kpi-card {
    min-height: auto;
    padding: 14px;
  }
  .kpi-card p {
    gap: 3px;
  }
  .kpi-card strong {
    font-size: 20px;
  }
  .dashboard-grid,
  .residents-layout,
  .automation-layout,
  .automation-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
  .quick {
    min-height: 52px;
  }
  table {
    min-width: 480px;
    font-size: 12px;
  }
  th,
  td {
    padding: 10px 8px;
  }
  .flow-canvas {
    grid-template-columns: 1fr;
  }
  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    transform: translateY(18px);
  }
}
