:root {
  --page-bg: #fbfdfd;
  --card-bg: #ffffff;
  --line: #d9dee7;
  --text: #35465f;
  --muted: #6f7f95;
  --blue: #083f8f;
  --blue-dark: #043178;
  --red: #ff4545;
  --cyan: #33b6e8;
  --input-line: #d6ddf5;
  --shadow: 0 5px 14px rgba(28, 42, 62, .08);
  --shadow-strong: 0 18px 38px rgba(33, 44, 55, .12);
  --focus: 0 0 0 3px rgba(8, 63, 143, .14);
  --accent: #0b428d;
  --accent-dark: #073979;
  --accent-2: #33b6e8;
  --accent-3: #ffb020;
  --accent-soft: #eef6ff;
  --page-start: #fbfdfd;
  --page-end: #f3f7f7;
  --nav-active-bg: #f6f9fc;
  --card-radius: 6px;
  --icon-radius: 3px;
  --module-min-height: 149px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--page-start) 0%, var(--page-end) 100%);
}

body.theme-vivid {
  --accent: #0f4aa6;
  --accent-dark: #0a3477;
  --accent-2: #0ea5e9;
  --accent-3: #f59e0b;
  --accent-soft: #eaf6ff;
  --page-start: #fbfdff;
  --page-end: #eef7fb;
  --nav-active-bg: #eef7ff;
  --focus: 0 0 0 3px rgba(14, 165, 233, .16);
  --shadow: 0 8px 18px rgba(31, 54, 86, .09);
  --shadow-strong: 0 22px 45px rgba(31, 54, 86, .16);
}

body.theme-blue {
  --accent: #0b428d;
  --accent-dark: #073979;
  --accent-2: #33b6e8;
  --accent-3: #ffb020;
  --accent-soft: #eef6ff;
  --page-start: #fbfdfd;
  --page-end: #f3f7f7;
  --nav-active-bg: #f6f9fc;
  --focus: 0 0 0 3px rgba(8, 63, 143, .14);
}

body.theme-green {
  --accent: #167a55;
  --accent-dark: #0f5f42;
  --accent-2: #22c55e;
  --accent-3: #d7922a;
  --accent-soft: #eefaf5;
  --page-start: #fbfdfb;
  --page-end: #f2f8f4;
  --nav-active-bg: #f3faf6;
  --focus: 0 0 0 3px rgba(22, 122, 85, .14);
}

body.theme-warm {
  --accent: #b65718;
  --accent-dark: #914313;
  --accent-2: #f59e0b;
  --accent-3: #2f9fc4;
  --accent-soft: #fff5eb;
  --page-start: #fffdfb;
  --page-end: #f8f3ee;
  --nav-active-bg: #fff8f1;
  --focus: 0 0 0 3px rgba(182, 87, 24, .14);
}

body.theme-dark {
  --accent: #243b6b;
  --accent-dark: #18284b;
  --accent-2: #3b82f6;
  --accent-3: #f59e0b;
  --accent-soft: #eef3fb;
  --page-start: #f6f8fb;
  --page-end: #eef2f7;
  --nav-active-bg: #f3f6fb;
  --focus: 0 0 0 3px rgba(36, 59, 107, .16);
}

body.theme-classic {
  --accent: #35465f;
  --accent-dark: #26354f;
  --accent-2: #657386;
  --accent-3: #95a6b6;
  --accent-soft: #f3f6f9;
  --page-start: #fbfdfd;
  --page-end: #f5f7f7;
  --nav-active-bg: #f8fafb;
  --focus: 0 0 0 3px rgba(53, 70, 95, .14);
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  padding: 28px 18px 36px;
}

.login-card {
  grid-row: 1 / 2;
  width: min(350px, 100%);
  align-self: start;
  margin-top: 0;
  background: var(--card-bg);
  border-radius: 2px;
  border-top: 2px solid var(--accent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-card-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  padding: 0 25px;
  border-bottom: 1px solid var(--line);
}

.login-card-header h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #536176;
}

.login-card-body {
  padding: 23px 25px 42px;
}

