:root {
  color-scheme: light;
  --yellow: #f7c948;
  --yellow-dark: #d99a00;
  --green: #13c487;
  --green-dark: #078a62;
  --blue: #168ce5;
  --red: #ef4444;
  --orange: #f59e0b;
  --ink: #16332d;
  --muted: #61736e;
  --line: #cae5df;
  --panel: #ffffff;
  --canvas: #d9f7ef;
  --teal: #0fb7a1;
  --teal-dark: #057c68;
  --emerald: #00a879;
  --emerald-dark: #006b55;
  --emerald-deep: #024b3e;
  --emerald-soft: #d9fbf1;
  --soft: #f4fbf8;
  --brown: #7b5b50;
  --shadow: 0 10px 24px rgba(0, 89, 72, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #44d7bd;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon-defs {
  display: none;
}

.desktop-backdrop {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.52), transparent 30%),
    linear-gradient(135deg, #7ee6d6 0%, #14b89d 48%, #02735f 100%);
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  height: min(920px, calc(100vh - 36px));
  min-height: 650px;
  overflow: hidden;
  background: var(--canvas);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 70px rgba(0, 64, 54, 0.34);
}

.status-row {
  height: 58px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 22px 0;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-dark) 48%, var(--emerald));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.dynamic-island {
  height: 34px;
  border-radius: 20px;
  background: #000;
  display: grid;
  place-items: center start;
  padding-left: 18px;
}

.dynamic-island span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f24b43;
}

.status-icons {
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-dark) 48%, var(--emerald));
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 86, 70, 0.28);
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.25;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--emerald-dark);
  font-size: 14px;
  font-weight: 800;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  transition: transform 0.16s ease, background 0.16s ease;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.icon-button:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.26);
}

.session-pill {
  max-width: 116px;
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.screen {
  height: calc(100% - 58px - 58px - 72px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 10px 94px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.44), rgba(255,255,255,0) 145px),
    var(--canvas);
}

.screen.login-mode {
  display: grid;
  place-items: center;
  height: calc(100% - 58px - 58px);
  padding: 16px;
}

.screen.receipt-mode {
  background: #fff;
  padding: 0 0 90px;
}

.login-card {
  width: min(100%, 360px);
  padding: 24px 18px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    #fff;
  box-shadow: 0 18px 48px rgba(0, 84, 70, 0.18);
  text-align: center;
}

.login-mark {
  width: 62px;
  height: 62px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 111, 93, 0.28);
}

.login-mark svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.login-card h2 {
  margin: 14px 0 5px;
  color: #143831;
  font-size: 22px;
  font-weight: 900;
}

.login-card p {
  margin: 0 0 16px;
  color: #5b746f;
  font-weight: 700;
  line-height: 1.35;
}

