*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --line: #dde4ee;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --success: #0f9f6e;
  --danger: #dc2626;
  --sidebar: #101827;
  --sidebar-soft: #182235;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px;
  min-height: 100vh;
}

.app-shell {
  padding: 28px 32px 32px 312px;
}

.summary-panel {
  margin: 18px 0 24px;
}

.summary-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.summary-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.dashboard-link {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.dashboard-link:hover {
  border-color: rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.summary-value.summary-text {
  font-size: 18px;
  font-weight: 600;
}

.summary-expense {
  border-left: 4px solid var(--danger);
}

.summary-income {
  border-left: 4px solid var(--success);
}

.summary-month {
  border-left: 4px solid var(--brand);
}

.pt-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 2fr);
  margin-bottom: 20px;
}

#previewToggle {
  margin: 10px 0 18px;
}

.pt-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.pt-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.rent-table th,
.rent-table td {
  padding: 10px;
}

.type-groups {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.type-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.type-card-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.type-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.type-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #334155;
}

.mortgage-body {
  min-height: 120px;
  color: #334155;
  font-size: 14px;
}

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

.mortgage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mortgage-row span {
  color: var(--muted);
}

.mortgage-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
}

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

.actions input {
  padding: 9px 11px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.actions select,
.page-header .actions select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

input,
select,
textarea {
  color: var(--text);
  font: inherit;
  accent-color: var(--brand);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

a {
  color: var(--brand);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.filter-field span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  align-items: end;
  gap: 14px;
  margin: 0 0 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.filters select,
.filters input {
  min-height: 42px;
  width: 100%;
  padding: 9px 11px;
}

.filters button {
  min-height: 42px;
  white-space: nowrap;
}

.keyword-filter-panel {
  grid-template-columns: minmax(220px, 360px) auto;
  justify-content: start;
}

.table-link {
  width: auto;
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--brand);
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.table-link:hover {
  background: transparent;
  color: var(--brand-strong);
  box-shadow: none;
  text-decoration: underline;
  transform: none;
}

button,
.actions button,
.actions a,
.page-header .actions a,
.page-header .actions button,
.form-actions button,
.form-actions a,
.modal-actions button {
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  padding: 10px 14px;
  text-decoration: none;
  line-height: 1.1;
}

button,
.actions button,
.actions a,
.page-header .actions a,
.page-header .actions button,
.form-actions button,
.form-actions a,
.modal-actions button {
  background: #1f3c88;
  color: #fff;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

button:hover,
.actions button:hover,
.actions a:hover,
.page-header .actions a:hover,
.page-header .actions button:hover,
.form-actions button:hover,
.form-actions a:hover,
.modal-actions button:hover {
  background: var(--brand-strong);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

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

table {
  width: 100%;
  background: var(--panel);
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

th {
  text-align: left;
  background: #eef3f8;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover {
  background: #f9fbff;
}

.table-row-selected {
  background: #eef2ff;
}

.table-row-selected:hover {
  background: #e0e7ff;
}

.check-icon {
  color: #16a34a;
  font-weight: 700;
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hidden {
  display: none !important;
}

.modal-content {
  background: var(--panel);
  padding: 24px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.28);
}

.modal-content-wide {
  width: min(640px, 100%);
}

.modal-content h3 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 20px;
}

.modal-content label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 10px 12px;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions .modal-delete {
  margin-right: auto;
}

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

.modal-form-grid label {
  margin-top: 0;
}

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: linear-gradient(180deg, var(--sidebar), #0b1220);
  color: #e5edf7;
  padding: 24px 18px;
  border-right: 1px solid var(--sidebar-line);
  box-shadow: 14px 0 36px rgba(15, 23, 42, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.menu-item {
  position: relative;
}

.menu-item > a,
.menu-trigger {
  width: 100%;
  background: transparent;
  color: #cbd5e1;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  line-height: 1.2;
}

.nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

.nav-icon::before {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.nav-icon img {
  width: 18px;
  height: 18px;
  display: block;
  filter: invert(78%) sepia(21%) saturate(1191%) hue-rotate(183deg) brightness(101%) contrast(98%);
}

.nav-icon-income::before {
  content: "$";
}

.nav-icon-import::before {
  content: "↓";
}

.nav-icon-houses::before {
  content: "⌂";
}

.menu-item > a:hover .nav-icon,
.menu-trigger:hover .nav-icon,
.menu-item.active-section > .menu-trigger .nav-icon,
.menu-item > a.active .nav-icon {
  background: rgba(37, 99, 235, 0.22);
  color: #bfdbfe;
}

.menu-item > a:hover .nav-icon img,
.menu-trigger:hover .nav-icon img,
.menu-item.active-section > .menu-trigger .nav-icon img,
.menu-item > a.active .nav-icon img {
  filter: invert(86%) sepia(22%) saturate(790%) hue-rotate(184deg) brightness(104%) contrast(99%);
}

.menu-item > a:hover,
.menu-trigger:hover,
.menu-item.active-section > .menu-trigger,
.menu-item > a.active {
  background: var(--sidebar-soft);
  color: #fff;
}

.menu-item.is-open > .menu-trigger:not(:hover):not(.active) {
  color: #e5edf7;
}

.menu-trigger::after {
  content: "›";
  width: 20px;
  height: 20px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
  opacity: 1;
}

.menu-trigger[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-avatar svg {
  width: 16px;
  height: 16px;
  display: block;
}

.submenu {
  display: grid;
  gap: 2px;
  padding: 4px 0 4px 16px;
}

.submenu[hidden] {
  display: none !important;
}

.menu-item:not(.is-open) > .submenu {
  display: none !important;
}

.menu-item.is-open > .submenu {
  display: grid;
}

.submenu a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.submenu a:hover,
.submenu a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.submenu a.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pagination .pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination .pages button {
  min-width: 34px;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #334155;
  font-weight: 800;
}

.pagination .pages button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  border-radius: var(--radius);
}

.pagination-ellipsis {
  min-width: 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  letter-spacing: 0;
}

.page-header .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .actions a,
.page-header .actions button {
  text-decoration: none;
}

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.page-header + table,
.summary-panel + table,
.form-card,
.pt-card,
.chart-card {
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  column-gap: 20px;
  row-gap: 18px;
}

.form-grid label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #334155;
}

.form-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
}

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

.mortgage-form .form-grid {
  column-gap: 24px;
  row-gap: 22px;
}

.mortgage-form .form-grid > div {
  padding-right: 2px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.mortgage-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.house-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mortgage-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.house-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.house-card-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.house-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #1f3c88;
  flex-shrink: 0;
}

.house-card-icon svg {
  width: 22px;
  height: 22px;
}

.mortgage-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.house-card-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}

.house-card-title a {
  color: inherit;
  text-decoration: none;
}

.house-card-title a:hover {
  text-decoration: underline;
}

.house-card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.mortgage-card-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--text);
}

.mortgage-card-title a {
  color: inherit;
  text-decoration: none;
}

.mortgage-card-title a:hover {
  text-decoration: underline;
}

.mortgage-card-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.mortgage-stats {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.mortgage-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mortgage-progress {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), #e5e9f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mortgage-progress-inner {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.mortgage-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 1.3fr) minmax(260px, 1fr);
  margin-bottom: 24px;
}

.mortgage-detail-left,
.mortgage-detail-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.balance-positive {
  color: #16a34a;
}

.balance-negative {
  color: #dc2626;
}

.chart-card {
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 900px;
  box-shadow: var(--shadow);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .mortgage-detail-grid {
    grid-template-columns: 1fr;
  }
}

.form-actions button,
.form-actions a {
  text-decoration: none;
}

button.btn-success,
.actions button.btn-success,
.actions a.btn-success,
.page-header .actions button.btn-success,
.page-header .actions a.btn-success,
.form-actions button.btn-success,
.modal-actions button.btn-success {
  background: #16a34a;
  color: #fff;
}

.form-actions a {
  background: #6b7280;
  color: #fff;
}

.btn-danger,
button.btn-danger,
.modal-actions button.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover,
button.btn-danger:hover,
.modal-actions button.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.2);
}

.btn-outline,
.btn-outline-danger,
.btn-outline-success {
  background: #fff;
  border: 1px solid transparent;
  padding: 6px 10px;
}

.btn-outline {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline-danger {
  border-color: #dc2626;
  color: #dc2626;
}

.btn-outline:hover {
  background: #eaf0ff;
}

.btn-outline-danger:hover {
  background: #fee2e2;
}

.btn-outline-success {
  border-color: #16a34a;
  color: #16a34a;
}

.btn-outline-success:hover {
  background: #dcfce7;
}

.btn-disabled {
  background: #9ca3af !important;
  color: #fff !important;
  pointer-events: none;
  cursor: not-allowed;
}

.helper-text {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.auth-page {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.92), rgba(37, 99, 235, 0.18)),
    radial-gradient(circle at 18% 18%, rgba(15, 159, 110, 0.28), transparent 24rem),
    var(--bg);
}

.auth-shell {
  width: min(980px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1fr);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.26);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 34px;
  color: #e5edf7;
  background:
    linear-gradient(160deg, rgba(37, 99, 235, 0.18), transparent 45%),
    #0b1220;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 92px -80px auto auto;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 19px;
}

