.dispatch-civil-root {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  font-family: Inter, Arial, sans-serif;
}

.dispatch-civil-root.active {
  display: flex;
}

.dispatch-civil-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 35%),
    rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(10px);
}

.dispatch-civil-modal {
  position: relative;
  width: min(980px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10,18,40,.98), rgba(2,8,24,.98));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
  color: #e5edf9;
}

.dispatch-civil-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 26px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.dispatch-civil-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.dispatch-civil-header p {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 15px;
}

.dispatch-civil-close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}

.dispatch-civil-close:hover {
  background: rgba(255,255,255,.12);
}

.dispatch-civil-body {
  padding: 22px 26px;
  overflow-y: auto;
}

.dispatch-civil-body::-webkit-scrollbar {
  width: 8px;
}

.dispatch-civil-body::-webkit-scrollbar-track {
  background: transparent;
}

.dispatch-civil-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

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

.dispatch-civil-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dispatch-civil-field.full {
  grid-column: 1 / -1;
}

.dispatch-civil-field label {
  font-size: 14px;
  font-weight: 700;
  color: #d9e3f0;
}

.dispatch-civil-field input,
.dispatch-civil-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
  color: #f8fafc;
  border-radius: 15px;
  padding: 14px 15px;
  outline: none;
  transition: .16s ease;
  font-size: 14px;
}

.dispatch-civil-field textarea {
  min-height: 120px;
  resize: vertical;
}

.dispatch-civil-field input:focus,
.dispatch-civil-field textarea:focus {
  border-color: rgba(59,130,246,.8);
  box-shadow: 0 0 0 4px rgba(59,130,246,.13);
  background: rgba(255,255,255,.05);
}

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

.dispatch-civil-empty {
  opacity: .7;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.dispatch-dept-chip {
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.03));
  cursor: pointer;
  transition: .16s ease;
  text-align: left;
  color: #f8fafc;
}

.dispatch-dept-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04));
}

.dispatch-dept-chip.active {
  border-color: rgba(59,130,246,.9);
  background: linear-gradient(180deg, rgba(37,99,235,.22), rgba(29,78,216,.12));
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.22);
}

.dispatch-dept-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(255,255,255,.08);
  flex: 0 0 auto;
}

.dispatch-dept-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dispatch-dept-label {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
  word-break: break-word;
}

.dispatch-dept-cat {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dispatch-dept-check {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

.dispatch-dept-chip.active .dispatch-dept-check {
  background: rgba(59,130,246,.95);
}

.switch-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
}

.switch-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #3b82f6;
}

.dispatch-civil-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 26px 22px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.btn-ghost,
.btn-danger {
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: .16s ease;
}

.btn-ghost {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.12);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 16px 30px rgba(220,38,38,.25);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(220,38,38,.32);
}

.dispatch-civil-notif {
  position: absolute;
  right: 26px;
  bottom: 26px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  display: none;
  max-width: 360px;
  z-index: 3;
}

.dispatch-civil-notif.show {
  display: block;
}

.dispatch-civil-notif.success {
  background: rgba(34,197,94,.16);
  border: 1px solid rgba(34,197,94,.30);
  color: #dcfce7;
}

.dispatch-civil-notif.error {
  background: rgba(239,68,68,.16);
  border: 1px solid rgba(239,68,68,.30);
  color: #fee2e2;
}

@media (max-width: 900px) {
  .dispatch-civil-modal {
    width: 96vw;
    max-height: 94vh;
  }

  .dispatch-civil-grid,
  .dispatch-civil-departments {
    grid-template-columns: 1fr;
  }

  .dispatch-civil-footer {
    flex-direction: column;
  }

  .btn-ghost,
  .btn-danger {
    width: 100%;
  }
}

.dispatch-civil-hint {
  margin-top: -2px;
  font-size: 12px;
  color: #94a3b8;
}