.login-portal-badge {
  display: inline-flex;
  margin: 8px 0 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card.admin-login .login-mark {
  background: linear-gradient(135deg, #f7c948, #d99a00);
  color: #17342e;
}

.login-card.admin-login .login-portal-badge {
  background: #fff5c7;
  color: #8a6100;
}

.login-form {
  text-align: left;
}

.login-error {
  margin: 10px 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #ffe8e6;
  color: #be2d26;
  font-weight: 800;
  text-align: center;
}

.login-demo {
  margin-top: 14px;
  padding: 10px;
  border-radius: 8px;
  background: #f0fffb;
  color: #365b55;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 20;
}

.nav-item {
  border: 0;
  background: #fff;
  color: #090909;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  font-size: 12px;
  min-width: 0;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.nav-item.active {
  color: var(--emerald);
}

.panel {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(8, 138, 103, 0.09);
  margin-bottom: 12px;
  overflow: hidden;
}

.panel.pad {
  padding: 12px;
}

.section-title {
  padding: 14px 16px;
  margin: 0;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-dark) 52%, var(--emerald));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.hint {
  color: #d9453f;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  text-align: center;
}

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

.row.between {
  justify-content: space-between;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label,
.field .label {
  color: #666;
  font-weight: 700;
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.input-like {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid #d8d8d8;
  background: #fff;
  color: #333;
  padding: 8px 8px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--emerald);
  box-shadow: inset 0 -1px 0 var(--emerald);
}

.money-green {
  color: #51ad58;
  font-weight: 800;
}

.money-blue {
  color: var(--blue);
  font-weight: 800;
}

.money-red {
  color: #e6403a;
  font-weight: 800;
}

.money-brown {
  color: #74594d;
  font-weight: 800;
}

.big-number {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  background: #777;
  font-weight: 700;
  box-shadow: 0 9px 18px rgba(0, 88, 72, 0.18);
  white-space: normal;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.btn.yellow {
  background: linear-gradient(135deg, #ffe177, var(--yellow-dark));
  color: #17342e;
}

.btn.green {
  background: linear-gradient(135deg, #28e09c, var(--green-dark));
}

.btn.bluegray {
  background: linear-gradient(135deg, #6c9297, #2f5b5e);
}

.btn.red {
  background: linear-gradient(135deg, #ff6862, #d92f29);
}

.btn.orange {
  background: linear-gradient(135deg, #ffbf4c, #e77d00);
}

.btn.brown {
  background: linear-gradient(135deg, #9b7468, #69483f);
}

.btn.zalo {
  background: linear-gradient(135deg, #19b7ff, #0068ff);
}

.btn.light {
  background: linear-gradient(180deg, #fff, #f3fffb);
  color: #16332d;
  border: 1px solid var(--line);
}

.btn.ghost {
  background: transparent;
  color: #333;
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 8px rgba(0,0,0,0.16);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.full {
  width: 100%;
}

.dashboard-card {
  min-height: 70px;
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: stretch;
  border: 0;
  color: #fff;
  width: 100%;
  padding: 0;
  margin: 0 0 8px;
  text-align: left;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.17);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.dashboard-card .icon-zone {
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.13);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.16);
}

.dashboard-card svg {
  width: 38px;
  height: 38px;
  fill: currentColor;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.22));
}

.dashboard-card:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.dashboard-card .card-content {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  min-width: 0;
}

.dashboard-card .label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-card .value {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.dashboard-card .suffix {
  font-size: 11px;
}

.tenant-plan-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 12px;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfff9, #d2f8ed);
  border: 1px solid #a9ead9;
}

.tenant-plan-strip div {
  min-width: 0;
  padding: 7px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.tenant-plan-strip span {
  display: block;
  color: #54756e;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tenant-plan-strip b {
  display: block;
  margin-top: 2px;
  color: #0d5f50;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bg-yellow {
  background: linear-gradient(135deg, #ffd85c, #f5a800);
}

.bg-green {
  background: linear-gradient(135deg, #17c964, #0a8f47);
}

.bg-orange {
  background: linear-gradient(135deg, #ffb23f, #f08200);
}

.bg-bluegray {
  background: linear-gradient(135deg, #6c8b96, #3f6570);
}

.bg-blue {
  background: linear-gradient(135deg, #31b6f6, #0877d8);
}

.bg-red {
  background: linear-gradient(135deg, #ff5f5b, #d92d2d);
}

.filters {
  display: grid;
  gap: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--yellow);
}

.wire-card {
  border-bottom: 1px solid #eee;
  padding: 14px 12px;
  background: #fff;
}

.wire-card:nth-child(even) {
  background: #eefbe8;
}

.wire-card button.title-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

.wire-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: #555;
}

.wire-meta b {
  color: #333;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: #e8f7e8;
  color: var(--green-dark);
}

.badge.warn {
  background: #fff2cc;
  color: #9a6500;
}

.badge.red {
  background: #ffe4e4;
  color: #d62e29;
}

.fab {
  position: sticky;
  left: 100%;
  bottom: 12px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 5;
}

.fab svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-top: 12px;
}

.tab-btn {
  min-height: 50px;
  border: 0;
  background: #fff;
  color: #222;
  font-weight: 800;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  border-bottom-color: var(--yellow);
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mini-table th {
  background: var(--yellow);
  color: #fff;
  text-align: left;
  padding: 10px 8px;
  border: 1px solid #f2d35b;
}

.mini-table td {
  padding: 10px 8px;
  border: 1px solid #e8e8e8;
  background: #fff;
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 70px;
  gap: 8px;
  padding: 8px;
  background: #d7d7d7;
  align-items: end;
}

.inline-add input {
  min-width: 0;
  height: 38px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}

.higlight-note {
  padding: 6px 8px;
  background: #e9ffe8;
  color: #20a031;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.payout-box {
  background: #fffdf2;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.deduct-box {
  background: #f0f0f0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.deduct-main {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
}

.settlement-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d7ddd9;
  color: #49615b;
  font-size: 12px;
  text-align: left;
}

.settlement-summary b {
  min-width: 0;
  color: #17342e;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settlement-summary strong {
  color: #81918c;
}

.settlement-summary.active {
  background: linear-gradient(135deg, #fff8df, #ffffff);
  border-color: #e7c25b;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.settlement-summary.active strong {
  color: var(--red);
}

.yellow-mark {
  background: var(--yellow);
  color: #111;
  padding: 2px 5px;
  font-weight: 900;
}

.brown-mark {
  background: var(--brown);
  color: #fff;
  padding: 2px 5px;
  font-weight: 900;
}

.total-panel {
  display: grid;
  gap: 6px;
  text-align: right;
}

.total-panel .big-number {
  color: var(--red);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tool-tile {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 6px;
  padding: 12px;
  color: #333;
  text-align: left;
}

.tool-tile svg {
  width: 24px;
  height: 24px;
  fill: var(--yellow-dark);
}

.tool-tile b {
  font-size: 14px;
}

.tool-tile span {
  font-size: 12px;
  color: var(--muted);
}

.tool-tile.install-tile {
  background:
    linear-gradient(135deg, rgba(0, 168, 121, 0.1), rgba(255, 255, 255, 0.96)),
    #fff;
  border-color: #a9ead9;
}

.tool-tile.install-tile svg {
  color: var(--emerald);
}

.install-guide {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.install-guide div {
  padding: 10px;
  border-radius: 8px;
  background: #f0fffb;
  border: 1px solid #beece1;
}

.install-guide b {
  display: block;
  color: var(--emerald-dark);
  font-size: 14px;
  margin-bottom: 3px;
}

.install-guide span,
.install-link {
  display: block;
  color: #4b635d;
  font-size: 12px;
  line-height: 1.35;
}

.install-link {
  padding: 9px 10px;
  border-radius: 7px;
  background: #fff;
  border: 1px dashed #9ddccd;
  word-break: break-all;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(0, 168, 121, 0.12), rgba(255, 255, 255, 0.95)),
    #fff;
  border-left: 5px solid var(--emerald);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.admin-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  color: var(--emerald-deep);
}

.admin-hero span {
  color: var(--muted);
  font-size: 12px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-metric {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #f4fffb);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-metric b {
  font-size: 18px;
  line-height: 1.1;
}

.admin-metric span {
  font-size: 11px;
  color: var(--muted);
}

.admin-metric.good b {
  color: var(--green-dark);
}

.admin-metric.warn b {
  color: #9a6500;
}

.admin-metric.bad b {
  color: var(--red);
}

.admin-metric.money b {
  color: var(--blue);
}

.admin-readiness {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(2, 75, 62, 0.92), rgba(0, 168, 121, 0.9)),
    var(--emerald-dark);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 87, 70, 0.22);
}

.admin-readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.admin-readiness-head b {
  font-size: 16px;
}

.admin-readiness-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 800;
}

.admin-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-readiness-grid div {
  min-height: 50px;
  padding: 8px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-readiness-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 700;
}

.admin-readiness-grid b {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.admin-readiness-grid .warn b {
  color: #ffe08a;
}

.admin-filter-panel {
  position: sticky;
  top: 0;
  z-index: 3;
}

.rental-card {
  padding: 14px 12px;
  background: #fff;
  border-bottom: 1px solid #ececec;
}

.rental-card:nth-child(even) {
  background: #f7fbf7;
}

.rental-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rental-card-head b {
  display: block;
  font-size: 16px;
}

.rental-card-head span:not(.badge) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.credential-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  background: #fff8dc;
  border: 1px solid #ffe08a;
  border-radius: 5px;
}

.credential-strip span {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.credential-strip button {
  border: 0;
  border-radius: 4px;
  padding: 6px 9px;
  background: var(--yellow);
  color: #fff;
  font-weight: 800;
}

.license-line {
  margin: 8px 0;
  padding: 7px 9px;
  border-radius: 4px;
  background: #f1f4f7;
  color: #455a64;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.rental-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px 10px;
  margin-top: 8px;
  color: #555;
  font-size: 12px;
}

.rental-grid b {
  display: block;
  margin-top: 2px;
  color: #222;
  overflow-wrap: anywhere;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.admin-actions .btn {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 12px;
}

.receipt-page {
  width: 100%;
  min-height: 100%;
  background: #fff;
  color: #111;
  padding: 18px 12px 110px;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
}

.receipt-page h2,
.receipt-page h3,
.receipt-page p {
  margin: 0;
}

.receipt-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-weight: 700;
  margin-bottom: 22px;
}

.receipt-title {
  text-align: center;
  margin-bottom: 18px;
}

.receipt-title h2 {
  font-size: 17px;
}

.receipt-title h3 {
  font-size: 16px;
  margin-top: 4px;
}

.member-strip {
  background: #fff8ae;
  padding: 10px 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.receipt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #ccc;
  margin-bottom: 8px;
}

.receipt-fields div {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #ccc;
}

.receipt-calc {
  width: 76%;
  margin: 8px auto 16px;
  border-collapse: collapse;
  font-weight: 800;
}

.receipt-calc td {
  border: 1px solid #333;
  background: #d7f8c8;
  padding: 7px 8px;
}

.receipt-calc .blue-text {
  color: #0019c9;
}

.receipt-calc .red-text {
  color: #e02020;
}

.receipt-copy {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  padding: 0 26px;
}

.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
  text-align: center;
}

.signature-space {
  height: 70px;
}

.receipt-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, #fff 80%, rgba(255,255,255,0));
}

.receipt-actions .btn {
  flex: 1 1 92px;
  min-height: 36px;
  padding: 7px 9px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
}

.modal {
  width: min(100%, 410px);
  max-height: min(94vh, 840px);
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  overflow: auto;
}

.modal-body {
  padding: 18px;
}

.modal-title {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
}

.share-modal {
  padding: 14px;
  background:
    linear-gradient(180deg, #f0fffb 0, #ffffff 180px),
    #fff;
}

.share-head {
  padding: 8px 6px 12px;
  text-align: center;
}

.share-head span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
  font-size: 12px;
  font-weight: 900;
}

.share-head h2 {
  margin: 8px 0 2px;
  color: #063d34;
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  font-weight: 900;
}

.share-head p {
  margin: 0;
  color: #56726c;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  font-weight: 700;
}

.share-preview-wrap {
  max-height: min(40vh, 390px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #aeeedf;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(0, 155, 122, 0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 155, 122, 0.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 155, 122, 0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 155, 122, 0.055) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.share-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 118, 95, 0.14);
}

.share-hint {
  margin: 10px 2px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8df;
  color: #53472a;
  font-size: 12px;
  line-height: 1.35;
}

.share-actions {
  position: sticky;
  bottom: -14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -14px -14px;
  padding: 12px 14px 14px;
  background: linear-gradient(to top, #fff 82%, rgba(255, 255, 255, 0));
  z-index: 2;
}

.share-actions .btn {
  flex: 1 1 116px;
  min-height: 40px;
  padding: 8px 10px;
}

.share-actions .btn.full {
  flex-basis: 100%;
}

.wheel-modal {
  padding: 18px 14px 0;
  background:
    radial-gradient(circle at 50% 170px, rgba(18, 181, 165, 0.18), transparent 170px),
    #fff;
}

.wheel-header {
  text-align: center;
}

.wheel-header span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dff7f3;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.wheel-header h2 {
  margin: 8px 0 4px;
  font-size: 21px;
  line-height: 1.1;
}

.wheel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.wheel-stage {
  position: relative;
  width: min(290px, 78vw);
  height: min(290px, 78vw);
  margin: 18px auto 12px;
  display: grid;
  place-items: center;
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  z-index: 4;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--red);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.22));
}

.winner-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #fff;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.22),
    inset 0 0 0 2px rgba(255,255,255,0.5);
  overflow: hidden;
  transform: rotate(0deg);
}

.winner-wheel::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.45);
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  margin-left: -37px;
  transform:
    rotate(calc((360deg / var(--n)) * var(--i) + (180deg / var(--n))))
    translateY(calc(-1 * min(112px, 30vw)))
    rotate(calc(-1 * ((360deg / var(--n)) * var(--i) + (180deg / var(--n)))));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wheel-center {
  position: absolute;
  z-index: 5;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--teal-dark);
  border: 7px solid #dff7f3;
  box-shadow: 0 5px 14px rgba(0,0,0,0.18);
  font-weight: 900;
  text-align: center;
  font-size: 13px;
}

.wheel-result {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eefbf9;
  color: #23524d;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.wheel-result b {
  color: var(--teal-dark);
  font-size: 16px;
}

.wheel-list {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-right: 3px;
}

.wheel-person {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #e3eeee;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.wheel-person b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #dff7f3;
  color: var(--teal-dark);
}

.wheel-person span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.wheel-person em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.wheel-person.selected {
  border-color: var(--yellow);
  background: #fff8d8;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  min-width: 220px;
  max-width: min(92vw, 420px);
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(33, 33, 33, 0.94);
  color: #fff;
  text-align: center;
  z-index: 200;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}

.success-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 5px solid #d8f4cf;
  border-radius: 50%;
  color: #80cf6f;
  font-size: 48px;
  margin: 0 auto 16px;
}

.chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 76px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar {
  height: 14px;
  background: #ededed;
  border-radius: 3px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--yellow);
}

.small-note {
  font-size: 11px;
  color: #757575;
  line-height: 1.35;
}

@media (max-width: 460px) {
  .desktop-backdrop {
    padding: 0;
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .screen {
    height: calc(100vh - 58px - 58px - 72px);
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-row .btn {
    grid-column: 2;
  }

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

  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-plan-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .grid-2,
  .grid-3,
  .wire-meta,
  .receipt-fields,
  .receipt-top {
    grid-template-columns: 1fr;
  }

  .inline-add {
    grid-template-columns: 1fr;
  }

  .receipt-calc {
    width: 100%;
  }

  .admin-metrics,
  .admin-actions,
  .admin-readiness-grid,
  .tenant-plan-strip,
  .rental-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .desktop-backdrop {
    display: block;
    padding: 0;
  }

  .phone-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }

  .status-row,
  .topbar,
  .bottom-nav,
  .receipt-actions,
  .toast,
  .modal-backdrop {
    display: none !important;
  }

  .screen {
    height: auto;
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  .receipt-page {
    padding: 16mm 10mm;
    font-size: 12pt;
  }
}
