/* Project-specific refinements on top of Kaiadmin Lite */

.alert-debug {
  color: #1f2937;
  background-color: #f8fafc;
  border-color: #dbe5f4;
}

.alert-error {
  color: #b42318;
  background-color: #fff1f0;
  border-color: #fecdc9;
}

.app-logo {
  align-items: center;
  border-radius: 14px;
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
  min-width: 0;
  padding: 0.15rem 0.3rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.app-logo:hover,
.app-logo:focus {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.app-logo-picture {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 0;
  max-width: 100%;
}

.app-logo-image {
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
  height: 40px;
  max-width: 138px;
  object-fit: contain;
  width: auto;
}

.sidebar_minimize .sidebar .app-logo,
[data-sidebar-minimized="true"] .sidebar .app-logo {
  min-height: 42px;
  padding: 0;
}

.sidebar_minimize .sidebar .app-logo-image,
[data-sidebar-minimized="true"] .sidebar .app-logo-image {
  height: 34px;
  max-width: 38px;
}

@media (max-width: 991.98px) {
  .app-logo {
    min-height: 42px;
  }

  .app-logo-image {
    height: 36px;
    max-width: 118px;
  }
}

.auth-shell {
  background:
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(124, 58, 237, 0.2), transparent 24%),
    linear-gradient(135deg, #07111f 0%, #0b1730 48%, #10294b 100%);
  color: #f8fafc;
  overflow: hidden;
  position: relative;
}

.auth-shell::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
  pointer-events: none;
  position: absolute;
}

.auth-layout {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.72fr);
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.auth-hero,
.auth-form-panel {
  align-items: center;
  display: flex;
}

.auth-hero {
  border-radius: 30px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 2.5rem;
  position: relative;
}

.auth-hero::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 72% 74%, rgba(45, 212, 191, 0.22), transparent 34%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
}

.auth-brand-panel,
.auth-hero-copy,
.auth-feature-grid {
  position: relative;
  width: 100%;
  z-index: 1;
}

.auth-brand-panel {
  align-items: center;
  display: flex;
  justify-content: flex-start;
}

.auth-logo-link {
  align-items: center;
  background: linear-gradient(135deg, rgba(9, 18, 34, 0.88), rgba(17, 36, 70, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: inline-flex;
  justify-content: center;
  min-height: 78px;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}

.auth-logo-image {
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.38));
  height: auto;
  max-height: 62px;
  max-width: 250px;
  object-fit: contain;
  width: 100%;
}

.auth-hero-copy {
  margin: auto 0;
  max-width: 680px;
  padding: 3rem 0;
}

