.doj-cr-page,
.doj-cr-page * {
  box-sizing: border-box;
}

.doj-cr-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(255,255,255,.96);
  min-height: 100%;
  padding: 4px;
}

.doj-cr-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.doj-cr-topbar h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.doj-cr-topbar p {
  margin: 6px 0 0;
  opacity: .72;
}

.doj-cr-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 1 1 720px;
}

.doj-cr-search-wrap {
  position: relative;
  flex: 1 1 360px;
  min-width: 260px;
}

.doj-cr-search,
.doj-cr-select,
.doj-cr-field input,
.doj-cr-field textarea,
.doj-cr-field select,
#dojCrCitizenSearch {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #fff;
  outline: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  transition: .18s ease;
}

.doj-cr-field select,
.doj-cr-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255,255,255,.04);
  color: #fff;
}

.doj-cr-field select option,
.doj-cr-select option {
  background: #0f1724;
  color: #ffffff;
}

.doj-cr-search:focus,
.doj-cr-select:focus,
.doj-cr-field input:focus,
.doj-cr-field textarea:focus,
.doj-cr-field select:focus,
#dojCrCitizenSearch:focus {
  border-color: rgba(0,170,255,.45);
  box-shadow: 0 0 0 3px rgba(0,170,255,.14);
  background: rgba(255,255,255,.06);
}

.doj-cr-select {
  min-width: 210px;
  max-width: 240px;
  flex: 0 0 210px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 12px center;
  background-size: auto, 16px;
  padding-right: 40px;
}

.doj-cr-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.doj-cr-btn:hover {
  transform: translateY(-1px);
}

.doj-cr-btn-primary {
  background: linear-gradient(135deg, #00aaff, #0077ff);
  color: #fff;
}

.doj-cr-btn-danger {
  background: linear-gradient(135deg, #ff4d67, #d81b60);
  color: #fff;
}

.doj-cr-btn-ghost {
  background: rgba(255,255,255,.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}

.doj-cr-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.doj-cr-stat-card,
.doj-cr-table-card,
.doj-cr-modal,
.doj-cr-view-card,
.doj-cr-selected-citizen,
.doj-cr-citizen-results {
  background: rgba(18,21,29,.92);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}

.doj-cr-stat-card {
  border-radius: 18px;
  padding: 16px;
}

.doj-cr-stat-card span {
  display: block;
  opacity: .66;
  font-size: 13px;
  margin-bottom: 8px;
}

.doj-cr-stat-card strong {
  font-size: 28px;
  font-weight: 800;
}

.doj-cr-table-card {
  border-radius: 20px;
  overflow: hidden;
}

.doj-cr-table-wrap {
  overflow: auto;
}

.doj-cr-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.doj-cr-table thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.64);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.doj-cr-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: middle;
}

.doj-cr-table tbody tr:hover {
  background: rgba(255,255,255,.03);
}

.doj-cr-empty {
  text-align: center;
  opacity: .7;
  padding: 26px !important;
}

.doj-cr-citizen-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doj-cr-citizen-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,170,255,.3), rgba(0,119,255,.22));
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.doj-cr-sub {
  margin-top: 3px;
  font-size: 12px;
  opacity: .62;
}

.doj-cr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 700;
}

.doj-cr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doj-cr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,7,12,.74);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 20px;
}

.doj-cr-modal-overlay.active {
  display: flex;
}

.doj-cr-modal {
  width: min(100%, 1100px);
  max-height: 92vh;
  border-radius: 22px;
  overflow: hidden;
}

.doj-cr-modal-sm {
  width: min(100%, 520px);
}

.doj-cr-modal-xl {
  width: min(100%, 1200px);
}

.doj-cr-modal-header,
.doj-cr-modal-footer {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.doj-cr-modal-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 0;
  justify-content: flex-end;
}

.doj-cr-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.doj-cr-modal-header p {
  margin: 5px 0 0;
  opacity: .68;
}

.doj-cr-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.doj-cr-modal-body {
  padding: 22px;
  overflow: auto;
  max-height: calc(92vh - 140px);
}

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

.doj-cr-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doj-cr-field-full {
  grid-column: 1 / -1;
}

.doj-cr-field label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.72);
}

.doj-cr-citizen-picker {
  position: relative;
}

.doj-cr-citizen-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border-radius: 16px;
  padding: 8px;
  display: none;
  z-index: 20;
  max-height: 260px;
  overflow: auto;
}

.doj-cr-citizen-results.active {
  display: block;
}

.doj-cr-citizen-result {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
}

.doj-cr-citizen-result:hover {
  background: rgba(255,255,255,.05);
}

.doj-cr-citizen-result span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  opacity: .66;
}

.doj-cr-selected-citizen {
  min-height: 56px;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.doj-cr-selected-citizen.empty {
  opacity: .62;
}

.doj-cr-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.doj-cr-view-card {
  border-radius: 18px;
  padding: 16px;
}

.doj-cr-view-card-full {
  grid-column: 1 / -1;
}

.doj-cr-view-card span {
  display: block;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 8px;
}

.doj-cr-view-card strong {
  font-size: 16px;
}

.doj-cr-view-card p {
  margin: 0;
  line-height: 1.6;
  opacity: .9;
}

.doj-cr-tag {
  display: inline-flex;
  margin: 0 8px 8px 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,170,255,.14);
  border: 1px solid rgba(0,170,255,.2);
  font-size: 13px;
  font-weight: 700;
}

.doj-cr-delete-text {
  line-height: 1.65;
  color: rgba(255,255,255,.9);
}

.doj-cr-table-wrap::-webkit-scrollbar,
.doj-cr-modal-body::-webkit-scrollbar,
.doj-cr-citizen-results::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.doj-cr-table-wrap::-webkit-scrollbar-thumb,
.doj-cr-modal-body::-webkit-scrollbar-thumb,
.doj-cr-citizen-results::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .doj-cr-stats {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .doj-cr-grid,
  .doj-cr-view-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .doj-cr-top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .doj-cr-search-wrap {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .doj-cr-select {
    flex: 1 1 220px;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .doj-cr-stats {
    grid-template-columns: 1fr;
  }
}

#dojCrOpenCreateBtn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doj-cr-field select {
  padding-right: 40px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 12px center;
  background-size: auto, 16px;
}