.account-choice {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.account-choice p {
  margin: 0 0 6px;
  font-size: 13px;
  color: #4f5f75;
}

.account-choice small {
  display: block;
  margin-bottom: 8px;
  color: #6d7890;
  font-size: 11px;
}

.role-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.role-btn {
  min-width: 59px;
  height: 34px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 7px rgba(6, 36, 80, .22);
  opacity: .88;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.role-btn:hover,
.role-btn.is-active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(6, 36, 80, .28);
}

.role-btn.admin {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.role-btn.manager {
  background: linear-gradient(135deg, #ff4d4d, #f97316);
}

.role-btn.tenant {
  background: linear-gradient(135deg, var(--accent-2), #22c55e);
}

.login-form {
  display: grid;
  gap: 19px;
}

.field-group {
  display: grid;
  gap: 9px;
}

.field-group span {
  font-size: 12px;
  font-weight: 500;
  color: #0f3374;
}

.field-group input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--input-line);
  border-radius: 2px;
  padding: 0 15px;
  color: #31425b;
  background: #fff;
  outline: none;
}

.field-group input::placeholder {
  color: #76849a;
}

.field-group input:focus {
  border-color: #7aa5e8;
  box-shadow: 0 0 0 2px rgba(8, 63, 143, .08);
}

.remember-line,
.demo-mode-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: #68778c;
  font-size: 13px;
  cursor: pointer;
}

.remember-line input,
.demo-mode-line input {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid #d4dbe3;
  background: #dce1e6;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.remember-line input:checked,
.demo-mode-line input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.remember-line input:checked::after,
.demo-mode-line input:checked::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.demo-mode-line {
  margin-top: -10px;
  padding: 9px 10px;
  border: 1px solid #e5ebf1;
  border-radius: 4px;
  background: #fbfcfd;
  color: #0f3374;
  font-weight: 700;
}

.login-submit {
  height: 43px;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(4, 49, 120, .42);
  transition: background .15s ease, transform .15s ease;
}

.login-submit:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  transform: translateY(-1px);
}

.form-message {
  min-height: 16px;
  margin: -8px 0 0;
  color: #0f3374;
  font-size: 12px;
  text-align: center;
}

.login-footer {
  grid-row: 2 / 3;
  margin-top: 42px;
  color: #49627c;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 420px) {
  .login-page {
    padding: 18px 14px 28px;
  }

  .login-card-body,
  .login-card-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .role-tabs {
    gap: 5px;
  }

  .role-btn {
    min-width: 56px;
  }
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.dashboard-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 218px 1fr;
  background: linear-gradient(180deg, var(--page-start) 0%, var(--page-end) 100%);
  overflow-x: hidden;
  transition: grid-template-columns .22s ease;
}

.manager-dashboard {
  border-top: 4px solid var(--accent);
}

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

body.sidebar-collapsed.dashboard-body,
body.sidebar-collapsed.admin-dashboard {
  grid-template-columns: 54px 1fr;
}

.module-sidebar {
  min-height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 30;
  align-self: start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cfd8e1 transparent;
  background: #fff;
  border-right: 1px solid #f0f2f4;
  padding: 17px 0 24px;
}

.module-sidebar h1 {
  margin: 0 0 18px;
  padding: 0 4px;
  color: #c1c7ce;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.module-nav {
  display: grid;
}

.module-group {
  display: grid;
}

.module-link {
  width: 100%;
  min-height: 50px;
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr 18px;
  align-items: center;
  gap: 14px;
  padding: 0 15px;
  border: 0;
  color: #87919d;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.module-link::before {
  content: "";
  width: 3px;
  height: 0;
  position: absolute;
  left: 0;
  top: 50%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height .18s ease;
}

.module-link:hover,
.module-link.is-active {
  background: var(--nav-active-bg);
  color: var(--accent);
}

.module-link.is-active::before {
  height: 28px;
}

.module-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.module-link span {
  font-size: 14px;
  font-weight: 500;
}

.module-link .chevron {
  width: 11px;
  height: 11px;
  justify-self: end;
  transition: transform .16s ease;
}

.module-group.is-open > .module-link .chevron {
  transform: rotate(180deg);
}

.module-subnav {
  display: grid;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 1px 0 0 52px;
  transform: translateY(-4px);
  transition: max-height .24s ease, opacity .2s ease, transform .22s ease, padding-bottom .2s ease;
}

.module-group.is-open > .module-subnav {
  max-height: 220px;
  opacity: 1;
  padding-bottom: 8px;
  transform: translateY(0);
}

.module-sublink {
  min-height: 32px;
  border: 0;
  border-radius: 4px 0 0 4px;
  padding: 0 8px;
  color: #87919d;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.module-sublink:hover,
.module-sublink.is-active {
  color: var(--accent);
  background: var(--nav-active-bg);
}

.module-sublink.is-active {
  font-weight: 700;
  transform: translateX(2px);
}

body.sidebar-collapsed .module-sidebar {
  z-index: 80;
  overflow: visible;
  padding-top: 10px;
}

body.sidebar-collapsed .module-sidebar h1 {
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
}

body.sidebar-collapsed .module-group {
  position: relative;
}

body.sidebar-collapsed .module-group:hover,
body.sidebar-collapsed .module-group:focus-within {
  z-index: 120;
}

body.sidebar-collapsed .module-link {
  min-height: 50px;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 0;
}

body.sidebar-collapsed .module-link span,
body.sidebar-collapsed .module-link .chevron {
  display: none;
}

body.sidebar-collapsed .module-link svg {
  width: 17px;
  height: 17px;
}

body.sidebar-collapsed .module-link::before {
  left: auto;
  right: 0;
}

body.sidebar-collapsed .module-subnav {
  min-width: 200px;
  position: absolute;
  left: 54px;
  top: 0;
  z-index: 130;
  display: none;
  max-height: none;
  gap: 4px;
  overflow: visible;
  padding: 13px 0 12px;
  border: 1px solid #eef2f5;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
  background: #fff;
  box-shadow: 0 18px 34px rgba(33, 44, 55, .14);
  opacity: 0;
  transform: translateX(-4px);
}

body.sidebar-collapsed .module-subnav::before {
  content: attr(data-title);
  padding: 0 18px 6px;
  color: #172451;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

body.sidebar-collapsed .module-group:hover > .module-subnav,
body.sidebar-collapsed .module-group:focus-within > .module-subnav {
  display: grid;
  opacity: 1;
  transform: translateX(0);
}

body.sidebar-collapsed .module-sublink {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 0;
}

.tenant-main {
  padding: 44px 45px;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 340px) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
  padding: 0 18px 16px;
  background: #fff;
  border: 1px solid #edf1f4;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(33, 44, 55, .07);
  max-height: 220px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: opacity .24s ease, transform .24s ease, max-height .28s ease, margin .28s ease, padding .28s ease;
}

.topbar-brand-strip {
  grid-column: 1 / -1;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 -18px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 64%, var(--accent-3) 100%);
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .3px;
}

.topbar-brand-strip strong {
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-content: center;
  gap: 4px;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}

.sidebar-toggle span {
  width: 16px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-toggle-inline {
  margin: 0 auto 10px;
  color: #7f8a96;
  background: #f6f9fc;
}

.sidebar-toggle-inline:hover {
  color: var(--accent);
  background: var(--nav-active-bg);
}

.dashboard-topbar h2 {
  margin: 0;
  color: #152350;
  font-size: 20px;
}

.dashboard-topbar p {
  margin: 6px 0 0;
  color: #7c8795;
  font-size: 13px;
}

.dashboard-search {
  display: grid;
  gap: 7px;
}

.dashboard-search span {
  color: #657386;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-search input {
  min-height: 38px;
  border: 1px solid #dfe6ee;
  border-radius: 3px;
  padding: 0 12px;
  color: #26354f;
  outline: none;
}

.dashboard-search input:focus {
  border-color: #7aa5e8;
  box-shadow: 0 0 0 2px rgba(8, 63, 143, .08);
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 30px;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: opacity .24s ease, transform .24s ease, max-height .3s ease, gap .24s ease, margin .24s ease;
}

.module-grid.is-filtered,
.admin-module-grid.is-filtered {
  align-items: stretch;
}

.module-card[hidden],
.module-link[hidden] {
  display: none;
}

.module-card {
  min-height: var(--module-min-height);
  position: relative;
  display: grid;
  place-items: center;
  gap: 16px;
  align-content: center;
  border: 1px solid rgba(228, 234, 239, .85);
  border-radius: var(--card-radius);
  background: #fff;
  color: #11163d;
  cursor: pointer;
  box-shadow: 0 22px 40px rgba(33, 44, 55, .10);
  animation: softRise .28s ease both;
  transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease, border-color .18s ease;
  overflow: hidden;
}

.module-card::after {
  content: "";
  height: 3px;
  position: absolute;
  inset: 0 0 auto;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: .58;
  transform: scaleX(.34);
  transform-origin: left;
  transition: transform .2s ease, opacity .2s ease;
}

.module-card:hover,
.module-card.is-selected {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 28%, #ffffff);
  box-shadow: var(--shadow-strong);
}

.module-card:hover::after,
.module-card.is-selected::after {
  opacity: 1;
  transform: scaleX(1);
}

.module-card strong {
  font-size: 12px;
  font-weight: 700;
}

.module-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: var(--icon-radius);
  box-shadow: inset 0 -12px 18px rgba(18, 27, 48, .11), 0 10px 18px rgba(31, 54, 86, .10);
}

.module-icon svg {
  width: 31px;
  height: 31px;
  fill: #fff;
}

.module-icon.red {
  background: #ff4d4d;
}

.module-icon.green {
  background: #58e875;
}

.module-icon.orange {
  background: #ffa321;
}

.module-icon.gray {
  background: #c5cbd2;
}

.module-icon.blue {
  background: #36b4e9;
}

.module-icon.navy {
  background: #0b428d;
}

body.theme-vivid .module-icon.red,
body.theme-vivid .summary-icon.red {
  background: linear-gradient(135deg, #ff4d5f, #f97316);
}

body.theme-vivid .module-icon.green,
body.theme-vivid .summary-icon.green {
  background: linear-gradient(135deg, #22c55e, #84cc16);
}

body.theme-vivid .module-icon.orange,
body.theme-vivid .summary-icon.orange {
  background: linear-gradient(135deg, #f59e0b, #fb7185);
}

body.theme-vivid .module-icon.gray,
body.theme-vivid .summary-icon.gray {
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
}

body.theme-vivid .module-icon.blue,
body.theme-vivid .summary-icon.blue {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

body.theme-vivid .module-icon.navy,
body.theme-vivid .summary-icon.navy {
  background: linear-gradient(135deg, #0f4aa6, #2563eb);
}

body.theme-green .module-icon.navy,
body.theme-green .summary-icon.navy,
body.theme-green .module-icon.blue,
body.theme-green .summary-icon.blue {
  background: #167a55;
}

body.theme-green .module-icon.green,
body.theme-green .summary-icon.green {
  background: #4fd179;
}

body.theme-green .module-icon.orange,
body.theme-green .summary-icon.orange {
  background: #d7922a;
}

body.theme-warm .module-icon.navy,
body.theme-warm .summary-icon.navy,
body.theme-warm .module-icon.orange,
body.theme-warm .summary-icon.orange {
  background: #b65718;
}

body.theme-warm .module-icon.blue,
body.theme-warm .summary-icon.blue {
  background: #2f9fc4;
}

body.theme-dark .module-icon.navy,
body.theme-dark .summary-icon.navy,
body.theme-dark .module-icon.blue,
body.theme-dark .summary-icon.blue {
  background: #243b6b;
}

body.theme-dark .module-icon.gray,
body.theme-dark .summary-icon.gray {
  background: #8792a4;
}

body.theme-classic .module-icon.navy,
body.theme-classic .summary-icon.navy {
  background: #35465f;
}

body.shape-soft {
  --card-radius: 8px;
  --icon-radius: 8px;
  --module-min-height: 156px;
}

body.shape-compact {
  --card-radius: 4px;
  --icon-radius: 4px;
  --module-min-height: 108px;
}

body.shape-compact .module-card {
  gap: 10px;
}

body.shape-compact .module-icon {
  width: 54px;
  height: 54px;
}

body.shape-compact .module-icon svg {
  width: 25px;
  height: 25px;
}

body.shape-sharp {
  --card-radius: 2px;
  --icon-radius: 2px;
  --module-min-height: 136px;
}

.tenant-status {
  min-height: 18px;
  margin: 28px 0 0;
  color: #748292;
  font-size: 13px;
}

.admin-dashboard .module-sidebar {
  padding-top: 6px;
}

.admin-dashboard .module-sidebar h1 {
  margin-bottom: 12px;
  font-size: 10px;
}

.admin-dashboard .module-link {
  min-height: 40px;
  grid-template-columns: 16px 1fr 13px;
  gap: 12px;
  padding: 0 14px;
}

.admin-dashboard .module-link span {
  font-size: 12px;
}

.admin-dashboard .module-link svg {
  width: 12px;
  height: 12px;
}

.admin-dashboard .module-subnav {
  padding-left: 42px;
  padding-bottom: 6px;
}

.admin-dashboard .module-sublink {
  min-height: 28px;
  font-size: 12px;
}

.admin-main {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 28px;
  min-height: 100vh;
  padding: 16px 24px 0;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 24px;
  max-height: 210px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: opacity .24s ease, transform .24s ease, max-height .3s ease, gap .24s ease, margin .24s ease;
}

.summary-card {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 7px 15px rgba(33, 44, 55, .14);
  animation: softRise .26s ease both;
  transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease;
}

.summary-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border-radius: 2px;
}

.summary-icon svg {
  width: 31px;
  height: 31px;
  fill: #fff;
}

.summary-icon.navy {
  background: #0b428d;
}

.summary-icon.green {
  background: #58e875;
}

.summary-icon.red {
  background: #ff4d4d;
}

.summary-icon.blue {
  background: #36b4e9;
}

.summary-icon.gray {
  background: #c5cbd2;
}

.summary-icon.orange {
  background: #ffa321;
}

.summary-card small {
  display: block;
  margin-bottom: 4px;
  color: #a3adb7;
  font-size: 11px;
  font-weight: 800;
}

.summary-card strong {
  color: #16224d;
  font-size: 16px;
  font-weight: 800;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 24px;
  max-height: 900px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: opacity .24s ease, transform .24s ease, max-height .3s ease, gap .24s ease, margin .24s ease;
}

.admin-dashboard .module-card {
  min-height: 121px;
  gap: 15px;
  box-shadow: 0 18px 35px rgba(33, 44, 55, .10);
}

.admin-dashboard .module-icon {
  width: 58px;
  height: 58px;
}

.admin-dashboard .module-icon svg {
  width: 27px;
  height: 27px;
}

.admin-footer {
  min-height: 73px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  margin: 26px -24px 0;
  border-top: 1px solid #dfe6ea;
  color: #95a6b6;
  font-size: 12px;
}

.dashboard-detail {
  display: none;
  margin-top: 6px;
  padding: 18px;
  background: #fff;
  border: 1px solid #edf1f4;
  border-radius: var(--card-radius);
  box-shadow: 0 18px 36px rgba(33, 44, 55, .08);
  scroll-margin-top: 14px;
  transform-origin: top center;
}

.dashboard-detail.is-visible {
  display: block;
  animation: detailEnter .28s cubic-bezier(.2, .8, .2, 1) both;
}

.detail-mode .dashboard-topbar,
.detail-mode .admin-summary-grid,
.detail-mode .module-grid,
.detail-mode .admin-module-grid {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.detail-mode .tenant-main,
.detail-mode .admin-main {
  gap: 0;
}

.detail-mode .admin-main {
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
}

.detail-mode .dashboard-detail {
  margin-top: 0;
}

.detail-mode .admin-footer {
  margin-top: 18px;
}

@keyframes detailEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf1f4;
}

.detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-kicker {
  display: block;
  margin-bottom: 5px;
  color: #9ba8b5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.detail-header h2 {
  margin: 0;
  color: #152350;
  font-size: 21px;
  line-height: 1.2;
}

.detail-header p {
  margin: 7px 0 0;
  color: #7c8795;
  font-size: 13px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-search {
  display: grid;
  max-width: 340px;
  gap: 7px;
  margin-bottom: 16px;
}

.detail-search span {
  color: #657386;
  font-size: 12px;
  font-weight: 700;
}

.detail-search input {
  min-height: 38px;
  border: 1px solid #dfe6ee;
  border-radius: 3px;
  padding: 0 12px;
  color: #26354f;
  outline: none;
}

.detail-search input:focus {
  border-color: #7aa5e8;
  box-shadow: 0 0 0 2px rgba(8, 63, 143, .08);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mini-stat {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  background: #f8fafb;
  border-left: 4px solid #36b4e9;
  border-radius: 4px;
}

.mini-stat.good {
  border-left-color: #58c873;
}

.mini-stat.warn {
  border-left-color: #ffa321;
}

.mini-stat span {
  color: #8b96a3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-stat strong {
  color: #172451;
  font-size: 18px;
}

.module-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fbfcfd;
  border: 1px solid #edf1f4;
  border-radius: 6px;
}

.module-form label {
  display: grid;
  gap: 7px;
}

.module-form label span {
  color: #657386;
  font-size: 12px;
  font-weight: 700;
}

.module-form input,
.module-form select,
.module-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dfe6ee;
  border-radius: 3px;
  padding: 0 10px;
  color: #26354f;
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.module-form textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.module-form input:focus,
.module-form select:focus,
.module-form textarea:focus {
  border-color: #7aa5e8;
  box-shadow: var(--focus);
}

.wide-field {
  grid-column: 1 / -1;
}

.primary-action,
.ghost-btn,
.small-action {
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  min-height: 38px;
  align-self: end;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 5px 12px rgba(6, 36, 80, .18);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.primary-action:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  box-shadow: 0 7px 16px rgba(6, 36, 80, .22);
  transform: translateY(-1px);
}

.ghost-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dfe6ee;
  color: #536277;
  background: #fff;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.ghost-btn:hover {
  border-color: #cbd8e5;
  color: var(--accent);
  background: #f8fbfd;
  transform: translateY(-1px);
}

.small-action {
  min-height: 30px;
  padding: 0 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 11px;
  transition: background .18s ease, transform .18s ease;
}

.small-action:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  transform: translateY(-1px);
}

.small-action.danger {
  background: #ff4d4d;
}

.table-wrap {
  max-height: min(560px, 58vh);
  overflow: auto;
  border: 1px solid #edf1f4;
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cfd8e1 transparent;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #8e9aa8;
  background: #fbfcfd;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td {
  color: #34445c;
}

.data-table tbody tr {
  transition: background .16s ease;
}

.data-table tbody tr:hover td {
  background: #fbfdff;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.good {
  color: #1f7f36;
  background: #e8f8ed;
}

.status-pill.warn {
  color: #9b640e;
  background: #fff2dd;
}

.status-pill.soft {
  color: #52667d;
  background: #edf3f8;
}

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

.list-item {
  padding: 14px;
  border: 1px solid #edf1f4;
  border-radius: 6px;
  background: #fbfcfd;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.list-item:hover {
  border-color: #dfe8f0;
  box-shadow: 0 12px 24px rgba(33, 44, 55, .07);
  transform: translateY(-1px);
}

.list-item strong {
  display: block;
  color: #172451;
  font-size: 14px;
}

.list-item span {
  display: block;
  margin-top: 5px;
  color: #8b96a3;
  font-size: 12px;
}

.list-item p {
  margin: 9px 0 0;
  color: #4c5b70;
  font-size: 13px;
}

.notice-line,
.empty-state {
  margin-bottom: 16px;
  padding: 13px 14px;
  color: #657386;
  background: #fbfcfd;
  border: 1px solid #edf1f4;
  border-radius: 4px;
  font-size: 13px;
}

.calc-result {
  min-height: 38px;
  display: flex;
  align-items: center;
  align-self: end;
  padding: 0 12px;
  color: #172451;
  background: var(--accent-soft);
  border-radius: 3px;
  font-weight: 800;
}

.settings-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px 18px;
  background: #fff;
  border: 0;
  padding: 0;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e6edf2;
}

.settings-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.settings-section h3 {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.settings-logo-row {
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr);
  align-items: end;
  gap: 14px;
}

.logo-preview {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed #aeb8c4;
  background: #fbfcfd;
  color: #0b8c1f;
  font-weight: 900;
  text-align: center;
}

.logo-preview span {
  font-size: 22px;
  line-height: 1;
}

.logo-preview small {
  color: #708096;
  font-size: 10px;
  font-weight: 700;
}

.file-field {
  display: grid;
  gap: 8px;
}

.file-field input {
  min-height: 38px;
  padding: 7px;
  background: #fff;
}

.settings-editor {
  border: 1px solid #cdd6df;
  background: #fff;
}

.editor-toolbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-bottom: 1px solid #dfe6ee;
  background: #fbfcfd;
}

.editor-toolbar button {
  width: 26px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #172451;
  font-size: 12px;
  font-weight: 800;
}

.settings-editor textarea {
  min-height: 220px;
  border: 0;
  border-radius: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px 16px;
  min-height: 58px;
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-group legend {
  width: 100%;
  margin-bottom: 1px;
  color: #657386;
  font-size: 12px;
  font-weight: 700;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #536277;
  font-size: 12px;
}

.radio-group input {
  width: 12px;
  height: 12px;
  accent-color: var(--accent);
}

.settings-save {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 170px;
}

.apartment-create-form {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 16px 14px;
}

.app-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(6, 36, 80, .28);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.apartment-create-form .wide-field {
  grid-column: 1 / -1;
}

.apartment-create-form .drop-field {
  grid-column: span 2;
  min-height: 210px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #fff;
  text-align: center;
}

.apartment-create-form .drop-field > span {
  justify-self: start;
  align-self: start;
}

.apartment-create-form .drop-field input {
  max-width: 260px;
  min-height: 38px;
  padding: 7px;
}

.apartment-create-form .drop-field strong {
  color: #9aa5b1;
  font-size: 22px;
  font-weight: 500;
}

.apartment-create-form .drop-field small {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe6ee;
  color: #708096;
  text-align: left;
}

.apartment-editor textarea {
  min-height: 160px;
}

@media (max-width: 1350px) {
  .module-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .admin-module-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
  }
}

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

  body.sidebar-collapsed.dashboard-body,
  body.sidebar-collapsed.admin-dashboard {
    grid-template-columns: 1fr;
  }

  .module-sidebar {
    min-height: auto;
    max-height: none;
    position: static;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid #eef1f4;
    padding: 14px 0;
  }

  .module-sidebar h1 {
    padding: 0 18px;
  }

  .module-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, max-content);
    overflow-x: auto;
    align-items: start;
  }

  .module-link {
    min-height: 44px;
  }

  .module-subnav {
    padding-left: 38px;
    min-width: 170px;
  }

  body.sidebar-collapsed .module-sidebar {
    z-index: 30;
    overflow-y: visible;
    padding: 14px 0;
  }

  body.sidebar-collapsed .module-sidebar h1 {
    width: auto;
    height: auto;
    margin: 0 0 18px;
    padding: 0 18px;
    overflow: visible;
    opacity: 1;
  }

  body.sidebar-collapsed .module-link {
    min-height: 44px;
    grid-template-columns: 24px 1fr 18px;
    justify-items: stretch;
    gap: 14px;
    padding: 0 15px;
  }

  body.sidebar-collapsed .module-link span,
  body.sidebar-collapsed .module-link .chevron {
    display: block;
  }

  body.sidebar-collapsed .module-link svg {
    width: 14px;
    height: 14px;
  }

  body.sidebar-collapsed .module-subnav {
    min-width: 170px;
    position: static;
    display: grid;
    max-height: 0;
    gap: 2px;
    overflow: hidden;
    padding: 1px 0 0 38px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-4px);
  }

  body.sidebar-collapsed .module-subnav::before {
    content: none;
  }

  body.sidebar-collapsed .module-group:hover > .module-subnav,
  body.sidebar-collapsed .module-group:focus-within > .module-subnav {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
  }

  body.sidebar-collapsed .module-group.is-open > .module-subnav {
    max-height: 220px;
    opacity: 1;
    padding-bottom: 8px;
    transform: translateY(0);
  }

  body.sidebar-collapsed .module-sublink {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 4px 0 0 4px;
  }

  .tenant-main {
    padding: 26px 18px;
  }

  .dashboard-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-actions,
  .detail-header-actions {
    justify-content: flex-start;
  }

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

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

  .admin-main {
    padding: 24px 18px 0;
  }

  .admin-summary-grid,
  .admin-module-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 18px;
  }

  .detail-header {
    display: grid;
  }

  .mini-stats,
  .module-form {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

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

  .apartment-create-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .admin-footer {
    margin-left: -18px;
    margin-right: -18px;
  }
}

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

  .admin-summary-grid,
  .admin-module-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-detail {
    padding: 16px;
  }

  .mini-stats,
  .module-form {
    grid-template-columns: 1fr;
  }

  .ghost-btn,
  .primary-action,
  .calc-result {
    width: 100%;
  }

  .settings-logo-row {
    grid-template-columns: 1fr;
  }

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

  .apartment-create-form .drop-field {
    grid-column: 1;
  }

  .settings-save {
    justify-self: stretch;
  }

  .dashboard-actions,
  .detail-header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

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

  .module-sidebar,
  .dashboard-topbar,
  .module-grid,
  .admin-module-grid,
  .admin-summary-grid,
  .tenant-status,
  .admin-footer,
  .detail-header-actions,
  .detail-search {
    display: none !important;
  }

  .dashboard-body,
  .admin-dashboard {
    display: block;
  }

  .tenant-main,
  .admin-main {
    padding: 0;
  }

  .dashboard-detail {
    display: block !important;
    box-shadow: none;
    border: 0;
    padding: 0;
  }
}
