html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

:root {
  --green-900: #082d24;
  --green-800: #0d4234;
  --green-700: #11543f;
  --green-600: #17684e;
  --gold-500: #d5a13b;
  --saffron-500: #cb6f2d;
  --ink-900: #12221c;
  --ink-600: #52645d;
  --line: #dbe5df;
  --surface: #f4f7f5;
  --panel: #ffffff;
}

* {
  letter-spacing: 0;
}

body {
  color: var(--ink-900);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
}

.app-body {
  background:
    linear-gradient(135deg, rgba(17, 84, 63, .07), transparent 34%),
    linear-gradient(315deg, rgba(213, 161, 59, .09), transparent 32%),
    var(--surface);
}

.app-body-auth {
  overflow: hidden;
}

.app-body-login {
  overflow: auto;
}

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

.app-sidebar {
  background:
    linear-gradient(180deg, var(--green-900), var(--green-700));
  box-shadow: 10px 0 28px rgba(8, 45, 36, .18);
  color: #fff;
  flex: 0 0 272px;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  position: sticky;
  top: 0;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 18px 14px;
  width: 100%;
}

.sidebar-brand,
.sidebar-brand:hover {
  align-items: center;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  margin-bottom: 22px;
  text-decoration: none;
}

.sidebar-brand strong {
  display: block;
  font-size: .98rem;
  line-height: 1.15;
}

.sidebar-brand small {
  color: rgba(255, 255, 255, .68);
  display: block;
  font-size: .76rem;
}

.sidebar-brand.compact {
  margin-bottom: 0;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--gold-500), #f0c866);
  border-radius: 8px;
  color: #13251f;
  display: inline-flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.logo-mark {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .7);
  overflow: hidden;
  padding: 2px;
}

.logo-mark img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.login-logo-mark {
  background: #fff;
  border: 1px solid #dce6e0;
  border-radius: 10px;
  display: inline-flex;
  height: 92px;
  justify-content: center;
  padding: 8px;
  width: 108px;
}

.login-logo-mark img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.sidebar-label {
  color: rgba(255, 255, 255, .54);
  font-size: .72rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px 0 0;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .25);
  border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  align-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, .84);
  display: flex;
  flex: 0 0 42px;
  font-weight: 650;
  gap: 10px;
  height: 42px;
  overflow: hidden;
  padding: 0 11px;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.sidebar-nav i {
  color: var(--gold-500);
  font-size: 1.05rem;
  width: 20px;
}

.sidebar-menu-group {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  flex: 0 0 auto;
  padding: 6px;
}

.compact-group {
  padding-bottom: 7px;
}

.sidebar-menu-title {
  align-items: center;
  color: #fff;
  display: flex;
  font-weight: 800;
  gap: 10px;
  height: 34px;
  overflow: hidden;
  padding: 0 7px;
  white-space: nowrap;
}

.sidebar-menu-title i {
  color: var(--gold-500);
  font-size: 1.05rem;
  width: 20px;
}

.sidebar-subnav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: 13px;
  padding-left: 12px;
  position: relative;
}

.sidebar-subnav::before {
  background: rgba(213, 161, 59, .5);
  bottom: 7px;
  content: "";
  left: 0;
  position: absolute;
  top: 7px;
  width: 1px;
}

.sidebar-subnav a {
  flex-basis: 34px;
  font-size: .91rem;
  height: 34px;
  padding: 0 9px;
}

.sidebar-foot {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 12px;
}

.sidebar-foot span {
  color: rgba(255, 255, 255, .66);
  display: block;
  font-size: .78rem;
}

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

.app-topbar {
  align-items: center;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 22px;
  position: relative;
  z-index: 20;
}

.topbar-kicker {
  color: var(--green-700);
  font-size: .74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
}

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

.user-chip {
  align-items: center;
  background: #edf4f0;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 7px;
  max-width: 240px;
  overflow: hidden;
  padding: 7px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 42px;
}