.auth-brand small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
}

.auth-visual {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.auth-meter {
  width: min(260px, 78%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #0b1220 0 55%, transparent 56%),
    conic-gradient(var(--success) 0 38%, var(--brand) 38% 76%, rgba(255, 255, 255, 0.12) 76%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 48px rgba(0, 0, 0, 0.25);
}

.auth-meter span {
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    #111827;
}

.auth-mini-grid {
  width: min(320px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.auth-mini-grid span {
  height: 72px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-mini-grid span:nth-child(2),
.auth-mini-grid span:nth-child(4) {
  transform: translateY(18px);
}

.auth-note {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 330px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-note strong,
.auth-note span {
  display: block;
}

.auth-note strong {
  color: #fff;
  font-size: 15px;
  margin-bottom: 6px;
}

.auth-note span {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}


.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: rgba(255, 255, 255, 0.95);
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-card h1 {
  margin: 0 0 26px;
  color: var(--text);
  font-size: 34px;
  letter-spacing: 0;
}

.auth-fieldset,
#authForm {
  display: grid;
  gap: 16px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 13px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-field input:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.auth-submit:hover {
  background: var(--brand-strong);
}

.auth-submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

.auth-message {
  min-height: 22px;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.auth-message.is-error {
  color: var(--danger);
}

.auth-message.is-success {
  color: var(--success);
}

.links {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.links a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  body,
  .app-shell {
    padding: 16px;
  }

  .topbar {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    padding: 14px 16px;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-line);
    border-radius: 12px;
    margin-bottom: 18px;
  }

  .brand {
    padding: 0 0 10px;
  }

  .menu {
    flex-direction: column;
    overflow: visible;
    padding: 0;
  }

  .menu-item {
    width: 100%;
    min-width: 0;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header .actions {
    width: 100%;
    flex-wrap: wrap;
  }

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

  table {
    display: block;
    overflow-x: auto;
  }

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

  .pagination .pages {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .pagination .pages button {
    flex: 0 0 auto;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: 240px;
    padding: 22px;
  }

  .auth-visual {
    display: none;
  }

  .login-card {
    padding: 28px 22px;
  }

  .login-card h1 {
    font-size: 28px;
  }

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