html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background: #f7f8fa;
  color: #16202a;
  font-family: "Segoe UI", Inter, Calibri, Arial, sans-serif;
}

body.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(7, 21, 34, 0.68), rgba(20, 52, 79, 0.48)),
    url("https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=1800&q=80") center center / cover no-repeat fixed;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric {
  border-left: 4px solid #0d6efd;
}

.table td,
.table th {
  vertical-align: middle;
}

.member-grid-table > :not(caption) > * > * {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.member-grid-table thead th {
  white-space: nowrap;
}

.member-grid-table {
  min-width: 1650px;
  border-collapse: separate;
  border-spacing: 0;
  isolation: isolate;
}

.member-filter-row th {
  background: #f8fafc;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  vertical-align: top;
}

.member-filter-input {
  min-width: 110px;
}

.member-filter-reset {
  white-space: nowrap;
}

.tabulator {
  border: 0;
  font-size: 0.96rem;
  color: #16202a;
  overflow: hidden;
}

.tabulator .tabulator-header {
  border-bottom: 1px solid #dde4eb;
  background: #f8fafc;
}

.tabulator .tabulator-header .tabulator-col {
  background: #f8fafc;
  border-right: 1px solid #edf1f5;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 0.7rem 0.75rem;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
  min-height: 34px;
  border: 1px solid #d2dbe5;
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  background: #ffffff;
}

.tabulator .tabulator-tableholder .tabulator-table {
  background: #ffffff;
}

.tabulator .tabulator-tableholder {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tabulator .tabulator-row {
  min-height: 52px;
  background: #ffffff;
  color: #16202a;
}

.tabulator .tabulator-row.tabulator-row-even {
  background: #f3f5f8;
}

.tabulator .tabulator-row.tabulator-row-odd {
  background: #ffffff;
}

.tabulator .tabulator-row .tabulator-cell {
  padding: 0.6rem 0.75rem;
  border-right: 1px solid #edf1f5;
  background: inherit;
  color: inherit;
}

.tabulator .tabulator-row .tabulator-cell.tabulator-frozen,
.tabulator .tabulator-header .tabulator-col.tabulator-frozen {
  background: inherit;
}

.tabulator .tabulator-row.tabulator-row-even .tabulator-cell.tabulator-frozen {
  background: #f3f5f8;
}

.tabulator .tabulator-row.tabulator-row-odd .tabulator-cell.tabulator-frozen {
  background: #ffffff;
}

.tabulator .badge {
  color: #ffffff;
}

.grid-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #ffffff;
}

.grid-status-pill-success {
  background: #198754;
}

.grid-status-pill-secondary {
  background: #6c757d;
}

.grid-status-pill-danger {
  background: #dc3545;
}

.grid-status-pill-warning {
  background: #b7791f;
}

.tabulator .tabulator-footer {
  border-top: 1px solid #dde4eb;
  background: #ffffff;
  padding: 0.65rem 0.8rem;
}

.tabulator .tabulator-footer .tabulator-page-size {
  border: 1px solid #d2dbe5;
  border-radius: 0.45rem;
  padding: 0.25rem 0.45rem;
}

.member-grid-link {
  color: #4d6f8d;
  text-decoration: none;
  font-weight: 600;
}

.member-grid-link:hover {
  color: #35556f;
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .tabulator {
    min-width: 100%;
  }

  .tabulator .tabulator-header .tabulator-headers,
  .tabulator .tabulator-tableholder .tabulator-table {
    min-width: 1450px;
  }

  .tabulator .tabulator-header {
    overflow: hidden;
  }

  .member-form-panel {
    max-width: 100%;
  }

  .member-form-grid .form-label {
    min-height: 0;
  }
}

.form-panel {
  max-width: 760px;
}

.member-form-panel {
  max-width: 1180px;
}

.member-form-grid .form-label {
  min-height: 1.5rem;
  margin-bottom: 0.45rem;
}

.member-form-grid .form-control,
.member-form-grid .form-select {
  min-height: 44px;
}

.member-form-grid textarea.form-control {
  min-height: 112px;
}

.member-form-grid .text-danger {
  display: block;
  min-height: 1.15rem;
  margin-top: 0.2rem;
}

.form-control-report-year {
  width: 130px;
}

.form-help-trigger {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #ffffff;
  color: #4d647b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.form-help-trigger:hover,
.form-help-trigger:focus {
  border-color: #86a5c4;
  color: #153552;
  background: #f3f8fd;
}

.login-screen {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 24, 39, 0.12), rgba(8, 24, 39, 0.22));
}