.app-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.app-alert {
  border: 0;
  border-left: 4px solid currentColor;
  box-shadow: 0 12px 26px rgba(18, 34, 28, .08);
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-form-panel {
  align-items: center;
  display: flex;
  justify-content: center;
  max-width: 620px;
  width: 100%;
}

.auth-form-panel .row {
  width: 100%;
}

.login-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.login-card {
  margin: 0 auto;
  max-width: 440px;
  padding: 24px;
  width: min(440px, 100%);
}

.login-brand {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  text-align: center;
}

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

.login-brand strong {
  font-size: 1.06rem;
  line-height: 1.25;
}

.login-brand small {
  color: var(--ink-600);
}

.page-heading {
  align-items: flex-end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-title {
  font-size: 1.34rem;
  font-weight: 850;
  margin: 0;
}

.page-subtitle {
  color: var(--ink-600);
  margin: 3px 0 0;
}

.toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  margin-bottom: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 34, 28, .06);
  min-height: 104px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.stat-card::before {
  background: var(--gold-500);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.stat-card i {
  color: var(--green-700);
  float: right;
  font-size: 1.22rem;
}

.stat-card span {
  color: var(--ink-600);
  display: block;
  font-size: .82rem;
}

.stat-card strong {
  display: block;
  font-size: 1.7rem;
  margin-top: 8px;
}

.data-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 34, 28, .06);
  padding: 16px;
}

.filter-panel {
  background:
    linear-gradient(135deg, rgba(17, 84, 63, .05), transparent 34%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 34, 28, .06);
  padding: 13px 16px;
}

.filter-panel-head {
  align-items: center;
  border-bottom: 1px solid #edf2ef;
  display: flex;
  justify-content: space-between;
  margin-bottom: 11px;
  padding-bottom: 10px;
}

.filter-panel-head strong {
  display: block;
  font-size: .98rem;
  font-weight: 850;
}

.filter-kicker {
  color: var(--green-700);
  display: block;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(260px, 1.2fr) 92px;
}

.district-filter-grid {
  grid-template-columns: minmax(260px, 1fr) 92px;
}

.block-filter-grid {
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.4fr) 92px;
}

.filter-field {
  display: grid;
  gap: 5px;
}

.filter-field span {
  color: #263c34;
  font-size: .78rem;
  font-weight: 850;
}

.filter-field .form-control,
.filter-field .form-select {
  background-color: #fbfdfc;
  min-height: 38px;
}

.active-filter-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  min-height: 30px;
}

.filter-muted {
  color: var(--ink-600);
  font-size: .86rem;
  font-weight: 700;
}

.filter-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 800;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
}

.district-chip {
  background: #eef7f3;
  border: 1px solid #c9e1d7;
  color: var(--green-800);
}

.block-chip {
  background: #fff5df;
  border: 1px solid #efd39d;
  color: #704f0b;
}

.search-chip {
  background: #f4f0ff;
  border: 1px solid #d9cef8;
  color: #4d348d;
}

.manager-create-shell {
  display: block;
  max-width: 1040px;
}

.manager-create-shell .validation-summary-valid {
  display: none;
}

.manager-form-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(18, 34, 28, .07);
}

.manager-form-panel {
  padding: 16px;
}

.form-section-title {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.form-section-title > span {
  align-items: center;
  background: #eef7f3;
  border: 1px solid #c9e1d7;
  border-radius: 8px;
  color: var(--green-700);
  display: inline-flex;
  flex: 0 0 34px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
}

.form-section-title h2 {
  font-size: .98rem;
  font-weight: 900;
  margin: 0;
}

.form-section-title p {
  color: var(--ink-600);
  font-size: .84rem;
  margin: 0;
}

.manager-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.manager-form-grid.single {
  grid-template-columns: minmax(240px, 420px);
}

.manager-submit-row {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
}

.application-shell {
  display: block;
}

.application-form-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(18, 34, 28, .07);
}

.application-form-panel {
  padding: 16px;
}

.location-readonly {
  background: #fff;
  color: var(--green-800);
  font-weight: 800;
}

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

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

.required-label::after {
  color: #b42318;
  content: " *";
  font-weight: 900;
}

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