.auth-eyebrow,
.auth-form-kicker {
  color: #2dd4bf;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}

.auth-hero-copy h1 {
  color: #fff;
  font-size: clamp(2.1rem, 4.8vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.95;
  margin-bottom: 1.25rem;
  max-width: 760px;
}

.auth-hero-copy p {
  color: rgba(226, 232, 240, 0.86);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
  max-width: 560px;
}

.auth-feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-feature-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.auth-feature-icon {
  align-items: center;
  background: rgba(45, 212, 191, 0.16);
  border-radius: 14px;
  color: #5eead4;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  margin-bottom: 0.85rem;
  width: 38px;
}

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

.auth-feature-card strong {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.auth-feature-card small {
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.5;
}

.auth-install-note {
  align-items: center;
  background: #fbfdff;
  border: 1px solid #e6edf6;
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 0.9rem;
  margin-top: 0.95rem;
  padding: 0.8rem 0.9rem;
}

.auth-install-note__icon {
  align-items: center;
  background: var(--color-primary-light);
  border-radius: 12px;
  color: var(--color-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.auth-install-note__copy {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-install-note__title {
  color: #172033;
  font-size: 0.92rem;
  font-weight: 800;
}

.auth-install-note__description {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-install-note__actions {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
}

.auth-install-note__actions .btn {
  min-width: 132px;
}

.auth-install-note__help {
  color: #6b7280;
  font-size: 0.79rem;
  line-height: 1.35;
  max-width: 210px;
}

.auth-form-panel {
  justify-content: center;
  padding: 2rem;
}

.auth-form-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
  color: #1a2035;
  max-width: 440px;
  padding: 2.25rem;
  width: 100%;
}

.auth-form-heading {
  margin-bottom: 1.75rem;
}

.auth-form-heading h2 {
  color: #111827;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  margin-bottom: 0.55rem;
}

.auth-form-heading p {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.auth-form-card .form-control {
  border-color: #d8e3f7;
  border-radius: 14px;
  min-height: 46px;
}

.auth-form-card .btn,
.auth-form-card button[type="submit"] {
  border-radius: 14px;
  min-height: 44px;
}

@media (max-width: 991.98px) {
  .auth-shell {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding: 1rem;
  }

  .auth-hero {
    border-radius: 26px;
    flex: 0 0 auto;
    min-height: auto;
    padding: 1.25rem;
  }

  .auth-brand-panel {
    justify-content: center;
  }

  .auth-hero-copy {
    padding: 1.75rem 0 1rem;
    text-align: center;
  }

  .auth-hero-copy h1 {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
    line-height: 1.02;
    margin-left: auto;
    margin-right: auto;
    max-width: 560px;
  }

  .auth-hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }

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

  .auth-install-note {
    margin-top: 1rem;
  }

  .auth-form-panel {
    align-items: flex-start;
    flex: 1 1 auto;
    padding: 1rem 0.25rem 0;
  }
}

@media (max-width: 575.98px) {
  .auth-shell {
    background:
      radial-gradient(circle at 50% -10%, rgba(45, 212, 191, 0.2), transparent 34%),
      linear-gradient(180deg, #07111f 0%, #0b1730 42%, #f8fafc 42%, #f8fafc 100%);
  }

  .auth-shell::before {
    opacity: 0.45;
  }

  .auth-layout {
    gap: 0;
    min-height: 100svh;
    padding: 0;
  }

  .auth-hero {
    border-radius: 0 0 28px 28px;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1.1rem;
  }

  .auth-hero::before {
    border-left: 0;
    border-radius: inherit;
    border-right: 0;
    border-top: 0;
  }

  .auth-logo-link {
    border-radius: 18px;
    min-height: 62px;
    padding: 0.55rem 0.9rem;
  }

  .auth-logo-image {
    max-height: 48px;
    max-width: 198px;
  }

  .auth-hero-copy {
    padding: 1rem 0 0;
  }

  .auth-eyebrow {
    font-size: 0.62rem;
    margin-bottom: 0.55rem;
  }

  .auth-hero-copy h1 {
    font-size: 1.42rem;
    letter-spacing: -0.035em;
    line-height: 1.12;
    margin-bottom: 0.55rem;
  }

  .auth-hero-copy p,
  .auth-feature-grid {
    display: none;
  }

  .auth-install-note {
    margin-top: 0.85rem;
    padding: 0.85rem;
  }

  .auth-install-note__actions {
    width: 100%;
  }

  .auth-install-note__actions .btn {
    min-width: 0;
    width: 100%;
  }

  .auth-form-panel {
    align-items: stretch;
    background: #f8fafc;
    padding: 0.9rem 0.85rem max(1rem, env(safe-area-inset-bottom));
  }

  .auth-form-card {
    border-color: rgba(216, 227, 247, 0.92);
    border-radius: 22px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
    max-width: none;
    padding: 1.15rem;
  }

  .auth-form-heading {
    margin-bottom: 1rem;
  }

  .auth-form-kicker {
    font-size: 0.62rem;
    margin-bottom: 0.45rem;
  }

  .auth-form-heading h2 {
    font-size: 1.28rem;
    margin-bottom: 0.35rem;
  }

  .auth-form-heading p {
    font-size: 0.82rem;
  }

  .auth-form-card .form-control {
    border-radius: 13px;
    font-size: 1rem;
    min-height: 50px;
  }

  .auth-form-card .btn,
  .auth-form-card button[type="submit"] {
    border-radius: 13px;
    font-size: 1rem;
    font-weight: 800;
    min-height: 50px;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .auth-form-card {
    padding: 1rem;
  }

  .auth-hero-copy h1 {
    font-size: 1.25rem;
  }
}

.main-header .navbar {
  min-height: 50px;
  padding-bottom: 0.25rem;
  padding-top: 0.25rem;
}

.workspace-loading {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dbe5f4;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  color: #1f2937;
  display: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  position: fixed;
  right: 1.25rem;
  top: 4.5rem;
  z-index: 1100;
}

.workspace-loading.htmx-request,
.htmx-request .workspace-loading {
  display: inline-flex;
}

#workspace:focus {
  outline: none;
}

.main-header .navbar .container-fluid {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  overflow: visible;
}

.dashboard-heading h3 {
  color: #1a2035;
  font-size: 1.05rem;
  margin-bottom: 0;
  white-space: nowrap;
}

.selection-form {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  margin: 0;
  min-width: max-content;
  white-space: nowrap;
}

.selection-shell {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  gap: 0;
  padding: 0;
}

.selection-control {
  align-items: center;
  display: flex;
  gap: 0.3rem;
}

.selection-shell-kicker {
  color: #5f6f88;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-shell-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.selection-form label {
  color: #6b778c;
  font-size: 0.68rem;
  font-weight: 600;
}

.selection-form select {
  appearance: auto;
  background-color: #fff !important;
  color: #243247 !important;
  color-scheme: light;
  height: 28px;
  min-width: 8.2rem;
  padding-bottom: 0.1rem;
  padding-top: 0.1rem;
}

.selection-form select option {
  background-color: #fff;
  color: #243247;
}

.pwa-install-prompt {
  bottom: 1.1rem;
  left: 1.1rem;
  position: fixed;
  right: 1.1rem;
  z-index: 1300;
}

.pwa-install-prompt__content {
  align-items: center;
  background: linear-gradient(135deg, rgba(8, 17, 29, 0.96), rgba(18, 59, 122, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(3, 9, 22, 0.3);
  color: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 720px;
  padding: 0.95rem 1rem;
  width: 100%;
}

.pwa-install-prompt__copy {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  gap: 0.15rem;
}

.pwa-install-prompt__kicker {
  color: #7dd3ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.pwa-install-prompt__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.pwa-install-prompt__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pwa-install-prompt__actions .btn {
  min-width: 96px;
}

@media (max-width: 575.98px) {
  .pwa-install-prompt {
    left: 0.75rem;
    right: 0.75rem;
  }

  .pwa-install-prompt__content {
    border-radius: 18px;
    padding: 0.85rem;
  }

  .pwa-install-prompt__actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }
}

.user-chip {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.shortcut-chip {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.context-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.6rem;
  text-transform: uppercase;
}

.context-badge-role {
  background: #e7f0ff;
  color: #24539d;
}

.context-badge-super {
  background: #fff3d9;
  color: #8a5a00;
}

.context-badge-count {
  background: #edf7ee;
  color: #2f7d45;
}

.context-badge-empty {
  background: #eff2f6;
  color: #617086;
}

.topbar-nav {
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-left: auto !important;
  min-width: max-content;
  overflow-x: auto;
  overflow-y: visible;
}

.topbar-nav .nav-item {
  display: flex;
  flex: 0 0 auto;
}

.periods-chip {
  align-items: center;
  border: 1px solid #d6deec;
  border-radius: 999px;
  color: #4f5d75;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.periods-chip:hover,
.periods-chip:focus {
  background: #eef3ff;
  color: #2f4369;
}

.shortcut-launcher {
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.shortcut-launcher:hover,
.shortcut-launcher:focus {
  box-shadow: 0 8px 20px rgba(18, 35, 74, 0.08);
}

.periods-section-title {
  color: #53627d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0;
  text-transform: uppercase;
}

.periods-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.periods-list li {
  align-items: center;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
}

.periods-list li:hover {
  background: #f6f8fc;
}

.period-status {
  align-items: center;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.35rem;
  white-space: nowrap;
}

.period-status i {
  font-size: 0.55rem;
}

.period-status.active {
  color: #1f9d46;
}

.period-status.inactive {
  color: #7a879e;
}

/* .dashboard-content-card.card rule removed - #workspace is now a flat wrapper */

.quick-card {
  height: 100%;
}

/* Society admin — role hierarchy cards */
.role-info-card {
  background: #fff;
  border: 1px solid #ebedf2;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  height: 100%;
}

.role-badge-large {
  margin-bottom: 0.35rem;
}

.role-badge-large .badge {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.account-tree {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.account-tree-group,
.account-tree-subgroup {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  box-shadow: 0 8px 20px rgba(24, 39, 75, 0.04);
  overflow: hidden;
}

.account-tree-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  list-style: none;
  padding: 0.9rem 1rem;
  user-select: none;
}

.account-tree-summary::-webkit-details-marker {
  display: none;
}

.account-tree-summary::before {
  color: #66758e;
  content: "▸";
  font-size: 0.9rem;
  transition: transform 0.18s ease;
}

.account-tree-group[open] > .account-tree-summary::before,
.account-tree-subgroup[open] > .account-tree-summary::before {
  transform: rotate(90deg);
}

.account-tree-summary-label {
  color: #1a2035;
  font-size: 0.98rem;
  font-weight: 700;
}

.account-tree-summary-sub {
  background: #f6f9ff;
  border-top: 1px solid #eef2f7;
}

.account-tree-group-body,
.account-tree-subgroup-body {
  padding: 0 0.9rem 0.9rem;
}

.account-tree-subgroup {
  margin-left: 0.75rem;
}

.account-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-tree-list.level-0 {
  margin-top: 0.75rem;
}

.account-tree-item + .account-tree-item {
  margin-top: 0.6rem;
}

.account-tree-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e6ebf4;
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.8rem 0.95rem;
}

.account-tree-main {
  min-width: 0;
}

.account-tree-name {
  align-items: center;
  color: #1c2438;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-weight: 700;
}

.account-tree-meta {
  align-items: center;
  color: #6d778b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.account-tree-code {
  background: #edf3ff;
  border-radius: 999px;
  color: #2756a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
}

.account-tree-actions .btn {
  white-space: nowrap;
}

.account-tree .badge {
  font-size: 0.72rem;
}

.society-overview-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-color: #dde5f2;
  box-shadow: 0 12px 32px rgba(24, 39, 75, 0.05);
}

.society-overview-top {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.society-overview-kicker {
  color: #72819a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.society-overview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.society-overview-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.society-overview-label,
.governance-label {
  color: #72819a;
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.society-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.governance-card {
  background: linear-gradient(135deg, #fdfefe 0%, #f4f8ff 100%);
}

.governance-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.governance-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.governance-metric {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e2e9f4;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}

.role-stack {
  display: grid;
  gap: 0.75rem;
}

.role-stack-item {
  border: 1px solid #e3e9f4;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}

.role-stack-badge-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.page-inner .table-responsive {
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.page-inner .table {
  margin-bottom: 0;
}

.page-inner .table > :not(caption) > * > * {
  padding: 0.7rem 0.8rem;
}

.page-inner .table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
  border-bottom: 1px solid #dde5f0;
  color: #526079;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-inner .form-control,
.page-inner .form-select {
  border-color: #d8dfeb;
}

.page-inner .form-control:focus,
.page-inner .form-select:focus {
  border-color: #8ab7ff;
  box-shadow: 0 0 0 0.16rem rgba(23, 125, 255, 0.15);
}

.page-inner .btn {
  font-weight: 600;
}

.page-inner {
  padding-top: 0.5rem;
  padding-bottom: 0.75rem;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.workspace {
  padding: 0;
}

.page-subtitle {
  margin: 0 0 var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

body.ka-body {
  background:
    radial-gradient(circle at top left, rgba(23, 125, 255, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.05), transparent 25%),
    #f5f8fd;
}

.main-panel {
  background: transparent;
}

.content-card__body .list-group-item {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  border-color: #e9eef5;
}

.report-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.report-card:hover {
  transform: translateY(-2px);
  border-color: #d6e1f0;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.report-card__icon {
  align-items: center;
  display: inline-flex;
  height: 52px;
  justify-content: center;
  width: 52px;
  border-radius: 16px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 1.15rem;
}

.report-card__icon--core {
  background: linear-gradient(135deg, #177dff 0%, #4e9dff 100%);
}

.report-card__icon--aging {
  background: linear-gradient(135deg, #0ea5e9 0%, #57c7f7 100%);
}

.report-card__icon--audit {
  background: linear-gradient(135deg, #b42318 0%, #dc4e43 100%);
}

.report-card__icon--assets {
  background: linear-gradient(135deg, #1f9d46 0%, #34b85f 100%);
}

.report-card__icon--reconciliation {
  background: linear-gradient(135deg, #617086 0%, #8a96a7 100%);
}

.report-card__icon--compliance {
  background: linear-gradient(135deg, #f9b115 0%, #f3c44e 100%);
}

.report-card__icon--operations {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
}

.report-card__icon--insights {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.report-card__icon--membership {
  background: linear-gradient(135deg, #334155 0%, #64748b 100%);
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.page-action-group .btn {
  font-weight: 600;
}

.page-action-group .btn-main {
  background: #ffffff;
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.page-action-group .btn-main:hover,
.page-action-group .btn-main:focus {
  background: #ffffff;
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.page-action-group .btn-plus {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  min-width: 34px;
  padding-left: 10px;
  padding-right: 10px;
}

.financial-statement-sheet {
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
  border: 1px solid #dce3ef;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(24, 39, 75, 0.06);
  padding: 1.5rem;
}

.statement-header {
  border-bottom: 2px solid #dbe4f0;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  text-align: center;
}

.statement-kicker {
  color: #6b7a90;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.statement-entity {
  color: #172033;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.statement-title {
  color: #2e405f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.statement-period,
.statement-period-detail {
  color: #55657f;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.statement-print-date {
  color: #6b7a90;
  font-size: 0.82rem;
  margin-bottom: 0;
}

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

.statement-panel {
  background: #fff;
  border: 1px solid #dde5f1;
  border-radius: 12px;
  overflow: hidden;
}

.statement-panel-header {
  background: #eaf0f8;
  color: #32425f;
  display: flex;
  font-size: 0.76rem;
  font-weight: 700;
  justify-content: space-between;
  letter-spacing: 0.08em;
  padding: 0.8rem 1rem;
  text-transform: uppercase;
}

.statement-table {
  border-collapse: collapse;
  width: 100%;
}

.statement-table-head th {
  background: #eef3f9;
  border-bottom: 1px solid #dde5f1;
  color: #4d5f7c;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.8rem 1rem;
  text-transform: uppercase;
}

.statement-table td {
  border-bottom: 1px solid #edf1f7;
  color: #23314d;
  padding: 0.78rem 1rem;
  vertical-align: top;
}

.statement-table tbody tr:last-child td {
  border-bottom: 1px solid #edf1f7;
}

.statement-subsection td {
  background: #f7f9fc;
  color: #50617e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statement-subtotal td,
.statement-table tfoot td {
  background: #f3f6fb;
  color: #172033;
  font-weight: 700;
}

.statement-summary {
  align-items: center;
  background: #f3f6fb;
  border: 1px solid #dde5f1;
  border-radius: 12px;
  color: #172033;
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
}

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

  .selection-shell {
    align-items: center;
    flex-direction: row;
  }

  .selection-form {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .selection-form select {
    min-width: 0;
    width: auto;
  }

  .society-overview-grid,
  .governance-metrics {
    grid-template-columns: 1fr;
  }
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: #ffffff !important;
  }

  .main-header,
  .sidebar,
  .nav-toggle,
  .navbar-header,
  .page-actions,
  .footer,
  .custom-template,
  .page-inner .btn,
  .page-inner .form-control,
  .page-inner .form-select,
  .alert,
  .breadcrumb,
  .sidebar-wrapper,
  .logo-header {
    display: none !important;
  }

  .wrapper,
  .main-panel,
  .content,
  .page-inner {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .dashboard-heading,
  .dashboard-title,
  .dashboard-subtitle {
    display: none !important;
  }

  .financial-statement-sheet,
  .statement-panel {
    border: 0 !important;
    box-shadow: none !important;
  }

  .financial-statement-sheet {
    background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%) !important;
    padding: 0 !important;
  }

  .statement-panel-header,
  .statement-subsection td,
  .statement-subtotal td,
  .statement-table tfoot td,
  .statement-table-head th {
    background: inherit;
  }

  .statement-header {
    border-bottom: 1px solid #cfd8e3 !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  .statement-table td,
  .statement-table-head th {
    padding: 0.45rem 0.55rem !important;
  }
}

.page-action-group .btn-plus:hover,
.page-action-group .btn-plus:focus {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #ffffff;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.form-shell {
  padding: 1.1rem;
}

.form-shell .form-label {
  color: #5e6d86;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.32rem;
  text-transform: uppercase;
}

.form-shell .form-text {
  color: #7a879e;
}

.form-shell .form-check-label {
  color: #4f5d75;
  font-weight: 600;
}

.form-actions-inline {
  margin-top: 0.4rem;
}

.member-filter-bar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-filter-item {
  flex: 1 1 170px;
  min-width: 170px;
}

.member-filter-search {
  flex: 2 1 280px;
  min-width: 240px;
}

.member-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.structure-filter-bar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.structure-filter-item {
  flex: 1 1 170px;
  min-width: 170px;
}

.structure-filter-search {
  flex: 2 1 320px;
  min-width: 260px;
}

.structure-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.list-group-item {
  border-color: #eff1f6;
}

.parking-dashboard .content-card .list-group-flush > .list-group-item {
  border-bottom: 1px solid #e7ecf3;
}

.parking-dashboard .content-card .list-group-flush > .list-group-item:last-child {
  border-bottom: 0;
}

.structure-tree,
.structure-children {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.structure-node {
  border-left: 2px solid #dde4f1;
  margin-top: 0.75rem;
  padding-left: 0.9rem;
}

.structure-accordion {
  background: #fff;
  border: 1px solid #eff1f6;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.structure-children {
  margin-left: 0.9rem;
}

.structure-toggle {
  align-items: flex-start;
  border: 0;
  color: inherit;
  display: inline-flex;
  gap: 0.7rem;
  padding: 0;
  text-align: left;
}

.structure-toggle:hover,
.structure-toggle:focus {
  color: inherit;
}

.structure-toggle-copy {
  display: grid;
  gap: 0.3rem;
}

.structure-toggle-meta {
  line-height: 1.35;
}

.structure-toggle-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.structure-toggle-badges .badge {
  font-weight: 600;
}

.structure-toggle-icon {
  align-items: center;
  color: #5f6b85;
  display: inline-flex;
  justify-content: center;
  min-width: 18px;
  padding-top: 0.2rem;
  transition: transform 0.2s ease;
}

.structure-toggle[aria-expanded="false"] .structure-toggle-icon {
  transform: rotate(-90deg);
}

.structure-collapse-body {
  padding-top: 0.75rem;
}

.structure-unit-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
}

.structure-unit-card {
  background: #fff;
  border: 1px solid #eff1f6;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
  padding: 0.9rem 1rem;
}

.sidebar .nav.nav-secondary > .nav-section {
  margin-top: 0.65rem;
}

.sidebar .nav.nav-secondary > .nav-item > a {
  border-radius: 14px;
  margin: 0.12rem 0.6rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar .nav.nav-secondary > .nav-item > a:hover,
.sidebar .nav.nav-secondary > .nav-item > a:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 #2dd4bf, 0 10px 22px rgba(0, 0, 0, 0.16);
  transform: translateX(2px);
}

.sidebar .nav.nav-secondary > .nav-item.active > a {
  background: linear-gradient(135deg, rgba(23, 125, 255, 0.22), rgba(45, 212, 191, 0.14));
  box-shadow: inset 3px 0 0 #2dd4bf;
}

@media (max-width: 991.98px) {
  .selection-form {
    gap: 0.25rem;
    padding: 0;
  }

  .selection-form .form-select {
    min-width: 7rem;
  }

  .logo-label {
    font-size: 0.88rem;
  }

  .structure-unit-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .structure-toggle-badges {
    gap: 0.3rem;
  }

  .main-header .navbar .container-fluid {
    align-items: stretch;
    flex-wrap: wrap;
    padding-top: 0.25rem;
  }

  .dashboard-heading {
    flex: 1 1 100%;
    min-width: 0;
  }

  .dashboard-heading h3 {
    white-space: normal;
  }

  .topbar-nav {
    display: none;
    flex: 1 1 100%;
    flex-direction: column !important;
    gap: 0.6rem;
    margin-left: 0 !important;
    min-width: 0;
    overflow: visible;
    padding-top: 0.35rem;
    width: 100%;
  }

  html.topbar_open .topbar-nav {
    display: flex;
  }

  .topbar-nav .nav-item {
    width: 100%;
  }

  .selection-shell {
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .selection-form {
    flex-wrap: wrap;
    justify-content: stretch;
    width: 100%;
  }

  .selection-form label {
    width: 100%;
  }

  .selection-form .form-select {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .user-chip,
  .periods-chip,
  .shortcut-chip {
    justify-content: center;
    width: 100%;
  }

  .topbar-nav .nav-item.ms-2 {
    margin-left: 0 !important;
  }

  .topbar-nav .nav-item .d-flex {
    flex-direction: column;
    width: 100%;
  }

  .topbar-nav .nav-item .d-flex .user-chip,
  .topbar-nav .nav-item .d-flex .btn {
    width: 100%;
  }

  .topbar-nav .nav-item .d-flex.gap-2 {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.45rem !important;
  }

  .topbar-nav .nav-item .d-flex.gap-2 .user-chip,
  .topbar-nav .nav-item .d-flex.gap-2 .btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .topbar-nav .nav-item .d-flex.gap-2 .user-chip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-header .navbar-header {
    align-items: flex-start;
  }
}

@media (max-width: 767.98px) {
  .main-header .navbar {
    min-height: 46px;
    padding-bottom: 0.2rem;
    padding-top: 0.2rem;
  }

  .main-header .navbar .container-fluid {
    gap: 0.35rem;
  }

  .selection-shell {
    padding: 0;
  }

  .user-chip,
  .periods-chip,
  .shortcut-chip {
    font-size: 0.7rem;
    min-height: 34px;
    padding: 0.42rem 0.6rem;
  }

  .topbar-nav {
    gap: 0.5rem;
    padding-top: 0.5rem;
  }

  .selection-form {
    gap: 0.35rem;
  }

  .page-inner {
    padding-top: 0.35rem;
  }

  .table > :not(caption) > * > * {
    padding: 0.65rem 0.7rem;
  }

  .member-filter-item,
  .member-filter-search,
  .structure-filter-item,
  .structure-filter-search {
    min-width: 100%;
  }

  .member-filter-actions,
  .structure-filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .member-filter-actions .btn,
  .structure-filter-actions .btn {
    flex: 1 1 auto;
  }
}

/* ========== Account Tree Browser ========== */

.tree-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.tree-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.tree-hero-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--color-text-primary);
}

.tree-hero-subtitle {
  margin: 0.5rem 0 0;
  max-width: 60rem;
  color: var(--color-text-secondary);
}

.tree-hero-copy {
  flex: 1 1 24rem;
}

.tree-hero-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tree-stat {
  min-width: 6.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border-subtle);
}

.tree-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.tree-stat-label {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.tree-page-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.tree-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  background: #fff;
}

button.tree-link {
  appearance: none;
  cursor: pointer;
}

.tree-link:hover {
  color: var(--color-primary);
  border-color: rgba(26, 86, 219, 0.18);
  background: #fff;
}

.tree-link--accent {
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.tree-link--accent:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #ffffff 100%);
}

.tree-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tree-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  background: #fff;
}

.tree-legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
}

.tree-legend-swatch--root {
  background: #2563eb;
}

.tree-legend-swatch--branch {
  background: #0f766e;
}

.tree-legend-swatch--leaf {
  background: #64748b;
}

.tree-search-panel {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: #fff;
}

.tree-search-panel--inline {
  flex: 1 1 32rem;
  max-width: none;
  min-width: 16rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.tree-search-panel--inline .tree-search-input-wrap {
  flex: 1 1 auto;
  max-width: none;
}

.tree-search-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tree-search-input-wrap {
  position: relative;
  flex: 1 1 24rem;
  max-width: 34rem;
}

.tree-search-input-wrap > i {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  color: var(--color-text-muted);
  transform: translateY(-50%);
}

.tree-search-input-wrap .form-control {
  min-height: 40px;
  padding-left: 2.35rem;
  border-color: var(--color-border-subtle);
  border-radius: 7px;
}

.tree-search-submit {
  min-height: 40px;
  white-space: nowrap;
}

.tree-search-clear {
  padding: 0.35rem 0.45rem;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
}

.tree-filter-details {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid #eef1f4;
}

.tree-filter-details > summary {
  width: fit-content;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  list-style: none;
}

.tree-filter-details > summary::-webkit-details-marker { display: none; }
.tree-filter-details > summary::after { content: " +"; color: var(--color-primary); }
.tree-filter-details[open] > summary::after { content: " −"; }

.tree-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.tree-filter-grid label {
  display: grid;
  gap: 0.25rem;
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.tree-filter-grid .form-select {
  min-height: 36px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.8rem;
}

.tree-filter-actions {
  display: flex;
  align-items: end;
}

.tree-search-results {
  margin: 0.6rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.tree-search-live-results {
  position: absolute;
  z-index: 20;
  top: 3.65rem;
  left: 0.75rem;
  width: min(34rem, calc(100% - 7.8rem));
  max-height: 20rem;
  overflow-y: auto;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 35, 60, 0.16);
}

.tree-search-result {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-bottom: 1px solid #f0f2f5;
  background: #fff;
  color: var(--color-text-primary);
  text-align: left;
}

.tree-search-result:hover,
.tree-search-result:focus-visible {
  outline: 0;
  background: #f3f8ff;
}

.tree-search-result-main strong {
  font-size: 0.84rem;
  font-weight: 700;
}

.tree-search-result-meta {
  color: var(--color-text-muted);
  font-size: 0.73rem;
}

.tree-search-no-results {
  margin: 0;
  padding: 0.7rem 0.8rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

@media (max-width: 767.98px) {
  .tree-search-main { flex-wrap: wrap; }
  .tree-search-input-wrap { flex-basis: 100%; max-width: none; }
  .tree-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-search-live-results { top: 6.6rem; left: 0.75rem; width: calc(100% - 1.5rem); }
}

@media (max-width: 420px) {
  .tree-filter-grid { grid-template-columns: 1fr; }
}

.tree-group {
  margin-bottom: 1.5rem;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.tree-group-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  background: #fff;
}

.tree-group-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tree-group-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.tree-group-count {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tree-container {
  padding: 0.9rem 1rem 1rem;
}

.tree-node {
  position: relative;
  --tree-line: rgba(26, 86, 219, 0.18);
}

.tree-node::before {
  content: "";
  position: absolute;
  left: calc(var(--tree-depth, 0) * 1.25rem + 0.45rem);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--tree-line);
}

.tree-node:last-child::before {
  bottom: 50%;
}

.tree-node-content {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  padding: 0.22rem 0;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.tree-node:hover > .tree-node-content {
  background: rgba(26, 86, 219, 0.04);
}

.tree-details {
  width: 100%;
}

.tree-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.tree-details > summary::-webkit-details-marker {
  display: none;
}

.tree-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 3.1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tree-summary:hover {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.tree-details[open] > .tree-summary .tree-toggle {
  transform: rotate(90deg);
}

.tree-node-name {
  font-weight: 600;
  color: var(--color-text-primary);
  min-width: 0;
}

.tree-node-title {
  display: flex;
  flex: 1;
  min-width: 12rem;
  flex-direction: column;
  gap: 0.25rem;
}

.tree-node-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tree-node.leaf .tree-node-name {
  font-weight: 500;
}

.tree-node.level-0 > .tree-node-content .tree-node-name {
  font-size: 1rem;
}

.tree-node-code {
  font-size: 0.76rem;
  color: #1d4ed8;
  font-family: monospace;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 0.12rem 0.38rem;
  white-space: nowrap;
}

.tree-node-type {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tree-node-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  min-width: 4.25rem;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tree-node-badge--root {
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.tree-node-badge--branch {
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
}

.tree-node-badge--leaf {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.tree-node-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.tree-action-link {
  font-size: 0.75rem;
  padding: 0.24rem 0.55rem;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
  min-height: 2rem;
}

.tree-action-link.btn {
  box-shadow: none;
}

.tree-action-link.btn-outline-secondary {
  border-color: rgba(100, 116, 139, 0.25);
}

.tree-action-link.btn-outline-success {
  border-color: rgba(16, 185, 129, 0.26);
}

.tree-action-link.btn-outline-primary {
  border-color: rgba(37, 99, 235, 0.22);
}

.tree-action-link:hover {
  text-decoration: none;
}

.tree-children {
  padding-left: 1.25rem;
  margin-left: 0.95rem;
  border-left: 2px solid rgba(37, 99, 235, 0.16);
}

.tree-leaf-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.tree-leaf-icon {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.tree-empty {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: 0;
  padding: 0.85rem 0 0.35rem;
}

.account-form-modal {
  border: 1px solid rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.app-form-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(15, 118, 110, 0.07));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.app-form-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.app-form-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-text-primary);
}

.app-form-subtitle {
  margin: 0.35rem 0 0;
  color: var(--color-text-secondary);
  max-width: 42rem;
}

.app-form-intro-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.app-form-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-text-primary);
  border: 1px solid rgba(37, 99, 235, 0.14);
  font-size: 0.82rem;
}

.app-form-chip--muted {
  color: var(--color-text-secondary);
}

.app-form-section {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--color-border-subtle);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.app-form-section--stacked {
  height: 100%;
}

.app-form-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.app-form-section-header h6 {
  font-size: 0.95rem;
  font-weight: 700;
}

.app-form-section-header span {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.app-form-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.app-form-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.app-form-toggle input[type="checkbox"] {
  margin-top: 0.2rem;
}

.app-form-toggle strong {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

.app-form-toggle small {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.app-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

/* Account modal: keep the everyday fields prominent and tuck away rare flags. */
.app-form-intro {
  align-items: center;
  margin: -0.25rem -0.25rem 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #dce8f7;
  border-radius: 18px;
  background: radial-gradient(circle at 100% 0%, #e4f1ff 0, transparent 34%), linear-gradient(135deg, #f5f9ff, #f7fbfa);
}

.app-form-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #35659b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.app-form-title {
  margin-top: 0.2rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.app-form-subtitle {
  max-width: 36rem;
  font-size: 0.88rem;
}

.app-form-code {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #dbe8f5;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.app-form-code-label,
.app-form-code-note {
  color: #64748b;
  font-size: 0.68rem;
}

.app-form-code strong {
  color: #174b7a;
  font-family: var(--font-family-mono);
  font-size: 1.05rem;
}

.app-form-code-note {
  color: #16805d;
  font-weight: 650;
}

.app-form-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e4eaf1;
  border-radius: 13px;
  background: #fbfcfe;
}

.app-form-context-icon,
.app-form-advanced-icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #eaf3ff;
  color: #2768aa;
}

.app-form-context-copy {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.app-form-context-copy small {
  color: #718096;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.app-form-context-copy strong {
  overflow-wrap: anywhere;
  color: #25364a;
  font-size: 0.86rem;
  font-weight: 650;
}

.app-form-context-society {
  margin-left: auto;
  color: #5d6e82;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

.app-form-essential {
  padding: 1.15rem;
  border: 1px solid #dfe8f2;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 50, 80, 0.045);
}

.app-form-section-header {
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
}

.app-form-step {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #1769aa;
  font-size: 0.82rem;
  font-weight: 800;
}

.app-form-section-header h4 {
  margin: 0;
  color: #24364b;
  font-size: 1rem;
  font-weight: 750;
}

.app-form-section-header p {
  margin: 0.15rem 0 0;
  color: #7a8796;
  font-size: 0.78rem;
}

.app-form-required-note {
  margin-left: auto;
  color: #738196;
  font-size: 0.72rem;
}

.app-form-required-mark {
  color: #d14b43;
}

.app-form-essential .form-label,
.app-form-gst-type .form-label {
  margin-bottom: 0.4rem;
  color: #35465a;
  font-size: 0.81rem;
  font-weight: 700;
}

.app-form-essential .form-control,
.app-form-essential .form-select {
  min-height: 46px;
  border-color: #dbe3ec;
  border-radius: 10px;
  background-color: #fff;
  color: #25364a;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.app-form-essential .form-control:focus,
.app-form-essential .form-select:focus {
  border-color: #62a4e8;
  box-shadow: 0 0 0 3px rgba(43, 128, 207, 0.13);
}

.app-form-essential #id_name {
  min-height: 50px;
  font-size: 1rem;
}

.app-form-advanced {
  margin-top: 0.8rem;
  border: 1px solid #e2e8ef;
  border-radius: 14px;
  background: #fff;
}

.app-form-advanced > summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  list-style: none;
}

.app-form-advanced > summary::-webkit-details-marker {
  display: none;
}

.app-form-advanced-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: #f1f4f8;
  color: #62758b;
}

.app-form-advanced-copy {
  display: grid;
  gap: 0.08rem;
}

.app-form-advanced-copy strong {
  color: #35465a;
  font-size: 0.82rem;
}

.app-form-advanced-copy small {
  color: #7e8a99;
  font-size: 0.72rem;
}

.app-form-advanced-chevron {
  margin-left: auto;
  color: #8290a0;
  font-size: 0.75rem;
  transition: transform 150ms ease;
}

.app-form-advanced[open] .app-form-advanced-chevron {
  transform: rotate(180deg);
}

.app-form-advanced-body {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid #edf0f4;
}

.app-form-advanced .app-form-toggle {
  padding: 0.7rem;
  border-color: #e7ecf2;
  border-radius: 11px;
  background: #fbfcfe;
}

.app-form-advanced .app-form-toggle strong {
  color: #36485c;
  font-size: 0.81rem;
}

.app-form-advanced .app-form-toggle small {
  margin-top: 0.12rem;
  font-size: 0.7rem;
}

.app-form-gst-type {
  max-width: 24rem;
  margin-top: 0.9rem;
}

.app-form-gst-type .form-select {
  min-height: 42px;
  border-color: #dbe3ec;
  border-radius: 9px;
}

.app-form-footer {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.app-form-submit {
  min-height: 42px;
  padding-inline: 1.1rem;
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(23, 105, 170, 0.17);
}

@media (max-width: 767.98px) {
  .tree-hero {
    flex-direction: column;
    align-items: start;
  }

  .tree-group-header {
    flex-direction: column;
  }

  .tree-node::before {
    left: calc(var(--tree-depth, 0) * 1rem + 0.35rem);
  }

  .tree-children {
    padding-left: 0.9rem;
    margin-left: 0.55rem;
  }

  .tree-summary,
  .tree-leaf-content {
    flex-wrap: wrap;
  }

  .tree-node-title {
    min-width: 100%;
  }

  .tree-node-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .app-form-intro {
    flex-direction: column;
  }

  .app-form-intro-meta {
    align-items: flex-start;
  }

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

  .app-form-footer {
    flex-direction: column-reverse;
  }
}



/* Enhanced navbar toggle buttons - easier to press */
.nav-toggle {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn.btn-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6b778c;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.btn.btn-toggle:hover {
  background: rgba(23, 125, 255, 0.08);
  color: #177dff;
}

.btn.btn-toggle:active,
.btn.btn-toggle.toggled {
  background: rgba(23, 125, 255, 0.12);
  color: #177dff;
}

.btn.btn-toggle i {
  font-size: 1.25rem;
}

/* Hide mobile toggle on desktop */
.btn.btn-toggle.sidenav-toggler {
  display: none;
}

/* Show mobile toggle on mobile screens */
@media (max-width: 991px) {
  .btn.btn-toggle.toggle-sidebar {
    display: none;
  }

  .btn.btn-toggle.sidenav-toggler {
    display: inline-flex;
  }
}

/* Topbar toggle button */
.topbar-toggler {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6b778c;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.topbar-toggler:hover {
  background: rgba(23, 125, 255, 0.08);
  color: #177dff;
}

.topbar-toggler:active,
.topbar-toggler.toggled {
  background: rgba(23, 125, 255, 0.12);
  color: #177dff;
}

.topbar-toggler i {
  font-size: 1.25rem;
}

/* Submenu hover effects */
.submenu-link {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.submenu-link:hover {
  background: rgba(23, 125, 255, 0.05);
  color: #177dff;
}

.submenu-link .submenu-caret {
  transition: all 0.2s ease-in-out;
}

.submenu-link:hover .submenu-caret {
  color: #177dff;
  transform: scale(1.15);
}

.submenu-link[aria-expanded="true"] .submenu-caret {
  color: #177dff;
}

.shares-dashboard .page-inner {
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 30rem),
    linear-gradient(180deg, #fbf8ff 0%, #ffffff 42%);
}

.shares-command-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(124, 58, 237, 0.12), transparent 22rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(252, 248, 255, 0.96));
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.shares-command-panel__intro {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #3b1d66 0%, #7c3aed 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.shares-command-panel__eyebrow {
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shares-command-panel__intro h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 850;
  letter-spacing: -0.03em;
}

.shares-command-panel__intro p {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.shares-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.shares-command {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem;
  border: 1px solid #e6dcf8;
  border-radius: 18px;
  color: #1f2937;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.shares-command:hover,
.shares-command:focus-visible {
  border-color: rgba(124, 58, 237, 0.36);
  color: #4c1d95;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 16px 32px rgba(124, 58, 237, 0.12);
  transform: translateY(-2px);
}

.shares-command:focus-visible,
.shares-card-link:focus-visible,
.shares-card-header-link:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.22);
  outline-offset: 3px;
}

.shares-command--primary {
  border-color: rgba(124, 58, 237, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f6f0ff 100%);
}

.shares-command--warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #fff8eb 100%);
}

.shares-command__icon {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #7c3aed;
  background: #f1e8ff;
}

.shares-command--warning .shares-command__icon {
  color: #b45309;
  background: #fff2d8;
}

.shares-command strong,
.shares-command small {
  display: block;
}

.shares-command strong {
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.15;
}

.shares-command small {
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 650;
}

.shares-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.shares-card-link:hover,
.shares-card-link:focus {
  color: inherit;
  text-decoration: none;
}

.shares-card-link .stat-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(252, 248, 255, 0.98)),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 55%);
}

.shares-card-link .stat-card::after {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  color: #a78bfa;
  font-family: "Font Awesome 5 Free";
  font-size: 0.78rem;
  font-weight: 900;
  content: "\f061";
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.shares-card-link:hover .stat-card::after,
.shares-card-link:focus .stat-card::after {
  opacity: 1;
  transform: translateX(0);
}

.shares-overview-card {
  height: 100%;
  border-color: rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.shares-card-header-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.shares-card-header-link span {
  color: #7c3aed;
  font-size: 0.8rem;
  font-weight: 800;
}

.shares-card-header-link:hover,
.shares-card-header-link:focus {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, #f8f3ff 0%, #fff 100%);
}

.shares-table-row,
.shares-list-row {
  transition: background 0.18s ease;
}

.shares-table-row:hover,
.shares-list-row:hover {
  background: #fbf8ff;
}

@media (max-width: 1199.98px) {
  .shares-command-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 767.98px) {
  .shares-command-panel {
    padding: 0.75rem;
    border-radius: 20px;
  }

  .shares-command-panel__intro {
    padding: 0.9rem;
  }

  .shares-command-grid {
    grid-template-columns: 1fr;
  }

  .shares-command {
    min-height: 64px;
  }
}

.structure-units-dashboard .page-inner {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 30rem),
    linear-gradient(180deg, #f7fffd 0%, #ffffff 42%);
}

.structure-command-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(20, 184, 166, 0.12), transparent 22rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 255, 253, 0.96));
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.structure-command-panel__intro {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.structure-command-panel__eyebrow {
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.structure-command-panel__intro h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 850;
  letter-spacing: -0.03em;
}

.structure-command-panel__intro p {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.structure-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.structure-command {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem;
  border: 1px solid #d7eee9;
  border-radius: 18px;
  color: #1f2937;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.structure-command:hover,
.structure-command:focus-visible {
  border-color: rgba(20, 184, 166, 0.38);
  color: #0f766e;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 16px 32px rgba(20, 184, 166, 0.12);
  transform: translateY(-2px);
}

.structure-command:focus-visible,
.structure-card-link:focus-visible,
.structure-card-header-link:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.22);
  outline-offset: 3px;
}

.structure-command--primary {
  border-color: rgba(20, 184, 166, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #effdfa 100%);
}

.structure-command__icon {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #0f766e;
  background: #dff9f4;
}

.structure-command strong,
.structure-command small {
  display: block;
}

.structure-command strong {
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.15;
}

.structure-command small {
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 650;
}

.structure-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.structure-card-link:hover,
.structure-card-link:focus {
  color: inherit;
  text-decoration: none;
}

.structure-card-link .stat-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 255, 253, 0.98)),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 55%);
}

.structure-card-link .stat-card::after {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  color: #5eead4;
  font-family: "Font Awesome 5 Free";
  font-size: 0.78rem;
  font-weight: 900;
  content: "\f061";
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.structure-card-link:hover .stat-card::after,
.structure-card-link:focus .stat-card::after {
  opacity: 1;
  transform: translateX(0);
}

.structure-overview-card {
  height: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfffe 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.structure-card-header-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -1rem -1rem 1rem;
  padding: 1rem;
  border-bottom: 1px solid #e8f2f0;
  border-radius: 22px 22px 0 0;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, #f6fffd 0%, #fff 100%);
  transition: color 0.18s ease, background 0.18s ease;
}

.structure-card-header-link span {
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 800;
}

.structure-card-header-link:hover,
.structure-card-header-link:focus {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, #eafffb 0%, #fff 100%);
}

.structure-card-header-link--static:hover,
.structure-card-header-link--static:focus {
  background: linear-gradient(180deg, #f6fffd 0%, #fff 100%);
}

.structure-filter-panel {
  padding: 1rem;
  border: 1px solid #dcefeb;
  border-radius: 18px;
  background: linear-gradient(135deg, #fbfffe 0%, #f5fffc 100%);
}

.structure-filter-panel .form-control,
.structure-filter-panel .form-select {
  min-height: 42px;
  border-color: #d5e7e3;
  border-radius: 12px;
  box-shadow: none;
}

.structure-filter-panel .form-control:focus,
.structure-filter-panel .form-select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 0.22rem rgba(20, 184, 166, 0.12);
}

.structure-list-row,
.structure-table-row {
  transition: background 0.18s ease;
}

.structure-list-row:hover,
.structure-table-row:hover {
  background: #f6fffd;
}

.structure-unit-card .table-responsive {
  border: 1px solid #e8f2f0;
  border-radius: 16px;
}

@media (max-width: 1199.98px) {
  .structure-command-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 767.98px) {
  .structure-command-panel {
    padding: 0.75rem;
    border-radius: 20px;
  }

  .structure-command-panel__intro {
    padding: 0.9rem;
  }

  .structure-command-grid {
    grid-template-columns: 1fr;
  }

  .structure-command {
    min-height: 64px;
  }

  .structure-card-header-link {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Smooth collapse/expand animation */
.collapse {
  transition: all 0.3s ease-in-out;
}

.nav-collapse {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shared form preview layout, used inside the account modal. */
.account-form-dialog { max-width: 760px; }
.account-form-modal {
  overflow: visible;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}
.account-form-modal .modal-body { padding: 0; }
.app-form {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #e2e6ec;
  border-radius: 12px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
}
.app-form-intro {
  position: relative;
  align-items: flex-start;
  margin: 0;
  padding: 1.5rem 2rem;
  border: 0;
  border-bottom: 1px solid #e2e6ec;
  border-radius: 0;
  background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}
.app-form-kicker {
  display: inline-block;
  margin-bottom: 0.4rem;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  background: #f3f0ff;
  color: #8b5cf6;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.app-form-title { margin: 0 0 0.15rem; color: #1e293b; font-size: 1.25rem; font-weight: 700; }
.app-form-subtitle { margin: 0; color: #64748b; font-size: 0.85rem; }
.app-form-header-meta { display: flex; align-items: flex-start; gap: 0.65rem; flex-shrink: 0; margin-left: 1rem; }
.app-form-close { margin-top: 0.2rem; padding: 0.5rem; }
.app-form-code {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin: 0.45rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
}
.app-form-code-label { color: #64748b; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.app-form-code strong { color: #3b82f6; font-size: 1.1rem; letter-spacing: 0.04em; }
.app-form-code-note { color: #64748b; font-size: 0.72rem; font-weight: 400; }
.app-form-context {
  gap: 0.6rem;
  margin: 0;
  padding: 0.75rem 2rem;
  border: 0;
  border-bottom: 1px solid #e2e6ec;
  border-radius: 0;
  background: #f8fafc;
  font-size: 0.85rem;
}
.app-form-context-icon { width: 30px; height: 30px; border-radius: 6px; background: #eff6ff; color: #3b82f6; font-size: 0.85rem; }
.app-form-context-copy small { color: #64748b; font-size: 0.7rem; letter-spacing: 0.04em; }
.app-form-context-copy strong { color: #1e293b; font-size: 0.85rem; font-weight: 600; }
.app-form-context-society { margin-left: auto; padding: 0.3em 0.7em; border-radius: 6px; background: #f1f5f9; color: #64748b; font-size: 0.8rem; }
.app-form-essential { padding: 1.5rem 2rem; border: 0; border-bottom: 1px solid #e2e6ec; border-radius: 0; box-shadow: none; }
.app-form-section-header { align-items: flex-start; gap: 0.75rem; justify-content: flex-start; margin-bottom: 1.25rem; padding: 0; border: 0; }
.app-form-step { width: 28px; height: 28px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 0.8rem; }
.app-form-section-header h4 { margin: 0 0 0.15rem; color: #1e293b; font-size: 1rem; font-weight: 700; }
.app-form-section-header p { margin: 0; color: #64748b; font-size: 0.8rem; }
.app-form-required-note { align-self: center; margin-left: auto; color: #64748b; font-size: 0.72rem; }
.app-form-required-note span, .app-form-required-mark { color: #ef4444; font-weight: 700; }
.app-form-essential .form-label, .app-form-gst-type .form-label { margin-bottom: 0.35rem; color: #1e293b; font-size: 0.8rem; font-weight: 600; }
.app-form-essential .form-control, .app-form-essential .form-select, .app-form-gst-type .form-select {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.app-form-essential .form-control:focus, .app-form-essential .form-select:focus, .app-form-gst-type .form-select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.app-form-essential #id_name { min-height: 42px; font-size: 0.875rem; }
.app-form-advanced { margin: 0; border: 0; border-bottom: 1px solid #e2e6ec; border-radius: 0; }
.app-form-advanced > summary { gap: 0.75rem; padding: 1rem 2rem; transition: background 150ms ease; }
.app-form-advanced > summary:hover { background: #f8fafc; }
.app-form-advanced-icon { width: 30px; height: 30px; border-radius: 6px; background: #f1f5f9; color: #64748b; }
.app-form-advanced-copy strong { color: #1e293b; font-size: 0.9rem; }
.app-form-advanced-copy small { color: #64748b; font-size: 0.75rem; }
.app-form-advanced-body { padding: 0 2rem 1.5rem; }
.app-form-toggle-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.app-form-advanced .app-form-toggle { gap: 0.65rem; padding: 0.75rem 1rem; border: 1px solid transparent; border-radius: 8px; background: #f1f5f9; cursor: pointer; }
.app-form-advanced .app-form-toggle:hover { background: #e8edf3; }
.app-form-advanced .app-form-toggle:has(input:checked) { border-color: #bfdbfe; background: #eff6ff; }
.app-form-advanced .app-form-toggle input[type="checkbox"] { position: relative; width: 36px; height: 20px; flex: 0 0 auto; margin: 2px 0 0; appearance: none; border: 0; border-radius: 10px; background: #cbd5e1; cursor: pointer; transition: background 200ms ease; }
.app-form-advanced .app-form-toggle input[type="checkbox"]::after { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); content: ""; transition: transform 200ms ease; }
.app-form-advanced .app-form-toggle input[type="checkbox"]:checked { background: #3b82f6; }
.app-form-advanced .app-form-toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.app-form-advanced .app-form-toggle input[type="checkbox"]:focus-visible { outline: 3px solid rgba(59, 130, 246, 0.22); outline-offset: 2px; }
.app-form-advanced .app-form-toggle strong { color: #1e293b; font-size: 0.82rem; font-weight: 600; }
.app-form-advanced .app-form-toggle small { color: #64748b; font-size: 0.72rem; }
.app-form-gst-type { max-width: 320px; margin-top: 0; }
.app-form-gst-type .form-text { margin-top: 0.25rem; color: #64748b; font-size: 0.75rem; }
.app-form-footer { align-items: center; margin: 0; padding: 1rem 2rem; border: 0; background: #f8fafc; }
.app-form-footer .btn { padding: 0.55rem 1.25rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; }
.app-form-footer .btn-outline-secondary { border-color: #e2e6ec; color: #64748b; }
.app-form-footer .btn-primary { border-color: #3b82f6; background: #3b82f6; }
.app-form-footer .btn-primary:hover { border-color: #2563eb; background: #2563eb; }

@media (max-width: 600px) {
  .account-form-dialog { margin: 0.5rem; }
  .app-form-intro { flex-direction: column; gap: 0.75rem; padding: 1.25rem 3rem 1.25rem 1.25rem; }
  .app-form-code { align-items: flex-start; margin: 0; }
  .app-form-header-meta { align-self: flex-start; margin-left: 0; }
  .app-form-context { flex-wrap: wrap; padding: 0.75rem 1.25rem; }
  .app-form-context-society { margin: 0.25rem 0 0; }
  .app-form-essential { padding: 1.25rem; }
  .app-form-advanced > summary { padding: 1rem 1.25rem; }
  .app-form-advanced-body { padding: 0 1.25rem 1.25rem; }
  .app-form-footer { padding: 1rem 1.25rem; }
}

/* Accounting periods modal */
.periods-modal .modal-dialog {
  height: 60vh;
  max-height: 60vh;
  max-width: 620px;
}

.periods-modal__content {
  height: 100%;
  max-height: 60vh;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(22, 35, 59, 0.22);
  overflow: hidden;
}

.periods-modal__header {
  align-items: center;
  background: linear-gradient(112deg, #263f65 0%, #315b82 100%);
  border: 0;
  min-height: 62px;
  padding: 0.9rem 1.2rem;
}

.periods-modal__header .modal-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.periods-modal__context {
  color: #d6e5f2;
  font-size: 0.88rem;
  font-weight: 450;
}

.periods-modal__body {
  background: #f4f7fa;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.9rem;
}

.periods-list--modal {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}

.periods-list--modal li {
  align-items: center;
  background: #fff;
  border: 1px solid #e3e9ef;
  border-left: 3px solid #c5d2df;
  border-radius: 7px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) 5.6rem;
  min-height: 2.45rem;
  padding: 0.32rem 0.65rem;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.periods-list--modal li:hover {
  background: #fbfdff;
  border-color: #d5e0ea;
}

.periods-list__date {
  color: #2c3b50;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  white-space: nowrap;
}

.periods-list__date span {
  color: #9aa8b7;
  padding: 0 0.15rem;
}

.periods-list--modal .period-status {
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 650;
  justify-content: center;
  padding: 0.28rem 0.4rem;
}

.periods-list--modal .period-status i {
  font-size: 0.42rem;
}

.periods-list--modal .period-status.active {
  background: #e1f3eb;
  color: #176b49;
}

.periods-list--modal .period-status.active i {
  color: #1d9a66;
}

.periods-list--modal .period-status.inactive {
  background: #fff0e6;
  color: #95532d;
}

.periods-list--modal .period-status.inactive i {
  color: #d17a3d;
}

.periods-empty {
  background: #fff;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
  color: #69798c;
  font-size: 0.82rem;
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
}

@media (max-width: 575.98px) {
  .periods-modal .modal-dialog {
    height: 60vh;
    max-height: 60vh;
  }

  .periods-modal__header {
    padding: 0.8rem 0.9rem;
  }

  .periods-modal__context {
    font-size: 0.76rem;
  }

  .periods-modal__body {
    padding: 0.6rem;
  }

  .periods-list--modal li {
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr) 5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .periods-list__date {
    font-size: 0.72rem;
  }
}