.login-panel-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
}

.login-panel {
  border-radius: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 28px 60px rgba(7, 20, 33, 0.24);
  backdrop-filter: blur(8px);
}

.login-brand {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #5f7387;
  margin-bottom: 0.7rem;
}

.login-title {
  margin: 0 0 0.55rem;
  font-size: 2rem;
  font-weight: 700;
  color: #153552;
}

.login-copy {
  margin: 0 0 1.5rem;
  color: #5c6f80;
  line-height: 1.55;
}

.login-form .form-label {
  font-weight: 600;
  color: #294760;
}

.login-form .form-control {
  border-radius: 0.8rem;
  border-color: #d9e2ea;
}

.login-form .form-check-label {
  color: #4e6173;
}

.login-footer-note {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: #647788;
  text-align: center;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #dde4eb;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 1040;
}

.mobile-topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #16334f;
}

.mobile-menu-button {
  border: 1px solid #d4dce5;
  background: #ffffff;
  color: #16334f;
  border-radius: 0.8rem;
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.mobile-menu-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 0.22rem;
}

.mobile-menu-icon span {
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav-offcanvas {
  width: 320px;
  max-width: 86vw;
  background: linear-gradient(180deg, #13304a 0%, #1d4669 56%, #214d72 100%);
  color: #f3f7fb;
}

.mobile-nav-offcanvas .offcanvas-header {
  padding: 1rem 1rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-nav-offcanvas .offcanvas-body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.mobile-nav-offcanvas .sidebar-brand {
  padding-top: 0;
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.1rem 1.1rem;
  background: linear-gradient(180deg, #13304a 0%, #1d4669 56%, #214d72 100%);
  color: #f3f7fb;
  box-shadow: 0 0 28px rgba(14, 31, 49, 0.18);
}

.sidebar-brand {
  margin-bottom: 1.5rem;
  padding: 0.2rem 0.35rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0;
}

.sidebar-brand-subtitle {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: rgba(243, 247, 251, 0.72);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  padding: 0.78rem 0.9rem;
  border-radius: 0.85rem;
  color: #f3f7fb;
  text-decoration: none;
  font-size: 0.97rem;
  font-weight: 600;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.sidebar-link-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.95;
}

.sidebar-link-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-link-content {
  display: inline-flex;
  align-items: center;
  gap: 0.78rem;
  min-width: 0;
}

.sidebar-toggle {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.sidebar-toggle-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.sidebar-submenu {
  margin-top: 0.05rem;
  padding: 0.2rem 0 0 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  margin-left: 0.95rem;
}

.sidebar-submenu .sidebar-link {
  padding: 0.68rem 0.85rem 0.68rem 0.9rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: rgba(243, 247, 251, 0.92);
}

.sidebar-link-active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(243, 247, 251, 0.64);
}

.sidebar-user {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(243, 247, 251, 0.92);
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.75rem;
  padding-bottom: 2.5rem;
}

.app-footer {
  padding: 0.9rem 1.5rem 1.2rem;
  margin-top: auto;
}

@media (max-width: 1199.98px) {
  .mobile-topbar {
    display: flex;
  }

  .mobile-menu-button,
  .mobile-topbar-title {
    display: inline-flex;
  }

  .app-shell {
    height: auto;
    overflow: visible;
  }

  .app-main {
    height: auto;
    overflow: visible;
  }

  .app-content {
    overflow: visible;
    padding: 1rem;
  }

  .app-footer {
    padding: 0.8rem 1rem 1rem;
  }
}

@media (max-width: 575.98px) {
  .login-screen {
    padding: 1rem;
    align-items: flex-start;
  }

  .login-panel {
    padding: 1.4rem;
    border-radius: 0.9rem;
  }

  .login-title {
    font-size: 1.7rem;
  }
}
