* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f4f6fb;
  color: #111827;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
}

input,
button,
select,
textarea {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button.ghost {
  background: #eef2ff;
  color: #1d4ed8;
}

.muted {
  color: #6b7280;
}

.error {
  color: #dc2626;
  min-height: 18px;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.stat h4 {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  background: #e5e7eb;
  color: #111827;
}

.tab.active {
  background: #2563eb;
  color: #fff;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
}

.panel {
  display: grid;
  gap: 10px;
}

.toolbar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 170px 170px auto;
  gap: 8px;
}

.item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.item h4 {
  margin: 0 0 8px;
}

.item p {
  margin: 0;
  color: #4b5563;
  line-height: 1.5;
}

.pill {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e0e7ff;
  color: #3730a3;
}

.actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-chip {
  display: inline-block;
  margin-right: 8px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
}

.service-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

textarea {
  margin-top: 8px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.message-list {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}

.msg {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d1d5db;
}

.msg:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}

.msg-image {
  max-width: 180px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  display: block;
}

.order-image-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.order-image-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
}

.mini-link {
  font-size: 12px;
  color: #1d4ed8;
  text-decoration: none;
}

.composer {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.composer-2 {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
}

.req-editor {
  margin-top: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.req-row {
  display: grid;
  grid-template-columns: 1fr 120px 90px auto;
  gap: 8px;
  margin-bottom: 8px;
  cursor: move;
}

.req-row.dragging {
  opacity: 0.6;
}

dialog {
  width: min(900px, 92vw);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  max-height: 55vh;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}
