.services-page {
  width: calc(100% - 48px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 0 70px;
  box-sizing: border-box;
}

.services-head {
  margin-bottom: 24px;
}

.services-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
}

.services-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.service-orders {
  margin-top: 34px;
}

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

.service-orders-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.service-orders-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.service-orders-link {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.service-orders-link:hover {
  text-decoration: underline;
}

.service-orders-list {
  display: grid;
  gap: 10px;
}

.service-order-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}

.service-order-card:hover {
  border-color: rgba(168,85,247,.65);
  background: #1a1a1a;
}

.service-order-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(168,85,247,.25);
  font-size: 16px;
  font-weight: 900;
}

.service-order-main {
  min-width: 0;
}

.service-order-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.service-order-title {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-order-type {
  color: var(--text-muted);
  font-size: 12px;
}

.service-order-last {
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-order-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.service-order-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.service-order-status.status-new {
  color: #fbbf24;
  background: rgba(251,191,36,.12);
}

.service-order-status.status-contacted {
  color: #60a5fa;
  background: rgba(96,165,250,.12);
}

.service-order-status.status-completed {
  color: #34d399;
  background: rgba(52,211,153,.12);
}

.service-order-status.status-closed {
  color: #d1d5db;
  background: rgba(156,163,175,.14);
}

.service-order-date {
  color: var(--text-muted);
  font-size: 11px;
}

.service-order-unread {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.service-orders-empty {
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.service-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, transform .15s, background .15s;
}

.service-card:hover {
  border-color: var(--accent);
  background: #1a1a1a;
  transform: translateY(-2px);
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(168,85,247,.25);
}

.service-card h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.service-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 3px 12px rgba(168,85,247,.25);
}

.service-btn:hover {
  opacity: .9;
}

.service-btn-secondary {
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  box-shadow: none;
}

.service-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
}

.service-modal-overlay.open {
  display: flex;
}

.service-modal {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}

.service-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--text-muted);
  cursor: pointer;
}

.service-modal-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.service-modal h2 {
  margin: 0 42px 20px 0;
  color: var(--text);
  font-size: 22px;
}

.service-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.service-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.service-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.service-field input,
.service-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 13px;
  outline: none;
}

.service-field textarea {
  resize: vertical;
  min-height: 132px;
}

.service-field input:focus,
.service-field textarea:focus {
  border-color: var(--accent);
  background: rgba(168,85,247,.05);
}

.service-form-error,
.service-form-success {
  min-height: 18px;
  font-size: 13px;
  margin-bottom: 12px;
}

.service-form-error {
  color: #ef9a9a;
}

.service-form-success {
  color: #81c784;
}

.service-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 820px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-form-grid {
    grid-template-columns: 1fr;
  }

  .service-order-card {
    grid-template-columns: 42px 1fr;
  }

  .service-order-side {
    grid-column: 2;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .services-page {
    width: calc(100% - 32px);
    padding-top: 24px;
  }

  .service-orders-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
