:root {
  color-scheme: light;
  --brand-orange: #ea580c;
  --brand-orange-light: #fff7ed;
  --brand-orange-mid: #fed7aa;
  --brand-orange-dark: #c2410c;
  --brand-dark: #3d3d3d;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --text-1: #111827;
  --text-2: #374151;
  --text-3: #6b7280;
  --text-4: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: #f5f6f8;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  min-height: 720px;
}

.sidebar {
  background: #fff;
  color: #4b5563;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  color: #1f2937;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-sub {
  color: #6b7280;
  font-size: 11px;
}

.brand-badge {
  align-self: flex-start;
  margin-top: 3px;
  border: 1px solid var(--brand-orange-mid);
  border-radius: 4px;
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: #fafbfc;
}

.avatar,
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f97316, var(--brand-orange));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
}

.user-role {
  color: var(--text-3);
  font-size: 10px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 16px;
}

.nav-section {
  padding: 14px 18px 6px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  border-left: 3px solid transparent;
  color: #4b5563;
  font-size: 12.5px;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.nav-item:hover {
  background: #f9fafb;
  color: #111827;
}

.nav-item.active {
  background: var(--brand-orange-light);
  border-left-color: var(--brand-orange);
  color: var(--brand-orange-dark);
  font-weight: 600;
}

.nav-item .icon {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  font-size: 12px;
}

.nav-item .count {
  margin-left: auto;
  min-width: 20px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  text-align: center;
}

.nav-item.active .count {
  background: var(--brand-orange-mid);
  color: var(--brand-orange-dark);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.main {
  display: grid;
  grid-template-rows: 52px 1fr;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 0 20px;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tab {
  border-radius: 6px;
  padding: 7px 12px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

.tab:hover {
  background: #f3f4f6;
}

.tab.active {
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-line {
  color: #6b7280;
  font-size: 11px;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-tool,
.btn-send {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
}

.btn-primary,
.btn-send {
  background: var(--brand-orange);
  color: #fff;
}

.btn-primary:hover,
.btn-send:hover {
  background: var(--brand-orange-dark);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover,
.btn-ghost:hover,
.btn-tool:hover {
  background: #e5e7eb;
}

.btn-ghost {
  color: #4b5563;
}

.content {
  overflow: hidden;
}

.tickets-view {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100%;
}

.list-panel {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-header {
  padding: 14px 18px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.list-title {
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
}

.list-count {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
}

.list-toolbar {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.search {
  position: relative;
  flex: 1;
}

.search::before {
  content: "🔍";
  position: absolute;
  left: 8px;
  top: 5px;
  opacity: 0.5;
  font-size: 11px;
}

.search input,
.sort-select,
.status-select,
.platform-select,
.composer-textarea,
.action-form input,
.action-form select,
.action-form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  padding: 6px 10px;
}

.search input {
  padding-left: 28px;
}

.search input:focus,
.sort-select:focus,
.composer-textarea:focus,
.action-form input:focus,
.action-form select:focus,
.action-form textarea:focus {
  border-color: transparent;
  outline: 2px solid var(--brand-orange);
  outline-offset: -1px;
}

.sort-select {
  width: 108px;
}

.ticket-list {
  flex: 1;
  overflow-y: auto;
}

.ticket-card {
  width: 100%;
  border-bottom: 1px solid var(--border-soft);
  border-left: 3px solid transparent;
  padding: 12px 18px;
  text-align: left;
  transition: background 0.1s;
}

.ticket-card:hover {
  background: #f9fafb;
}

.ticket-card.selected {
  background: var(--brand-orange-light);
  border-left-color: var(--brand-orange);
}

.tc-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tc-pri {
  flex-shrink: 0;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
}

.tc-pri.P1 { background: #fee2e2; color: #991b1b; }
.tc-pri.P2 { background: #fef3c7; color: #92400e; }
.tc-pri.P3 { background: #e0f2fe; color: #075985; }

.tc-from {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
}

.tc-time {
  flex-shrink: 0;
  color: #9ca3af;
  font-size: 10px;
}

.tc-subject {
  margin-bottom: 4px;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.tc-summary {
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tc-row3 {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  padding: 1px 6px;
  white-space: nowrap;
}

.tag-platform,
.tag-status-closed,
.tag-cat-other {
  background: #f3f4f6;
  color: #4b5563;
}

.tag-status-new,
.tag-cat-inquiry,
.tag-cat-logistics {
  background: #dbeafe;
  color: #1e40af;
}

.tag-status-processing {
  background: #fef3c7;
  color: #92400e;
}

.tag-missed {
  background: #fee2e2;
  color: #991b1b;
}

.tag-call-type {
  background: #ecfdf5;
  color: #047857;
  text-transform: capitalize;
}

.tag-cat-complaint,
.tag-cat-return_exchange {
  background: #fee2e2;
  color: #991b1b;
}

.pagination {
  border-top: 1px solid var(--border-soft);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6b7280;
  font-size: 11px;
}

.detail-panel {
  overflow-y: auto;
  background: #f5f6f8;
  padding: 18px 22px 32px;
}

.detail-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: #9ca3af;
  text-align: center;
}

.detail-header,
.card,
.thread,
.composer {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.detail-header {
  padding: 16px 18px;
  margin-bottom: 12px;
}

.dh-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.dh-subject {
  flex: 1;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.dh-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.dh-actions .status-select,
.dh-actions .platform-select {
  width: auto;
  min-width: 92px;
  max-width: 132px;
  padding: 4px 24px 4px 8px;
  font-size: 11px;
}

.dh-actions .platform-select {
  min-width: 118px;
}

.dh-meta,
.dh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dh-meta {
  color: #6b7280;
  font-size: 11px;
  margin-bottom: 10px;
}

.dh-meta strong {
  color: #374151;
  font-weight: 500;
}

.dh-tags {
  gap: 5px;
}

.card {
  padding: 14px 18px;
  margin-bottom: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.card-title {
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
}

.card-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
}

.card-icon-summary { background: #dbeafe; color: #1e40af; }
.card-icon-action,
.card-icon-reply { background: var(--brand-orange-light); color: var(--brand-orange-dark); }
.card-icon-score { background: #d1fae5; color: #065f46; }

.card-body-text,
.action-list,
.transcript-body,
.timeline,
.meta-grid {
  color: #374151;
  font-size: 12px;
  line-height: 1.6;
}

.action-list li {
  list-style: none;
  position: relative;
  margin-bottom: 4px;
  padding-left: 0;
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-order {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 10px 12px;
}

.related-order-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.related-order-id {
  color: #111827;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
}

.related-order-meta {
  color: #9a3412;
  font-size: 11px;
  margin-top: 2px;
}

.order-refresh-btn {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 9px;
}

.order-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.order-detail-empty {
  color: #9a3412;
  font-size: 11px;
  margin-top: 8px;
}

.order-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.order-info-block,
.order-section,
.tracking-card,
.order-json {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(251, 146, 60, 0.22);
  border-radius: 10px;
  margin-top: 8px;
  padding: 9px;
}

.order-info-title,
.order-section-title {
  color: #7c2d12;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.order-info-row,
.order-row-list div,
.tracking-event {
  display: grid;
  gap: 6px;
  grid-template-columns: 84px minmax(0, 1fr);
  line-height: 1.35;
  margin-top: 5px;
}

.order-info-row span,
.order-row-list span,
.tracking-event span,
.tracking-event em {
  color: #9a3412;
  font-size: 10px;
  font-style: normal;
}

.order-info-row strong,
.order-row-list strong,
.tracking-event strong {
  color: #111827;
  font-size: 11px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.tracking-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.tracking-head strong {
  color: #111827;
  font-size: 11px;
}

.tracking-head span,
.tracking-meta {
  color: #9a3412;
  font-size: 10px;
}

.tracking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.shipment-card {
  background: rgba(255, 247, 237, 0.72);
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 9px;
  margin-top: 8px;
  padding: 8px;
}

.shipment-no-events {
  color: #9a3412;
  font-size: 10px;
  margin-top: 7px;
}

.order-json summary {
  color: #9a3412;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-json pre {
  color: #374151;
  font-size: 10px;
  line-height: 1.45;
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.muted {
  color: #9ca3af;
}

.score-card .sc-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-title-wrap {
  align-items: center;
  display: flex;
  gap: 6px;
}

.sc-overall {
  align-items: baseline;
  display: flex;
  gap: 6px;
}

.sc-num {
  color: #111827;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.sc-grade {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
}

.sc-grade.A { background: #d1fae5; color: #065f46; }
.sc-grade.B { background: #fef3c7; color: #92400e; }
.sc-grade.C { background: #fee2e2; color: #991b1b; }

.sc-label,
.sc-meta {
  color: #6b7280;
  font-size: 11px;
}

.sc-meta {
  margin-bottom: 12px;
}

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

.sc-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.sc-row-label {
  color: #6b7280;
  flex-shrink: 0;
  font-size: 10px;
  width: 96px;
}

.sc-bar {
  background: #f3f4f6;
  border-radius: 999px;
  flex: 1;
  height: 6px;
  overflow: hidden;
}

.sc-fill {
  border-radius: 999px;
  height: 100%;
}

.sc-fill.A { background: #10b981; }
.sc-fill.B { background: #f59e0b; }
.sc-fill.C { background: #ef4444; }

.sc-val {
  color: #374151;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  width: 28px;
}

.sc-pending {
  background: var(--brand-orange-light);
  border: 1px dashed var(--brand-orange-mid);
  border-radius: 10px;
  color: #9a3412;
  padding: 14px;
  text-align: center;
}

.sc-pending .pending-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.sc-pending .pending-sub {
  color: var(--brand-orange-dark);
  font-size: 11px;
}

.call-score-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.call-score-pill {
  align-items: center;
  background: #f9fafb;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: #6b7280;
  display: inline-flex;
  font-size: 10px;
  gap: 6px;
  padding: 4px 8px;
}

.call-score-pill strong {
  color: #111827;
  font-size: 12px;
}

.sc-coach {
  background: #f9fafb;
  border-left: 3px solid var(--brand-orange);
  border-radius: 8px;
  color: #374151;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 12px;
  padding: 8px 10px;
}

.audio-player {
  width: 100%;
}

.call-recording-list {
  display: grid;
  gap: 12px;
}

.call-recording-item {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.call-recording-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 11px;
}

.call-recording-meta strong {
  color: #374151;
}

.transcript-call-block {
  border-top: 1px solid var(--border-soft);
  margin-top: 10px;
  padding-top: 10px;
}

.transcript-call-block:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.transcript-call-title {
  color: var(--brand-orange-dark);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.transcript-call-body {
  white-space: pre-wrap;
}

.transcript-call-body.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.transcript-toggle {
  background: transparent;
  color: var(--brand-orange-dark);
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  padding: 0;
}

.transcript-body {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.turn {
  display: flex;
  gap: 10px;
}

.turn .who {
  width: 70px;
  flex-shrink: 0;
  color: var(--brand-orange-dark);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.turn .text {
  flex: 1;
}

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

.meta-row .k {
  color: #6b7280;
  font-size: 10px;
}

.meta-row .v {
  color: #111827;
  font-weight: 600;
  word-break: break-word;
}

.badge-order,
.badge-sku {
  border-radius: 4px;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
}

.badge-order { background: var(--brand-dark); }
.badge-sku { background: var(--brand-orange); }

.tc-score-badge {
  align-items: center;
  border: 1px solid;
  border-radius: 10px;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  gap: 4px;
  line-height: 1.25;
  padding: 1px 6px;
}

.tc-score-badge .num {
  font-size: 10px;
  font-weight: 500;
}

.tc-score-badge .lv {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}

.tc-score-badge.A {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.tc-score-badge.B {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.tc-score-badge.C {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.tc-score-badge.pending {
  background: var(--brand-orange-light);
  border-color: var(--brand-orange-mid);
  color: var(--brand-orange-dark);
}

.thread {
  margin-bottom: 12px;
}

.msg {
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 16px;
}

.msg:last-child {
  border-bottom: 0;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-avatar.in {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.msg-avatar.out {
  background: linear-gradient(135deg, #f97316, var(--brand-orange));
}

.msg-from {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 11px;
  font-weight: 500;
}

.msg-time {
  color: #9ca3af;
  font-size: 10px;
}

.msg-direction {
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
}

.msg-direction.in {
  background: #dbeafe;
  color: #1e40af;
}

.msg-direction.out {
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
}

.msg-body {
  color: #374151;
  font-size: 12px;
  line-height: 1.6;
  padding-left: 34px;
  white-space: pre-wrap;
}

.composer {
  padding: 14px 16px;
}

.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.composer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
}

.composer-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.7;
}

.composer-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.composer-actions .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.action-form {
  display: grid;
  gap: 10px;
}

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

.address-grid .wide {
  grid-column: 1 / -1;
}

.action-form label {
  display: grid;
  gap: 4px;
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
}

.action-section {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--brand-orange-mid);
  border-radius: 8px;
  background: var(--brand-orange-light);
  padding: 10px;
}

.form-message,
.action-message {
  min-height: 16px;
  color: #dc2626;
  font-size: 11px;
}

.hide {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 20px;
}

.modal-card {
  width: min(420px, 100%);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head {
  margin-bottom: 12px;
}

.modal-head h3 {
  color: #111827;
  font-size: 15px;
}

.modal-head button {
  color: #6b7280;
  font-size: 22px;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-form label {
  display: grid;
  gap: 4px;
  color: #6b7280;
  font-size: 11px;
}

.modal-form input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 220px 1fr;
  }

  .tickets-view {
    grid-template-columns: 340px 1fr;
  }
}

@media (max-width: 860px) {
  .app,
  .main,
  .tickets-view {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    max-height: 55vh;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px;
  }

  .detail-panel {
    min-height: 420px;
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }
}
