:root {
  --bg: #eef4f8;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --ink: #152033;
  --muted: #6a7386;
  --line: #dbe5ed;
  --blue: #2f68d8;
  --blue-dark: #1f4faa;
  --green: #0e9a77;
  --red: #d94747;
  --amber: #c47a14;
  --cyan: #0787a2;
  --rose: #c65379;
  --sidebar: #132333;
  --sidebar-2: #18384a;
  --shadow: 0 16px 42px rgba(30, 48, 72, 0.12);
  --shadow-soft: 0 8px 24px rgba(30, 48, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eaf2f7 0%, #f6f8fb 46%, #eef4f8 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(47, 104, 216, 0.2), rgba(14, 154, 119, 0.16) 46%, rgba(198, 83, 121, 0.12)),
    linear-gradient(180deg, #f7fbff, #eaf1f5);
}

.login-panel {
  width: min(430px, 100%);
  padding: 34px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 8px;
  font-weight: 800;
  margin-bottom: 18px;
  box-shadow: 0 10px 22px rgba(47, 104, 216, 0.28);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 8px;
  color: #39445a;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 10px 18px rgba(47, 104, 216, 0.22);
}

.ghost-btn {
  color: #33415c;
  background: #ffffff;
  border-color: var(--line);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: #b7c6d6;
  box-shadow: var(--shadow-soft);
}

.danger-btn {
  color: white;
  background: linear-gradient(135deg, #e45757, #c9364a);
}

.icon-btn {
  width: 40px;
  padding: 0;
  color: #33415c;
  background: white;
  border-color: var(--line);
}

.form-error {
  min-height: 20px;
  color: var(--red);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(160deg, var(--sidebar), var(--sidebar-2));
  color: white;
  box-shadow: 10px 0 28px rgba(19, 35, 51, 0.16);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 12px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  position: relative;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-btn.active,
.nav-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.13);
}

.nav-btn.active {
  box-shadow: inset 3px 0 0 #56d0b3;
}

.nav-btn:hover {
  transform: translateX(2px);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 24px;
  background: rgba(246, 249, 252, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar h2,
.topbar p {
  margin: 0;
}

.topbar h2 {
  font-size: 22px;
  color: #12253a;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

#menuToggle {
  display: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  min-height: 190px;
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(135deg, rgba(20, 35, 55, 0.1), rgba(20, 35, 55, 0.22)),
    linear-gradient(125deg, #1d5fd1 0%, #0787a2 48%, #0e9a77 100%);
  box-shadow: 0 22px 46px rgba(24, 70, 130, 0.2);
  overflow: hidden;
  position: relative;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -88px;
  top: -110px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-hero h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.dashboard-hero p {
  max-width: 620px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.7;
}

.hero-meter {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.hero-meter span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
}

.hero-meter strong {
  display: block;
  margin: 8px 0 16px;
  font-size: 42px;
  line-height: 1;
}

.meter-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dffcf4, #ffffff);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
}

.stat-card,
.panel,
.placeholder {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.stat-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
  min-height: 112px;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-stats .stat-card {
  min-height: 132px;
  padding: 18px;
  border: 0;
}

.dashboard-stats .stat-card:focus-visible {
  outline: 3px solid rgba(47, 104, 216, 0.22);
  outline-offset: 3px;
}

.dashboard-stats .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(30, 48, 72, 0.12);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 18px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(47, 104, 216, 0.12);
}

.stat-card:nth-child(2)::before {
  background: var(--green);
}

.stat-card:nth-child(2)::after {
  background: rgba(14, 154, 119, 0.13);
}

.stat-card:nth-child(3)::before {
  background: var(--cyan);
}

.stat-card:nth-child(3)::after {
  background: rgba(7, 135, 162, 0.13);
}

.stat-card:nth-child(4)::before {
  background: var(--red);
}

.stat-card:nth-child(4)::after {
  background: rgba(217, 71, 71, 0.12);
}

.stat-card:nth-child(5)::before {
  background: var(--amber);
}

.stat-card:nth-child(5)::after {
  background: rgba(196, 122, 20, 0.14);
}

.stat-card:nth-child(6)::before {
  background: var(--rose);
}

.stat-card:nth-child(6)::after {
  background: rgba(198, 83, 121, 0.13);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  position: relative;
  z-index: 1;
}

.dashboard-stats .stat-card strong {
  margin-top: 10px;
  font-size: 34px;
}

.stat-card em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  position: relative;
  z-index: 1;
}

.dashboard-stats .tone-room {
  background: linear-gradient(145deg, #ffffff, #edf5ff);
}

.dashboard-stats .tone-leased {
  background: linear-gradient(145deg, #ffffff, #eaf8f3);
}

.dashboard-stats .tone-vacant {
  background: linear-gradient(145deg, #ffffff, #e7f7fb);
}

.dashboard-stats .tone-overdue {
  background: linear-gradient(145deg, #ffffff, #fff0f0);
}

.dashboard-stats .tone-remind {
  background: linear-gradient(145deg, #ffffff, #fff5e6);
}

.dashboard-stats .tone-expire {
  background: linear-gradient(145deg, #ffffff, #fff0f6);
}

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

.dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.rich-head {
  justify-content: space-between;
}

.rich-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.rich-head b {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--amber);
  font-size: 20px;
}

.accent-rose .rich-head b {
  background: var(--rose);
}

.task-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.task-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e5edf4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.task-main {
  min-width: 0;
}

.task-type {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--amber);
  background: #fff1d7;
  font-size: 12px;
  font-weight: 800;
}

.accent-rose .task-type {
  color: var(--rose);
  background: #fff0f6;
}

.task-main strong {
  display: block;
  font-size: 16px;
}

.task-main p,
.task-meta span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.task-meta {
  text-align: right;
}

.task-meta strong {
  display: block;
  color: #172033;
  font-size: 15px;
}

.empty-state {
  display: grid;
  gap: 6px;
  margin: 16px;
  padding: 28px;
  border: 1px dashed #c8d5e0;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.panel {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.panel-head,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.panel-head h3 {
  margin: 0;
  font-size: 17px;
}

.toolbar {
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 150px;
}

.toolbar .push {
  margin-left: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

.pagination span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-jump input {
  width: 64px;
  padding: 8px 9px;
  text-align: center;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.excel-panel {
  overflow: hidden;
}

.excel-grid,
.export-grid {
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.export-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.excel-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.excel-card strong {
  font-size: 16px;
}

.excel-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.excel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 14px;
  color: #33415c;
  background: #ffffff;
  cursor: pointer;
}

.file-btn input {
  display: none;
}

.import-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

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

th {
  color: #475569;
  background: #f2f6fa;
  font-weight: 700;
}

tr:hover td {
  background: #f6fbff;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e8eef8;
  color: #33415c;
  font-weight: 700;
}

.badge.green {
  background: #ddf7ee;
  color: var(--green);
}

.badge.red {
  background: #fde7e8;
  color: var(--red);
}

.badge.amber {
  background: #fff1d7;
  color: var(--amber);
}

.badge.cyan {
  background: #daf4f9;
  color: var(--cyan);
}

.due-pill {
  min-width: 112px;
  display: inline-grid;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.due-pill b {
  font-size: 13px;
}

.due-pill em {
  font-size: 11px;
  font-style: normal;
}

.due-pill.red {
  color: #b4232f;
  border-color: #ffc6cc;
  background: #ffe8eb;
}

.due-pill.amber {
  color: #9a5f09;
  border-color: #ffd891;
  background: #fff3d8;
}

.due-pill.blue {
  color: #2455b8;
  border-color: #c7dcff;
  background: #eaf2ff;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.actions-cell {
  width: 96px;
  min-width: 96px;
}

.rooms-table th:last-child,
.rooms-table td:last-child {
  width: 96px;
  min-width: 96px;
  text-align: center;
}

.leases-table th:last-child,
.leases-table td:last-child {
  width: 168px;
  min-width: 168px;
}

.lease-actions {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 8px;
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.link-btn:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.floor-plan-thumb {
  width: 74px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: #f8fbfd;
}

.floor-plan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floor-plan-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 48px;
  border: 1px dashed #c8d5e0;
  border-radius: 6px;
  color: var(--muted);
  background: #f8fbfd;
  font-size: 12px;
}

.floor-plan-preview {
  min-height: 118px;
  display: grid;
  place-items: center;
  border: 1px dashed #c8d5e0;
  border-radius: 8px;
  background: #f8fbfd;
  overflow: hidden;
}

.floor-plan-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.floor-plan-preview span,
.calc-hint {
  color: var(--muted);
  font-size: 13px;
}

.calc-hint {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f1f7ff;
  color: #31557f;
}

.image-viewer {
  width: min(980px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

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

.image-stage {
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(45deg, #f4f7fb 25%, transparent 25%),
    linear-gradient(-45deg, #f4f7fb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f4f7fb 75%),
    linear-gradient(-45deg, transparent 75%, #f4f7fb 75%),
    #ffffff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

.image-stage img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.16s ease;
}

.placeholder {
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(47, 104, 216, 0.08), rgba(14, 154, 119, 0.08)),
    #ffffff;
}

.placeholder h3 {
  margin: 0 0 8px;
}

.placeholder p {
  margin: 0;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.payment-modal {
  width: min(920px, 100%);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.modal-head h3 {
  margin: 0;
}

.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.annual-rules {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd, #ffffff);
}

.annual-rules-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.annual-rules-head strong {
  color: #16325c;
}

.annual-rules-head span,
.annual-rules-empty {
  color: var(--muted);
  font-size: 13px;
}

.annual-rule-row {
  display: grid;
  grid-template-columns: 64px 132px minmax(0, 1fr) 132px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #ffffff;
  min-width: 0;
}

.annual-rule-row b {
  color: #1f2937;
  font-size: 14px;
}

.annual-rule-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.annual-rule-row input,
.annual-rule-row select {
  min-width: 0;
}

.annual-rule-row label input {
  width: 86px;
  flex: 0 0 86px;
}

.annual-rule-row label.inactive {
  visibility: hidden;
  pointer-events: none;
}

.annual-rule-preview {
  justify-self: end;
  display: grid;
  gap: 2px;
  min-width: 128px;
  padding: 6px 9px;
  border-radius: 8px;
  color: #2353a4;
  background: #eaf2ff;
  text-align: center;
  white-space: nowrap;
}

.annual-rule-preview b,
.annual-rule-preview em {
  font-style: normal;
  line-height: 1.25;
}

.annual-rule-preview b {
  font-size: 13px;
}

.annual-rule-preview em {
  color: #5d7194;
  font-size: 12px;
}

.bill-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd, #ffffff);
}

.bill-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bill-panel-head strong {
  font-size: 15px;
}

.bill-panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.bill-list {
  max-height: 330px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.bill-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e1ebf2;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.bill-row:hover,
.bill-row.active {
  border-color: rgba(47, 104, 216, 0.45);
  background: #f2f7ff;
  transform: none;
}

.bill-row.paid {
  background: #f6fbf8;
}

.bill-row span,
.bill-row b,
.bill-row em {
  min-width: 0;
}

.bill-row b {
  display: block;
  font-size: 14px;
}

.bill-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.bill-row i {
  min-width: 86px;
  justify-self: end;
  padding: 5px 8px;
  border-radius: 999px;
  color: #945f0b;
  background: #fff4dc;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.bill-status {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.bill-status .cancel-payment {
  margin-top: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bill-row.paid i {
  color: #08745d;
  background: #def7ec;
}

.empty-bills {
  padding: 16px;
  color: var(--muted);
  border: 1px dashed #cbd8e3;
  border-radius: 8px;
  text-align: center;
  background: #ffffff;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.mobile-mask {
  display: none;
}

@media (max-width: 1120px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-meter {
    max-width: 360px;
  }

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

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

@media (max-width: 760px) {
  body {
    background: #eef4f8;
  }

  .login-shell {
    padding: 16px;
    align-items: start;
    padding-top: 72px;
  }

  .login-panel {
    padding: 26px 22px;
  }

  .login-panel h1 {
    font-size: 23px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: 250px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 16px 0 40px rgba(15, 23, 42, 0.26);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  #menuToggle {
    display: block;
    flex: 0 0 auto;
  }

  .topbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 10px 12px;
  }

  .topbar > div:not(.topbar-actions) {
    min-width: 0;
  }

  .topbar h2 {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p {
    margin-top: 3px;
    overflow: hidden;
    max-width: 100%;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    margin-left: 0;
    justify-self: end;
  }

  #currentUser {
    display: none;
  }

  .topbar-actions .ghost-btn {
    min-height: 36px;
    padding: 7px 10px;
  }

  .content {
    gap: 14px;
    padding: 14px 12px 24px;
  }

  .dashboard-hero {
    min-height: 0;
    gap: 16px;
    padding: 18px;
  }

  .dashboard-hero h3 {
    max-width: 12em;
    font-size: 22px;
    line-height: 1.35;
  }

  .dashboard-hero p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.65;
  }

  .hero-meter {
    max-width: none;
    padding: 15px;
  }

  .hero-meter strong {
    font-size: 32px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dashboard-stats .stat-card {
    min-height: 112px;
    padding: 13px;
  }

  .dashboard-stats .stat-card strong {
    font-size: 27px;
  }

  .stat-card::after {
    right: 12px;
    top: 14px;
    width: 42px;
    height: 42px;
  }

  .stat-card em {
    font-size: 11px;
    line-height: 1.35;
  }

  .rich-head {
    align-items: center;
    padding: 14px;
  }

  .rich-head b {
    min-width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .task-list {
    padding: 12px;
  }

  .task-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px;
  }

  .task-meta {
    text-align: left;
  }

  .panel,
  .dashboard-panel,
  .placeholder,
  .stat-card,
  .dashboard-hero {
    border-radius: 8px;
  }

  .panel-head,
  .toolbar {
    padding: 13px;
  }

  .table-wrap {
    border-top: 1px solid var(--line);
    background:
      linear-gradient(90deg, rgba(47, 104, 216, 0.08), transparent 24px),
      #ffffff;
  }

  table {
    min-width: 760px;
  }

  th,
  td {
    padding: 11px 12px;
    font-size: 13px;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .toolbar .push {
    margin-left: 0;
  }

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

  .pagination span {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .pagination button {
    width: 100%;
  }

  .page-jump {
    justify-content: center;
    grid-column: span 2;
    width: 100%;
  }

  .page-jump input {
    width: 78px;
  }

  .excel-grid,
  .export-grid {
    grid-template-columns: 1fr;
    padding: 13px;
  }

  .excel-actions,
  .excel-actions button,
  .file-btn,
  .export-grid button {
    width: 100%;
  }

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

  .annual-rules-head,
  .annual-rule-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .annual-rule-row label {
    min-height: auto;
  }

  .annual-rule-row label input {
    width: min(110px, 100%);
  }

  .annual-rule-row label.inactive {
    display: none;
  }

  .annual-rule-values {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .annual-rule-preview {
    justify-self: start;
  }

  .bill-panel-head,
  .bill-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .bill-panel-head {
    display: grid;
  }

  .bill-row i {
    justify-self: start;
  }

  .bill-status {
    justify-items: start;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal {
    width: 100%;
    max-height: 88vh;
  }
}

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

  .dashboard-hero h3 {
    max-width: 11em;
  }
}

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