.document-card {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.document-sample {
  background:
    linear-gradient(135deg, rgba(17, 84, 63, .05), transparent),
    #fff;
  border: 1px solid #d9e5df;
  border-radius: 8px;
  display: flex;
  height: 132px;
  justify-content: center;
  margin-bottom: 11px;
  overflow: hidden;
}

.document-sample img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.document-card-head {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 7px;
}

.document-card-head .form-label {
  margin-bottom: 0;
}

.document-card-head span {
  background: #eef7f3;
  border: 1px solid #c9e1d7;
  border-radius: 999px;
  color: var(--green-700);
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 850;
  padding: 4px 8px;
}

.document-card small {
  color: var(--ink-600);
  display: block;
  font-size: .78rem;
  font-weight: 700;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.upload-preview {
  margin-top: 10px;
}

.upload-preview-empty,
.upload-preview-file,
.upload-preview-meta {
  align-items: center;
  border-radius: 8px;
  display: flex;
  gap: 8px;
}

.upload-preview-empty {
  background: #f3f7f5;
  border: 1px dashed #c3d4cc;
  color: var(--ink-600);
  font-size: .82rem;
  font-weight: 700;
  min-height: 42px;
  padding: 9px 10px;
}

.upload-preview-empty i {
  color: var(--green-700);
}

.upload-preview-image {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 112px;
  overflow: hidden;
}

.upload-preview-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.upload-preview-meta {
  color: var(--green-700);
  font-size: .78rem;
  font-weight: 800;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.upload-preview-file {
  background: #fff8eb;
  border: 1px solid #ead3a7;
  min-height: 58px;
  padding: 10px;
}

.upload-preview-file i {
  color: #b66a22;
  font-size: 1.45rem;
}

.upload-preview-file strong,
.upload-preview-file span {
  display: block;
  overflow-wrap: anywhere;
}

.upload-preview-file strong {
  font-size: .84rem;
}

.upload-preview-file span {
  color: var(--ink-600);
  font-size: .78rem;
  font-weight: 700;
}

.application-actions {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
}

.final-submit-panel {
  align-items: center;
  background: #fff8eb;
  border: 1px solid #ead3a7;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 13px;
}

.final-submit-panel strong,
.final-submit-panel span {
  display: block;
}

.final-submit-panel span {
  color: var(--ink-600);
  font-size: .86rem;
}

.review-print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(18, 34, 28, .07);
  max-width: 980px;
  padding: 14px;
}

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

.review-print-head {
  align-items: center;
  background: linear-gradient(90deg, #eef7f3, #fff8eb);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.review-print-head h2 {
  font-size: 1.08rem;
  font-weight: 900;
  margin: 1px 0;
}

.review-print-head p {
  color: var(--ink-600);
  font-size: .82rem;
  margin: 0;
}

.review-print-head > div > span,
.review-id-box span {
  color: var(--green-700);
  display: block;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-id-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 138px;
  padding: 8px 10px;
  text-align: right;
}

.review-id-box strong {
  display: block;
  font-size: 1.22rem;
}

.compact-review-table {
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
  width: 100%;
}

.compact-review-table th,
.compact-review-table td {
  border: 1px solid #dce6e0;
  padding: 7px 9px;
  vertical-align: top;
}

.compact-review-table th {
  background: #f3f8f5;
  color: var(--green-800);
  font-size: .76rem;
  font-weight: 900;
  width: 17%;
}

.compact-review-table td {
  color: var(--ink-900);
  font-size: .88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  width: 33%;
}

.compact-documents {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.compact-document {
  border: 1px solid #dce6e0;
  border-radius: 8px;
  padding: 7px;
}

.compact-document-thumb {
  align-items: center;
  background: #f4f7f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  height: 76px;
  justify-content: center;
  margin-bottom: 6px;
  overflow: hidden;
}

.compact-document-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.compact-document-thumb i {
  color: #b66a22;
  font-size: 1.5rem;
}

.compact-document span {
  color: var(--green-800);
  display: block;
  font-size: .75rem;
  font-weight: 900;
}

.compact-document strong {
  display: block;
  font-size: .72rem;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.declaration-panel {
  align-items: flex-start;
  background: #fff8eb;
  border: 1px solid #ead3a7;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-top: 16px;
  padding: 13px;
}

.declaration-panel p {
  color: var(--ink-600);
  margin: 4px 0 0;
}

.declaration-panel .form-check {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 260px;
  padding: 11px 12px 11px 38px;
}

.review-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
}

.compact-declaration {
  background: #fff8eb;
  border: 1px solid #ead3a7;
  border-radius: 8px;
  color: var(--ink-900);
  font-size: .86rem;
  line-height: 1.35;
  margin-top: 8px;
  padding: 9px 10px;
}

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

.guidance-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 34, 28, .05);
  display: flex;
  gap: 12px;
  padding: 14px;
}

.guidance-card i {
  align-items: center;
  background: #edf5f0;
  border-radius: 8px;
  color: var(--green-700);
  display: inline-flex;
  flex: 0 0 34px;
  height: 34px;
  justify-content: center;
}

.guidance-card h2 {
  font-size: .95rem;
  font-weight: 850;
  margin: 0 0 4px;
}

.guidance-card p {
  color: var(--ink-600);
  font-size: .88rem;
  margin: 0;
}

.form-hint {
  align-items: center;
  background: #f2f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #375249;
  display: flex;
  font-size: .88rem;
  gap: 8px;
  padding: 9px 11px;
}

.empty-state {
  align-items: center;
  color: var(--ink-600);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  text-align: center;
}

.empty-state i {
  color: var(--green-700);
  font-size: 2rem;
  margin-bottom: 8px;
}

.empty-state h2 {
  color: var(--ink-900);
  font-size: 1.05rem;
  font-weight: 850;
  margin: 0 0 5px;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
}

.section-title {
  font-size: .98rem;
  font-weight: 850;
  margin: 0 0 12px;
}

.form-label {
  color: #263c34;
  font-size: .9rem;
  font-weight: 750;
}

.form-control,
.form-select {
  border-color: #ccd9d3;
  border-radius: 7px;
  min-height: 40px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 .18rem rgba(17, 84, 63, .14);
}

.field-validation-error,
.validation-summary-errors {
  color: #b42318;
  font-size: .84rem;
  font-weight: 700;
}

.input-validation-error {
  border-color: #d92d20;
}

.btn {
  border-radius: 7px;
  font-weight: 700;
}

.btn-success {
  background: var(--green-700);
  border-color: var(--green-700);
}

.btn-success:hover {
  background: var(--green-800);
  border-color: var(--green-800);
}

.btn-premium {
  background: linear-gradient(90deg, var(--green-700), var(--saffron-500));
  border: 0;
  color: #fff;
}

.btn-premium:hover,
.btn-premium:focus {
  color: #fff;
  filter: brightness(.96);
}

.row-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-soft-action {
  background: #eef7f3;
  border: 1px solid #bdd8cc;
  color: var(--green-700);
  font-weight: 750;
}

.btn-soft-action:hover,
.btn-soft-action:focus {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}

.btn-soft-danger {
  background: #fff5ef;
  border: 1px solid #efc8b2;
  color: #a94d1d;
  font-weight: 750;
}

.btn-soft-danger:hover,
.btn-soft-danger:focus {
  background: #a94d1d;
  border-color: #a94d1d;
  color: #fff;
}

.app-modal {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(18, 34, 28, .28);
}

.app-modal .modal-header {
  background: linear-gradient(90deg, #f7fbf8, #fff7eb);
  border-bottom: 1px solid var(--line);
}

.app-modal .modal-title {
  color: var(--ink-900);
  font-weight: 850;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: .76rem;
  font-weight: 850;
  padding: 5px 9px;
}

.status-draft {
  background: #fff7e6;
  color: #9a5b00;
}

.status-final {
  background: #e6f4ee;
  color: #0d6047;
}

.table {
  vertical-align: middle;
}

.table thead th {
  color: #40564f;
  font-size: .79rem;
  text-transform: uppercase;
}

.application-list-panel {
  padding: 18px;
}

.application-filter-strip {
  align-items: end;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 190px) minmax(260px, 1fr) 100px;
  margin-bottom: 14px;
  padding: 12px;
}

.application-search-field {
  min-width: 0;
}

.application-workflow-table tbody tr {
  border-left: 4px solid transparent;
}

.application-row-draft {
  border-left-color: var(--gold-500) !important;
}

.application-row-final {
  border-left-color: var(--green-700) !important;
}

.application-workflow-table td strong,
.application-workflow-table td small {
  display: block;
}

.application-workflow-table td small {
  color: var(--ink-600);
  font-size: .75rem;
  margin-top: 2px;
}

.app-id-link {
  color: var(--green-700);
  font-weight: 900;
  text-decoration: none;
}

.app-id-link:hover {
  text-decoration: underline;
}

.filter-mark {
  background: linear-gradient(180deg, #fff3bd, #ffd96f);
  border: 1px solid rgba(181, 117, 18, .28);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(181, 117, 18, .18);
  color: #3b2a00;
  font-weight: 900;
  padding: 1px 4px;
}

.district-filter-match {
  background: linear-gradient(90deg, rgba(13, 66, 52, .12), rgba(13, 66, 52, .03));
  box-shadow: inset 4px 0 0 var(--green-700);
  color: var(--green-800);
  font-weight: 800;
}

.block-filter-match {
  background: linear-gradient(90deg, rgba(213, 161, 59, .2), rgba(213, 161, 59, .04));
  box-shadow: inset 4px 0 0 var(--gold-500);
  color: #6f4b05;
  font-weight: 800;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
}

.pagination-bar {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
}

.pagination-bar span {
  color: var(--ink-600);
  font-size: .9rem;
  font-weight: 700;
}

.mobile-sidebar {
  background: var(--green-900);
  color: #fff;
}

@media (max-width: 991px) {
  .app-body-auth {
    overflow: auto;
  }

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

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

  .app-content {
    overflow: visible;
    padding: 14px;
  }

  .app-topbar {
    align-items: center;
    padding: 12px 14px;
    position: sticky;
    top: 0;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .user-chip {
    display: none;
  }

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

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

  .application-search-field {
    grid-column: 1 / -1;
  }

  .filter-search {
    grid-column: 1 / -1;
  }

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

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

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

@media (max-width: 768px) {
  .auth-shell {
    align-items: flex-start;
    padding: 14px;
  }

  .auth-form-panel {
    max-width: none;
  }

  .page-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-panel-head {
    align-items: flex-start;
    gap: 8px;
  }

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

  .application-filter-strip {
    grid-template-columns: 1fr;
  }

  .application-search-field {
    grid-column: auto;
  }

  .rows-field {
    max-width: 140px;
  }

  .manager-page-heading .btn {
    width: 100%;
  }

  .manager-form-panel {
    border-radius: 8px;
    padding: 14px;
  }

  .manager-form-grid,
  .manager-form-grid.two,
  .manager-form-grid.single {
    grid-template-columns: 1fr;
  }

  .form-section-title {
    align-items: flex-start;
  }

  .manager-submit-row {
    display: grid;
  }

  .manager-submit-row .btn {
    min-height: 44px;
  }

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

  .application-form-panel {
    padding: 14px;
  }

  .application-actions,
  .final-submit-panel,
  .review-actions,
  .declaration-panel {
    align-items: stretch;
    display: grid;
  }

  .compact-documents {
    grid-template-columns: 1fr;
  }

  .declaration-panel .form-check {
    min-width: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body,
  .app-body {
    background: #fff !important;
  }

  .app-sidebar,
  .app-topbar,
  .page-heading,
  .app-alert,
  .review-screen-only {
    display: none !important;
  }

  .app-frame,
  .app-main,
  .app-content {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .review-print-sheet {
    border: 0;
    box-shadow: none;
    max-width: none;
    padding: 0;
  }

  .review-print-head,
  .compact-review-table th,
  .compact-document,
  .compact-declaration {
    break-inside: avoid;
  }
}
