/**
 * ALVIRAN Desk v3.0 - Modern SaaS Dashboard
 * Premium Design mit ALVIRAN Brand Identity
 */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Core Colors */
  --bg-base: #08080c;
  --bg-surface: #0f0f14;
  --bg-elevated: #16151d;
  --bg-hover: #1c1b25;
  --bg-active: #242330;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(249, 200, 108, 0.5);

  /* Text */
  --text-primary: #f8f8fa;
  --text-secondary: #a8a8b3;
  --text-muted: #6b6b78;
  --text-inverse: #08080c;

  /* Brand - ALVIRAN Gold */
  --gold: #f9c86c;
  --gold-dim: #d4a84d;
  --gold-glow: rgba(249, 200, 108, 0.15);

  /* Accent - Purple */
  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-dim: #7c5dcc;
  --accent-glow: rgba(167, 139, 250, 0.15);

  /* Semantic */
  --success: #34d399;
  --success-dim: #059669;
  --success-glow: rgba(52, 211, 153, 0.15);

  --warning: #fbbf24;
  --warning-dim: #d97706;
  --warning-glow: rgba(251, 191, 36, 0.15);

  --danger: #f87171;
  --danger-dim: #dc2626;
  --danger-glow: rgba(248, 113, 113, 0.15);

  --info: #60a5fa;
  --info-dim: #2563eb;
  --info-glow: rgba(96, 165, 250, 0.15);

  /* Teal */
  --teal: #2dd4bf;
  --teal-glow: rgba(45, 212, 191, 0.15);

  /* Game Colors */
  --game-valorant: #ff4655;
  --game-rainbow: #00a0e9;
  --game-fortnite: #9d4dbb;
  --game-lol: #c89b3c;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(249, 200, 108, 0.1);

  /* Animation */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* Account support cases */
.alvd-cases-workbench {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.alvd-case-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 10px;
}

.alvd-case-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.alvd-case-list,
.alvd-case-detail {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(13, 14, 21, .72);
  border-radius: 16px;
}

.alvd-case-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.alvd-case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.alvd-case-row:last-child {
  border-bottom: 0;
}

.alvd-case-row:hover,
.alvd-case-row.active {
  background: rgba(214, 173, 85, .08);
}

.alvd-case-row.is-unread {
  box-shadow: inset 3px 0 0 #f4d58a;
}

.alvd-case-row-main,
.alvd-case-row-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.alvd-case-row-main strong,
.alvd-case-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-case-row-main small,
.alvd-case-row-meta small {
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-case-row-meta {
  justify-items: end;
  flex: 0 0 auto;
}

.alvd-case-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .04);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.alvd-case-badge.is-live {
  color: #55d6a2;
  border-color: rgba(85, 214, 162, .24);
  background: rgba(85, 214, 162, .10);
}

.alvd-case-badge.is-waiting {
  color: #f4d58a;
  border-color: rgba(244, 213, 138, .28);
  background: rgba(244, 213, 138, .10);
}

.alvd-case-badge.is-muted {
  color: #9ca3af;
  border-color: rgba(156, 163, 175, .20);
}

.alvd-case-detail {
  padding: 18px;
}

.alvd-case-detail.is-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
}

.alvd-case-detail.is-empty svg {
  width: 42px;
  height: 42px;
  color: #d6ad55;
}

.alvd-case-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.alvd-case-detail-head h2 {
  margin: 4px 0;
  font-size: 26px;
}

.alvd-case-detail-head p {
  margin: 0;
  color: var(--text-muted);
}

.alvd-case-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.alvd-case-context,
.alvd-case-context-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.alvd-case-context {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.alvd-case-context-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.alvd-case-info-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .026));
}

.alvd-case-info-card h3 {
  margin: 0 0 10px;
  color: #f4d58a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.alvd-case-info-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alvd-case-info-row {
  min-width: 0;
}

.alvd-case-info-row.is-wide {
  grid-column: 1 / -1;
}

.alvd-case-info-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.alvd-case-info-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.alvd-case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.alvd-case-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(249, 200, 108, .24);
  border-radius: 8px;
  color: #f4d58a;
  background: rgba(249, 200, 108, .08);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.alvd-case-problem-card {
  grid-column: 1 / -1;
}

.alvd-case-problem-card p {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: var(--text-secondary);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.alvd-case-context span {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
}

.alvd-case-context strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.alvd-case-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.alvd-case-message {
  max-width: 82%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.alvd-case-message.is-customer {
  margin-left: auto;
  border-color: rgba(214, 173, 85, .22);
  background: rgba(214, 173, 85, .08);
}

.alvd-case-message.is-system {
  max-width: 100%;
  color: var(--text-muted);
  text-align: center;
  background: transparent;
}

.alvd-case-message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.alvd-case-message-head strong {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.alvd-case-agent {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.alvd-case-message-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-case-message p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.55;
}

.alvd-case-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.alvd-case-attachment {
  color: #f4d58a;
  font-size: 12px;
}

.alvd-case-attachment.is-image img {
  width: 110px;
  height: 82px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
}

.alvd-case-reply {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.alvd-case-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.alvd-case-reply-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.alvd-case-pending-attachments {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.alvd-case-pending-attachment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  width: min(100%, 230px);
  min-height: 42px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.alvd-case-pending-attachment img,
.alvd-case-pending-file {
  width: 34px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, .22);
}

.alvd-case-pending-file {
  display: grid;
  place-items: center;
  color: #f4d58a;
}

.alvd-case-pending-file svg {
  width: 16px;
  height: 16px;
}

.alvd-case-pending-attachment strong {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-remove-attachment {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

.case-remove-attachment:hover,
.case-remove-attachment:focus-visible {
  outline: 0;
  border-color: rgba(248, 113, 113, .34);
  color: var(--danger);
  background: rgba(248, 113, 113, .08);
}

.case-quick-reply {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.case-quick-reply:hover,
.case-quick-reply:focus-visible {
  outline: 0;
  border-color: rgba(249, 200, 108, .34);
  background: rgba(249, 200, 108, .10);
  color: var(--text-primary);
}

.alvd-case-reply.is-locked {
  min-height: 58px;
  align-items: center;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  padding: 14px;
}

.alvd-case-reply textarea {
  min-height: 108px;
  resize: vertical;
}

.alvd-case-reply-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

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

  .alvd-case-list {
    max-height: 340px;
    overflow: auto;
  }
}

@media (max-width: 720px) {
  .alvd-case-toolbar,
  .alvd-case-context,
  .alvd-case-context-grid,
  .alvd-case-info-rows {
    grid-template-columns: 1fr;
  }

  .alvd-case-detail-head,
  .alvd-case-reply-foot {
    display: grid;
  }

  .alvd-case-reply-tools,
  .alvd-case-pending-attachments {
    display: grid;
    grid-template-columns: 1fr;
  }

  .alvd-case-pending-attachment {
    width: 100%;
  }

  .alvd-case-message {
    max-width: 94%;
  }
}

/* Case workbench polish */
.alvd-cases-workbench {
  gap: 14px;
}

.alvd-cases-workbench .alvd-case-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-color: rgba(255, 255, 255, .10);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(20, 21, 29, .98), rgba(10, 11, 16, .96)),
    radial-gradient(circle at 8% 0%, rgba(249, 200, 108, .12), transparent 30%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .20);
}

.alvd-case-head-copy {
  min-width: 0;
}

.alvd-cases-workbench .alvd-case-head h2 {
  margin: 3px 0 5px;
  font-size: 22px;
  line-height: 1.1;
}

.alvd-cases-workbench .alvd-case-head p {
  max-width: 540px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.alvd-case-head-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.alvd-case-head-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 6px;
  min-width: min(100%, 330px);
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(0, 0, 0, .18);
}

.alvd-case-head-stats span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
}

.alvd-case-head-stats strong {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.alvd-case-head-stats small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.alvd-cases-workbench .alvd-case-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.alvd-case-toolbar .alvd-input {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(5, 6, 10, .58);
}

.alvd-cases-workbench .alvd-case-grid {
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.alvd-cases-workbench .alvd-case-list,
.alvd-cases-workbench .alvd-case-detail {
  border-color: rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(14, 15, 22, .86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.alvd-cases-workbench .alvd-case-list {
  align-self: start;
  gap: 7px;
  min-height: 0;
  max-height: calc(100vh - 236px);
  padding: 8px;
  overflow: auto;
}

.alvd-cases-workbench .alvd-case-list .alvd-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
}

.alvd-cases-workbench .alvd-case-row {
  min-height: 72px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, .024);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.alvd-cases-workbench .alvd-case-row:last-child {
  border-bottom: 1px solid transparent;
}

.alvd-cases-workbench .alvd-case-row:hover {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .045);
  transform: translateY(-1px);
}

.alvd-cases-workbench .alvd-case-row.active {
  border-color: rgba(249, 200, 108, .34);
  background: linear-gradient(135deg, rgba(249, 200, 108, .13), rgba(255, 255, 255, .035));
  box-shadow: inset 3px 0 0 rgba(249, 200, 108, .76);
}

.alvd-case-row-main strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.25;
}

.alvd-case-row-main small,
.alvd-case-row-meta small {
  line-height: 1.35;
}

.alvd-case-row-meta {
  align-self: stretch;
  align-content: space-between;
}

.alvd-case-row-meta small {
  text-align: right;
}

.alvd-cases-workbench .alvd-case-badge {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: 0;
}

.alvd-cases-workbench .alvd-case-detail {
  padding: 16px;
}

.alvd-cases-workbench .alvd-case-detail.is-empty {
  min-height: 420px;
  align-content: center;
  justify-items: center;
  padding: 26px;
  border-style: dashed;
  background: rgba(255, 255, 255, .025);
}

.alvd-cases-workbench .alvd-case-detail-head {
  align-items: center;
  padding-bottom: 14px;
}

.alvd-cases-workbench .alvd-case-detail-head h2 {
  margin: 3px 0 5px;
  font-size: 22px;
  line-height: 1.12;
}

.alvd-cases-workbench .alvd-case-detail-head p {
  max-width: 560px;
  line-height: 1.4;
}

.alvd-case-detail-actions .alvd-btn {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.alvd-case-detail-actions .alvd-btn svg {
  width: 15px;
  height: 15px;
}

.alvd-cases-workbench .alvd-case-context-grid {
  gap: 9px;
  margin: 14px 0;
}

.alvd-cases-workbench .alvd-case-info-card {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.alvd-case-info-card h3 {
  margin-bottom: 9px;
  letter-spacing: .06em;
}

.alvd-cases-workbench .alvd-case-messages {
  max-height: min(480px, 46vh);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(0, 0, 0, .14);
  overflow: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
}

.alvd-cases-workbench .alvd-case-message {
  border-radius: 12px;
  background: rgba(255, 255, 255, .042);
}

.alvd-cases-workbench .alvd-case-message.is-customer {
  border-color: rgba(249, 200, 108, .26);
  background: rgba(249, 200, 108, .095);
}

.alvd-case-message-head {
  align-items: start;
}

.alvd-case-message-head span {
  white-space: nowrap;
}

.alvd-cases-workbench .alvd-case-reply {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.alvd-case-reply textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  background: rgba(5, 6, 10, .62);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.45;
}

.alvd-case-reply textarea:focus {
  outline: 0;
  border-color: rgba(249, 200, 108, .48);
  box-shadow: 0 0 0 3px rgba(249, 200, 108, .10);
}

.alvd-case-reply-tools {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  background: rgba(0, 0, 0, .12);
}

.alvd-case-reply-foot span {
  min-width: 0;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .alvd-cases-workbench .alvd-case-grid {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  }

  .alvd-case-head-side {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .alvd-cases-workbench .alvd-case-grid {
    grid-template-columns: 1fr;
  }

  .alvd-cases-workbench .alvd-case-list {
    min-height: 0;
    max-height: 300px;
  }
}

@media (max-width: 720px) {
  .alvd-cases-workbench .alvd-case-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .alvd-case-head-side,
  .alvd-case-head-stats {
    width: 100%;
  }

  .alvd-case-head-side {
    display: grid;
    justify-content: stretch;
  }

  .alvd-case-head-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-case-head-side .alvd-btn,
  .alvd-case-reply-foot .alvd-btn {
    width: 100%;
  }

  .alvd-cases-workbench .alvd-case-toolbar {
    grid-template-columns: 1fr;
  }

  .alvd-cases-workbench .alvd-case-detail {
    padding: 12px;
  }

  .alvd-cases-workbench .alvd-case-detail-head {
    display: grid;
    align-items: start;
  }

  .alvd-case-detail-actions {
    justify-content: stretch;
  }

  .alvd-case-detail-actions .alvd-btn,
  .alvd-case-detail-actions .alvd-case-badge {
    flex: 1 1 130px;
    min-width: 0;
  }

  .alvd-case-message {
    max-width: 100%;
  }

  .alvd-case-message-head {
    display: grid;
  }
}

@media (max-width: 480px) {
  .alvd-cases-workbench .alvd-case-row {
    display: grid;
    align-items: start;
  }

  .alvd-case-row-meta {
    justify-items: start;
  }

  .alvd-case-row-meta small {
    text-align: left;
  }

  .alvd-case-detail-actions .alvd-btn,
  .alvd-case-detail-actions .alvd-case-badge {
    flex-basis: 100%;
  }
}

/* Ticket chat links and transcript action */
.alvd-chat-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.alvd-chat-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.alvd-chat-copy svg {
  width: 14px;
  height: 14px;
}

.alvd-chat-copy:hover,
.alvd-chat-copy:focus-visible {
  border-color: rgba(249, 200, 108, 0.36);
  background: rgba(249, 200, 108, 0.08);
  color: var(--gold);
  outline: none;
}

.alvd-chat-copy:disabled {
  opacity: 0.65;
  cursor: wait;
}

.alvd-msg-raw-link {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(249, 200, 108, 0.34);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.alvd-msg-raw-link:hover,
.alvd-msg-raw-link:focus-visible {
  color: #ffe29a;
  text-decoration-color: currentColor;
  outline: none;
}

.alvd-msg-admin .alvd-msg-raw-link {
  color: #1f2937;
  text-decoration-color: rgba(31, 41, 55, 0.42);
}

@media (max-width: 640px) {
  .alvd-chat-head {
    gap: 10px;
  }

  .alvd-chat-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .alvd-chat-copy {
    min-height: 30px;
  }

}

/* DESK SHOP MANAGER - Clean inventory-backed shop backend */
.alvd-shop-workbench {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.alvd-shop-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(22, 23, 31, .95), rgba(18, 18, 24, .92));
}

.alvd-shop-head h2 {
  margin: 4px 0;
  font-size: 24px;
  line-height: 1.1;
}

.alvd-shop-head p,
.alvd-shop-kicker {
  color: var(--text-muted);
}

.alvd-shop-kicker {
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #d6ad55;
}

.alvd-shop-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

.alvd-shop-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
}

.alvd-shop-tabs button svg {
  width: 15px;
  height: 15px;
}

.alvd-shop-tabs button.active {
  background: rgba(214, 173, 85, .14);
  color: #f4d58a;
}

.alvd-shop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 18px;
  align-items: start;
}

.alvd-shop-main,
.alvd-shop-side {
  min-width: 0;
}

.alvd-shop-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.alvd-shop-stat {
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.alvd-shop-stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.alvd-shop-stat span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.alvd-shop-stat.is-good strong { color: #55d6a2; }
.alvd-shop-stat.is-gold strong { color: #f4d58a; }
.alvd-shop-stat.is-purple strong { color: #a78bfa; }
.alvd-shop-stat.is-bad strong { color: #fb7185; }

.alvd-shop-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.alvd-shop-toolbar .alvd-toolbar-left,
.alvd-shop-toolbar .alvd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alvd-shop-table-wrap {
  overflow-x: auto;
}

.alvd-shop-table th,
.alvd-shop-table td {
  vertical-align: middle;
}

.alvd-shop-listing-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.alvd-shop-listing-main strong,
.alvd-shop-listing-main span {
  display: block;
}

.alvd-shop-listing-main span {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.alvd-shop-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #d6ad55;
}

.alvd-shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alvd-shop-thumb svg {
  width: 18px;
  height: 18px;
}

.alvd-shop-badge,
.alvd-shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.alvd-shop-badge.is-live {
  color: #55d6a2;
  background: rgba(85, 214, 162, .11);
  border-color: rgba(85, 214, 162, .24);
}

.alvd-shop-badge.is-locked {
  color: #fb7185;
  background: rgba(251, 113, 133, .10);
  border-color: rgba(251, 113, 133, .22);
}

.alvd-shop-pill {
  margin-right: 5px;
  color: #f4d58a;
}

.alvd-shop-pill svg {
  width: 12px;
  height: 12px;
}

.alvd-shop-editor {
  position: sticky;
  top: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(20, 20, 28, .96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

.alvd-shop-editor.is-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

.alvd-shop-editor.is-empty svg {
  width: 42px;
  height: 42px;
  color: #d6ad55;
}

.alvd-shop-editor-head,
.alvd-shop-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.alvd-shop-editor-foot {
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 0;
}

.alvd-shop-editor-head h3 {
  margin: 3px 0;
  font-size: 18px;
}

.alvd-shop-editor-head p {
  margin: 0;
  color: var(--text-muted);
}

.alvd-shop-editor-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  padding: 16px;
}

.alvd-shop-switch,
.alvd-shop-checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.alvd-shop-switch {
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid rgba(214, 173, 85, .22);
  border-radius: 12px;
  background: rgba(214, 173, 85, .08);
}

.alvd-shop-switch small {
  color: #fb7185;
  font-weight: 700;
}

.alvd-shop-workbench .alvd-form-grid {
  display: grid;
  gap: 12px;
}

.alvd-shop-workbench .alvd-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alvd-shop-workbench .alvd-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alvd-shop-image-editor {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.alvd-shop-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.alvd-shop-image-head span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-shop-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.alvd-shop-image-tile,
.alvd-shop-image-empty {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
}

.alvd-shop-image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alvd-shop-image-tile .shop-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, .55);
}

.alvd-shop-image-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.alvd-shop-image-empty svg {
  width: 24px;
  height: 24px;
  color: #d6ad55;
}

.alvd-shop-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alvd-shop-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  font-weight: 700;
}

.alvd-shop-valorant.is-hidden {
  display: none;
}

.alvd-shop-final-price {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(244, 213, 138, .22);
  border-radius: 10px;
  background: rgba(244, 213, 138, .08);
  color: #f4d58a;
  font-weight: 900;
}

.alvd-shop-audit-card .alvd-card-header svg {
  width: 18px;
  height: 18px;
}

.alvd-shop-audit-list {
  display: flex;
  flex-direction: column;
}

.alvd-shop-audit-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.alvd-shop-audit-row:last-child {
  border-bottom: 0;
}

.alvd-shop-audit-row small {
  grid-column: 2;
  color: var(--text-muted);
}

@media (max-width: 1180px) {
  .alvd-shop-grid {
    grid-template-columns: 1fr;
  }

  .alvd-shop-editor {
    position: relative;
    top: auto;
  }

  .alvd-shop-editor-body {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .alvd-shop-head,
  .alvd-shop-toolbar,
  .alvd-shop-image-head {
    align-items: stretch;
    flex-direction: column;
  }

  .alvd-shop-tabs,
  .alvd-shop-toolbar .alvd-toolbar-left,
  .alvd-shop-toolbar .alvd-toolbar-right {
    width: 100%;
  }

  .alvd-shop-tabs button {
    flex: 1;
    justify-content: center;
  }

  .alvd-shop-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-shop-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-shop-workbench .alvd-form-grid.two,
  .alvd-shop-workbench .alvd-form-grid.three {
    grid-template-columns: 1fr;
  }

  .alvd-shop-audit-row {
    grid-template-columns: 1fr;
  }

  .alvd-shop-audit-row small {
    grid-column: auto;
  }
}

/* DESK SHOP MANAGER V2 - Active listings workbench */
.alvd-shop-head {
  align-items: center;
  border-color: rgba(255, 255, 255, .10);
  background: linear-gradient(135deg, rgba(19, 20, 27, .98), rgba(13, 14, 20, .96));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

.alvd-shop-head h2 {
  font-size: 22px;
}

.alvd-shop-head p {
  max-width: 620px;
}

.alvd-shop-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.alvd-shop-stat {
  min-height: 70px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025));
}

.alvd-shop-stat.is-warn strong {
  color: #fbbf24;
}

.alvd-shop-stat.is-info strong {
  color: #60a5fa;
}

.alvd-shop-list-card {
  overflow: hidden;
  background: rgba(255, 255, 255, .025);
}

.alvd-shop-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.alvd-shop-list-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.alvd-shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.alvd-shop-row-card {
  display: grid;
  grid-template-columns: 28px 62px minmax(0, 1fr) 132px 116px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(12, 13, 18, .74);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.alvd-shop-row-card:hover,
.alvd-shop-row-card.is-selected {
  border-color: rgba(249, 200, 108, .22);
  background: rgba(18, 19, 26, .92);
}

.alvd-shop-row-card:hover {
  transform: translateY(-1px);
}

.alvd-shop-select {
  display: flex;
  justify-content: center;
}

.alvd-shop-row-card .alvd-shop-thumb {
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, .12);
  cursor: pointer;
}

.alvd-shop-card-body {
  min-width: 0;
}

.alvd-shop-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alvd-shop-card-title {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-shop-card-meta {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-shop-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.alvd-shop-pill.is-muted {
  color: var(--text-muted);
}

.alvd-shop-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.alvd-shop-card-metrics span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.alvd-shop-card-metrics strong {
  color: #f4d58a;
  font-size: 16px;
  font-weight: 900;
}

.alvd-shop-card-metrics small {
  max-width: 132px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
  text-align: right;
}

.alvd-shop-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.alvd-shop-edit-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .028);
}

.alvd-shop-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.alvd-shop-section-head strong {
  font-size: 13px;
  letter-spacing: .02em;
}

.alvd-shop-section-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-shop-image-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

.alvd-shop-image-tile {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .18);
}

.alvd-shop-image-empty {
  min-height: 132px;
  border-style: dashed;
  background: rgba(255, 255, 255, .025);
}

@media (max-width: 1180px) {
  .alvd-shop-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .alvd-shop-row-card {
    grid-template-columns: 28px 56px minmax(0, 1fr);
  }

  .alvd-shop-card-metrics,
  .alvd-shop-card-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  .alvd-shop-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-shop-list-head,
  .alvd-shop-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* DESK SHOP MANAGER V3 - Minimal listing editor */
.alvd-shop-editor-clean {
  border-radius: 12px;
  background: rgba(15, 16, 22, .98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .26);
}

.alvd-shop-editor-clean .alvd-shop-editor-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(15, 16, 22, .98);
}

.alvd-shop-editor-clean .alvd-shop-kicker {
  font-size: 10px;
  letter-spacing: .08em;
}

.alvd-shop-editor-clean .alvd-shop-editor-head h3 {
  margin: 2px 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-shop-editor-clean .alvd-shop-editor-head p {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-shop-editor-status {
  display: flex;
  justify-content: flex-end;
}

.alvd-shop-editor-clean .alvd-shop-editor-body {
  gap: 12px;
  max-height: calc(100vh - 218px);
  padding: 12px;
}

.alvd-shop-editor-clean .alvd-shop-edit-group {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.alvd-shop-editor-clean .alvd-shop-group-title {
  align-items: center;
  padding: 0;
  border: 0;
}

.alvd-shop-editor-clean .alvd-shop-group-title strong {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.alvd-shop-editor-clean .alvd-shop-group-title span {
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-shop-editor-clean .alvd-shop-switch {
  padding: 10px;
  border-color: rgba(85, 214, 162, .18);
  border-radius: 10px;
  background: rgba(85, 214, 162, .055);
}

.alvd-shop-editor-clean .alvd-shop-switch > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alvd-shop-editor-clean .alvd-shop-desc-field label {
  display: flex;
  justify-content: space-between;
}

.alvd-shop-editor-clean .alvd-shop-desc-field label span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.alvd-shop-editor-clean #shop-edit-desc {
  min-height: 72px;
  resize: vertical;
}

.alvd-shop-editor-clean .alvd-shop-image-head {
  margin-bottom: 8px;
}

.alvd-shop-upload-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(249, 200, 108, .24);
  border-radius: 9px;
  background: rgba(249, 200, 108, .08);
  color: #f4d58a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.alvd-shop-upload-tile svg {
  width: 14px;
  height: 14px;
}

.alvd-shop-editor-clean .alvd-shop-image-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.alvd-shop-editor-clean .alvd-shop-image-strip .alvd-shop-image-tile,
.alvd-shop-editor-clean .alvd-shop-image-strip .alvd-shop-image-empty {
  width: 82px;
  min-width: 82px;
  height: 70px;
  aspect-ratio: auto;
  border-radius: 9px;
}

.alvd-shop-editor-clean .alvd-shop-image-strip .alvd-shop-image-empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-shop-editor-clean .alvd-shop-checks label {
  min-height: 30px;
  border-radius: 8px;
}

.alvd-shop-editor-clean .alvd-shop-editor-foot {
  position: sticky;
  bottom: 0;
  padding: 12px;
  background: rgba(15, 16, 22, .98);
}

@media (max-width: 760px) {
  .alvd-shop-editor-clean {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    max-height: 88dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .alvd-shop-editor-clean .alvd-shop-editor-body {
    max-height: calc(88dvh - 128px);
    padding: 12px;
  }

  .alvd-shop-editor-clean .alvd-form-grid.two,
  .alvd-shop-editor-clean .alvd-form-grid.three,
  .alvd-shop-editor-clean .alvd-shop-primary-fields {
    grid-template-columns: 1fr;
  }

  .alvd-shop-editor-clean .alvd-shop-editor-foot {
    gap: 8px;
  }

  .alvd-shop-editor-clean .alvd-shop-editor-foot .alvd-btn {
    min-height: 44px;
    flex: 1;
  }
}

/* DESK SHOP ORDERS - Sold account records */
.alvd-shop-orders-grid {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
}

.alvd-shop-order-stats .alvd-shop-stat strong {
  font-size: clamp(18px, 2vw, 24px);
}

.alvd-shop-order-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 124px auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .018)), rgba(11, 12, 17, .88);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.alvd-shop-order-card:hover,
.alvd-shop-order-card.is-selected {
  border-color: rgba(249, 200, 108, .26);
  background: linear-gradient(180deg, rgba(249, 200, 108, .055), rgba(255, 255, 255, .022)), rgba(14, 15, 21, .94);
}

.alvd-shop-order-card:hover {
  transform: translateY(-1px);
}

.alvd-shop-order-thumb {
  width: 64px;
  height: 54px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
}

.alvd-shop-order-main {
  min-width: 0;
}

.alvd-shop-order-side {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
}

.alvd-shop-order-side strong {
  color: #f4d58a;
  font-size: 16px;
  font-weight: 950;
}

.alvd-shop-order-side span,
.alvd-shop-order-side small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.alvd-shop-order-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.alvd-shop-order-status.is-good {
  border-color: rgba(52, 211, 153, .28);
  background: rgba(52, 211, 153, .12);
  color: #75e0b4;
}

.alvd-shop-order-status.is-warn {
  border-color: rgba(249, 200, 108, .34);
  background: rgba(249, 200, 108, .13);
  color: #f4d58a;
}

.alvd-shop-order-status.is-info {
  border-color: rgba(96, 165, 250, .28);
  background: rgba(96, 165, 250, .12);
  color: #93c5fd;
}

.alvd-shop-order-status.is-bad {
  border-color: rgba(248, 113, 113, .30);
  background: rgba(248, 113, 113, .12);
  color: #fca5a5;
}

.alvd-shop-order-detail .alvd-shop-editor-body {
  gap: 12px;
}

.alvd-shop-order-hero {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.alvd-shop-order-hero img,
.alvd-shop-order-hero > div:first-child {
  width: 96px;
  height: 70px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0, 0, 0, .20);
}

.alvd-shop-order-hero > div:first-child {
  display: grid;
  place-items: center;
  color: #f4d58a;
}

.alvd-shop-order-hero strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.25;
}

.alvd-shop-order-hero span {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.alvd-shop-order-money {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(249, 200, 108, .20);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(249, 200, 108, .12), rgba(255, 255, 255, .035));
}

.alvd-shop-order-money span,
.alvd-shop-order-money small,
.alvd-shop-order-grid span,
.alvd-shop-order-claim span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.alvd-shop-order-money strong {
  color: #f4d58a;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

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

.alvd-shop-order-grid > div,
.alvd-shop-order-claim > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.alvd-shop-order-grid strong,
.alvd-shop-order-claim strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.3;
}

.alvd-shop-order-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: 12px;
  background: rgba(96, 165, 250, .055);
}

.alvd-shop-order-claim {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.alvd-shop-order-timeline {
  display: grid;
  gap: 8px;
}

.alvd-shop-order-timeline > div {
  display: grid;
  gap: 3px;
  padding: 9px 0 0 12px;
  border-left: 2px solid rgba(249, 200, 108, .32);
}

.alvd-shop-order-timeline strong {
  color: var(--text-primary);
  font-size: 12px;
}

.alvd-shop-order-timeline span,
.alvd-shop-order-emptyline {
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .alvd-shop-orders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .alvd-shop-order-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .alvd-shop-order-thumb {
    width: 56px;
    height: 50px;
  }

  .alvd-shop-order-side,
  .alvd-shop-order-card .alvd-shop-card-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .alvd-shop-orders-toolbar .alvd-toolbar-left {
    display: grid;
    grid-template-columns: 1fr;
  }

  .alvd-shop-order-hero,
  .alvd-shop-order-grid,
  .alvd-shop-order-claim {
    grid-template-columns: 1fr;
  }
}

/* Analytics Workbench v2 */
.alvd-aw {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.alvd-aw-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 2px;
}

.alvd-aw-topbar h2 {
  margin: 2px 0 2px;
  color: var(--text-primary, #f6f3ff);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.alvd-aw-topbar span,
.alvd-aw-panel-head span,
.alvd-aw-rank span,
.alvd-aw-event small,
.alvd-aw-backfill span,
.alvd-aw-kpi small {
  color: var(--text-muted, #8f8aa3);
  font-size: 12px;
}

.alvd-aw-eyebrow {
  margin: 0;
  color: var(--accent, #f5c35d);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.alvd-aw-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.alvd-aw-filterbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(11, 10, 17, .9);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  backdrop-filter: blur(14px);
}

.alvd-aw-filter {
  min-width: 0;
}

.alvd-aw-filter span {
  display: block;
  margin: 0 0 5px;
  color: var(--text-muted, #8f8aa3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.alvd-aw-filter .alvd-select,
.alvd-aw-filter .alvd-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 34px 0 12px;
  color: var(--text-primary, #f8f8fa);
  background-color: #0b0b11;
  line-height: 38px;
  font-size: 12px;
  font-weight: 750;
  color-scheme: dark;
}

.alvd-aw-filter .alvd-select option {
  color: #f8f8fa;
  background: #111118;
}

.alvd-aw-filter.is-hidden {
  display: none;
}

.alvd-aw-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.alvd-aw-kpi,
.alvd-aw-panel,
.alvd-aw-goal,
.alvd-aw-backfill {
  background: rgba(18, 18, 25, .82);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .18);
}

.alvd-aw-kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px;
}

.alvd-aw-kpi-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #f5c35d;
  background: rgba(245, 195, 93, .1);
  border: 1px solid rgba(245, 195, 93, .18);
  border-radius: 8px;
}

.alvd-aw-kpi-icon svg {
  width: 17px;
  height: 17px;
}

.alvd-aw-kpi strong {
  display: block;
  color: var(--text-primary, #f6f3ff);
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0;
}

.alvd-aw-kpi span {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary, #c8c2d8);
  font-size: 12px;
  font-weight: 750;
}

.alvd-aw-kpi-blue .alvd-aw-kpi-icon { color: #60a5fa; background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .18); }
.alvd-aw-kpi-green .alvd-aw-kpi-icon { color: #34d399; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .18); }
.alvd-aw-kpi-violet .alvd-aw-kpi-icon { color: #a78bfa; background: rgba(167, 139, 250, .1); border-color: rgba(167, 139, 250, .18); }
.alvd-aw-kpi-teal .alvd-aw-kpi-icon { color: #2dd4bf; background: rgba(45, 212, 191, .1); border-color: rgba(45, 212, 191, .18); }
.alvd-aw-kpi-red .alvd-aw-kpi-icon { color: #fb7185; background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .18); }

.alvd-aw-goal {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.alvd-aw-goal strong,
.alvd-aw-panel-head h3,
.alvd-aw-backfill strong {
  display: block;
  margin: 0;
  color: var(--text-primary, #f6f3ff);
  font-size: 14px;
  line-height: 1.2;
}

.alvd-aw-goal i {
  display: block;
  height: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
}

.alvd-aw-goal b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #f5c35d);
  border-radius: inherit;
}

.alvd-aw-goal em {
  color: #f5c35d;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.alvd-aw-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.alvd-aw-tabs::-webkit-scrollbar {
  display: none;
}

.alvd-aw-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  color: var(--text-secondary, #c8c2d8);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.alvd-aw-tab.active {
  color: #15110a;
  background: #f5c35d;
  border-color: rgba(245, 195, 93, .8);
}

.alvd-aw-grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 12px;
}

.alvd-aw-panel {
  min-width: 0;
  padding: 14px;
}

.alvd-aw-panel-wide {
  grid-column: span 1;
}

.alvd-aw-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.alvd-aw-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 220px;
  min-width: 0;
  padding: 8px 4px 0;
  overflow-x: auto;
}

.alvd-aw-bar {
  display: flex;
  flex: 1 0 26px;
  min-width: 26px;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.alvd-aw-bar-stack {
  display: flex;
  width: 100%;
  min-height: 2px;
  flex-direction: column-reverse;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border-radius: 6px 6px 2px 2px;
}

.alvd-aw-bar-stack .ticket {
  display: block;
  background: #60a5fa;
}

.alvd-aw-bar-stack .shop {
  display: block;
  background: #34d399;
}

.alvd-aw-bar small {
  max-width: 50px;
  overflow: hidden;
  color: var(--text-muted, #8f8aa3);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-aw-list {
  display: grid;
  gap: 9px;
}

.alvd-aw-rank {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 8px;
}

.alvd-aw-rank strong,
.alvd-aw-event strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary, #f6f3ff);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-aw-rank b {
  position: relative;
  z-index: 1;
  color: #f5c35d;
  font-size: 12px;
}

.alvd-aw-rank i {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #f5c35d;
  opacity: .65;
}

.alvd-aw-funnel {
  display: grid;
  gap: 10px;
}

.alvd-aw-funnel-step {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.alvd-aw-funnel-copy strong {
  display: block;
  color: var(--text-primary, #f6f3ff);
  font-size: 13px;
}

.alvd-aw-funnel-copy span {
  color: var(--text-muted, #8f8aa3);
  font-size: 11px;
}

.alvd-aw-funnel-track {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
}

.alvd-aw-funnel-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #f5c35d);
  border-radius: inherit;
}

.alvd-aw-funnel-step b {
  color: #f5c35d;
  font-size: 12px;
  text-align: right;
}

.alvd-aw-events {
  display: grid;
  gap: 8px;
}

.alvd-aw-event {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 8px;
}

.alvd-aw-event[data-ticket-id] {
  cursor: pointer;
}

.alvd-aw-event[data-ticket-id]:hover {
  border-color: rgba(245, 195, 93, .32);
}

.alvd-aw-event.is-risk {
  border-color: rgba(251, 113, 133, .22);
  background: rgba(251, 113, 133, .06);
}

.alvd-aw-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 999px;
}

.alvd-aw-event.is-risk .alvd-aw-dot {
  background: #fb7185;
}

.alvd-aw-event b {
  display: block;
  color: #f5c35d;
  font-size: 12px;
  text-align: right;
}

.alvd-aw-mini-grid,
.alvd-aw-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alvd-aw-mini-grid span,
.alvd-aw-health span {
  padding: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 8px;
}

.alvd-aw-mini-grid b,
.alvd-aw-health b {
  display: block;
  color: var(--text-primary, #f6f3ff);
  font-size: 22px;
  line-height: 1;
}

.alvd-aw-mini-grid small,
.alvd-aw-health small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted, #8f8aa3);
  font-size: 11px;
}

.alvd-aw-health .warn {
  border-color: rgba(251, 113, 133, .22);
  background: rgba(251, 113, 133, .06);
}

.alvd-aw-backfill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.alvd-aw-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--text-secondary, #c8c2d8);
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 10px;
}

.alvd-aw-notice svg {
  width: 18px;
  height: 18px;
  color: #f59e0b;
}

.alvd-aw-notice strong {
  display: block;
  color: var(--text-primary, #f6f3ff);
  font-size: 13px;
}

.alvd-aw-notice span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted, #8f8aa3);
  font-size: 12px;
}

.alvd-aw-backfill-state {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alvd-aw-backfill-state span {
  padding: 5px 8px;
  color: #8f8aa3;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.alvd-aw-backfill-state .done {
  color: #34d399;
  background: rgba(52, 211, 153, .08);
  border-color: rgba(52, 211, 153, .2);
}

.alvd-aw-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
}

.alvd-aw-table .head,
.alvd-aw-table .row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(4, minmax(72px, .6fr));
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
}

.alvd-aw-table .head {
  color: var(--text-muted, #8f8aa3);
  background: rgba(255, 255, 255, .045);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.alvd-aw-table .row {
  color: var(--text-secondary, #c8c2d8);
  background: rgba(255, 255, 255, .025);
  font-size: 12px;
}

.alvd-aw-table .row strong {
  color: var(--text-primary, #f6f3ff);
}

@media (max-width: 1280px) {
  .alvd-aw-filterbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .alvd-aw-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .alvd-aw-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-aw-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .alvd-aw-filterbar {
    position: relative;
    top: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-aw-kpis,
  .alvd-aw-grid-main {
    grid-template-columns: 1fr;
  }

  .alvd-aw-goal {
    grid-template-columns: 1fr;
  }

  .alvd-aw-panel-wide {
    grid-column: auto;
  }

  .alvd-aw-funnel-step {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .alvd-aw-funnel-step b {
    text-align: left;
  }

  .alvd-aw-backfill {
    grid-template-columns: 1fr;
  }

  .alvd-aw-notice {
    grid-template-columns: 1fr;
  }

  .alvd-aw-table {
    overflow-x: auto;
  }

  .alvd-aw-table .head,
  .alvd-aw-table .row {
    min-width: 620px;
  }
}

@media (max-width: 520px) {
  .alvd-aw {
    gap: 12px;
  }

  .alvd-aw-topbar h2 {
    font-size: 20px;
  }

  .alvd-aw-filterbar,
  .alvd-aw-kpis,
  .alvd-aw-mini-grid,
  .alvd-aw-health {
    grid-template-columns: 1fr;
  }

  .alvd-aw-kpi strong {
    font-size: 19px;
  }

  .alvd-aw-panel {
    padding: 12px;
  }

  .alvd-aw-chart {
    height: 180px;
  }

  .alvd-aw-event {
    grid-template-columns: 9px minmax(0, 1fr);
  }

  .alvd-aw-event > div:last-child {
    grid-column: 2;
  }

  .alvd-aw-event b,
  .alvd-aw-event > div:last-child small {
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BASE RESET
   ═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.alvd-layout {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────── */
.alvd-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 5001;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Gradient Glow */
.alvd-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse at top left, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.alvd-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  position: relative;
}

.alvd-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--gold);
}

.alvd-logo-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30), 0 0 22px var(--gold-glow);
}

.alvd-logo-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.alvd-logo-copy strong {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 30px var(--gold-glow);
}

.alvd-logo-copy span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  letter-spacing: 4px;
}

/* Navigation */
.alvd-nav {
  flex: 1;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.alvd-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.alvd-nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--gold-glow) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.alvd-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.alvd-nav-item:hover::before {
  opacity: 1;
}

.alvd-nav-item.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(249, 200, 108, 0.12) 0%, transparent 100%);
}

.alvd-nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.alvd-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
}

.alvd-nav-item.active svg {
  opacity: 1;
}

.alvd-nav-item span {
  flex: 1;
}

/* Badge Count */
.alvd-badge-count {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dim) 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.4);
}

.alvd-badge-count.alvd-badge-warning {
  background: linear-gradient(135deg, var(--gold) 0%, rgba(201, 147, 53, 0.82) 100%);
  color: #14100a;
  box-shadow: 0 2px 10px rgba(201, 147, 53, 0.32);
}

/* User Box */
.alvd-user-box {
  padding: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.alvd-user-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.alvd-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────
   MAIN CONTENT
   ───────────────────────────────────────── */
.alvd-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.alvd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: rgba(15, 15, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.alvd-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.alvd-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.alvd-header h1 svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

.alvd-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Content Area */
.alvd-content {
  flex: 1;
  padding: var(--space-xl);
  background: var(--bg-base);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.alvd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.alvd-btn svg {
  width: 18px;
  height: 18px;
}

.alvd-btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(249, 200, 108, 0.3);
}

.alvd-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(249, 200, 108, 0.4);
}

.alvd-btn-primary:active {
  transform: translateY(0);
}

.alvd-btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.alvd-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--gold);
  color: var(--gold);
}

.alvd-btn-danger-soft {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.075);
  color: #fca5a5;
}

.alvd-btn-danger-soft:hover {
  border-color: rgba(248, 113, 113, 0.46);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.alvd-btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.alvd-btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.alvd-btn-icon svg {
  width: 18px;
  height: 18px;
}

.alvd-btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dim) 100%);
  color: white;
}

.alvd-btn-danger:hover {
  box-shadow: 0 4px 16px rgba(248, 113, 113, 0.4);
}

.alvd-btn:disabled,
.alvd-btn-icon:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS - Premium Design
   ═══════════════════════════════════════════════════════════════ */
.alvd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.alvd-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.alvd-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
  opacity: 0.6;
}

.alvd-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.alvd-stat-card:hover::before {
  opacity: 1;
}

.alvd-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alvd-stat-icon svg {
  width: 24px;
  height: 24px;
}

.alvd-stat-icon.purple {
  background: var(--accent-glow);
  color: var(--accent);
}

.alvd-stat-card:has(.alvd-stat-icon.purple) {
  --stat-color: var(--accent);
}

.alvd-stat-icon.orange {
  background: var(--warning-glow);
  color: var(--warning);
}

.alvd-stat-card:has(.alvd-stat-icon.orange) {
  --stat-color: var(--warning);
}

.alvd-stat-icon.green {
  background: var(--success-glow);
  color: var(--success);
}

.alvd-stat-card:has(.alvd-stat-icon.green) {
  --stat-color: var(--success);
}

.alvd-stat-icon.blue {
  background: var(--info-glow);
  color: var(--info);
}

.alvd-stat-card:has(.alvd-stat-icon.blue) {
  --stat-color: var(--info);
}

.alvd-stat-content {
  flex: 1;
  min-width: 0;
}

.alvd-stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.alvd-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Trend Indicator */
.alvd-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
}

.alvd-stat-trend.up {
  background: var(--success-glow);
  color: var(--success);
}

.alvd-stat-trend.down {
  background: var(--danger-glow);
  color: var(--danger);
}

.alvd-stat-trend svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.alvd-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.alvd-card-mb {
  margin-bottom: var(--space-lg);
}

.alvd-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.alvd-card-body {
  padding: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES - Premium Look
   ═══════════════════════════════════════════════════════════════ */
.alvd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

/* Status Dot */
.alvd-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.alvd-badge-request,
.alvd-badge-pending {
  background: var(--warning-glow);
  color: var(--warning);
}

.alvd-badge-analyzing,
.alvd-badge-quoting {
  background: var(--accent-glow);
  color: var(--accent);
}

.alvd-badge-matched,
.alvd-badge-waiting_customer {
  background: var(--info-glow);
  color: var(--info);
}

.alvd-badge-secured,
.alvd-badge-delivering,
.alvd-badge-fulfilled {
  background: var(--success-glow);
  color: var(--success);
}

.alvd-badge-closed {
  background: rgba(107, 107, 120, 0.15);
  color: var(--text-muted);
}

.alvd-badge-canceled {
  background: var(--danger-glow);
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════
   STATUS OVERVIEW (Dashboard)
   ═══════════════════════════════════════════════════════════════ */
.alvd-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.alvd-status-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--duration-fast);
}

.alvd-status-item:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}

.alvd-status-item .alvd-badge {
  margin-bottom: var(--space-sm);
}

.alvd-status-count {
  font-size: 28px;
  font-weight: 700;
  display: block;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   TOOLBAR (Search & Filters)
   ═══════════════════════════════════════════════════════════════ */
.alvd-toolbar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.alvd-search-box {
  flex: 1;
  position: relative;
}

.alvd-search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.alvd-search-box input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--duration-fast);
}

.alvd-search-box input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.alvd-search-box input::placeholder {
  color: var(--text-muted);
}

.alvd-select {
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  color-scheme: dark;
  font-size: 14px;
  cursor: pointer;
  min-width: 160px;
  transition: all var(--duration-fast);
}

.alvd-select option,
.alvd-select optgroup {
  background: #111118;
  color: #f8fafc;
}

.alvd-select option:checked {
  background: #2563eb;
  color: #ffffff;
}

.alvd-select option:disabled {
  color: #94a3b8;
}

.alvd-select:focus {
  outline: none;
  border-color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   TICKET TABLE
   ═══════════════════════════════════════════════════════════════ */
.alvd-ticket-table {
  width: 100%;
  border-collapse: collapse;
}

.alvd-ticket-table th {
  text-align: left;
  padding: 14px var(--space-md);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.alvd-ticket-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.alvd-ticket-table tbody tr {
  cursor: pointer;
  transition: background var(--duration-fast);
}

.alvd-ticket-table tbody tr:hover {
  background: var(--bg-elevated);
}

.alvd-ticket-table tbody tr:last-child td {
  border-bottom: none;
}

.alvd-ticket-id {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
}

.alvd-ticket-email {
  font-weight: 600;
  color: var(--text-primary);
}

.alvd-ticket-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.alvd-ticket-time {
  font-size: 12px;
  color: var(--text-muted);
}

.alvd-assigned {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY FEED - Premium Timeline
   ═══════════════════════════════════════════════════════════════ */
.alvd-dashboard-activity {
  margin-top: var(--space-xl);
}

.alvd-activity-header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.alvd-activity-header-controls h2 {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.alvd-activity-header-controls h2 svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

.alvd-activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.alvd-activity-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.alvd-activity-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--space-sm) 0;
  position: sticky;
  top: 80px;
  background: var(--bg-base);
  z-index: 10;
}

.alvd-activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-left: var(--space-lg);
  border-left: 2px solid var(--border-subtle);
  margin-left: var(--space-sm);
}

.alvd-activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-left: calc(-1 * var(--space-lg) - 9px);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.alvd-activity-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-md) - 5px);
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--bg-base);
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.alvd-activity-item:hover {
  background: var(--bg-elevated);
  border-color: var(--gold);
  transform: translateX(4px);
}

.alvd-activity-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alvd-activity-icon svg {
  width: 20px;
  height: 20px;
}

.alvd-activity-icon-blue {
  background: var(--info-glow);
  color: var(--info);
}

.alvd-activity-icon-purple {
  background: var(--accent-glow);
  color: var(--accent);
}

.alvd-activity-icon-green {
  background: var(--success-glow);
  color: var(--success);
}

.alvd-activity-icon-orange {
  background: var(--warning-glow);
  color: var(--warning);
}

.alvd-activity-icon-teal {
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal);
}

.alvd-activity-icon-red {
  background: var(--danger-glow);
  color: var(--danger);
}

.alvd-activity-content {
  flex: 1;
  min-width: 0;
}

.alvd-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 4px;
}

.alvd-activity-header strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.alvd-activity-order {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

.alvd-activity-details {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alvd-activity-preview {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.alvd-form-group {
  margin-bottom: var(--space-md);
}

.alvd-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alvd-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--duration-fast);
}

.alvd-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.alvd-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.alvd-toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  padding: 16px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-spring);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-lg);
}

.alvd-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.alvd-toast-success {
  border-left: 4px solid var(--success);
  color: var(--success);
}

.alvd-toast-error {
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════
   LOADING & EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */
.alvd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.alvd-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.alvd-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.alvd-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.alvd-empty p {
  font-size: 14px;
}

.alvd-mini-busy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: var(--radius-full);
  background: rgba(249, 200, 108, 0.055);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.alvd-mini-busy span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(249, 200, 108, 0.12);
  animation: alvd-pulse 1.1s ease-in-out infinite;
}

.alvd-inline-state {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
}

.alvd-inline-state-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.alvd-inline-state-icon svg {
  width: 16px;
  height: 16px;
}

.alvd-inline-state-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.alvd-inline-state-copy strong {
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-inline-state-copy span {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.alvd-inline-state-error {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.055);
}

.alvd-inline-state-error .alvd-inline-state-icon {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.alvd-soft-error {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: var(--radius-full);
  background: rgba(248, 113, 113, 0.055);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
}

.alvd-skeleton {
  display: grid;
  gap: 10px;
  width: 100%;
}

.alvd-skeleton-row {
  display: grid;
  gap: 9px;
  min-height: 58px;
  padding: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.alvd-skeleton-row-card {
  min-height: 92px;
}

.alvd-skeleton-line {
  display: block;
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  background-size: 220% 100%;
  animation: alvd-shimmer 1.25s ease-in-out infinite;
}

.alvd-skeleton-line-1 {
  width: 72%;
}

.alvd-skeleton-line-2 {
  width: 54%;
}

.alvd-skeleton-line-3 {
  width: 38%;
}

.alvd-skeleton-line-soft {
  width: 46%;
  opacity: 0.62;
}

@keyframes alvd-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@keyframes alvd-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════════ */
#loading {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-surface) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: var(--space-lg);
}

.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loading-logo .logo-mark {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), 0 0 36px var(--gold-glow);
}

.loading-logo .logo-text {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow: 0 0 40px var(--gold-glow);
}

.loading-logo .logo-sub {
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  letter-spacing: 8px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE HELPERS
   ═══════════════════════════════════════════════════════════════ */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: flex;
}

.alvd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal);
}

.alvd-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════════════════════ */
.alvd-notif-wrapper {
  position: relative;
}

.alvd-notif-bell {
  position: relative;
}

.alvd-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dim) 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.5);
}

.alvd-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1000;
}

.alvd-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.alvd-notif-header h4 {
  font-size: 14px;
  font-weight: 600;
}

#alvd-notif-toggle-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.alvd-notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.alvd-notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.alvd-notif-item:hover {
  background: var(--bg-elevated);
}

.alvd-notif-item:last-child {
  border-bottom: none;
}

.alvd-notif-icon {
  font-size: 20px;
}

.alvd-notif-content {
  flex: 1;
  min-width: 0;
}

.alvd-notif-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.alvd-notif-body {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.alvd-notif-empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

.alvd-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
  background: var(--gold);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   TICKET DETAIL VIEW
   ═══════════════════════════════════════════════════════════════ */
.alvd-ticket-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.alvd-ticket-header h2 {
  flex: 1;
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
}

.alvd-ticket-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-rows: auto auto;
  gap: var(--space-lg);
  align-items: start;
}

/* Left column: Request Details + Chat */
.alvd-ticket-left {
  grid-column: 1;
  grid-row: 1;
}

/* Right column: Config, Pricing, Analytics etc. */
.alvd-ticket-right {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* Customer overview: full-width block BELOW the grid */
.alvd-customer-overview-card {
  margin-top: 0;
}

/* Detail-box, items-box, chat: defined in FIXES v3 section below */

.alvd-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.alvd-checkbox svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alvd-checkbox input {
  accent-color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   HINT TEXT
   ═══════════════════════════════════════════════════════════════ */
.alvd-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════
   MAGIC LINK
   ═══════════════════════════════════════════════════════════════ */
.alvd-magic-link {
  display: flex;
  gap: var(--space-sm);
}

.alvd-magic-link input {
  flex: 1;
  font-size: 12px;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
}

/* ═══════════════════════════════════════════════════════════════
   SVG ICON SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* Base SVG behavior */
svg {
  flex-shrink: 0;
  max-width: 100%;
}

/* Icon size utilities — apply via class in HTML */
.alvd-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alvd-icon-xs {
  width: 12px;
  height: 12px;
}

.alvd-icon-sm {
  width: 14px;
  height: 14px;
}

.alvd-icon-md {
  width: 18px;
  height: 18px;
}

.alvd-icon-lg {
  width: 22px;
  height: 22px;
}

.alvd-icon-xl {
  width: 24px;
  height: 24px;
}

.alvd-icon-2xl {
  width: 48px;
  height: 48px;
}

/* Chat Message Avatars */
.alvd-msg-avatar svg {
  width: 18px;
  height: 18px;
}

/* Chat Message Actions (Edit/Delete buttons) */
.alvd-msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alvd-msg-actions button {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alvd-msg-actions button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.alvd-msg-actions button svg,
.alvd-msg-edit svg,
.alvd-msg-delete svg {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.alvd-msg-delete:hover svg {
  color: var(--danger);
}

.alvd-msg-edit:hover svg {
  color: var(--gold);
}

.alvd-msg-evidence-pin.is-pinned {
  opacity: 1;
  background: rgba(249, 200, 108, 0.16);
}

.alvd-msg-evidence-pin.is-pinned svg,
.alvd-msg-evidence-pin:hover svg {
  color: var(--desk-gold-strong);
}

.alvd-msg-evidence-pinned .alvd-msg-bubble {
  box-shadow: 0 0 0 1px rgba(249, 200, 108, 0.38);
}

/* Admin message actions - darker border */
.alvd-msg-admin .alvd-msg-actions {
  border-top-color: rgba(0, 0, 0, 0.15);
}

.alvd-msg-admin .alvd-msg-actions button svg {
  color: rgba(0, 0, 0, 0.5);
}

.alvd-msg-admin .alvd-msg-actions button:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Audit Log Icons */
.alvd-audit-icon svg {
  width: 20px;
  height: 20px;
}

/* Detail Box Icons */
.alvd-detail-box svg,
.alvd-items-box label svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Analytics Grid Icons */
.alvd-analytics-item svg {
  width: 14px;
  height: 14px;
}

/* Source Tags Icons */
.alvd-source-tag svg {
  width: 12px;
  height: 12px;
}

/* Empty State Icons */
.alvd-empty-icon svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* Showcase Item Icons */
.alvd-showcase-item svg {
  width: 16px;
  height: 16px;
}

/* Account Card Icons */
.alvd-account-icon svg {
  width: 24px;
  height: 24px;
}

.alvd-account-lock-badge svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* Heatmap Card Header */
.alvd-heatmap-wrapper h3 svg {
  width: 18px;
  height: 18px;
}

/* Chart Card Headers */
.alvd-chart-card .alvd-card-header h3 svg,
.alvd-chart-card-small .alvd-card-header h3 svg {
  width: 18px;
  height: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   TEAM PAGE STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-team {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.alvd-kpi-grid-small {
  grid-template-columns: repeat(3, 1fr);
}

.alvd-table-wrapper {
  overflow-x: auto;
}

.alvd-team-row {
  transition: background var(--duration-fast);
}

.alvd-team-row:hover {
  background: var(--bg-elevated);
}

.alvd-team-member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alvd-team-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.alvd-team-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alvd-team-name {
  font-weight: 600;
  color: var(--text-primary);
}

.alvd-team-you {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}

.alvd-team-email {
  color: var(--text-secondary);
  font-size: 13px;
}

.alvd-team-time {
  color: var(--text-muted);
  font-size: 13px;
}

/* Status Indicators */
.alvd-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.alvd-status-online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.alvd-status-offline {
  background: var(--text-muted);
}

.alvd-status-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Gold Badge */
.alvd-badge-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--text-inverse);
}

/* ═══════════════════════════════════════════════════════════════
   CSAT STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-csat-positive {
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alvd-csat-positive svg {
  width: 16px;
  height: 16px;
}

.alvd-csat-negative {
  color: var(--danger);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alvd-csat-negative svg {
  width: 16px;
  height: 16px;
}

.alvd-csat-reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alvd-csat-review {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast);
}

.alvd-csat-review:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.alvd-csat-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alvd-aw-csat .alvd-aw-panel {
  min-width: 0;
}

.alvd-csat-hero {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.alvd-csat-hero > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 132px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(249, 200, 108, .22);
  background: rgba(249, 200, 108, .08);
}

.alvd-csat-hero strong {
  color: var(--gold);
  font-size: 46px;
  line-height: 1;
}

.alvd-csat-hero strong small {
  color: var(--text-muted);
  font-size: 18px;
}

.alvd-csat-hero > div:first-child span,
.alvd-csat-stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.alvd-csat-bars {
  display: grid;
  gap: 10px;
}

.alvd-csat-bar-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-csat-bar-row i {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.alvd-csat-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #34d399);
}

.alvd-csat-trend {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 172px;
  padding-top: 8px;
}

.alvd-csat-trend > div {
  flex: 1 1 0;
  min-width: 10px;
  height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 6px;
}

.alvd-csat-trend b {
  display: block;
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #a78bfa, var(--gold));
}

.alvd-csat-trend small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-csat-review {
  cursor: pointer;
}

.alvd-csat-review-header small,
.alvd-csat-review-meta {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-csat-review p {
  margin: 12px 0 0;
  color: var(--text-primary);
  line-height: 1.45;
}

.alvd-csat-review p.is-muted {
  color: var(--text-muted);
}

.alvd-csat-review-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 760px) {
  .alvd-csat-hero {
    grid-template-columns: 1fr;
  }

  .alvd-csat-review-header,
  .alvd-csat-review-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════════════ */

.alvd-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-xl) 0 var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.alvd-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.alvd-section-title svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

.alvd-select-inline {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   AUDIT LOG ADDITIONAL STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-audit-date-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.alvd-audit-date-row .alvd-input {
  flex: 1;
}

.alvd-audit-meta svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.alvd-audit-ip {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   PAYMENT LIST
   ═══════════════════════════════════════════════════════════════ */

.alvd-payments-list {
  display: flex;
  flex-direction: column;
}

.alvd-payment-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.alvd-payment-item:hover {
  background: var(--bg-elevated);
}

.alvd-payment-item:last-child {
  border-bottom: none;
}

.alvd-payment-icon {
  width: 44px;
  height: 44px;
  background: var(--success-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.alvd-payment-icon svg {
  width: 22px;
  height: 22px;
}

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

.alvd-payment-order {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.alvd-payment-email {
  font-size: 13px;
  color: var(--text-secondary);
}

.alvd-payment-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

.alvd-payment-time {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   TOP LIST STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alvd-top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast);
}

.alvd-top-item:hover {
  transform: translateX(4px);
}

.alvd-top-rank {
  font-weight: 700;
  color: var(--gold);
  min-width: 24px;
}

.alvd-top-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.alvd-top-value {
  font-weight: 600;
  color: var(--success);
}

.alvd-top-pct {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   FUNNEL STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alvd-funnel-step {
  position: relative;
}

.alvd-funnel-bar {
  height: 36px;
  background: linear-gradient(90deg, var(--accent-glow) 0%, var(--accent) 100%);
  border-radius: var(--radius-md);
  transition: width var(--duration-slow);
}

.alvd-funnel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
}

.alvd-funnel-label span:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

.alvd-funnel-count {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   CHANGE INDICATORS
   ═══════════════════════════════════════════════════════════════ */

.alvd-change {
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}

.alvd-change-green {
  color: var(--success);
}

.alvd-change-red {
  color: var(--danger);
}

.alvd-change-gray {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */

.alvd-empty {
  padding: var(--space-2xl);
  text-align: center;
}

.alvd-empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.alvd-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.alvd-empty p {
  font-size: 14px;
  color: var(--text-secondary);
}

.alvd-empty-small {
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNTS PAGE STYLES (layout + non-duplicated helpers)
   Main definitions in FIXES v3 section below.
   ═══════════════════════════════════════════════════════════════ */

.alvd-accounts {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.alvd-account-edit-badge,
.alvd-account-lock-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.alvd-account-edit-badge svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.alvd-account-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.alvd-account-ticket svg {
  color: var(--info);
}

.alvd-account-server svg {
  color: var(--accent);
}

.alvd-account-card .alvd-account-rank {
  color: var(--gold);
}

.alvd-account-rank svg {
  color: var(--gold);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-notif-active {
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.alvd-notif-active svg {
  width: 14px;
  height: 14px;
}

.alvd-notif-icon svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
}

.alvd-btn-small svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL STYLES
   ═══════════════════════════════════════════════════════════════ */

.alvd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}

html.alvd-inventory-modal-open,
body.alvd-inventory-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.alvd-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.alvd-modal-large {
  max-width: 800px;
}

.alvd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.alvd-modal-header h2,
.alvd-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.alvd-modal-header h2 svg,
.alvd-modal-header h3 svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

.alvd-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  overscroll-behavior: contain;
}

.alvd-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

/* Form Sections */
.alvd-form-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.alvd-form-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.alvd-form-section h4 svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.alvd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════
   INVENTORY 2.0 STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Tabs */
.alvd-tabs {
  display: flex;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.alvd-tab {
  background: none;
  border: none;
  padding: var(--space-md) var(--space-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.alvd-tab:hover {
  color: var(--text-primary);
}

.alvd-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.alvd-tab-content {
  animation: fadeIn 0.2s ease;
}

/* Inline Status Dropdown */
.alvd-inline-status {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 140px;
  transition: all 0.2s;
  text-align: center;
}

.alvd-inline-status:hover {
  filter: brightness(1.1);
}

/* Profit Display */
.alvd-profit-display {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Credentials Section */
.alvd-credentials-box {
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: 8px;
}

.alvd-credentials-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.alvd-credentials-locked {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}



.alvd-form-group {
  margin-bottom: var(--space-md);
}

.alvd-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.alvd-password-field {
  position: relative;
  display: flex;
}

.alvd-password-field .alvd-input {
  flex: 1;
  padding-right: 44px;
}

.alvd-password-field .alvd-btn-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.alvd-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.alvd-quick-url {
  font-size: 11px;
  padding: 4px 10px;
}

.alvd-textarea {
  resize: vertical;
  min-height: 80px;
}

.alvd-autocomplete {
  position: relative;
}

.alvd-autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.alvd-autocomplete-results.show {
  display: block;
}

.alvd-selected-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.alvd-selected-user img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.alvd-muted {
  color: var(--text-muted);
}

/* ========================================================================
   FIXES v3 (merged from fixes-v3.css)
   ======================================================================== */
/**
 * ALVIRAN Desk v3.0 - FIXES & IMPROVEMENTS
 * Für: Audit Log, Team, Accounts, Analytics, Ticket Detail
 * 
 * Diese Datei NACH app.css laden!
 */

/* ═══════════════════════════════════════════════════════════════
   SHARED: KPI CARDS (Audit Log, Peak Hours Stats)
   Ersetzt die hässlichen Emoji-Icons durch SVG-styled Cards
   ═══════════════════════════════════════════════════════════════ */

.alvd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.alvd-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--duration-fast);
  position: relative;
  overflow: hidden;
}

.alvd-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-color, var(--accent));
  opacity: 0.6;
}

.alvd-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-default);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.alvd-kpi-card:hover::before {
  opacity: 1;
}

.alvd-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* Ersetze Emojis durch farbige Icon-Backgrounds */
.alvd-kpi-icon-blue {
  background: var(--info-glow);
  color: var(--info);
  --kpi-color: var(--info);
}

.alvd-kpi-icon-green {
  background: var(--success-glow);
  color: var(--success);
  --kpi-color: var(--success);
}

.alvd-kpi-icon-red {
  background: var(--danger-glow);
  color: var(--danger);
  --kpi-color: var(--danger);
}

.alvd-kpi-icon-purple {
  background: var(--accent-glow);
  color: var(--accent);
  --kpi-color: var(--accent);
}

.alvd-kpi-icon-orange {
  background: var(--warning-glow);
  color: var(--warning);
  --kpi-color: var(--warning);
}

.alvd-kpi-icon-teal {
  background: var(--teal-glow);
  color: var(--teal);
  --kpi-color: var(--teal);
}

/* KPI Card mit Color auf Parent setzen */
.alvd-kpi-card:has(.alvd-kpi-icon-blue) {
  --kpi-color: var(--info);
}

.alvd-kpi-card:has(.alvd-kpi-icon-green) {
  --kpi-color: var(--success);
}

.alvd-kpi-card:has(.alvd-kpi-icon-red) {
  --kpi-color: var(--danger);
}

.alvd-kpi-card:has(.alvd-kpi-icon-purple) {
  --kpi-color: var(--accent);
}

.alvd-kpi-card:has(.alvd-kpi-icon-orange) {
  --kpi-color: var(--warning);
}

.alvd-kpi-content {
  flex: 1;
  min-width: 0;
}

.alvd-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.alvd-kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   AUDIT LOG - COMPLETE REDESIGN
   ═══════════════════════════════════════════════════════════════ */

/* Filter Section */
.alvd-audit-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.alvd-audit-filters .alvd-input,
.alvd-audit-filters .alvd-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all var(--duration-fast);
}

.alvd-audit-filters .alvd-input:focus,
.alvd-audit-filters .alvd-select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 200, 108, 0.15);
}

/* Date inputs row */
.alvd-audit-date-row {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.alvd-audit-date-row input {
  flex: 1;
}

.alvd-audit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.alvd-audit-presets,
.alvd-audit-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alvd-audit-tools {
  justify-content: flex-end;
}

/* Audit Entry List - Timeline Style */
.alvd-audit-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alvd-audit-entry {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
  transition: all var(--duration-fast);
  position: relative;
}

.alvd-audit-entry:hover {
  background: var(--bg-elevated);
}

.alvd-audit-entry:last-child {
  border-bottom: none;
}

/* Audit Icon - Größer und mit SVGs */
.alvd-audit-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}

/* Icon SVG für verschiedene Actions */
.alvd-audit-icon svg {
  width: 20px;
  height: 20px;
}

/* Color variations */
.alvd-audit-green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.alvd-audit-red {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.alvd-audit-blue {
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
}

.alvd-audit-orange {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.alvd-audit-purple {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
}

.alvd-audit-gray {
  background: rgba(156, 163, 175, 0.12);
  color: var(--text-secondary);
}

/* Content */
.alvd-audit-content {
  flex: 1;
  min-width: 0;
}

.alvd-audit-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.alvd-audit-user {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

/* Action Badge - Premium Look */
.alvd-audit-main .alvd-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.alvd-audit-ticket {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  padding: 2px 8px;
  background: rgba(249, 200, 108, 0.1);
  border-radius: 4px;
  transition: all var(--duration-fast);
}

.alvd-audit-ticket:hover {
  background: rgba(249, 200, 108, 0.2);
  text-decoration: none;
}

.alvd-audit-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.alvd-audit-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.alvd-audit-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* IP Address styling */
.alvd-audit-meta .alvd-audit-ip {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 11px;
  opacity: 0.7;
}

/* Mobile Audit Log */
@media (max-width: 768px) {
  .alvd-audit-filters {
    grid-template-columns: 1fr;
  }

  .alvd-audit-date-row {
    flex-direction: column;
  }

  .alvd-audit-entry {
    padding: 14px 16px;
  }

  .alvd-audit-icon {
    width: 36px;
    height: 36px;
  }

  .alvd-audit-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .alvd-kpi-grid-small {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TEAM PAGE - BETTER TABLE
   ═══════════════════════════════════════════════════════════════ */

/* Team Card Container */
.alvd-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* Wenn Table Layout bevorzugt wird: */
.alvd-card>.alvd-table {
  margin: 0;
}

.alvd-table {
  width: 100%;
  border-collapse: collapse;
}

.alvd-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.alvd-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.alvd-table tbody tr {
  transition: background var(--duration-fast);
}

.alvd-table tbody tr:hover {
  background: var(--bg-elevated);
}

.alvd-table tbody tr:last-child td {
  border-bottom: none;
}

/* Team Member Row styling */
.alvd-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* Email column */
.alvd-table td:nth-child(2) {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Role Badge improvements */
.alvd-badge-admin {
  background: linear-gradient(135deg, rgba(249, 200, 108, 0.2), rgba(249, 200, 108, 0.1));
  color: var(--gold);
  border: 1px solid rgba(249, 200, 108, 0.3);
}

.alvd-badge-support,
.alvd-badge-agent {
  background: var(--info-glow);
  color: var(--info);
}

/* Last Login styling */
.alvd-table td:last-child {
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNTS PAGE - CARD GRID
   ═══════════════════════════════════════════════════════════════ */

/* Accounts Toolbar */
.alvd-accounts-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.alvd-accounts-toolbar .alvd-search-box {
  flex: 1;
  min-width: 200px;
}

.alvd-accounts-toolbar .alvd-select {
  min-width: 150px;
}

/* Accounts Grid */
.alvd-accounts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* Account Card */
.alvd-account-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--duration-fast);
  position: relative;
  overflow: hidden;
}

.alvd-account-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--account-color, var(--accent));
  opacity: 0.6;
  transition: opacity var(--duration-fast);
}

.alvd-account-clickable {
  cursor: pointer;
}

.alvd-account-clickable:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.alvd-account-clickable:hover::before {
  opacity: 1;
  background: var(--gold);
}

.alvd-account-readonly {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Account Header */
.alvd-account-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.alvd-account-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

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

.alvd-account-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-account-game {
  font-size: 13px;
  font-weight: 600;
}

/* Game Colors */
.alvd-account-game[style*="Valorant"],
.alvd-account-card[data-game="valorant"] .alvd-account-game {
  color: var(--game-valorant);
}

.alvd-account-card[data-game="valorant"] {
  --account-color: var(--game-valorant);
}

.alvd-account-card[data-game="rainbow"] {
  --account-color: var(--game-rainbow);
}

.alvd-account-card[data-game="fortnite"] {
  --account-color: var(--game-fortnite);
}

.alvd-account-card[data-game="lol"] {
  --account-color: var(--game-lol);
}

/* Account Details */
.alvd-account-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alvd-account-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.alvd-account-owner.alvd-muted {
  color: var(--text-muted);
  font-style: italic;
}

.alvd-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  object-fit: cover;
}

/* Account Meta Tags */
.alvd-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alvd-account-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.alvd-account-meta .alvd-account-ticket {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  color: var(--gold);
  background: rgba(249, 200, 108, 0.1);
}

.alvd-account-claim-badge {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.alvd-account-claim-badge strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.alvd-account-claim-badge span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.alvd-account-claim-badge.is-revealed,
.alvd-account-claim-state.is-revealed,
.alvd-account-claim-event.is-revealed {
  border-color: rgba(52, 211, 153, 0.36);
  background: rgba(16, 185, 129, 0.1);
}

.alvd-account-claim-badge.is-opened,
.alvd-account-claim-state.is-opened,
.alvd-account-claim-event.is-opened {
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(59, 130, 246, 0.09);
}

.alvd-account-claim-badge.is-warning,
.alvd-account-claim-state.is-warning,
.alvd-account-claim-event.is-warning {
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.08);
}

.alvd-account-claim-badge.is-created,
.alvd-account-claim-state.is-created {
  border-color: rgba(249, 200, 108, 0.32);
  background: rgba(249, 200, 108, 0.08);
}

.alvd-account-claim-activity {
  border-color: rgba(52, 211, 153, 0.2);
  background:
    radial-gradient(circle at 10% 0%, rgba(52, 211, 153, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.035);
}

.alvd-account-claim-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.alvd-account-claim-head h4 {
  margin: 0 0 4px;
}

.alvd-account-claim-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-account-claim-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.alvd-account-claim-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.alvd-account-claim-metrics div,
.alvd-account-claim-meta div,
.alvd-account-claim-event {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.alvd-account-claim-metrics div {
  padding: 9px 10px;
}

.alvd-account-claim-metrics strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1;
}

.alvd-account-claim-metrics span,
.alvd-account-claim-meta span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alvd-account-claim-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.alvd-account-claim-meta div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  min-width: 0;
}

.alvd-account-claim-meta strong {
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-account-claim-timeline {
  display: grid;
  gap: 7px;
}

.alvd-account-claim-event {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}

.alvd-account-claim-event div {
  min-width: 0;
}

.alvd-account-claim-event strong {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
}

.alvd-account-claim-event span,
.alvd-account-claim-event small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Account Footer */
.alvd-account-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.alvd-account-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Mobile Accounts */
@media (max-width: 600px) {
  .alvd-accounts-toolbar {
    flex-direction: column;
  }

  .alvd-accounts-toolbar .alvd-search-box,
  .alvd-accounts-toolbar .alvd-select {
    width: 100%;
  }

  .alvd-accounts-list {
    grid-template-columns: 1fr;
    padding: 16px;
  }

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

  .alvd-account-claim-head,
  .alvd-account-claim-event {
    display: grid;
  }

  .alvd-account-claim-state {
    width: fit-content;
  }

  .alvd-account-claim-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-account-claim-meta {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANALYTICS PAGE - FIX CHART OVERFLOW
   ═══════════════════════════════════════════════════════════════ */

.alvd-analytics {
  max-width: 100%;
  overflow-x: hidden;
}

/* Goal Card */
.alvd-goal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.alvd-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.alvd-goal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.alvd-goal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--gold-glow);
  border-radius: var(--radius-md);
  color: var(--gold);
  font-size: 20px;
}

.alvd-goal-icon svg {
  width: 20px;
  height: 20px;
}

/* Progress Bar */
.alvd-goal-progress {
  margin-bottom: 12px;
}

.alvd-goal-bar {
  height: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

.alvd-goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-dim));
  border-radius: var(--radius-sm);
  transition: width var(--duration-slow);
  position: relative;
}

.alvd-goal-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.alvd-goal-numbers {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.alvd-goal-current {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

.alvd-goal-target {
  font-size: 14px;
  color: var(--text-muted);
}

.alvd-goal-percentage {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Charts Container - Prevent Overflow */
.alvd-simple-chart {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.alvd-simple-chart svg {
  max-width: 100%;
  height: auto;
}

/* Donut Chart Fix */
.alvd-donut-chart {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.alvd-donut-container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.alvd-donut-svg {
  width: 140px;
  height: 140px;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   BAR CHARTS (Revenue, Verteilung nach Stunde/Tag)
   ═══════════════════════════════════════════════════════════════ */
.alvd-bar-chart {
  width: 100%;
  padding-top: var(--space-md);
}

.alvd-bar-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
  padding-bottom: 28px;
  position: relative;
}

.alvd-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  justify-content: flex-end;
}

.alvd-bar {
  width: 70%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: relative;
  transition: opacity var(--duration-fast);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.alvd-bar:hover {
  opacity: 0.8;
}

.alvd-bar-value {
  position: absolute;
  top: -20px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.alvd-bar-wrapper:hover .alvd-bar-value {
  opacity: 1;
}

.alvd-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   HEATMAP (Ticket-Aktivität nach Tag & Stunde)
   ═══════════════════════════════════════════════════════════════ */
.alvd-heatmap-wrapper {
  overflow-x: auto;
}

.alvd-heatmap {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 2px;
  min-width: 600px;
}

.alvd-heatmap-corner {
  /* empty top-left cell */
}

.alvd-heatmap-hour-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
}

.alvd-heatmap-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  padding-right: 8px;
}

.alvd-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-secondary);
  cursor: default;
  transition: transform var(--duration-fast);
  min-height: 18px;
}

.alvd-heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 1;
}

.alvd-heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: var(--space-md);
  font-size: 11px;
  color: var(--text-muted);
}

.alvd-heatmap-legend-bar {
  width: 120px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--accent) 100%);
}

/* ═══════════════════════════════════════════════════════════════
   DONUT CHART DETAILS
   ═══════════════════════════════════════════════════════════════ */
.alvd-donut-visual {
  flex-shrink: 0;
}

.alvd-donut-segment {
  transition: opacity var(--duration-fast);
}

.alvd-donut-center {
  font-size: 8px;
  font-weight: 700;
  fill: var(--text-primary);
  text-anchor: middle;
  dominant-baseline: auto;
}

.alvd-donut-center-label {
  font-size: 3px;
  fill: var(--text-muted);
  text-anchor: middle;
}

.alvd-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alvd-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.alvd-donut-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alvd-donut-label {
  color: var(--text-secondary);
}

.alvd-donut-count {
  font-weight: 600;
  color: var(--text-primary);
  margin-left: auto;
}

/* Charts Row Responsive */
.alvd-charts-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

/* Analytics Toolbar */
.alvd-analytics-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   TICKET DETAIL - FIX HEXAGON & LAYOUT
   ═══════════════════════════════════════════════════════════════ */

/* Hide broken hexagon placeholder */
.alvd-ticket-left img[src=""],
.alvd-ticket-left img:not([src]),
.alvd-ticket-left svg:empty {
  display: none !important;
}

/* Request Details Card */
.alvd-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .alvd-charts-row {
    grid-template-columns: 1fr;
  }

  .alvd-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .alvd-details-grid {
    grid-template-columns: 1fr;
  }

  .alvd-pagination {
    flex-direction: column;
    gap: 12px;
  }

  .alvd-pagination .alvd-btn {
    width: 100%;
  }
}

.alvd-detail-box {
  background: var(--bg-elevated);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.alvd-detail-box label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.alvd-detail-box span {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

/* Items Box */
.alvd-items-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.alvd-items-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.alvd-items-text {
  background: var(--bg-elevated);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.6;
  border: 1px solid var(--border-subtle);
}

/* Customer Display Section */
.alvd-card-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.alvd-card-header h3 svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex-shrink: 0;
}

/* Showcase Items */
.alvd-showcase-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alvd-showcase-item {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  padding-right: 40px;
  transition: border-color var(--duration-fast);
}

.alvd-showcase-item:hover {
  border-color: var(--gold);
}

.alvd-showcase-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.alvd-showcase-row .showcase-title {
  flex: 1 1 auto;
  min-width: 0;
}

.alvd-showcase-type-pill {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(249, 200, 108, 0.18);
  border-radius: 8px;
  background: rgba(249, 200, 108, 0.07);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.alvd-showcase-type-pill.is-image {
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(96, 165, 250, 0.08);
  color: var(--info);
}

.alvd-showcase-type-pill svg {
  width: 14px;
  height: 14px;
}

.alvd-showcase-row:last-child {
  margin-bottom: 0;
}

.alvd-showcase-offer {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 9px;
  border: 1px solid rgba(249, 200, 108, 0.12);
  border-radius: 8px;
  background: rgba(249, 200, 108, 0.045);
}

.alvd-showcase-offer label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.alvd-showcase-budget {
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.alvd-showcase-budget.is-above {
  color: var(--warning);
}

.alvd-locked-match,
.alvd-match-lock-hint {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.alvd-match-lock-hint {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.alvd-locked-match.is-waiting {
  border-color: rgba(249, 200, 108, 0.18);
  background: rgba(249, 200, 108, 0.055);
}

.alvd-locked-match.is-locked {
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.07);
}

.alvd-locked-match strong {
  display: block;
  color: var(--text-primary);
}

.alvd-locked-match span,
.alvd-locked-match small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.alvd-locked-match-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.alvd-locked-match-head span {
  color: var(--success);
  font-weight: 900;
  text-transform: uppercase;
}

.alvd-locked-match-head strong {
  color: var(--success);
  white-space: nowrap;
}

.alvd-showcase-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--danger-glow);
  color: var(--danger);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alvd-showcase-remove:hover {
  background: var(--danger);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

.alvd-chat {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.alvd-chat-messages {
  flex: 1;
  max-height: 500px;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
}

/* Message Bubbles */
.alvd-msg {
  display: flex;
  gap: 0;
  max-width: 85%;
  animation: msgSlideIn 0.2s ease-out;
  position: relative;
  align-items: flex-end;
}

/* Reply hover button — in flex flow, always present but invisible */
.alvd-msg-reply-btn {
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, background 0.15s;
  transform: scale(0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  align-self: center;
  margin: 0 6px;
}

.alvd-msg-reply-btn svg {
  stroke: var(--text-muted);
  transition: stroke 0.15s;
}

.alvd-msg-reply-btn:hover {
  background: var(--gold);
  transform: scale(1.05) !important;
}

.alvd-msg-reply-btn:hover svg {
  stroke: #000;
}

/* Show on hover — message OR button itself */
.alvd-msg:hover .alvd-msg-reply-btn,
.alvd-msg-reply-btn:hover {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Layout: customer msgs — avatar | bubble | reply-btn */
.alvd-msg-customer,
.alvd-msg-user {
  flex-direction: row;
  align-self: flex-start;
}

/* admin msgs — reply-btn | bubble | avatar */
.alvd-msg-admin {
  flex-direction: row-reverse;
  align-self: flex-end;
}

/* Gap between avatar and bubble */
.alvd-msg-avatar {
  margin: 0 10px 0 0;
}

.alvd-msg-admin .alvd-msg-avatar {
  margin: 0 0 0 10px;
}

.alvd-reply-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(249, 200, 108, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 6px 6px 0 0;
  padding: 8px 12px;
  margin-bottom: -4px;
}

.alvd-reply-preview-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.alvd-reply-preview-bar {
  width: 3px;
  height: 30px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

.alvd-reply-preview-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.alvd-reply-preview-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}

.alvd-reply-preview-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-reply-cancel {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.alvd-reply-cancel:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes msgSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alvd-msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.alvd-msg-customer .alvd-msg-avatar,
.alvd-msg-user .alvd-msg-avatar {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dim) 100%);
}

.alvd-msg-admin .alvd-msg-avatar {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
}

.alvd-msg-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  position: relative;
}

.alvd-msg-customer .alvd-msg-bubble,
.alvd-msg-user .alvd-msg-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

.alvd-msg-admin .alvd-msg-bubble {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-bottom-right-radius: 4px;
}

.alvd-msg-system.alvd-msg-delivery-event .alvd-msg-avatar {
  background: linear-gradient(135deg, rgba(16, 185, 129, .95), rgba(7, 89, 66, .95));
  color: #ecfdf5;
}

.alvd-msg-system.alvd-msg-delivery-event .alvd-msg-bubble {
  background: linear-gradient(135deg, rgba(16, 185, 129, .12), rgba(249, 200, 108, .06));
  border: 1px solid rgba(52, 211, 153, .24);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.alvd-msg-system.alvd-msg-delivery-event .alvd-msg-sender {
  color: #6ee7b7;
}

.alvd-msg-admin .alvd-msg-bubble,
.alvd-msg-admin .alvd-msg-text,
.alvd-msg-admin .alvd-msg-header {
  color: var(--text-inverse);
}

.alvd-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.alvd-msg-sender {
  font-weight: 600;
}

.alvd-msg-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Chat Input */
.alvd-chat-input {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.alvd-chat-input textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  min-height: 80px;
  transition: border-color var(--duration-fast);
}

.alvd-chat-input textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.alvd-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
}

/* Send Button - Gold */
.alvd-chat-actions .alvd-btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(249, 200, 108, 0.3);
}

.alvd-chat-actions .alvd-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 200, 108, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */

.alvd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0;
  flex-wrap: wrap;
}

.alvd-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}


/* ═══ SETTINGS ═══ */
.alvd-settings {
  display: flex;
  gap: 0;
  min-height: 400px
}

.alvd-settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 16px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) 0 0 var(--radius-md)
}

.alvd-settings-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
  white-space: nowrap
}

.alvd-settings-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary)
}

.alvd-settings-tab.active {
  background: var(--bg-active);
  color: var(--gold);
  font-weight: 600
}

.alvd-settings-content {
  flex: 1;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0
}

.alvd-settings-card {
  max-width: 600px
}

.alvd-settings-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px
}

.alvd-settings-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px
}

.alvd-settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle)
}

.alvd-settings-toggle-row:last-of-type {
  border-bottom: none;
  margin-bottom: 16px
}

.alvd-settings-toggle-row strong {
  font-size: 13px
}

.alvd-settings-toggle-row small {
  color: var(--text-muted);
  font-size: 12px
}

.alvd-push-health {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04)
}

.alvd-push-health-head,
.alvd-push-health-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.alvd-push-health-head h4 {
  margin: 0 0 3px;
  font-size: 14px
}

.alvd-push-health-head p,
.alvd-push-health-foot span {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px
}

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

.alvd-push-health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(0, 0, 0, .16)
}

.alvd-push-health-item span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase
}

.alvd-push-health-item strong {
  color: var(--text-primary);
  font-size: 13px
}

.alvd-push-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap
}

.alvd-push-pill svg {
  width: 12px;
  height: 12px
}

.alvd-push-pill.is-ok {
  color: var(--success);
  background: var(--success-glow)
}

.alvd-push-pill.is-warn {
  color: var(--warning);
  background: var(--warning-glow)
}

@media(max-width: 640px) {
  .alvd-push-health-head,
  .alvd-push-health-foot {
    align-items: stretch;
    flex-direction: column
  }

  .alvd-push-health-grid {
    grid-template-columns: 1fr
  }
}

.alvd-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0
}

.alvd-switch input {
  opacity: 0;
  width: 0;
  height: 0
}

.alvd-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  transition: all var(--duration-fast)
}

.alvd-switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--duration-fast)
}

.alvd-switch input:checked+.alvd-switch-slider {
  background: var(--gold);
  border-color: var(--gold)
}

.alvd-switch input:checked+.alvd-switch-slider::before {
  transform: translateX(20px);
  background: var(--bg-base)
}

.alvd-qr-item {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle)
}

.alvd-email-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--duration-fast)
}

.alvd-email-recipient:hover {
  background: var(--bg-hover);
  border-color: var(--border-default)
}

.alvd-email-recipient input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold)
}

.alvd-recipient-info {
  display: flex;
  flex-direction: column;
  gap: 1px
}

.alvd-recipient-info strong {
  font-size: 13px
}

.alvd-recipient-info small {
  font-size: 11px;
  color: var(--text-muted)
}

.alvd-custom-email-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px
}

.alvd-custom-email-row .alvd-input {
  flex: 1
}

.alvd-rank-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle)
}

.alvd-rank-order {
  display: inline-flex;
  gap: 4px;
  flex: 0 0 auto;
}

.alvd-rank-order .alvd-btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.alvd-rank-order svg {
  width: 14px;
  height: 14px;
}

.alvd-rank-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  width: 20px;
  text-align: center
}

.alvd-rank-color {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 0
}

@media(max-width:768px) {
  .alvd-settings {
    flex-direction: column
  }

  .alvd-settings-tabs {
    flex-direction: row;
    overflow-x: auto;
    min-width: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 8px
  }

  .alvd-settings-tab {
    padding: 8px 12px;
    font-size: 12px
  }

  .alvd-settings-content {
    border-left: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 16px
  }
}

/* ═══ INVENTORY ═══ */
.alvd-risk {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.alvd-risk-head,
.alvd-settings-v2 .alvd-settings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.alvd-risk-head p,
.alvd-settings-v2 .alvd-settings-head p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.alvd-risk-head h2,
.alvd-settings-v2 .alvd-settings-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.alvd-risk-head span,
.alvd-settings-v2 .alvd-settings-head span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.alvd-settings-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.alvd-settings-dirty {
  display: inline-flex !important;
  align-items: center;
  min-height: 28px;
  margin: 0 !important;
  padding: 0 10px;
  color: #f8d58a !important;
  background: rgba(249, 200, 108, 0.09);
  border: 1px solid rgba(249, 200, 108, 0.24);
  border-radius: 999px;
  font-size: 11px !important;
  font-weight: 800;
  line-height: 1;
}

.alvd-settings-dirty[hidden],
#settings-discard[hidden] {
  display: none !important;
}

.alvd-risk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.alvd-risk-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.alvd-risk-stat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.alvd-risk-stat-icon svg {
  width: 18px;
  height: 18px;
}

.alvd-risk-red { color: var(--danger); background: var(--danger-glow); }
.alvd-risk-orange { color: var(--warning); background: var(--warning-glow); }
.alvd-risk-purple { color: var(--accent); background: var(--accent-glow); }
.alvd-risk-blue { color: var(--info); background: var(--info-glow); }

.alvd-risk-stat strong {
  display: block;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
}

.alvd-risk-stat span,
.alvd-risk-stat small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-risk-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.alvd-risk-search {
  position: relative;
  min-width: 0;
}

.alvd-risk-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.alvd-risk-search .alvd-input {
  width: 100%;
  padding-left: 36px;
}

.alvd-risk-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  scrollbar-width: none;
}

.alvd-risk-tabs::-webkit-scrollbar {
  display: none;
}

.alvd-risk-tabs button {
  display: flex;
  position: relative;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  color: rgba(229, 225, 238, 0.72);
  background: rgba(8, 8, 12, 0.18);
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}

.alvd-risk-tabs button:hover,
.alvd-risk-tabs button:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
  outline: none;
}

.alvd-risk-tabs button.active {
  color: var(--text-primary);
  background: rgba(249, 200, 108, 0.09);
  border-color: rgba(249, 200, 108, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.alvd-risk-tabs button.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 5px;
  height: 2px;
  background: var(--gold);
  border-radius: 999px;
}

.alvd-risk-tab-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--gold);
  background: rgba(249, 200, 108, 0.08);
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: 7px;
}

.alvd-risk-tab-icon svg {
  width: 15px;
  height: 15px;
}

.alvd-risk-tab-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.alvd-risk-tab-copy strong,
.alvd-risk-tab-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alvd-risk-tab-copy strong {
  color: currentColor;
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
}

.alvd-risk-tab-copy small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.alvd-risk-tab-count {
  min-width: 22px;
  padding: 3px 7px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.alvd-risk-panel {
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.alvd-risk-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-risk-panel-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
}

.alvd-risk-panel-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-risk-add,
.alvd-risk-ticket-check {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-risk-add-ip {
  grid-template-columns: minmax(150px, 1.15fr) 138px 92px minmax(150px, 1fr) auto;
}

.alvd-risk-add-email {
  grid-template-columns: minmax(220px, 1fr) minmax(170px, .9fr) auto;
}

.alvd-risk-ticket-check {
  grid-template-columns: auto minmax(120px, 180px) auto;
  justify-content: start;
}

.alvd-risk-add .alvd-btn-sm,
.alvd-risk-ticket-check .alvd-btn-sm,
.alvd-risk-lookup-actions .alvd-btn-sm {
  min-width: auto;
  min-height: 38px;
  padding: 0 13px !important;
  border-radius: 8px;
  box-shadow: none;
  white-space: nowrap;
  width: max-content;
  justify-self: start;
}

.alvd-risk button svg,
.alvd-risk .alvd-btn-sm svg {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px;
  display: block;
}

.alvd-risk-add .alvd-btn-primary,
.alvd-risk-ticket-check .alvd-btn-primary,
.alvd-risk-lookup-actions .alvd-btn-primary {
  color: #17130a;
  background: linear-gradient(180deg, #f6c45f, #d89a27);
  border-color: rgba(255, 218, 133, 0.32);
}

.alvd-risk-add .alvd-btn-primary:hover,
.alvd-risk-ticket-check .alvd-btn-primary:hover,
.alvd-risk-lookup-actions .alvd-btn-primary:hover {
  transform: none;
  box-shadow: none;
  filter: brightness(1.05);
}

.alvd-risk-add .alvd-btn-danger,
.alvd-risk-ticket-check .alvd-btn-danger,
.alvd-risk-lookup-actions .alvd-btn-danger {
  color: #ffe8e8;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
}

.alvd-risk-add .alvd-btn-danger:hover,
.alvd-risk-ticket-check .alvd-btn-danger:hover,
.alvd-risk-lookup-actions .alvd-btn-danger:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.18);
  box-shadow: none;
}

.alvd-risk-list {
  display: flex;
  flex-direction: column;
}

.alvd-risk-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) minmax(110px, .65fr) minmax(150px, .9fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-risk-row:last-child {
  border-bottom: 0;
}

.alvd-risk-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alvd-risk-main div,
.alvd-risk-meta {
  min-width: 0;
}

.alvd-risk-main strong,
.alvd-risk-meta strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-risk-main small,
.alvd-risk-meta small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-risk-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.alvd-risk-type.ip {
  color: var(--info);
  background: var(--info-glow);
}

.alvd-risk-type.email {
  color: var(--warning);
  background: var(--warning-glow);
}

.alvd-risk-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.alvd-risk-chip.danger { color: var(--danger); background: var(--danger-glow); }
.alvd-risk-chip.warning { color: var(--warning); background: var(--warning-glow); }
.alvd-risk-chip.info { color: var(--info); background: var(--info-glow); }
.alvd-risk-chip.muted { color: var(--text-secondary); background: rgba(255, 255, 255, .05); }

.alvd-risk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.alvd-risk-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 170px;
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
}

.alvd-risk-empty svg {
  width: 26px;
  height: 26px;
  color: var(--success);
}

.alvd-risk-empty strong {
  color: var(--text-primary);
}

.alvd-risk-lookup-result {
  margin: 0 16px 16px;
  padding: 14px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.alvd-risk-lookup-result > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.alvd-risk-lookup-result span {
  color: var(--text-muted);
  font-size: 12px;
}

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

.alvd-risk-lookup-grid > div,
.alvd-risk-health-grid > div,
.alvd-system-grid > div {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}

.alvd-risk-lookup-grid small,
.alvd-risk-health-grid small,
.alvd-system-grid small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.alvd-risk-lookup-grid strong,
.alvd-risk-health-grid strong,
.alvd-system-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-risk-lookup-grid .ok,
.alvd-system-row .ok {
  color: var(--success);
}

.alvd-risk-lookup-grid .danger,
.alvd-system-row .danger {
  color: var(--danger);
}

.alvd-risk-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.alvd-risk-health-grid,
.alvd-system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.alvd-risk-note {
  display: flex;
  gap: 10px;
  margin: 0 16px 16px;
  padding: 12px;
  color: var(--text-secondary);
  background: rgba(96, 165, 250, .07);
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 10px;
  font-size: 12px;
}

.alvd-risk-privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 16px 0;
  padding: 10px 12px;
  color: var(--text-secondary);
  background: rgba(96, 165, 250, .055);
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: 9px;
  font-size: 12px;
}

.alvd-risk-privacy-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--info);
}

.alvd-risk-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--info);
}

.alvd-settings-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alvd-settings-v2 .alvd-settings-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.alvd-settings-v2 .alvd-settings-tabs {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.014)),
    rgba(8, 8, 12, 0.22);
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
}

.alvd-settings-v2 .alvd-settings-tab {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 8px 10px;
  color: rgba(229, 225, 238, 0.72);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.alvd-settings-v2 .alvd-settings-tab:hover,
.alvd-settings-v2 .alvd-settings-tab:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.085);
  outline: none;
}

.alvd-settings-v2 .alvd-settings-tab.active {
  color: var(--text-primary);
  background: rgba(249, 200, 108, 0.09);
  border-color: rgba(249, 200, 108, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.alvd-settings-v2 .alvd-settings-tab.active::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(249, 200, 108, 0.13);
}

.alvd-settings-v2 .alvd-settings-tab-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  color: var(--gold);
  background: rgba(249, 200, 108, 0.08);
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: 8px;
}

.alvd-settings-v2 .alvd-settings-tab.active .alvd-settings-tab-icon {
  color: #08080c;
  background: var(--gold);
  border-color: transparent;
}

.alvd-settings-v2 .alvd-settings-tab-icon svg {
  width: 16px;
  height: 16px;
}

.alvd-settings-v2 .alvd-settings-tab-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding-right: 14px;
}

.alvd-settings-v2 .alvd-settings-tab-copy strong,
.alvd-settings-v2 .alvd-settings-tab-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alvd-settings-v2 .alvd-settings-tab-copy strong {
  color: currentColor;
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
}

.alvd-settings-v2 .alvd-settings-tab-copy small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.alvd-settings-v2 .alvd-settings-tab.active .alvd-settings-tab-copy small {
  color: rgba(245, 242, 250, 0.66);
}

.alvd-settings-v2 .alvd-settings-content {
  min-width: 0;
  padding: 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.alvd-settings-v2 .alvd-settings-card {
  max-width: 760px;
}

.alvd-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.alvd-settings-system {
  max-width: none;
}

.alvd-system-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.alvd-system-panels > div {
  padding: 14px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.alvd-system-panels h4 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-system-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}

.alvd-system-row:first-of-type {
  border-top: 0;
}

.alvd-system-row span {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: capitalize;
}

.alvd-system-row strong {
  color: var(--text-primary);
  font-size: 12px;
  text-align: right;
}

.alvd-system-grid.compact {
  padding-top: 0;
}

@media (max-width: 900px) {
  .alvd-risk-stats,
  .alvd-risk-health-grid,
  .alvd-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-risk-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .alvd-risk-actions {
    justify-content: flex-start;
  }

  .alvd-risk-add {
    grid-template-columns: 1fr;
  }

  .alvd-risk-tabs {
    grid-template-columns: repeat(5, minmax(148px, 1fr));
  }

  .alvd-settings-v2 .alvd-settings-shell {
    grid-template-columns: 1fr;
  }

  .alvd-settings-v2 .alvd-settings-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
  }

  .alvd-settings-v2 .alvd-settings-tabs::-webkit-scrollbar {
    display: none;
  }

  .alvd-settings-v2 .alvd-settings-tab {
    width: auto;
    min-width: 178px;
    flex: 0 0 auto;
  }

  .alvd-system-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .alvd-risk-head,
  .alvd-settings-v2 .alvd-settings-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-risk-stats,
  .alvd-risk-toolbar,
  .alvd-risk-lookup-grid,
  .alvd-risk-health-grid,
  .alvd-system-grid {
    grid-template-columns: 1fr;
  }

  .alvd-risk-panel-head,
  .alvd-risk-row,
  .alvd-risk-add,
  .alvd-risk-ticket-check,
  .alvd-risk-health-grid,
  .alvd-system-grid,
  .alvd-settings-v2 .alvd-settings-content {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.alvd-inventory {
  display: flex;
  flex-direction: column;
  gap: 20px
}

.alvd-inventory-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px
}

.alvd-stat-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--duration-fast)
}

.alvd-stat-mini:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm)
}

.alvd-stat-mini-content {
  display: flex;
  flex-direction: column
}

.alvd-stat-mini-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1
}

.alvd-stat-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px
}

.alvd-stat-success .alvd-stat-mini-value {
  color: var(--success)
}

.alvd-stat-warning .alvd-stat-mini-value {
  color: var(--warning)
}

.alvd-stat-purple .alvd-stat-mini-value {
  color: #8b5cf6
}

.alvd-stat-danger .alvd-stat-mini-value {
  color: var(--danger)
}

.alvd-stat-profit-pos .alvd-stat-mini-value {
  color: var(--success)
}

.alvd-stat-profit-neg .alvd-stat-mini-value {
  color: var(--danger)
}

.alvd-stat-invest .alvd-stat-mini-value {
  color: var(--info)
}

.alvd-stat-avail-val .alvd-stat-mini-value {
  color: var(--gold)
}

.alvd-inventory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.alvd-toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center
}

.alvd-toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center
}

.alvd-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle)
}

.alvd-selected-count {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600
}

.alvd-select-compact {
  min-width: 110px;
  max-width: 150px
}

.alvd-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px !important;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px !important;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.alvd-btn-sm svg {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px;
  display: block;
}

.alvd-card-flush {
  padding: 0
}

.alvd-spreadsheet-wrapper {
  overflow-x: auto
}

.alvd-spreadsheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px
}

.alvd-spreadsheet th {
  background: var(--bg-elevated);
  padding: 11px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10
}

.alvd-spreadsheet th.alvd-sortable {
  cursor: pointer;
  user-select: none
}

.alvd-spreadsheet th.alvd-sortable:hover {
  color: var(--gold);
  background: var(--bg-hover)
}

.alvd-spreadsheet-row {
  transition: background var(--duration-fast)
}

.alvd-spreadsheet-row:hover {
  background: var(--bg-hover)
}

.alvd-spreadsheet-row.selected {
  background: rgba(249, 200, 108, .06)
}

.alvd-spreadsheet-row.alvd-row-sold {
  opacity: .65
}

.alvd-spreadsheet-row.alvd-row-sold:hover {
  opacity: 1
}

.alvd-spreadsheet-row.alvd-row-problem {
  border-left: 3px solid var(--danger)
}

.alvd-spreadsheet td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle
}

.alvd-col-check {
  width: 36px;
  text-align: center
}

.alvd-col-id {
  width: 90px
}

.alvd-col-status {
  width: 105px
}

.alvd-col-game {
  width: 120px
}

.alvd-col-rank {
  width: 95px
}

.alvd-col-highlights {
  min-width: 140px;
  max-width: 240px
}

.alvd-col-login {
  min-width: 110px;
  max-width: 200px
}

.alvd-col-buy,
.alvd-col-sell,
.alvd-col-profit {
  width: 75px;
  text-align: right
}

.alvd-col-notes {
  min-width: 120px;
  max-width: 200px
}

.alvd-col-actions {
  width: 90px;
  text-align: center
}

.alvd-cell-empty {
  color: var(--text-muted);
  font-size: 12px
}

.alvd-inv-id {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap
}

.alvd-inline-status {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 110px
}

.alvd-inline-status:focus {
  box-shadow: 0 0 0 2px var(--border-focus)
}

.alvd-game-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap
}

.alvd-rank-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap
}

.alvd-highlights-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0
}

.alvd-highlights-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
  font-size: 12px;
  color: var(--text-secondary)
}

.alvd-tracker-link {
  flex-shrink: 0;
  text-decoration: none;
  font-size: 13px;
  opacity: .7
}

.alvd-tracker-link:hover {
  opacity: 1
}

.alvd-sold-ticket {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap
}

.alvd-delivery-ticket {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(16, 185, 129, .28);
  background: rgba(16, 185, 129, .1);
  color: #6ee7b7;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.alvd-delivery-ticket::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .12);
}

.alvd-delivery-ticket:hover {
  border-color: rgba(52, 211, 153, .48);
  background: rgba(16, 185, 129, .16);
  color: #d1fae5;
}

.alvd-shop-evidence-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(249, 200, 108, .28);
  background: rgba(249, 200, 108, .1);
  color: #f9d889;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.alvd-shop-evidence-chip:hover {
  border-color: rgba(249, 200, 108, .48);
  background: rgba(249, 200, 108, .16);
  color: #ffe5a8;
}

.alvd-login-cell {
  display: flex;
  align-items: center;
  gap: 6px
}

.alvd-login-masked {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden
}

.alvd-login-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--text-secondary)
}

.profit-positive {
  color: var(--success) !important;
  font-weight: 600
}

.profit-negative {
  color: var(--danger) !important;
  font-weight: 600
}

.alvd-notes-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-size: 12px;
  color: var(--text-muted)
}

.alvd-action-btns {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center
}

.alvd-btn-icon-sm {
  width: 28px !important;
  height: 28px !important;
  padding: 5px !important
}

.alvd-btn-icon-sm svg {
  width: 14px !important;
  height: 14px !important
}

.alvd-btn-icon-danger {
  color: var(--text-muted) !important
}

.alvd-btn-icon-danger:hover {
  color: var(--danger) !important;
  background: var(--danger-glow) !important
}

.alvd-spinner-tiny {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: alvd-spin .6s linear infinite
}

@keyframes alvd-spin {
  to {
    transform: rotate(360deg)
  }
}

.alvd-editable {
  cursor: text;
  position: relative;
  padding: 10px !important
}

.alvd-editable:hover {
  background: var(--bg-elevated)
}

.alvd-editable:hover::after {
  content: "✎";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: .4
}

.alvd-inline-input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-base);
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none
}

.alvd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle)
}

.alvd-pagination-info {
  font-size: 12px;
  color: var(--text-muted)
}

.alvd-badge-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dim) 100%) !important
}

.alvd-tabs-inv .alvd-tab svg {
  width: 14px !important;
  height: 14px !important
}

.alvd-credential-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-base)
}

.alvd-credential-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600
}

.alvd-input-mono {
  font-family: ui-monospace, 'Cascadia Code', monospace !important;
  letter-spacing: .5px
}

.alvd-form-hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  display: block
}

.alvd-cred-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0
}

.alvd-cred-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle)
}

.alvd-cred-badge.alvd-cred-ok {
  color: var(--success);
  border-color: rgba(52, 211, 153, .2);
  background: var(--success-glow)
}

.alvd-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px
}

.alvd-alert-warn {
  background: var(--warning-glow);
  border: 1px solid rgba(251, 191, 36, .2)
}

.alvd-alert-warn strong {
  color: var(--warning)
}

.alvd-alert-error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.alvd-alert-error svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--danger);
}

.alvd-alert-error strong,
.alvd-alert-error span {
  display: block;
}

.alvd-alert-error strong {
  color: #fecaca;
  font-size: 13px;
}

.alvd-alert-error span {
  margin-top: 2px;
  color: rgba(254, 202, 202, 0.82);
  font-size: 12px;
}

.alvd-credentials-locked {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-top: 12px
}

.alvd-credentials-locked p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text-secondary)
}

.alvd-credentials-locked small {
  font-size: 11px;
  color: var(--text-muted)
}

.alvd-profit-display {
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px
}

@media(max-width:900px) {
  .alvd-inventory-stats {
    grid-template-columns: repeat(2, 1fr)
  }

  .alvd-inventory-toolbar {
    flex-direction: column;
    align-items: stretch
  }

  .alvd-col-notes,
  .alvd-col-profit {
    display: none
  }
}

@media(max-width:600px) {
  .alvd-inventory-stats {
    grid-template-columns: 1fr 1fr
  }

  .alvd-stat-mini {
    padding: 10px 12px
  }

  .alvd-stat-mini-value {
    font-size: 16px
  }

  .alvd-col-notes,
  .alvd-col-profit,
  .alvd-col-login,
  .alvd-col-rank {
    display: none
  }
}

/* ═══ QUICK REPLY BAR (Chat) ═══ */
.alvd-qr-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative
}

.alvd-qr-toggle {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  padding: 5px 12px !important;
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important
}

.alvd-qr-toggle:hover {
  color: var(--gold) !important;
  border-color: var(--gold) !important;
  background: var(--bg-hover) !important
}

.alvd-qr-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 20;
  max-height: 160px;
  overflow-y: auto
}

.alvd-qr-pick {
  padding: 5px 10px;
  font-size: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap
}

.alvd-qr-pick:hover {
  background: var(--gold);
  color: var(--bg-base);
  border-color: var(--gold)
}

/* ═══════════════════════════════════════════════════════════════
   NEW FEATURES: Unread, Optimistic, Command Palette, Read Receipts
   ═══════════════════════════════════════════════════════════════ */

/* ═══ UNREAD INDICATOR ═══ */
.alvd-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-right: 6px;
  animation: alvd-pulse-dot 2s ease-in-out infinite;
  vertical-align: middle;
}

.alvd-ticket-unread td {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.alvd-ticket-unread {
  background: rgba(249, 200, 108, 0.04) !important;
  border-left: 3px solid var(--gold) !important;
}

@keyframes alvd-pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ═══ OPTIMISTIC / PENDING MESSAGE ═══ */
.alvd-msg-pending {
  opacity: 0.6;
}

.alvd-msg-pending .alvd-msg-bubble::after {
  content: '⏳';
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
}

/* ═══ NEW MESSAGE FLASH ═══ */
.alvd-msg-new .alvd-msg-bubble {
  animation: alvd-msg-flash 0.6s ease;
}

@keyframes alvd-msg-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 200, 108, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(249, 200, 108, 0.1);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(249, 200, 108, 0);
  }
}

/* ═══ READ RECEIPT ═══ */
.alvd-read-receipt {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-read-receipt svg {
  width: 12px;
  height: 12px;
  color: var(--success, #22c55e);
}

.alvd-read-receipt.is-online {
  color: var(--success, #22c55e);
}

/* ═══ COMMAND PALETTE ═══ */
.alvd-cmdpal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(20vh, 160px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.alvd-cmdpal-overlay.open {
  opacity: 1;
}

.alvd-cmdpal {
  width: 90%;
  max-width: 560px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: scale(0.96) translateY(-10px);
  transition: transform 0.15s ease;
}

.alvd-cmdpal-overlay.open .alvd-cmdpal {
  transform: scale(1) translateY(0);
}

.alvd-cmdpal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.alvd-cmdpal-header svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.alvd-cmdpal-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.alvd-cmdpal-input::placeholder {
  color: var(--text-muted);
}

.alvd-cmdpal-kbd {
  padding: 2px 8px;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: inherit;
}

.alvd-cmdpal-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.alvd-cmdpal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.1s;
}

.alvd-cmdpal-item:hover,
.alvd-cmdpal-item.selected {
  background: var(--bg-hover);
}

.alvd-cmdpal-item.selected {
  background: rgba(249, 200, 108, 0.08);
}

.alvd-cmdpal-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.alvd-cmdpal-item-text {
  flex: 1;
  min-width: 0;
}

.alvd-cmdpal-label {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.alvd-cmdpal-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-cmdpal-type {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.alvd-cmdpal-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══ ASSIGN-TO-CUSTOMER MODAL ═══ */
.alvd-assign-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
}

.alvd-assign-selected {
  margin-top: 8px;
}

.alvd-assign-customer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(249, 200, 108, 0.06);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md, 8px);
}

.alvd-assign-customer-info strong {
  color: var(--text-primary);
}

.alvd-assign-preview {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.alvd-assign-preview h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

.alvd-assign-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alvd-assign-preview-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.alvd-assign-preview-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.alvd-ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.alvd-ac-item:last-child {
  border-bottom: none;
}

.alvd-ac-item:hover {
  background: var(--bg-hover);
}

.alvd-ac-item strong {
  color: var(--gold);
  font-size: 13px;
  white-space: nowrap;
}

.alvd-ac-item span {
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-ac-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.alvd-autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.3));
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
}

.alvd-autocomplete {
  position: relative;
}

/* ═══ INVENTORY ASSIGN BUTTON HIGHLIGHT ═══ */
.inv-assign-ticket {
  color: var(--gold) !important;
}

.inv-assign-ticket:hover {
  background: rgba(249, 200, 108, 0.15) !important;
}



/* ═══════════════════════════════════════════════════════════════════
   UNREAD COUNT BADGE  (replaces the old yellow dot)
   ═══════════════════════════════════════════════════════════════════ */
.alvd-unread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary, #8B5CF6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Row highlight when there are unread messages */
tr.alvd-ticket-unread {
  background: rgba(139, 92, 246, 0.06) !important;
}

tr.alvd-ticket-unread:hover {
  background: rgba(139, 92, 246, 0.12) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   NOTES INDICATOR IN LIST
   ═══════════════════════════════════════════════════════════════════ */
.alvd-note-dot {
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.8;
  cursor: default;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOMER OVERVIEW CARD
   ═══════════════════════════════════════════════════════════════════ */
.alvd-customer-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  min-height: 80px;
}

/* ── Customer Overview: full-width card below chat ────── */

.alvd-customer-overview-card {
  margin-top: 16px;
}

.alvd-customer-email-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: auto;
  font-weight: 400;
}

.alvd-customer-overview-body-wrap {
  padding: 16px 20px 20px;
}

/* Main layout: KPI tiles left, ticket history right */
.alvd-co-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* KPI tiles: 2x2 grid */
.alvd-co-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.alvd-co-kpi {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s;
}

.alvd-co-kpi:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* KPI accent left border */
.alvd-co-kpi-ok {
  border-left: 3px solid #10b981;
}

.alvd-co-kpi-warn {
  border-left: 3px solid #ef4444;
}

.alvd-co-kpi-green {
  border-left: 3px solid #10b981;
}

.alvd-co-kpi-blue {
  border-left: 3px solid #60a5fa;
}

.alvd-co-kpi-purple {
  border-left: 3px solid #a78bfa;
}

.alvd-co-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alvd-co-kpi-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.alvd-co-kpi-ok .alvd-co-kpi-icon,
.alvd-co-kpi-green .alvd-co-kpi-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.alvd-co-kpi-warn .alvd-co-kpi-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.alvd-co-kpi-blue .alvd-co-kpi-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.alvd-co-kpi-purple .alvd-co-kpi-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
}

.alvd-co-kpi-body {
  flex: 1;
  min-width: 0;
}

.alvd-co-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
}

.alvd-co-kpi-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-co-kpi-value.alvd-co-paid {
  color: #10b981;
}

.alvd-co-kpi-value.alvd-co-none {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}

.alvd-co-kpi-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.alvd-co-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.alvd-co-link:hover {
  text-decoration: underline;
}

/* Ticket history table */
.alvd-co-history {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.alvd-co-history-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.alvd-co-history-list {
  display: flex;
  flex-direction: column;
}

.alvd-co-history-row {
  display: grid;
  grid-template-columns: 90px 1fr auto auto 20px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  transition: background 0.12s;
}

.alvd-co-history-row:last-child {
  border-bottom: none;
}

.alvd-co-history-clickable {
  cursor: pointer;
}

.alvd-co-history-clickable:hover {
  background: rgba(249, 200, 108, 0.05);
}

.alvd-co-history-id {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 11px;
}

.alvd-co-history-game {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alvd-co-history-date {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.alvd-co-history-arrow {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

.alvd-co-no-history {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════
   INTERNAL NOTES PANEL
   ═══════════════════════════════════════════════════════════════════ */
.alvd-notes-body {
  padding: 12px 16px;
}

/* Empty state */
.alvd-notes-empty {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 8px;
  font-style: italic;
}

/* Single note item */
.alvd-note-item {
  background: rgba(251, 191, 36, 0.07);
  /* amber tint – sticky note feel */
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-left: 3px solid rgba(251, 191, 36, 0.55);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.alvd-note-item:last-child {
  margin-bottom: 0;
}

/* Note meta row: author + time */
.alvd-note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.alvd-note-author {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.alvd-note-time {
  font-size: 11px;
  color: var(--text-muted);
}

.alvd-note-edited {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Note text content */
.alvd-note-text {
  font-size: 13px;
  color: var(--text-secondary, #c4c4cf);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Note action buttons (edit / delete) */
.alvd-note-actions {
  display: flex;
  gap: 12px;
  margin-top: 7px;
}

.alvd-btn-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.alvd-btn-link:hover {
  color: var(--text-primary);
}


/* ═══════════════════════════════════════════════════════════════════
   READ ALL BUTTON
   ═══════════════════════════════════════════════════════════════════ */
.alvd-read-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  padding: 5px 11px !important;
  transition: border-color 0.15s, background 0.15s;
}

.alvd-read-all-btn:hover {
  border-color: var(--primary, #8B5CF6) !important;
  background: rgba(139, 92, 246, 0.08) !important;
  color: var(--primary, #8B5CF6) !important;
}

.alvd-read-all-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary, #8B5CF6);
  flex-shrink: 0;
  animation: alvd-pulse 2s ease-in-out infinite;
}

@keyframes alvd-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.alvd-read-all-count {
  background: rgba(139, 92, 246, 0.18);
  color: var(--primary, #8B5CF6);
  border-radius: 10px;
  padding: 0 6px;
  font-weight: 700;
  font-size: 11px;
  line-height: 16px;
}

/* ═══════════════════════════════════════════════════════════════════
   NOTES COLUMN IN TICKET TABLE
   ═══════════════════════════════════════════════════════════════════ */
.alvd-ticket-table th:nth-child(3),
.alvd-ticket-table td.alvd-col-note-preview {
  max-width: 200px;
  min-width: 100px;
  width: 180px;
}

.alvd-note-preview-text {
  display: block;
  font-size: 12px;
  color: rgba(251, 191, 36, 0.85);
  /* amber — matches sticky note feel */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  cursor: default;
}

.alvd-note-preview-empty {
  color: var(--text-muted);
  font-size: 13px;
}


/* ═══════════════════════════════════════════════════════════════════
   REPLY QUOTES IN MESSAGES
   ═══════════════════════════════════════════════════════════════════ */

.alvd-msg-reply-quote {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.alvd-msg-reply-quote-bar {
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

.alvd-msg-reply-quote-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.alvd-msg-reply-quote-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}

.alvd-msg-reply-quote-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Textarea row with upload button ─────── */
.alvd-textarea-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.alvd-textarea-row #msg {
  flex: 1;
}

.alvd-upload-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}

.alvd-upload-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(249, 200, 108, 0.08);
}

.alvd-upload-btn.alvd-uploading {
  opacity: 0.5;
  pointer-events: none;
}

.alvd-upload-btn svg {
  pointer-events: none;
}

/* ── Attachment preview strip ─────────────── */
.alvd-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 4px;
}

.alvd-attach-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.alvd-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alvd-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ── Attachment image in message bubble ──── */
.alvd-msg-attachment-wrap {
  position: relative;
  margin-top: 8px;
  display: inline-block;
  max-width: 280px;
  border-radius: 8px;
  overflow: hidden;
}

.alvd-msg-attachment-img {
  display: block;
  width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
}

.alvd-msg-attachment-wrap:focus-visible {
  outline: 2px solid rgba(249, 200, 108, 0.72);
  outline-offset: 3px;
}

.alvd-msg-att-badge {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 10px;
  color: #10b981;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   SHOWCASE IMAGE UPLOAD
   ═══════════════════════════════════════════════════════════════════ */

.alvd-lightbox-open {
  overflow: hidden;
}

.alvd-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 7, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.alvd-image-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.alvd-image-lightbox-panel {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: min(88vh, 900px);
}

.alvd-image-lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(88vh, 900px);
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #050507;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.alvd-image-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #f8f8fa;
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.alvd-image-lightbox-close:hover {
  color: var(--gold);
  border-color: rgba(249, 200, 108, 0.42);
  background: rgba(14, 14, 20, 0.94);
}

.alvd-image-lightbox-close svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 620px) {
  .alvd-image-lightbox {
    padding: 12px;
  }

  .alvd-image-lightbox-img {
    max-height: 84vh;
    border-radius: 10px;
  }

  .alvd-image-lightbox-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
}

.alvd-showcase-upload-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.alvd-showcase-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 100%;
}

.alvd-showcase-thumb {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.alvd-showcase-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alvd-showcase-clear-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.alvd-showcase-url-store {
  display: none;
}
/* ================================================================
   PIN & PURGE — Ticket List Enhancements
   ================================================================ */

.alvd-col-pin {
  width: 36px;
  padding: 0 4px !important;
  text-align: center;
}

.alvd-pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0.3;
  transition: opacity 0.15s;
}

.alvd-pin-btn:hover {
  opacity: 0.7;
}

.alvd-pin-btn.pinned {
  opacity: 1;
}

.alvd-pin-empty {
  font-size: 16px;
  color: var(--text-muted);
}

.alvd-ticket-pinned {
  background: rgba(249, 200, 108, 0.04) !important;
  border-left: 2px solid rgba(249, 200, 108, 0.5);
}

.alvd-ticket-pinned:hover {
  background: rgba(249, 200, 108, 0.08) !important;
}

.alvd-archive-btn {
  margin-left: auto;
  opacity: 0.7;
  font-size: 12px;
}

.alvd-archive-btn:hover {
  opacity: 1;
  color: var(--danger);
  border-color: var(--danger);
}

/* ================================================================
   DESK POLISH V1 - Cleaner internal tool layer
   ================================================================ */

:root {
  --desk-panel: rgba(15, 15, 20, 0.9);
  --desk-panel-soft: rgba(255, 255, 255, 0.025);
  --desk-border: rgba(255, 255, 255, 0.075);
  --desk-gold: #c99335;
  --desk-gold-strong: #e1ad48;
}

body {
  background: #08080c;
}

@media (min-width: 901px) {
  .alvd-sidebar {
    width: 248px;
    background: #0a0a0f;
  }

  .alvd-main {
    margin-left: 248px;
  }
}

.alvd-sidebar::before {
  opacity: 0.35;
}

.alvd-nav-section {
  margin: 14px 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.alvd-nav-section-label {
  padding: 0 10px 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-nav-sub {
  min-height: 36px;
  padding: 9px 12px;
  font-size: 13px;
}

/* Admin workspace tabs */
.alvd-nav-section.alvd-admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 8px 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.018)),
    rgba(8, 8, 12, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.alvd-admin-tabs .alvd-nav-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px;
  color: rgba(224, 220, 235, 0.58);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-admin-tabs .alvd-nav-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent);
}

.alvd-admin-tabs .alvd-admin-tab {
  --admin-accent: #f7c66b;
  --admin-surface: rgba(247, 198, 107, 0.1);
  --admin-border: rgba(247, 198, 107, 0.28);
  --admin-glow: rgba(247, 198, 107, 0.15);
  min-height: 54px;
  padding: 7px 10px;
  gap: 11px;
  color: rgba(229, 225, 238, 0.72);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  overflow: hidden;
}

.alvd-admin-tabs .alvd-admin-tab[data-v="users"] {
  --admin-accent: #67e8f9;
  --admin-surface: rgba(103, 232, 249, 0.1);
  --admin-border: rgba(103, 232, 249, 0.28);
  --admin-glow: rgba(103, 232, 249, 0.15);
}

.alvd-admin-tabs .alvd-admin-tab[data-v="auditlog"] {
  --admin-accent: #fbbf24;
  --admin-surface: rgba(251, 191, 36, 0.1);
  --admin-border: rgba(251, 191, 36, 0.28);
  --admin-glow: rgba(251, 191, 36, 0.15);
}

.alvd-admin-tabs .alvd-admin-tab[data-v="blacklist"] {
  --admin-accent: #fb7185;
  --admin-surface: rgba(251, 113, 133, 0.1);
  --admin-border: rgba(251, 113, 133, 0.28);
  --admin-glow: rgba(251, 113, 133, 0.15);
}

.alvd-admin-tabs .alvd-admin-tab[data-v="settings"] {
  --admin-accent: #86efac;
  --admin-surface: rgba(134, 239, 172, 0.1);
  --admin-border: rgba(134, 239, 172, 0.28);
  --admin-glow: rgba(134, 239, 172, 0.15);
}

.alvd-admin-tabs .alvd-admin-tab::before {
  content: none;
}

.alvd-admin-tabs .alvd-admin-tab > svg {
  width: 17px;
  height: 17px;
  padding: 6px;
  color: var(--admin-accent);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 7px;
  opacity: 1;
}

.alvd-admin-tabs .alvd-admin-tab-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding-right: 12px;
  overflow: hidden;
}

.alvd-admin-tabs .alvd-admin-tab-copy strong,
.alvd-admin-tabs .alvd-admin-tab-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alvd-admin-tabs .alvd-admin-tab-copy strong {
  color: currentColor;
  font-size: 13px;
  font-weight: 820;
}

.alvd-admin-tabs .alvd-admin-tab-copy small {
  color: rgba(224, 220, 235, 0.48);
  font-size: 11px;
  font-weight: 650;
}

.alvd-admin-tabs .alvd-admin-tab:hover,
.alvd-admin-tabs .alvd-admin-tab:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.085);
  outline: none;
}

.alvd-admin-tabs .alvd-admin-tab:hover > svg,
.alvd-admin-tabs .alvd-admin-tab:focus-visible > svg {
  background: var(--admin-surface);
  border-color: var(--admin-border);
}

.alvd-admin-tabs .alvd-admin-tab.active {
  color: var(--text-primary);
  background: var(--admin-surface);
  border-color: var(--admin-border);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 8px 22px rgba(0, 0, 0, 0.18);
}

.alvd-admin-tabs .alvd-admin-tab.active::after {
  content: "";
  position: absolute;
  left: auto;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  background: var(--admin-accent);
  border-radius: 999px;
  box-shadow: 0 0 0 4px var(--admin-glow);
}

.alvd-admin-tabs .alvd-admin-tab.active > svg {
  color: #08080c;
  background: var(--admin-accent);
  border-color: transparent;
}

.alvd-admin-tabs .alvd-admin-tab.active .alvd-admin-tab-copy small {
  color: rgba(245, 242, 250, 0.66);
}

/* Admin workbench tabs - compact polish */
.alvd-nav-section.alvd-admin-tabs {
  gap: 5px;
  padding: 8px;
  border-radius: 10px;
}

.alvd-admin-tabs .alvd-admin-tab {
  min-height: 48px;
  padding: 6px 9px;
  border-radius: 8px;
}

.alvd-admin-tabs .alvd-admin-tab > svg {
  width: 16px;
  height: 16px;
  padding: 5px;
  border-radius: 7px;
}

.alvd-admin-tabs .alvd-admin-tab.active {
  background: linear-gradient(90deg, var(--admin-surface), rgba(255, 255, 255, 0.018));
  box-shadow: none;
}

.alvd-admin-tabs .alvd-admin-tab.active::after {
  right: 8px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  box-shadow: none;
}

.alvd-admin-tabs .alvd-admin-tab-copy strong {
  font-size: 12px;
  line-height: 1.05;
}

.alvd-admin-tabs .alvd-admin-tab-copy small {
  font-size: 10px;
  line-height: 1.05;
}

.alvd-content {
  padding: 22px;
}

.alvd-card {
  background: linear-gradient(180deg, rgba(18, 18, 24, 0.92), rgba(13, 13, 18, 0.94));
  border-color: var(--desk-border);
  border-radius: 10px;
  box-shadow: none;
}

.alvd-card-mb {
  margin-bottom: 12px;
}

.alvd-card-header {
  padding: 12px 14px;
  background: transparent;
}

.alvd-card-header h3 {
  font-size: 14px;
  letter-spacing: 0;
}

.alvd-card-header h3 svg {
  width: 16px;
  height: 16px;
}

.alvd-card-body {
  padding: 14px;
}

.alvd-btn-primary {
  background: linear-gradient(135deg, var(--desk-gold-strong), #a66f1b);
  color: #fff8ea;
  box-shadow: none;
}

.alvd-btn-primary:hover,
.alvd-chat-actions .alvd-btn-primary:hover {
  box-shadow: none;
}

.alvd-toolbar {
  gap: 10px;
  margin-bottom: 14px;
}

.alvd-ticket-table th {
  padding: 11px 14px;
  font-size: 11px;
  letter-spacing: 0;
}

.alvd-ticket-table td {
  padding: 12px 14px;
}

.alvd-ticket-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.alvd-ticket-pinned {
  background: rgba(201, 147, 53, 0.055) !important;
  border-left-color: rgba(201, 147, 53, 0.7);
}

.alvd-archive-btn {
  gap: 7px;
}

.alvd-archive-btn svg {
  width: 14px;
  height: 14px;
}

.alvd-queue-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.alvd-queue-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-queue-kicker svg {
  width: 15px;
  height: 15px;
}

.alvd-queue-hero h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.alvd-queue-hero p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.alvd-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.alvd-action-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--desk-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.026);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.alvd-action-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(249, 200, 108, 0.24);
}

.alvd-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.alvd-action-icon svg {
  width: 17px;
  height: 17px;
}

.alvd-action-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.alvd-action-label {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-action-hint {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-action-value {
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.alvd-action-card-warning .alvd-action-icon {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.12);
}

.alvd-action-card-blue .alvd-action-icon {
  color: var(--info);
  background: rgba(96, 165, 250, 0.11);
}

.alvd-action-card-purple .alvd-action-icon {
  color: var(--accent-bright);
  background: rgba(167, 139, 250, 0.1);
}

.alvd-action-card-green .alvd-action-icon {
  color: var(--success);
  background: rgba(52, 211, 153, 0.11);
}

.alvd-action-card-neutral .alvd-action-icon {
  color: var(--teal);
  background: rgba(45, 212, 191, 0.1);
}

.alvd-system-health {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(12, 12, 18, 0.72);
}

.alvd-system-health.is-ok {
  border-color: rgba(52, 211, 153, 0.24);
}

.alvd-system-health.is-warning {
  border-color: rgba(245, 158, 11, 0.34);
}

.alvd-system-health-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alvd-system-health-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.11);
  color: var(--success);
  flex: 0 0 auto;
}

.alvd-system-health.is-warning .alvd-system-health-icon {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.alvd-system-health-main strong,
.alvd-system-health-main small {
  display: block;
}

.alvd-system-health-main strong {
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-system-health-main small,
.alvd-system-health-last {
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-system-health-last {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .alvd-system-health {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .alvd-system-health-last {
    white-space: normal;
  }
}

.alvd-queue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.alvd-queue-card {
  overflow: hidden;
}

.alvd-queue-card-head {
  min-height: 52px;
}

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

.alvd-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.alvd-queue-row:hover {
  background: rgba(255, 255, 255, 0.038);
  border-color: rgba(249, 200, 108, 0.2);
}

.alvd-queue-row.has-unread {
  border-color: rgba(96, 165, 250, 0.3);
}

.alvd-queue-row-main,
.alvd-queue-row-side {
  display: grid;
  min-width: 0;
}

.alvd-queue-row-main {
  gap: 4px;
}

.alvd-queue-row-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 900;
}

.alvd-queue-row-meta,
.alvd-queue-row-sub,
.alvd-queue-owner,
.alvd-queue-time {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-queue-row-side {
  justify-items: end;
  gap: 6px;
}

.alvd-queue-activity .alvd-activity-feed {
  gap: 16px;
}

.alvd-queue-activity .alvd-activity-group {
  gap: 8px;
}

.alvd-queue-activity .alvd-activity-date {
  position: static;
  top: auto;
  z-index: auto;
  padding: 0;
  margin-bottom: 8px;
  font-size: 11px;
  background: transparent;
}

.alvd-queue-activity .alvd-activity-timeline {
  padding-left: 0;
  margin-left: 0;
  border-left: 0;
}

.alvd-queue-activity .alvd-activity-item {
  margin-left: 0;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.alvd-queue-activity .alvd-activity-item::before {
  display: none;
}

.alvd-empty-compact {
  padding: 26px 12px;
}

.alvd-ticket-header {
  margin-bottom: 14px;
}

.alvd-ticket-header h2 {
  font-size: 20px;
}

.alvd-ticket-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.alvd-ticket-right .alvd-card {
  margin-bottom: 10px;
}

.alvd-ticket-right .alvd-card-header {
  padding: 10px 12px;
}

.alvd-ticket-right .alvd-card-body {
  padding: 12px;
}

.alvd-secondary-card .alvd-collapsible-head {
  cursor: default;
}

.alvd-card-toggle {
  width: 28px;
  height: 28px;
}

.alvd-card-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.16s ease;
}

.alvd-secondary-card.is-collapsed .alvd-card-toggle svg {
  transform: rotate(-90deg);
}

.alvd-secondary-card.is-collapsed .alvd-card-body {
  display: none;
}

/* Desk Support Automation card */
.alvd-followup-card .alvd-card-body {
  display: grid;
  gap: 12px;
}

.alvd-followup-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(249, 200, 108, 0.045)),
    rgba(255, 255, 255, 0.025);
}

.alvd-followup-summary span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-followup-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-followup-summary small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.alvd-followup-status {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.alvd-followup-status.is-active {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
}

.alvd-followup-status.is-paused {
  border-color: rgba(249, 200, 108, 0.34);
  background: rgba(249, 200, 108, 0.1);
  color: var(--desk-gold-strong);
}

.alvd-followup-status.is-stopped {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-muted);
}

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

.alvd-followup-actions .alvd-btn {
  justify-content: center;
}

.alvd-followup-events {
  display: grid;
  gap: 7px;
}

.alvd-followup-event {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-followup-event span,
.alvd-followup-event strong,
.alvd-followup-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-followup-event strong {
  color: var(--text-secondary);
  font-weight: 800;
}

/* Desk Evidence & Access card */
.alvd-evidence-access-card .alvd-card-body {
  display: grid;
  gap: 12px;
}

.alvd-evidence-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(249, 200, 108, 0.15);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(249, 200, 108, 0.08), rgba(16, 185, 129, 0.035)),
    rgba(255, 255, 255, 0.025);
}

.alvd-evidence-summary span,
.alvd-access-tools-head span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-evidence-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.2;
}

.alvd-evidence-summary small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.alvd-evidence-score {
  min-width: 54px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.alvd-evidence-score.is-strong {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.alvd-evidence-score.is-good {
  border-color: rgba(249, 200, 108, 0.34);
  background: rgba(249, 200, 108, 0.11);
  color: var(--desk-gold-strong);
}

.alvd-evidence-score.is-partial {
  border-color: rgba(251, 146, 60, 0.34);
  background: rgba(251, 146, 60, 0.1);
  color: #fdba74;
}

.alvd-evidence-score.is-review {
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text-muted);
}

.alvd-evidence-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.alvd-evidence-report-grid .alvd-btn {
  justify-content: center;
  padding-inline: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.alvd-evidence-dossier {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.alvd-evidence-dossier.has-gaps {
  border-color: rgba(251, 146, 60, 0.22);
  background: rgba(251, 146, 60, 0.055);
}

.alvd-evidence-dossier.is-clean {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.045);
}

.alvd-evidence-dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alvd-evidence-dossier-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.alvd-evidence-dossier-head svg {
  width: 15px;
  height: 15px;
}

.alvd-evidence-dossier-head span {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.alvd-evidence-chip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alvd-evidence-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  align-items: start;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-evidence-chip.is-ok {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.07);
}

.alvd-evidence-chip.is-muted {
  border-color: rgba(148, 163, 184, 0.18);
}

.alvd-evidence-chip svg {
  grid-row: 1 / span 2;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: #6ee7b7;
}

.alvd-evidence-chip b,
.alvd-evidence-gap b {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-evidence-chip small,
.alvd-evidence-gap small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-evidence-gap-list {
  display: grid;
  gap: 7px;
}

.alvd-evidence-gap {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 8px;
  background: rgba(251, 146, 60, 0.07);
}

.alvd-evidence-settings {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.045);
}

.alvd-evidence-settings-head,
.alvd-evidence-settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alvd-evidence-settings-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.alvd-evidence-settings-head svg {
  width: 15px;
  height: 15px;
}

.alvd-evidence-settings-head span,
.alvd-evidence-settings label > span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-evidence-settings label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.alvd-evidence-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.alvd-evidence-chat-scope {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-evidence-chat-scope > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alvd-evidence-chat-scope > div:first-child span,
.alvd-evidence-chat-scope > small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-evidence-chat-scope > div:first-child strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.alvd-evidence-chat-scope > small {
  line-height: 1.35;
  text-transform: none;
}

.alvd-evidence-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alvd-evidence-scope-option {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px 10px 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.alvd-evidence-scope-option input {
  position: absolute;
  left: 11px;
  top: 12px;
  margin: 0;
  accent-color: var(--gold);
}

.alvd-evidence-scope-option b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.alvd-evidence-scope-option b svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.alvd-evidence-scope-option small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.alvd-evidence-scope-option.is-active {
  border-color: rgba(249, 200, 108, 0.5);
  background: rgba(249, 200, 108, 0.1);
}

.alvd-evidence-settings textarea {
  min-height: 86px;
  resize: vertical;
}

.alvd-evidence-settings-foot small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.alvd-evidence-export-log {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.12);
}

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

.alvd-evidence-export-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.alvd-evidence-export-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-evidence-export-grid strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-case-evidence-card .alvd-card-body {
  display: grid;
  gap: 12px;
}

.alvd-case-evidence-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alvd-case-evidence-actions .alvd-btn {
  min-width: 0;
}

.alvd-case-evidence-checklist {
  display: grid;
  gap: 8px;
}

.alvd-evidence-workbench {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alvd-evidence-filterbar {
  grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(150px, 0.7fr));
}

.alvd-evidence-search .alvd-input {
  min-height: 40px;
}

.alvd-evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: start;
}

.alvd-evidence-list-panel,
.alvd-evidence-detail {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.alvd-evidence-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.alvd-evidence-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  background: rgba(12, 13, 18, 0.72);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.alvd-evidence-row:hover,
.alvd-evidence-row.active {
  border-color: rgba(249, 200, 108, 0.26);
  background: rgba(22, 23, 31, 0.94);
}

.alvd-evidence-row-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(249, 200, 108, 0.06);
}

.alvd-evidence-row-icon svg {
  width: 17px;
  height: 17px;
}

.alvd-evidence-row-main,
.alvd-evidence-row-side {
  min-width: 0;
}

.alvd-evidence-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.alvd-evidence-row-title strong {
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-evidence-source,
.alvd-evidence-provider,
.alvd-evidence-row-side em,
.alvd-evidence-detail-head span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alvd-evidence-source,
.alvd-evidence-provider {
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-evidence-row-main p,
.alvd-evidence-row-main small {
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-evidence-row-main .alvd-evidence-row-dispute {
  color: var(--desk-gold-strong);
}

.alvd-evidence-row-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.alvd-evidence-row-side strong {
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}

.alvd-evidence-row-side .alvd-evidence-score {
  min-width: 82px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.alvd-evidence-detail {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.alvd-evidence-detail.is-empty {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.alvd-evidence-detail.is-empty svg {
  width: 40px;
  height: 40px;
  color: var(--gold);
}

.alvd-evidence-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.alvd-evidence-detail-head h3 {
  margin: 4px 0 2px;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.2;
}

.alvd-evidence-detail-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.alvd-evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.alvd-evidence-actions .alvd-btn {
  text-decoration: none;
}

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

.alvd-evidence-meta-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
}

.alvd-evidence-meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.alvd-evidence-meta-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.alvd-evidence-section {
  display: grid;
  gap: 9px;
}

.alvd-evidence-proof-list {
  display: grid;
  gap: 7px;
}

.alvd-evidence-proof {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
}

.alvd-evidence-proof > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.alvd-evidence-proof.ok > span {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
}

.alvd-evidence-proof svg {
  width: 14px;
  height: 14px;
}

.alvd-evidence-proof strong,
.alvd-evidence-proof small {
  display: block;
}

.alvd-evidence-proof strong {
  color: var(--text-primary);
  font-size: 12px;
}

.alvd-evidence-proof small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.alvd-evidence-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alvd-evidence-flags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(251, 146, 60, 0.24);
  border-radius: 999px;
  color: #fdba74;
  background: rgba(251, 146, 60, 0.075);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .alvd-evidence-layout,
  .alvd-evidence-filterbar {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-detail {
    position: relative;
    top: auto;
  }
}

@media (max-width: 640px) {
  .alvd-evidence-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .alvd-evidence-row-side {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .alvd-evidence-meta-grid {
    grid-template-columns: 1fr;
  }
}

.alvd-access-tools {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.alvd-access-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alvd-access-tools-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-access-tools-head svg {
  width: 14px;
  height: 14px;
  color: var(--desk-gold-strong);
}

.alvd-regenerate-token {
  border-color: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}

.alvd-regenerate-token:hover {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(239, 68, 68, 0.08);
}

.alvd-evidence-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
}

.alvd-evidence-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(14px);
}

.alvd-evidence-viewer-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 96vw);
  height: min(88vh, 920px);
  overflow: hidden;
  border: 1px solid rgba(249, 200, 108, 0.22);
  border-radius: 14px;
  background: #0f1118;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.alvd-evidence-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(135deg, rgba(249, 200, 108, 0.1), rgba(16, 185, 129, 0.035)),
    rgba(255, 255, 255, 0.035);
}

.alvd-evidence-viewer-head span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alvd-evidence-viewer-head strong {
  display: block;
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 14px;
}

.alvd-evidence-viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.alvd-evidence-viewer-actions .alvd-btn-icon {
  width: 34px;
  height: 34px;
  color: var(--text-primary);
  font-size: 19px;
  line-height: 1;
}

.alvd-evidence-viewer-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 900px) {
  .alvd-evidence-report-grid {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-summary {
    align-items: flex-start;
  }

  .alvd-evidence-chip-list {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-settings-head,
  .alvd-evidence-settings-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-evidence-settings-grid {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-chat-scope > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-evidence-chat-scope > div:first-child strong {
    text-align: left;
  }

  .alvd-evidence-scope-options {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-export-grid {
    grid-template-columns: 1fr;
  }

  .alvd-evidence-viewer {
    padding: 8px;
  }

  .alvd-evidence-viewer-panel {
    width: 100%;
    height: 94dvh;
    border-radius: 12px;
  }

  .alvd-evidence-viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-evidence-viewer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.alvd-ticket-right .alvd-form-group {
  margin-bottom: 10px;
}

.alvd-ticket-right .alvd-btn {
  min-height: 38px;
}

.alvd-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.alvd-btn-link svg {
  width: 12px;
  height: 12px;
}

@media (min-width: 1100px) {
  .alvd-ticket-right {
    position: sticky;
    top: 78px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding-right: 2px;
  }
}

.alvd-chat {
  min-height: 620px;
}

.alvd-chat-messages {
  max-height: 560px;
}

.alvd-chat-input {
  padding: 14px;
}

.alvd-chat-actions .alvd-btn-primary {
  background: linear-gradient(135deg, var(--desk-gold-strong), #a66f1b);
  color: #fff8ea;
}

.alvd-soft-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.66);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.alvd-soft-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.alvd-soft-modal {
  width: min(420px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: #101016;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.14s ease;
}

.alvd-soft-modal-overlay.open .alvd-soft-modal {
  transform: translateY(0) scale(1);
}

.alvd-soft-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.alvd-soft-modal-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

.alvd-soft-modal-x svg {
  width: 18px;
  height: 18px;
}

.alvd-soft-modal-copy {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.alvd-soft-modal-field {
  width: 100%;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  font: inherit;
}

.alvd-soft-modal-field:focus {
  outline: none;
  border-color: rgba(249, 200, 108, 0.45);
}

.alvd-soft-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1200px) {
  .alvd-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .alvd-queue-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .alvd-content {
    padding: 14px;
  }

  .alvd-queue-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-ticket-grid {
    grid-template-columns: 1fr;
  }

  .alvd-ticket-right {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .alvd-chat {
    min-height: 520px;
  }
}

@media (max-width: 620px) {
  .alvd-action-grid {
    grid-template-columns: 1fr;
  }

  .alvd-action-card {
    min-height: 64px;
  }

  .alvd-queue-row {
    grid-template-columns: 1fr;
  }

  .alvd-queue-row-side {
    justify-items: start;
  }

  .alvd-soft-modal-actions {
    flex-direction: column-reverse;
  }

  .alvd-soft-modal-actions .alvd-btn {
    justify-content: center;
    width: 100%;
  }
}

/* ================================================================
   DESK POLISH V2 - Ticket detail and inbox refinement
   ================================================================ */

.alvd-primary-actions-card {
  border-color: rgba(201, 147, 53, 0.2);
  background: linear-gradient(180deg, rgba(21, 19, 18, 0.95), rgba(12, 12, 17, 0.96));
}

.alvd-primary-actions-head {
  align-items: center;
  min-height: 52px;
}

.alvd-primary-section {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.alvd-primary-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.alvd-primary-section:last-child {
  padding-bottom: 0;
}

.alvd-primary-section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-primary-section-title svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

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

.alvd-label-muted {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.alvd-currency-mini,
.alvd-price-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(249, 200, 108, 0.14);
  border-radius: 8px;
  background: rgba(249, 200, 108, 0.045);
}

.alvd-currency-mini strong,
.alvd-price-preview strong {
  color: var(--text-primary);
  font-size: 12px;
}

.alvd-currency-mini span,
.alvd-price-preview span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.alvd-currency-mini .is-paid {
  color: var(--success);
  font-weight: 800;
}

.alvd-inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alvd-inline-field .alvd-input {
  min-width: 0;
}

.alvd-copy-mini {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(249, 200, 108, 0.22);
  color: var(--gold);
  background: rgba(249, 200, 108, 0.08);
}

.alvd-copy-mini svg {
  width: 15px;
  height: 15px;
}

.alvd-primary-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.alvd-primary-actions-row .alvd-btn {
  min-width: 142px;
}

.alvd-primary-actions-card #add_showcase {
  margin-top: 8px;
}

.alvd-primary-actions-card .alvd-showcase-list {
  gap: 8px;
}

.alvd-primary-actions-card .alvd-showcase-item {
  padding: 10px;
  border-radius: 8px;
}

.alvd-inbox-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.alvd-inbox-topline h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.alvd-inbox-topline p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.alvd-delivery-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 999px;
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.alvd-delivery-pill svg {
  width: 14px;
  height: 14px;
}

.alvd-inbox-toolbar {
  align-items: stretch;
}

.alvd-ticket-quickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.alvd-ticket-quick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.alvd-ticket-quick strong {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  text-align: center;
}

.alvd-ticket-quick:hover,
.alvd-ticket-quick.active {
  color: var(--gold);
  border-color: rgba(201, 147, 53, 0.36);
  background: rgba(201, 147, 53, 0.08);
}

.alvd-ticket-bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px;
  border: 1px solid rgba(201, 147, 53, 0.2);
  border-radius: 10px;
  background: rgba(201, 147, 53, 0.075);
}

.alvd-ticket-bulk-count {
  padding: 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.alvd-ticket-bulkbar .alvd-select {
  min-height: 34px;
  max-width: 150px;
}

.alvd-inbox-card {
  overflow: hidden;
}

.alvd-ticket-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.alvd-ticket-list-head {
  display: grid;
  grid-template-columns: 64px minmax(150px, 0.75fr) minmax(220px, 1.25fr) minmax(112px, 0.45fr) minmax(120px, 0.45fr) minmax(88px, 0.35fr);
  align-items: center;
  gap: 12px;
  padding: 6px 12px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.alvd-ticket-row-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(150px, 0.75fr) minmax(220px, 1.25fr) minmax(112px, 0.45fr) minmax(120px, 0.45fr) minmax(88px, 0.35fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  overflow: hidden;
  transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.alvd-ticket-row-card:hover {
  border-color: rgba(201, 147, 53, 0.32);
  background: rgba(255, 255, 255, 0.04);
}

.alvd-action-grid.is-updating .alvd-action-card,
.alvd-queue-hero.is-refreshing {
  transition: opacity var(--duration-fast) var(--ease-out);
}

.alvd-action-grid.is-updating .alvd-action-card {
  opacity: 0.78;
}

.alvd-inbox-statusline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.alvd-inbox-card > .alvd-inline-state,
.alvd-inbox-list > .alvd-inline-state {
  margin: 8px;
  width: calc(100% - 16px);
}

.alvd-analytics-toolbar {
  flex-wrap: wrap;
  align-items: center;
}

.alvd-ticket-row-card::after {
  content: "";
  position: absolute;
  inset: 10px 8px 10px auto;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.alvd-ticket-row-card.alvd-ticket-unread::after {
  background: var(--info);
}

.alvd-ticket-row-card.alvd-ticket-delivery::after {
  background: var(--success);
}

.alvd-ticket-row-card > * {
  min-width: 0;
}

.alvd-ticket-row-pin {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.alvd-ticket-select,
#ticket-select-visible {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.alvd-ticket-row-main,
.alvd-ticket-row-request {
  display: grid;
  gap: 3px;
}

.alvd-ticket-row-state,
.alvd-ticket-row-owner,
.alvd-ticket-row-activity {
  display: flex;
  min-width: 0;
}

.alvd-ticket-row-state {
  align-items: center;
}

.alvd-ticket-row-owner,
.alvd-ticket-row-activity {
  justify-content: flex-start;
}

.alvd-ticket-row-request .alvd-ticket-email,
.alvd-ticket-row-request .alvd-ticket-meta,
.alvd-ticket-row-request .alvd-note-preview-inline {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-inbox-table {
  table-layout: auto;
}

.alvd-inbox-table th {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.018);
}

.alvd-inbox-table td {
  vertical-align: middle;
}

.alvd-inbox-table tbody tr {
  position: relative;
}

.alvd-inbox-table tbody tr::after {
  content: "";
  position: absolute;
  inset: 8px 8px 8px auto;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.alvd-inbox-table tbody tr.alvd-ticket-unread::after {
  background: var(--info);
}

.alvd-inbox-table tbody tr.alvd-ticket-delivery::after {
  background: var(--success);
}

.alvd-ticket-main {
  display: grid;
  gap: 7px;
}

.alvd-ticket-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.alvd-ticket-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 130px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.028);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.alvd-ticket-flag svg {
  width: 11px;
  height: 11px;
}

.alvd-ticket-flag-delivery {
  border-color: rgba(52, 211, 153, 0.18);
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

.alvd-ticket-flag-paid {
  border-color: rgba(249, 200, 108, 0.18);
  color: var(--gold);
  background: rgba(249, 200, 108, 0.075);
}

.alvd-note-preview-inline {
  overflow: hidden;
  max-width: 360px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-state-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.alvd-state-hint {
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.alvd-assigned {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.alvd-assigned.is-unassigned {
  border-color: rgba(96, 165, 250, 0.18);
  color: var(--info);
  background: rgba(96, 165, 250, 0.07);
}

.alvd-pin-btn svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

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

  .alvd-primary-actions-row {
    grid-template-columns: 1fr;
  }

  .alvd-primary-actions-row .alvd-btn {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .alvd-inbox-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-inbox-card {
    overflow-x: auto;
  }

  .alvd-inbox-table {
    min-width: 760px;
  }
}

/* ================================================================
   DESK POLISH V3 - Safer, denser inventory surface
   ================================================================ */

.alvd-inventory {
  gap: 14px;
}

.alvd-inventory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.alvd-inventory-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

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

.alvd-inventory-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(249, 200, 108, 0.17);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(249, 200, 108, 0.055);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.alvd-inventory-live svg {
  width: 14px;
  height: 14px;
}

.alvd-inventory-stats {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.alvd-stat-mini {
  min-height: 64px;
  padding: 10px 12px;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.024);
  box-shadow: none;
}

.alvd-stat-mini:hover {
  transform: none;
  box-shadow: none;
}

.alvd-stat-mini-value {
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-stat-mini-label {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.alvd-inventory-toolbar {
  padding: 10px;
  border: 1px solid var(--desk-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.024);
}

.alvd-inventory-toolbar .alvd-search-box {
  min-width: min(320px, 100%);
}

.alvd-select-compact {
  min-width: 126px;
  max-width: 180px;
}

.alvd-selected-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: 999px;
  background: rgba(249, 200, 108, 0.06);
  font-size: 12px;
}

.alvd-spreadsheet-wrapper {
  max-height: calc(100vh - 330px);
  min-height: 360px;
  overflow: auto;
}

.alvd-spreadsheet {
  min-width: 1180px;
}

.alvd-spreadsheet th {
  top: 0;
  padding: 10px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #111118;
  font-size: 10px;
  letter-spacing: 0;
}

.alvd-spreadsheet td {
  padding: 9px;
}

.alvd-spreadsheet-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.alvd-spreadsheet-row.selected {
  background: rgba(249, 200, 108, 0.075);
}

.alvd-spreadsheet-row.alvd-row-sold {
  opacity: 0.78;
}

.alvd-inv-id,
.alvd-game-tag,
.alvd-rank-badge,
.alvd-sold-ticket {
  border-radius: 999px;
}

.alvd-inline-status {
  min-height: 28px;
  border-radius: 999px;
  font-weight: 800;
}

.alvd-action-btns {
  gap: 4px;
}

.alvd-action-btns .alvd-btn-icon-sm {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.alvd-action-btns .alvd-btn-icon-sm:hover {
  border-color: rgba(249, 200, 108, 0.22);
  background: rgba(249, 200, 108, 0.08);
}

.alvd-modal.alvd-modal-large {
  border-radius: 12px;
}

.alvd-tabs-inv {
  padding: 8px 10px 0;
  gap: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.alvd-tabs-inv .alvd-tab {
  min-height: 34px;
  border-radius: 8px 8px 0 0;
}

@media (max-width: 900px) {
  .alvd-inventory-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-inventory-live {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
  }

  .alvd-inventory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-inventory-toolbar,
  .alvd-toolbar-left,
  .alvd-toolbar-right {
    align-items: stretch;
    flex-direction: column;
  }

  .alvd-inventory-toolbar .alvd-search-box,
  .alvd-inventory-toolbar .alvd-select,
  .alvd-inventory-toolbar .alvd-btn {
    width: 100%;
    max-width: none;
  }

  .alvd-toolbar-divider {
    display: none;
  }

  .alvd-spreadsheet-wrapper {
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .alvd-inventory-stats {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   DESK POLISH V5 - Admin Workbench Tabs
   ================================================================ */

.alvd-nav-section.alvd-admin-tabs {
  gap: 4px;
  margin: 14px 10px 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.024);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

.alvd-admin-tabs .alvd-nav-section-label {
  padding: 0 3px 7px;
  font-size: 10px;
  color: rgba(224, 220, 235, 0.55);
}

.alvd-admin-tabs .alvd-admin-tab {
  min-height: 44px;
  padding: 6px 8px;
  gap: 9px;
  border-radius: 8px;
  color: rgba(229, 225, 238, 0.72);
  background: transparent;
}

.alvd-admin-tabs .alvd-admin-tab > svg {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 7px;
  color: var(--admin-accent);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
}

.alvd-admin-tabs .alvd-admin-tab-copy {
  gap: 3px;
  padding-right: 11px;
}

.alvd-admin-tabs .alvd-admin-tab-copy strong {
  font-size: 12px;
  line-height: 1.05;
}

.alvd-admin-tabs .alvd-admin-tab-copy small {
  font-size: 10px;
  line-height: 1.05;
}

.alvd-admin-tabs .alvd-admin-tab:hover,
.alvd-admin-tabs .alvd-admin-tab:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

.alvd-admin-tabs .alvd-admin-tab.active {
  background: linear-gradient(90deg, var(--admin-surface), rgba(255, 255, 255, 0.015));
  border-color: var(--admin-border);
  box-shadow: none;
}

.alvd-admin-tabs .alvd-admin-tab.active::after {
  right: 8px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  box-shadow: none;
}

.alvd-admin-tabs .alvd-admin-tab.active > svg {
  color: #08080c;
  background: var(--admin-accent);
}

/* ================================================================
   DESK POLISH V5 - Cleaner Workbench Views
   ================================================================ */

.alvd-team,
.alvd-risk,
.alvd-settings-v2 {
  gap: 14px;
}

.alvd-team .alvd-kpi-card,
.alvd-risk-stat {
  min-height: 74px;
  padding: 12px;
  border-radius: 9px;
  box-shadow: none;
}

.alvd-team-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.alvd-team-row td {
  padding-top: 11px;
  padding-bottom: 11px;
}

.alvd-status-dot {
  width: 7px;
  height: 7px;
}

.alvd-audit-filters {
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
}

.alvd-audit-filters .alvd-input,
.alvd-audit-filters .alvd-select,
.alvd-audit-date-row .alvd-input {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
}

.alvd-audit-actions {
  align-items: flex-start;
  margin-top: 8px;
}

.alvd-audit-entry {
  gap: 12px;
  padding: 13px 16px;
}

.alvd-audit-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.alvd-audit-icon svg {
  width: 16px;
  height: 16px;
}

.alvd-audit-main {
  gap: 8px;
  margin-bottom: 4px;
}

.alvd-audit-details {
  margin-bottom: 5px;
  font-size: 12px;
}

.alvd-settings-v2 .alvd-settings-shell {
  grid-template-columns: 198px minmax(0, 1fr);
  min-height: 380px;
  border-radius: 10px;
}

.alvd-settings-v2 .alvd-settings-tabs {
  gap: 5px;
  padding: 8px;
}

.alvd-settings-v2 .alvd-settings-tab {
  min-height: 46px;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
}

.alvd-settings-v2 .alvd-settings-tab-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.alvd-settings-v2 .alvd-settings-tab-icon svg {
  width: 14px;
  height: 14px;
}

.alvd-settings-v2 .alvd-settings-content {
  padding: 16px;
}

.alvd-settings-v2 .alvd-settings-card {
  max-width: 820px;
  border-radius: 10px;
}

.alvd-settings-toggle-row {
  padding: 12px 0;
}

.alvd-settings-actions {
  gap: 8px;
  margin-top: 14px;
}

.alvd-risk-head,
.alvd-settings-v2 .alvd-settings-head {
  align-items: center;
  padding: 0;
}

.alvd-risk-head h2,
.alvd-settings-v2 .alvd-settings-head h2 {
  font-size: 22px;
}

.alvd-risk-stats {
  gap: 8px;
}

.alvd-risk-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.alvd-risk-stat strong {
  font-size: 19px;
}

.alvd-risk-toolbar {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  padding: 8px;
  border-radius: 9px;
}

.alvd-risk-tabs {
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 9px;
}

.alvd-risk-tabs button {
  min-height: 44px;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
}

.alvd-risk-tab-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.alvd-risk-tab-icon svg {
  width: 13px;
  height: 13px;
}

.alvd-risk-tab-copy {
  gap: 3px;
}

.alvd-risk-tab-copy strong {
  font-size: 12px;
}

.alvd-risk-tab-copy small {
  font-size: 10px;
}

.alvd-risk-tab-count {
  min-width: 20px;
  padding: 3px 6px;
  font-size: 10px;
}

.alvd-risk-panel {
  border-radius: 10px;
}

.alvd-risk-panel-head {
  padding: 13px 14px;
}

.alvd-risk-add,
.alvd-risk-ticket-check {
  padding: 10px 14px;
}

.alvd-risk-add-ip {
  grid-template-columns: minmax(140px, 1.15fr) 130px 84px minmax(140px, 1fr) auto;
}

.alvd-risk-ticket-check {
  grid-template-columns: auto minmax(110px, 160px) auto;
}

.alvd-risk-row {
  padding: 12px 14px;
}

.alvd-risk .alvd-btn,
.alvd-settings-v2 .alvd-btn,
.alvd-audit-actions .alvd-btn {
  min-height: 34px;
  padding: 0 12px !important;
  gap: 6px;
  border-radius: 8px;
  box-shadow: none;
}

.alvd-risk .alvd-btn:hover,
.alvd-settings-v2 .alvd-btn:hover,
.alvd-audit-actions .alvd-btn:hover {
  transform: none;
  box-shadow: none;
}

.alvd-risk .alvd-btn svg,
.alvd-settings-v2 .alvd-btn svg,
.alvd-audit-actions .alvd-btn svg,
.alvd-risk button svg {
  box-sizing: border-box;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex: 0 0 14px;
  padding: 0 !important;
}

@media (max-width: 900px) {
  .alvd-settings-v2 .alvd-settings-shell {
    grid-template-columns: 1fr;
  }

  .alvd-risk-tabs {
    grid-template-columns: repeat(5, minmax(132px, 1fr));
  }
}

@media (max-width: 560px) {
  .alvd-audit-actions,
  .alvd-risk-head,
  .alvd-settings-v2 .alvd-settings-head {
    align-items: stretch;
  }

  .alvd-audit-presets,
  .alvd-audit-tools,
  .alvd-settings-head-actions {
    width: 100%;
  }

  .alvd-risk .alvd-btn,
  .alvd-settings-v2 .alvd-btn,
  .alvd-audit-actions .alvd-btn {
    width: 100%;
  }
}

/* ================================================================
   DESK POLISH V4 - Cleaner start page
   ================================================================ */

.alvd-queue-hero {
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--desk-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.alvd-queue-kicker {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-queue-hero h2 {
  font-size: 24px;
}

.alvd-queue-hero p {
  margin-top: 5px;
  font-size: 13px;
}

.alvd-action-grid {
  gap: 8px;
  margin-bottom: 14px;
}

.alvd-action-card {
  min-height: 62px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
}

.alvd-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.alvd-action-icon svg {
  width: 15px;
  height: 15px;
}

.alvd-action-label {
  font-size: 12px;
}

.alvd-action-hint {
  font-size: 10px;
}

.alvd-action-value {
  font-size: 22px;
}

.alvd-queue-card-head {
  min-height: 46px;
}

.alvd-queue-list {
  gap: 7px;
}

.alvd-queue-row {
  padding: 10px;
  border-radius: 8px;
}

.alvd-queue-row-title {
  font-size: 13px;
}

.alvd-queue-row-meta,
.alvd-queue-row-sub,
.alvd-queue-owner,
.alvd-queue-time {
  font-size: 11px;
}

.alvd-queue-activity .alvd-card-body {
  max-height: 560px;
  overflow: auto;
}

@media (max-width: 900px) {
  .alvd-queue-hero {
    padding: 12px;
  }

  .alvd-queue-hero h2 {
    font-size: 22px;
  }

  .alvd-action-grid {
    grid-template-columns: 1fr;
  }

  .alvd-action-card {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 56px;
  }

  .alvd-queue-activity {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --alvd-sidebar-width: min(300px, 85vw);
  }

  .alvd-sidebar {
    width: var(--alvd-sidebar-width) !important;
    max-width: none !important;
    z-index: 5001 !important;
    pointer-events: auto !important;
  }

  .alvd-overlay {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: var(--alvd-sidebar-width) !important;
    z-index: 5000 !important;
  }
}

@media (max-width: 480px) {
  :root {
    --alvd-sidebar-width: min(280px, 85vw);
  }
}

@media (max-width: 360px) {
  :root {
    --alvd-sidebar-width: min(260px, 85vw);
  }
}

/* Ticket detail polish v2 */
.alvd-ticket-actionbar {
  position: sticky;
  top: 76px;
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(11, 11, 16, 0.93);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.alvd-ticket-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 92px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.alvd-ticket-action:hover {
  border-color: rgba(249, 200, 108, 0.34);
  background: rgba(249, 200, 108, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.alvd-ticket-action:focus-visible {
  outline: 2px solid rgba(249, 200, 108, 0.45);
  outline-offset: 2px;
}

.alvd-ticket-action svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.alvd-ticket-action.is-primary {
  margin-left: auto;
  border-color: rgba(249, 200, 108, 0.45);
  background: linear-gradient(135deg, rgba(217, 161, 61, 0.95), rgba(157, 101, 22, 0.95));
  color: #fff9ee;
}

.alvd-ticket-action.is-primary:hover {
  border-color: rgba(249, 200, 108, 0.64);
  background: linear-gradient(135deg, rgba(226, 174, 76, 0.98), rgba(172, 113, 28, 0.98));
}

.alvd-ticket-action.is-muted {
  border-color: rgba(168, 85, 247, 0.36);
  background: rgba(139, 92, 246, 0.12);
  color: #dbc9ff;
}

.alvd-ticket-action.is-muted:hover {
  border-color: rgba(196, 181, 253, 0.5);
  background: rgba(139, 92, 246, 0.18);
}

.alvd-ticket-action:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.alvd-primary-actions-card {
  border-color: rgba(249, 200, 108, 0.14);
  background:
    linear-gradient(180deg, rgba(249, 200, 108, 0.045), rgba(249, 200, 108, 0) 180px),
    rgba(15, 15, 21, 0.96);
}

.alvd-primary-actions-head {
  background: rgba(255, 255, 255, 0.018);
}

.alvd-primary-actions-card .alvd-card-body {
  display: grid;
  gap: 0;
}

.alvd-primary-section {
  padding: 11px 0;
}

.alvd-primary-section-title {
  margin-bottom: 8px;
}

.alvd-primary-actions-row {
  gap: 8px;
}

.alvd-chat {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(14, 14, 20, 0.96);
}

.alvd-chat-head {
  min-height: 48px;
  background: rgba(255, 255, 255, 0.018);
}

.alvd-chat-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.alvd-chat-messages {
  min-height: 430px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 120px),
    rgba(8, 8, 12, 0.4);
  scrollbar-gutter: stable;
}

.alvd-chat-input {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(12, 12, 17, 0.98);
}

.alvd-textarea-row {
  align-items: stretch;
}

.alvd-textarea-row #msg {
  min-height: 84px;
  resize: vertical;
}

.alvd-upload-btn {
  align-self: stretch;
  height: auto;
  min-height: 42px;
}

.alvd-chat-actions {
  align-items: center;
}

.alvd-chat-actions .alvd-checkbox {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.alvd-checkbox.is-disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.alvd-checkbox.is-disabled input {
  cursor: not-allowed;
}

.alvd-ticket-muted-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.08);
  color: rgba(221, 214, 254, 0.92);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.alvd-ticket-muted-banner svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #c4b5fd;
}

/* ================================================================
   DESK POLISH V7 - Ticket Engagement Analytics
   ================================================================ */

.alvd-ticket-analytics {
  display: grid;
  gap: 12px;
}

.alvd-ticket-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.alvd-ticket-analytics-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
}

.alvd-ticket-analytics-head span {
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-ticket-analytics-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.028);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.alvd-ticket-analytics-status svg {
  width: 12px;
  height: 12px;
}

.alvd-ticket-analytics-status.is-online {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
}

.alvd-ticket-analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.alvd-ticket-analytics-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
}

.alvd-ticket-analytics-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--gold);
  background: rgba(201, 147, 53, 0.1);
}

.alvd-ticket-analytics-icon svg {
  width: 14px;
  height: 14px;
}

.alvd-ticket-analytics-metric label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.alvd-ticket-analytics-metric strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.alvd-ticket-analytics-metric.is-count strong {
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
}

.alvd-ticket-analytics-metric small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.alvd-ticket-analytics-timeline {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
}

.alvd-ticket-analytics-step {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--text-secondary);
}

.alvd-ticket-analytics-step > span {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 147, 53, 0.08);
}

.alvd-ticket-analytics-step.is-muted > span {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.alvd-ticket-analytics-step strong {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
}

.alvd-ticket-analytics-step small {
  color: var(--text-muted);
  font-size: 11px;
}

.alvd-ticket-analytics-sources {
  display: grid;
  gap: 7px;
}

.alvd-ticket-analytics-sources label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.alvd-ticket-analytics-sources > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 560px) {
  .alvd-ticket-analytics-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .alvd-ticket-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   DESK POLISH V6 - Ticket Inbox Workbench
   ================================================================ */

.alvd-inbox-topline {
  align-items: center;
  margin-bottom: 10px;
}

.alvd-inbox-topline h2 {
  font-size: 22px;
}

.alvd-inbox-statusline .alvd-mini-busy {
  min-height: 28px;
}

.alvd-ticket-quickbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(108px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  overflow: visible;
}

.alvd-ticket-quick {
  justify-content: space-between;
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  box-shadow: none;
}

.alvd-ticket-quick strong {
  min-width: 24px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.06);
}

.alvd-ticket-quick.active {
  color: var(--text-primary);
  border-color: rgba(201, 147, 53, 0.38);
  background: rgba(201, 147, 53, 0.095);
}

.alvd-ticket-quick.active strong {
  color: #09090d;
  background: var(--gold);
}

.alvd-inbox-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto auto auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.alvd-inbox-toolbar .alvd-search-box,
.alvd-inbox-toolbar .alvd-select,
.alvd-inbox-toolbar .alvd-btn {
  min-height: 36px;
}

.alvd-ticket-clear-filters svg,
.alvd-read-all-btn svg,
.alvd-archive-btn svg,
.alvd-ticket-bulkbar .alvd-btn svg {
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px;
}

.alvd-ticket-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.alvd-ticket-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  max-width: 260px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.028);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-ticket-filter-chip svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.alvd-ticket-bulkbar {
  gap: 7px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(201, 147, 53, 0.065);
}

.alvd-ticket-bulkbar .alvd-btn,
.alvd-ticket-bulkbar .alvd-select {
  min-height: 32px;
}

.alvd-ticket-list {
  gap: 6px;
  padding: 7px;
}

.alvd-ticket-list-head,
.alvd-ticket-row-card {
  grid-template-columns: 52px minmax(128px, 0.72fr) minmax(220px, 1.35fr) minmax(104px, 0.42fr) minmax(112px, 0.42fr) minmax(82px, 0.32fr);
}

.alvd-ticket-list-head {
  gap: 10px;
  padding: 5px 10px 3px;
}

.alvd-ticket-row-card {
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: none;
}

.alvd-ticket-row-card:hover {
  transform: none;
}

.alvd-ticket-row-pin {
  gap: 7px;
}

.alvd-ticket-main {
  gap: 6px;
}

.alvd-ticket-id {
  font-size: 13px;
}

.alvd-ticket-email {
  font-size: 12px;
}

.alvd-ticket-meta,
.alvd-note-preview-inline,
.alvd-ticket-time,
.alvd-assigned {
  font-size: 11px;
}

.alvd-ticket-flag {
  padding: 3px 6px;
}

.alvd-delivery-pill {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
}

@media (max-width: 980px) {
  .alvd-ticket-quickbar {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .alvd-inbox-toolbar {
    grid-template-columns: 1fr 150px;
  }

  .alvd-inbox-toolbar .alvd-btn {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .alvd-ticket-quickbar,
  .alvd-inbox-toolbar {
    grid-template-columns: 1fr;
  }

  .alvd-ticket-filter-chip {
    max-width: 100%;
  }
}

/* ==========================================================================
   DESK POLISH V8 - Ticket Message Pagination
   ========================================================================== */
.alvd-chat-load-older {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 10px auto 0;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: rgba(226, 232, 240, .82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.alvd-chat-load-older:hover {
  border-color: rgba(249, 200, 108, .45);
  background: rgba(249, 200, 108, .11);
  color: #F9C86C;
}

.alvd-chat-load-older:disabled {
  cursor: wait;
  opacity: .58;
}

/* ==========================================================================
   DESK POLISH V9 - Currency Context
   ========================================================================== */
.alvd-currency-detail span {
  display: block;
}

.alvd-currency-detail small {
  display: block;
  margin-top: 4px;
  color: rgba(249, 200, 108, .86);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

/* Performance/design patch v1: quiet ticket workbench polish without layout refactor. */
.alvd-ticket-right .alvd-card,
.alvd-primary-actions-card,
.alvd-customer-overview-card,
.alvd-ticket-analytics {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(15, 15, 20, 0.96);
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}

.alvd-chat {
  background:
    linear-gradient(180deg, rgba(201,147,53,0.035), rgba(255,255,255,0.012) 120px),
    rgba(12, 12, 17, 0.98);
  border-color: rgba(255,255,255,0.08);
}

.alvd-chat-messages {
  background:
    radial-gradient(circle at 12% 0%, rgba(201,147,53,0.055), transparent 34%),
    rgba(5, 5, 9, 0.32);
}

.alvd-ticket-analytics-metric,
.alvd-co-kpi {
  background: rgba(255,255,255,0.032);
  border-color: rgba(255,255,255,0.075);
}

/* ==========================================================================
   DESK POLISH V12 - Inventory Better Tabs Workbench
   ========================================================================== */
.alvd-inv-editor {
  width: min(960px, 96vw);
  max-height: min(88vh, 720px);
  overflow: hidden;
  border-color: rgba(148, 163, 184, .18);
  background: #0f1117;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}

.alvd-inv-editor-header {
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  background: #121620;
}

.alvd-inv-editor-title {
  min-width: 0;
}

.alvd-inv-editor-title > span {
  display: inline-flex;
  margin-bottom: 6px;
  color: rgba(249, 200, 108, .82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.alvd-inv-editor-header h2 {
  margin: 0;
  color: rgba(248, 250, 252, .96);
  font-size: 19px;
  line-height: 1.15;
}

.alvd-inv-editor-header p {
  max-width: 620px;
  margin: 5px 0 0;
  color: rgba(203, 213, 225, .66);
  font-size: 13px;
  line-height: 1.42;
}

.alvd-inv-editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 18px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  background: rgba(4, 5, 9, .2);
}

.alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 8px;
  color: rgba(203, 213, 225, .78);
  background: rgba(255,255,255,.022);
  text-align: left;
}

.alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab:hover {
  border-color: rgba(249, 200, 108, .22);
  background: rgba(255,255,255,.04);
}

.alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab.active {
  border-color: rgba(249, 200, 108, .34);
  color: rgba(248, 250, 252, .96);
  background: rgba(249, 200, 108, .08);
  box-shadow: inset 0 0 0 1px rgba(249, 200, 108, .08);
}

.alvd-inv-tab-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.alvd-inv-tab-icon svg {
  width: 15px;
  height: 15px;
}

.alvd-inv-tab-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.alvd-inv-tab-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-inv-tab-copy small {
  overflow: hidden;
  color: rgba(148, 163, 184, .74);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-inv-editor .alvd-modal-body {
  max-height: calc(88vh - 158px);
  overflow: auto;
  padding: 14px 18px 16px;
  background: #0b0d12;
}

.alvd-inv-editor-form {
  display: block;
}

.alvd-inv-form-section,
.alvd-inv-access-box {
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
}

.alvd-inv-form-section + .alvd-inv-form-section {
  margin-top: 10px;
}

.alvd-inv-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.alvd-inv-section-head strong,
.alvd-inv-access-box .alvd-credentials-header h4 {
  color: rgba(248, 250, 252, .93);
  font-size: 13px;
  font-weight: 950;
}

.alvd-inv-section-head span {
  color: rgba(148, 163, 184, .72);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.alvd-inv-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.alvd-inv-quick-btns .alvd-btn-small {
  min-height: 25px;
  padding: 0 8px;
  border-radius: 7px;
  border-color: rgba(148, 163, 184, .16);
  background: rgba(255,255,255,.035);
  color: rgba(226, 232, 240, .8);
  font-size: 11px;
}

.alvd-inv-access-box {
  border-color: rgba(148, 163, 184, .14);
}

.alvd-inv-access-box .alvd-credentials-header {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.alvd-inv-access-box .alvd-credentials-header h4 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.alvd-inv-access-box .alvd-credentials-header svg {
  width: 15px;
  height: 15px;
  color: #F9C86C;
}

.alvd-inv-credential-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.alvd-inv-editor .alvd-credential-section {
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(0,0,0,.14);
}

.alvd-inv-editor .alvd-credentials-locked {
  padding: 13px;
  border: 1px dashed rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: rgba(255,255,255,.022);
}

.alvd-inv-pricing-section {
  max-width: 640px;
}

.alvd-inv-margin-display {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-top: 2px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(255,255,255,.028);
  font-size: 13px;
  font-weight: 900;
}

.alvd-inv-editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.075);
  background: rgba(15, 17, 23, .96);
  backdrop-filter: blur(14px);
}

.alvd-inv-editor-footer .alvd-btn {
  min-height: 36px;
}

.alvd-inv-editor .alvd-form-row {
  gap: 10px;
  margin-bottom: 10px;
}

.alvd-inv-editor .alvd-form-group {
  margin-bottom: 10px;
}

.alvd-inv-editor .alvd-form-group:last-child {
  margin-bottom: 0;
}

.alvd-inv-editor .alvd-form-group label {
  margin-bottom: 6px;
  color: rgba(203, 213, 225, .78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}

.alvd-inv-editor .alvd-input,
.alvd-inv-editor .alvd-select {
  min-height: 38px;
  border-color: rgba(148, 163, 184, .16);
  background: rgba(0,0,0,.18);
  font-size: 13px;
}

.alvd-inv-editor .alvd-input:focus,
.alvd-inv-editor .alvd-select:focus {
  border-color: rgba(249, 200, 108, .34);
  box-shadow: 0 0 0 3px rgba(249, 200, 108, .08);
}

@media (max-width: 860px) {
  .alvd-inv-editor-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
    min-height: 44px;
  }
}

@media (max-width: 720px) {
  .alvd-inv-editor {
    width: min(96vw, 680px);
    max-height: 92vh;
  }

  .alvd-inv-editor-header,
  .alvd-inv-editor-tabs {
    padding-left: 14px;
    padding-right: 14px;
  }

  .alvd-inv-editor-header h2 {
    font-size: 18px;
  }

  .alvd-inv-tab-copy small {
    display: none;
  }

  .alvd-inv-editor .alvd-modal-body {
    max-height: calc(92vh - 168px);
    padding: 12px;
  }

  .alvd-inv-section-head {
    display: block;
  }

  .alvd-inv-section-head span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}

/* ==========================================================================
   DESK POLISH V13 - Quieter Runtime Workbench
   ========================================================================== */
.alvd-ticket-left .alvd-card,
.alvd-ticket-right .alvd-card,
.alvd-customer-overview-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)),
    #171922;
  border-color: rgba(180, 190, 210, .14);
}

.alvd-chat {
  background: #181b24;
  border-color: rgba(180, 190, 210, .14);
}

.alvd-chat-head,
.alvd-primary-actions-head {
  background: rgba(255, 255, 255, .035);
}

.alvd-chat-messages {
  min-height: 390px;
  background:
    radial-gradient(circle at 18% 0%, rgba(249, 200, 108, .075), transparent 32%),
    linear-gradient(180deg, #1b1f2a 0%, #151922 100%);
  gap: 14px;
}

.alvd-msg-bubble {
  max-width: min(620px, 100%);
  padding: 12px 15px;
  border: 1px solid rgba(180, 190, 210, .14);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
}

.alvd-msg-customer .alvd-msg-bubble,
.alvd-msg-user .alvd-msg-bubble {
  background: #242a36;
  color: rgba(245, 247, 250, .94);
}

.alvd-msg-admin .alvd-msg-bubble {
  background: linear-gradient(135deg, #d8aa55, #a97026);
  border-color: rgba(249, 200, 108, .42);
}

.alvd-msg-system.alvd-msg-delivery-event .alvd-msg-bubble {
  background: linear-gradient(135deg, rgba(16, 185, 129, .13), rgba(249, 200, 108, .065));
  border-color: rgba(52, 211, 153, .3);
}

.alvd-msg-text {
  color: rgba(245, 247, 250, .92);
  overflow-wrap: anywhere;
}

.alvd-msg-admin .alvd-msg-text {
  color: #17120a;
}

.alvd-chat-input {
  background: #171b24;
}

.alvd-textarea-row #msg {
  min-height: 76px;
  background: #202530;
  border-color: rgba(180, 190, 210, .18);
}

.alvd-upload-btn {
  border-color: rgba(180, 190, 210, .16);
  background: #202530;
}

.alvd-msg-attachment-wrap {
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.alvd-msg-attachment-img {
  border-radius: 7px;
}

.alvd-primary-section {
  padding: 10px 0;
}

.alvd-primary-section + .alvd-primary-section {
  border-top-color: rgba(180, 190, 210, .12);
}

.alvd-ticket-analytics-metric,
.alvd-co-kpi,
.alvd-detail-box {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(180, 190, 210, .13);
}

.alvd-inv-editor.alvd-inv-editor-v2 {
  width: min(900px, 96vw);
  max-height: min(90vh, 690px);
  background: #151922;
}

.alvd-inv-editor-header {
  padding: 12px 16px 10px;
  background: #1a1f2a;
}

.alvd-inv-editor-header p {
  display: none;
}

.alvd-inv-editor-tabs {
  gap: 5px;
  padding: 8px 16px;
}

.alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
  min-height: 38px;
  padding: 6px 8px;
}

.alvd-inv-tab-icon {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
}

.alvd-inv-tab-copy small {
  display: none;
}

.alvd-inv-editor .alvd-modal-body {
  max-height: calc(90vh - 132px);
  padding: 12px 16px;
  background: #11151d;
}

.alvd-inv-form-section,
.alvd-inv-access-box,
.alvd-inv-editor .alvd-credential-section {
  padding: 10px;
  background: rgba(255, 255, 255, .035);
}

.alvd-inv-editor .alvd-form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.alvd-inv-editor .alvd-form-group {
  margin-bottom: 8px;
}

.alvd-inv-editor .alvd-input,
.alvd-inv-editor .alvd-select {
  min-height: 34px;
}

.alvd-inv-editor .alvd-textarea {
  min-height: 120px;
}

.alvd-inv-editor-footer {
  min-height: 54px;
  padding: 9px 16px;
  background: rgba(21, 25, 34, .98);
}

@media (max-width: 720px) {
  .alvd-chat-messages {
    min-height: 320px;
    max-height: 58vh;
    padding: 14px 10px;
  }

  .alvd-msg {
    max-width: 96%;
  }

  .alvd-msg-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .alvd-msg-bubble {
    padding: 10px 12px;
  }

  .alvd-inv-editor.alvd-inv-editor-v2 {
    width: 100vw;
    max-width: 100vw;
    max-height: 94vh;
    border-radius: 10px 10px 0 0;
  }

  .alvd-inv-editor-tabs {
    display: flex;
    overflow-x: auto;
  }

  .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
    flex: 0 0 auto;
    min-width: 118px;
  }

  .alvd-inv-editor .alvd-modal-body {
    max-height: calc(94vh - 142px);
    padding: 10px;
  }

  .alvd-inv-editor .alvd-form-row {
    grid-template-columns: 1fr;
  }

  .alvd-inv-editor-footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   DESK INVENTORY REBUILD - Phase 1 layout containment
   ========================================================================== */
:root {
  --desk-sidebar-width: 248px;
}

.alvd-layout,
.alvd-main,
.alvd-header,
.alvd-content,
.alvd-content > *,
.alvd-inventory,
.alvd-inventory > *,
.alvd-card,
.alvd-card-flush,
.alvd-spreadsheet-wrapper {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.alvd-layout {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.alvd-spreadsheet-wrapper {
  width: 100%;
}

@media (min-width: 901px) {
  .alvd-sidebar {
    width: var(--desk-sidebar-width);
  }

  .alvd-main {
    flex: 0 0 auto;
    width: calc(100vw - var(--desk-sidebar-width));
    max-width: calc(100vw - var(--desk-sidebar-width));
    margin-left: var(--desk-sidebar-width);
    overflow-x: hidden;
  }

  .alvd-header,
  .alvd-content {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .alvd-main {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    overflow-x: hidden;
  }

  .alvd-content {
    width: 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   DESK INVENTORY REBUILD - Phase 4 mobile cards
   ========================================================================== */
.alvd-inventory-mobile-list {
  display: none;
}

@media (max-width: 900px) {
  .alvd-inventory .alvd-spreadsheet-wrapper {
    display: none;
  }

  .alvd-inventory-mobile-list {
    display: grid;
    gap: 10px;
  }

  .alvd-inv-mobile-card {
    display: grid;
    gap: 11px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(24, 28, 38, .96), rgba(15, 18, 26, .98));
  }

  .alvd-inv-mobile-card.is-sold {
    border-color: rgba(139, 92, 246, .22);
  }

  .alvd-inv-mobile-card.is-problem {
    border-color: rgba(239, 68, 68, .28);
  }

  .alvd-inv-mobile-card-head,
  .alvd-inv-mobile-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  .alvd-inv-mobile-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
  }

  .alvd-inv-mobile-status {
    flex: 0 0 auto;
    min-height: 34px;
    max-width: 118px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 850;
  }

  .alvd-inv-mobile-meta,
  .alvd-inv-mobile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  .alvd-inv-mobile-meta > span:not(.alvd-rank-badge),
  .alvd-inv-mobile-chips > span,
  .alvd-inv-mobile-chips > a,
  .alvd-inv-mobile-chips > button {
    max-width: 100%;
  }

  .alvd-inv-mobile-highlights {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(226, 232, 240, .82);
    font-size: 13px;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .alvd-inv-mobile-money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .alvd-inv-mobile-money > span {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .11);
    border-radius: 7px;
    background: rgba(255, 255, 255, .028);
  }

  .alvd-inv-mobile-money small {
    color: rgba(148, 163, 184, .72);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .alvd-inv-mobile-money strong {
    overflow: hidden;
    color: rgba(248, 250, 252, .95);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .alvd-inv-mobile-bottom {
    align-items: flex-start;
    padding-top: 2px;
  }

  .alvd-inv-mobile-bottom .alvd-login-cell {
    flex: 1 1 auto;
    min-width: 0;
  }

  .alvd-inv-mobile-bottom .alvd-action-btns {
    flex: 0 0 auto;
    justify-content: flex-end;
    max-width: 52%;
  }

  .alvd-inv-mobile-bottom .alvd-btn-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}

@media (max-width: 430px) {
  .alvd-inv-mobile-card-head,
  .alvd-inv-mobile-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .alvd-inv-mobile-status,
  .alvd-inv-mobile-bottom .alvd-action-btns {
    max-width: 100%;
  }

  .alvd-inv-mobile-status {
    width: 100%;
  }

  .alvd-inv-mobile-bottom .alvd-action-btns {
    justify-content: flex-start;
  }
}

/* Inventory rebuild phase 6: compact filter controls */
.alvd-inv-filter-toggle {
  display: none;
}

.alvd-inv-filter-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alvd-inv-filter-field {
  display: block;
  margin: 0;
}

.alvd-inv-filter-field > span,
.alvd-inv-filter-panel-head,
.alvd-inv-filter-actions,
.alvd-inv-filter-backdrop {
  display: none;
}

.alvd-inv-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(249, 200, 108, 0.18);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

/* Inventory rebuild phase 7: calmer workbench top area */
.alvd-inventory {
  gap: 12px;
}

.alvd-inventory-head {
  align-items: center;
  min-height: 66px;
  padding: 13px 15px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(15, 17, 24, 0.74);
}

.alvd-inventory-head h2 {
  font-size: 22px;
  line-height: 1.15;
}

.alvd-inventory-head p {
  margin-top: 5px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
}

.alvd-inventory-live {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(249, 200, 108, 0.07);
  box-shadow: inset 0 0 0 1px rgba(249, 200, 108, 0.08);
}

.alvd-inventory-stats {
  grid-template-columns: repeat(9, minmax(92px, 1fr));
  gap: 7px;
}

.alvd-stat-mini {
  --stat-accent: rgba(148, 163, 184, 0.26);
  min-height: 58px;
  padding: 9px 10px 8px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.105);
  border-left: 2px solid var(--stat-accent);
  background: rgba(255, 255, 255, 0.02);
}

.alvd-stat-success {
  --stat-accent: rgba(34, 197, 94, 0.55);
}

.alvd-stat-warning {
  --stat-accent: rgba(245, 158, 11, 0.6);
}

.alvd-stat-purple {
  --stat-accent: rgba(139, 92, 246, 0.58);
}

.alvd-stat-danger {
  --stat-accent: rgba(239, 68, 68, 0.58);
}

.alvd-stat-invest {
  --stat-accent: rgba(56, 189, 248, 0.5);
}

.alvd-stat-avail-val {
  --stat-accent: rgba(249, 200, 108, 0.58);
}

.alvd-stat-profit-pos {
  --stat-accent: rgba(34, 197, 94, 0.55);
}

.alvd-stat-profit-neg {
  --stat-accent: rgba(248, 113, 113, 0.58);
}

.alvd-stat-mini-content {
  gap: 1px;
}

.alvd-stat-mini-value {
  font-size: 17px;
  line-height: 1.08;
}

.alvd-stat-mini-label {
  color: rgba(203, 213, 225, 0.62);
  font-size: 10px;
  line-height: 1.2;
}

.alvd-inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(11, 13, 19, 0.74);
}

.alvd-inventory-toolbar .alvd-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.alvd-inventory-toolbar .alvd-toolbar-right {
  justify-content: flex-end;
  min-width: 0;
  flex: 0 0 auto;
}

.alvd-inventory-toolbar .alvd-search-box {
  flex: 0 1 240px;
  width: 220px;
  min-width: min(220px, 100%);
  max-width: 240px;
}

.alvd-inventory-toolbar .alvd-input,
.alvd-inventory-toolbar .alvd-select,
.alvd-inventory-toolbar .alvd-btn {
  min-height: 36px;
}

.alvd-inv-access-tabs {
  flex: 0 0 auto;
  min-width: 0;
  flex-wrap: nowrap !important;
}

.alvd-inv-access-tabs .alvd-btn {
  min-height: 34px;
  padding-inline: 9px;
}

.alvd-select-compact {
  min-width: 104px;
  max-width: 116px;
}

.alvd-inv-filter-panel {
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: nowrap;
}

#inv-filter-game {
  min-width: 126px;
  max-width: 134px;
}

.alvd-selected-count {
  min-height: 30px;
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .alvd-inventory-stats {
    grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  }

  .alvd-inventory-toolbar {
    grid-template-columns: 1fr;
  }

  .alvd-inventory-toolbar .alvd-toolbar-right {
    justify-content: flex-start;
  }

  .alvd-inventory-toolbar .alvd-toolbar-left,
  .alvd-inv-filter-panel {
    flex-wrap: wrap;
  }

  .alvd-inv-access-tabs {
    flex-wrap: wrap !important;
  }

  .alvd-inventory-toolbar .alvd-search-box {
    width: auto;
    max-width: none;
  }
}

/* Inventory rebuild phase 8: cleaner Add/Edit modal */
#inv-modal-overlay {
  background: rgba(3, 4, 7, 0.72);
}

.alvd-inv-editor.alvd-inv-editor-v2 {
  display: flex;
  flex-direction: column;
  width: min(940px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  height: min(760px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: #10141b;
  box-shadow: 0 26px 86px rgba(0, 0, 0, 0.55);
}

.alvd-inv-editor-v2 .alvd-inv-editor-header {
  flex: 0 0 auto;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: #151a23;
}

.alvd-inv-editor-v2 .alvd-inv-editor-title > span {
  margin-bottom: 4px;
  color: rgba(249, 200, 108, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.alvd-inv-editor-v2 .alvd-inv-editor-header h2 {
  font-size: 20px;
  line-height: 1.1;
}

.alvd-inv-editor-v2 #inv-modal-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: #0d1118;
}

.alvd-inv-editor-v2 .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
  align-items: center;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 7px 9px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.alvd-inv-editor-v2 .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab.active {
  border-color: rgba(249, 200, 108, 0.4);
  background: rgba(249, 200, 108, 0.095);
}

.alvd-inv-editor-v2 .alvd-inv-tab-icon {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.alvd-inv-editor-v2 .alvd-inv-tab-copy strong {
  font-size: 12px;
  line-height: 1.1;
}

.alvd-inv-editor-v2 .alvd-inv-tab-copy small {
  display: none !important;
}

.alvd-inv-editor-v2 .alvd-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 14px 16px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 130px),
    #0b0f15;
  scrollbar-gutter: stable;
}

.alvd-inv-editor-v2 .alvd-inv-editor-form,
.alvd-inv-editor-v2 .alvd-tab-content.active {
  display: grid;
  gap: 12px;
}

.alvd-inv-editor-v2 .alvd-inv-form-section,
.alvd-inv-editor-v2 .alvd-inv-access-box,
.alvd-inv-editor-v2 .alvd-credential-section {
  padding: 12px;
  border-color: rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  box-shadow: none;
}

.alvd-inv-editor-v2 .alvd-inv-section-head,
.alvd-inv-editor-v2 .alvd-credentials-header {
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom-color: rgba(148, 163, 184, 0.09);
}

.alvd-inv-editor-v2 .alvd-inv-section-head strong,
.alvd-inv-editor-v2 .alvd-credentials-header h4 {
  font-size: 13px;
  line-height: 1.2;
}

.alvd-inv-editor-v2 .alvd-inv-section-head span {
  color: rgba(148, 163, 184, 0.68);
}

.alvd-inv-editor-v2 .alvd-inv-valorant-fields {
  gap: 9px;
  margin: 10px 0 9px;
  padding: 12px;
  border: 1px solid rgba(255, 70, 85, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 70, 85, 0.052), rgba(255, 255, 255, 0.018));
}

.alvd-inv-editor-v2 .alvd-inv-subsection-head {
  margin: 0 0 2px;
  padding-bottom: 8px;
}

.alvd-inv-editor-v2 .alvd-inv-skins-textarea {
  min-height: 142px;
  line-height: 1.45;
}

.alvd-inv-editor-v2 .alvd-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 9px;
}

.alvd-inv-editor-v2 .alvd-form-group {
  min-width: 0;
  margin-bottom: 9px;
}

.alvd-inv-editor-v2 .alvd-form-group label {
  margin-bottom: 5px;
  color: rgba(203, 213, 225, 0.74);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-inv-editor-v2 .alvd-input,
.alvd-inv-editor-v2 .alvd-select,
.alvd-inv-editor-v2 .alvd-textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 7px;
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(248, 250, 252, 0.94);
  font-size: 13px;
}

.alvd-inv-editor-v2 .alvd-textarea {
  min-height: 150px;
  resize: vertical;
}

.alvd-inv-editor-v2 .alvd-input:focus,
.alvd-inv-editor-v2 .alvd-select:focus,
.alvd-inv-editor-v2 .alvd-textarea:focus {
  border-color: rgba(249, 200, 108, 0.4);
  box-shadow: 0 0 0 3px rgba(249, 200, 108, 0.08);
}

.alvd-inv-editor-v2 .alvd-inv-credential-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.alvd-inv-editor-v2 .alvd-inv-credential-grid .alvd-credential-section:last-child {
  grid-column: 1 / -1;
}

.alvd-inv-editor-v2 .alvd-credential-title {
  margin-bottom: 9px;
}

.alvd-inv-editor-v2 .alvd-credentials-locked {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.alvd-inv-editor-v2 .alvd-cred-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alvd-inv-editor-v2 .alvd-cred-badge {
  border-radius: 999px;
}

.alvd-inv-editor-v2 .alvd-inv-quick-btns {
  gap: 6px;
}

.alvd-inv-editor-v2 .alvd-inv-quick-btns .alvd-btn-small {
  min-height: 27px;
  border-radius: 7px;
}

.alvd-inv-editor-v2 .alvd-inv-pricing-section {
  max-width: 680px;
}

.alvd-inv-editor-v2 .alvd-inv-price-row {
  max-width: 560px;
}

.alvd-inv-editor-v2 .alvd-inv-margin-display {
  max-width: 560px;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.alvd-inv-editor-v2 .alvd-inv-editor-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 60px;
  padding: 10px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.11);
  background: rgba(16, 20, 27, 0.98);
}

.alvd-inv-editor-v2 .alvd-inv-editor-footer .alvd-btn {
  min-height: 38px;
  border-radius: 8px;
}

/* Inventory rebuild phase 9: final row/card polish */
.alvd-inventory .alvd-card-flush {
  border-color: rgba(148, 163, 184, 0.11);
  background: rgba(8, 10, 15, 0.68);
}

.alvd-inventory .alvd-spreadsheet {
  min-width: 1260px;
}

.alvd-inventory .alvd-spreadsheet th {
  height: 38px;
  padding: 8px 9px;
  background: #0f1219;
  color: rgba(203, 213, 225, 0.62);
  font-size: 10px;
  font-weight: 850;
}

.alvd-inventory .alvd-spreadsheet td {
  height: 48px;
  padding: 7px 9px;
  border-bottom-color: rgba(148, 163, 184, 0.08);
}

.alvd-inventory .alvd-spreadsheet-row {
  background: transparent;
}

.alvd-inventory .alvd-spreadsheet-row:hover {
  background: rgba(255, 255, 255, 0.028);
}

.alvd-inventory .alvd-spreadsheet-row.alvd-row-sold {
  opacity: 0.86;
}

.alvd-inventory .alvd-spreadsheet-row.alvd-row-problem {
  box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.72);
}

.alvd-inventory .alvd-col-highlights {
  min-width: 220px;
  max-width: 300px;
}

.alvd-inventory .alvd-col-actions {
  width: 176px;
}

.alvd-inventory .alvd-highlights-cell {
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
}

.alvd-inventory .alvd-highlights-text {
  flex: 1 1 auto;
  max-width: 185px;
  min-width: 52px;
  color: rgba(203, 213, 225, 0.76);
  font-size: 12px;
}

.alvd-inventory .alvd-inv-id,
.alvd-inventory .alvd-game-tag,
.alvd-inventory .alvd-rank-badge,
.alvd-inventory .alvd-sold-ticket {
  border-radius: 7px;
}

.alvd-inventory .alvd-game-tag,
.alvd-inventory .alvd-rank-badge {
  min-height: 24px;
  font-weight: 800;
}

.alvd-inventory .alvd-sold-ticket {
  display: inline-flex;
  align-items: center;
  max-width: 154px;
  min-height: 22px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: rgba(203, 213, 225, 0.78);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-inventory .alvd-delivery-ticket {
  border-color: rgba(52, 211, 153, 0.2);
  color: rgba(167, 243, 208, 0.84);
  background: rgba(16, 185, 129, 0.065);
}

.alvd-inventory .alvd-delivery-ticket::before {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.09);
}

.alvd-inventory .alvd-shop-evidence-chip {
  border-color: rgba(249, 200, 108, 0.18);
  color: rgba(249, 216, 137, 0.86);
  background: rgba(249, 200, 108, 0.06);
}

.alvd-inventory .alvd-claim-access-chip {
  max-width: 170px;
}

.alvd-inventory .alvd-tracker-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.026);
  font-size: 11px;
}

.alvd-inventory .alvd-login-cell {
  gap: 5px;
  max-width: 168px;
}

.alvd-inventory .alvd-login-masked {
  max-width: 104px;
  letter-spacing: 1.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alvd-inventory .alvd-action-btns-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.105);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
}

.alvd-inventory .alvd-action-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 4px;
  border-right: 1px solid rgba(148, 163, 184, 0.11);
}

.alvd-inventory .alvd-action-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.alvd-inventory .alvd-action-btns-v2 .alvd-btn-icon-sm {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  padding: 5px !important;
  border-radius: 7px;
  opacity: 0.82;
}

.alvd-inventory .alvd-action-btns-v2 .alvd-btn-icon-sm:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.alvd-inventory .alvd-action-btns-v2 .alvd-action-primary {
  border-color: rgba(249, 200, 108, 0.28);
  color: var(--gold);
  background: rgba(249, 200, 108, 0.075);
  opacity: 1;
}

.alvd-inventory .alvd-action-group-delivery .alvd-btn-icon-sm {
  color: rgba(167, 243, 208, 0.82);
}

.alvd-inventory .alvd-action-group-access .alvd-btn-icon-sm {
  color: rgba(251, 191, 36, 0.78);
}

.alvd-inventory .alvd-action-group-utility .alvd-btn-icon-danger {
  color: rgba(248, 113, 113, 0.72) !important;
}

/* Inventory final fix: cleaner editor chrome */
.alvd-inv-editor.alvd-inv-editor-v2 {
  height: min(700px, calc(100dvh - 36px));
}

.alvd-inv-editor-v2 .alvd-inv-editor-header {
  min-height: 58px;
  padding: 10px 14px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-title > span {
  margin-bottom: 3px;
  font-size: 9px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-header h2 {
  font-size: 18px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-tabs {
  padding: 7px 14px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
}

.alvd-inv-editor-v2 .alvd-inv-tab-copy {
  gap: 0;
}

.alvd-inv-editor-v2 .alvd-modal-body {
  padding: 12px 14px;
}

.alvd-inv-editor-v2 .alvd-inv-form-section,
.alvd-inv-editor-v2 .alvd-inv-access-box,
.alvd-inv-editor-v2 .alvd-credential-section {
  padding: 10px;
}

.alvd-inv-editor-v2 .alvd-inv-section-head,
.alvd-inv-editor-v2 .alvd-credentials-header {
  margin-bottom: 8px;
  padding-bottom: 7px;
}

.alvd-inv-editor-v2 .alvd-form-row {
  gap: 8px;
  margin-bottom: 8px;
}

.alvd-inv-editor-v2 .alvd-form-group {
  margin-bottom: 8px;
}

.alvd-inv-editor-v2 .alvd-input,
.alvd-inv-editor-v2 .alvd-select {
  min-height: 36px;
}

.alvd-inv-editor-v2 .alvd-inv-editor-footer {
  min-height: 54px;
  padding: 8px 14px;
}

/* Inventory desktop modal rescue: compact, readable editor */
@media (min-width: 901px) {
  .alvd-modal-overlay:has(.alvd-inv-editor-v2) {
    align-items: center;
    justify-content: center;
    padding: 22px;
  }

  .alvd-inv-editor.alvd-inv-editor-v2 {
    width: min(940px, calc(100vw - 56px));
    max-width: min(940px, calc(100vw - 56px));
    height: auto;
    max-height: calc(100dvh - 56px);
    border-radius: 8px;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-header {
    min-height: 58px;
    padding: 12px 16px;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-title > span {
    display: block;
    margin: 0 0 3px;
    color: rgba(249, 200, 108, 0.86);
    font-size: 10px;
    line-height: 1;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-header h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 16px;
    background: #0c1017;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(203, 213, 225, 0.82);
    text-align: center;
    overflow: hidden;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-tabs .alvd-tab.alvd-inv-tab.active {
    border-color: rgba(249, 200, 108, 0.48);
    background: rgba(249, 200, 108, 0.09);
    color: rgba(248, 250, 252, 0.96);
    box-shadow: none;
  }

  .alvd-inv-editor-v2 .alvd-inv-tab-icon {
    display: inline-flex;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .alvd-inv-editor-v2 .alvd-inv-tab-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  .alvd-inv-editor-v2 .alvd-inv-tab-copy {
    display: block;
    min-width: 0;
  }

  .alvd-inv-editor-v2 .alvd-inv-tab-copy strong {
    display: block;
    color: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .alvd-inv-editor-v2 .alvd-modal-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 230px);
    padding: 14px 16px 16px;
    overflow-y: auto;
  }

  .alvd-inv-editor-v2 .alvd-inv-form-section,
  .alvd-inv-editor-v2 .alvd-inv-access-box,
  .alvd-inv-editor-v2 .alvd-credential-section {
    padding: 12px;
  }

  .alvd-inv-editor-v2 .alvd-inv-pricing-section {
    width: 100%;
    max-width: none;
  }

  .alvd-inv-editor-v2 .alvd-inv-price-row {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-inv-editor-v2 .alvd-inv-margin-display {
    max-width: none;
  }

  .alvd-inv-editor-v2 .alvd-inv-editor-footer {
    position: relative;
    min-height: 58px;
    padding: 10px 16px;
  }
}

/* ==========================================================================
   DESK TICKET DETAIL - Desktop containment
   ========================================================================== */
@media (min-width: 901px) {
  .alvd-layout {
    max-width: 100%;
  }

  .alvd-main {
    flex: 1 1 auto;
    width: calc(100% - var(--desk-sidebar-width));
    max-width: calc(100% - var(--desk-sidebar-width));
  }

  .alvd-header,
  .alvd-content {
    max-width: 100%;
  }

  .alvd-ticket-grid {
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }

  .alvd-ticket-left,
  .alvd-ticket-right {
    min-width: 0;
  }

  .alvd-ticket-right {
    width: 100%;
    max-width: 360px;
    justify-self: stretch;
    padding-right: 0;
    scrollbar-gutter: stable;
  }
}

@media (min-width: 901px) and (max-width: 1260px) {
  .alvd-ticket-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  }

  .alvd-ticket-right {
    max-width: 340px;
  }
}

@media (min-width: 901px) and (max-width: 1099px) {
  .alvd-ticket-grid {
    grid-template-columns: 1fr;
  }

  .alvd-ticket-left,
  .alvd-ticket-right {
    grid-column: auto;
    grid-row: auto;
  }

  .alvd-ticket-right {
    position: static;
    max-width: 100%;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .alvd-ticket-actionbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .alvd-ticket-action {
    width: 100%;
    min-width: 0;
  }

  .alvd-ticket-action.is-primary {
    grid-column: auto;
    margin-left: 0;
  }
}

/* Desk cases V5 - keep conversation directly below Case Summary */
body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-ticket-left {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
}

body[data-alvd-view="cases"] .alvd-ticket-left > .alvd-case-summary-card {
  order: 1;
  margin-bottom: 0;
}

body[data-alvd-view="cases"] .alvd-ticket-left > .alvd-case-chat {
  order: 2;
  margin-bottom: 0;
}

body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-case-right {
  align-self: start;
}

@media (max-width: 900px) {
  body[data-alvd-view="cases"] .alvd-case-detail-grid {
    display: grid;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-ticket-left {
    order: 1;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-case-right {
    order: 2;
  }
}

/* ==========================================================================
   DESK REFINEMENT - Clean shell, cases and responsive behavior
   ========================================================================== */
:root {
  --desk-sidebar-width: 236px;
  --desk-bg-clean: #090a0d;
  --desk-surface-clean: #101116;
  --desk-surface-raised: #15161d;
  --desk-border-clean: rgba(148, 163, 184, .12);
  --desk-border-soft: rgba(148, 163, 184, .08);
  --desk-text-soft: rgba(203, 213, 225, .76);
  --desk-text-muted-clean: rgba(148, 163, 184, .76);
  --desk-accent-clean: #f2c66d;
}

html,
body,
.alvd-layout {
  background: var(--desk-bg-clean);
}

body[data-alvd-view="cases"] #refresh {
  display: none;
}

.alvd-sidebar::before,
.alvd-nav-item::before {
  display: none;
}

@media (min-width: 901px) {
  .alvd-sidebar {
    width: var(--desk-sidebar-width);
  }

  .alvd-main {
    width: calc(100% - var(--desk-sidebar-width));
    max-width: calc(100% - var(--desk-sidebar-width));
    margin-left: var(--desk-sidebar-width);
  }
}

.alvd-sidebar {
  border-right: 1px solid var(--desk-border-soft);
  background: #0b0c10;
  box-shadow: none;
}

.alvd-sidebar-header {
  min-height: 82px;
  padding: 20px 18px 12px;
}

.alvd-logo {
  gap: 11px;
}

.alvd-logo-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 8px;
  box-shadow: none;
}

.alvd-logo-copy strong {
  color: var(--desk-accent-clean);
  font-size: 16px;
  letter-spacing: 1.7px;
  text-shadow: none;
}

.alvd-logo-copy span {
  color: rgba(148, 163, 184, .72);
  font-size: 9px;
  letter-spacing: 3px;
}

.alvd-nav {
  gap: 5px;
  padding: 10px 12px 14px;
}

.alvd-nav-item {
  min-height: 42px;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--desk-text-soft);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0;
}

.alvd-nav-item svg {
  width: 18px;
  height: 18px;
  color: rgba(203, 213, 225, .72);
}

.alvd-nav-item:hover {
  border-color: var(--desk-border-clean);
  background: rgba(255, 255, 255, .035);
  color: #f8fafc;
}

.alvd-nav-item.active {
  border-color: rgba(242, 198, 109, .22);
  background: rgba(242, 198, 109, .08);
  color: var(--desk-accent-clean);
}

.alvd-nav-item.active::after {
  width: 2px;
  height: 20px;
  background: var(--desk-accent-clean);
}

.alvd-nav-item.active svg {
  color: var(--desk-accent-clean);
}

.alvd-nav-section.alvd-admin-tabs {
  margin: 14px 0 0;
  padding: 8px;
  border-color: var(--desk-border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .022);
  box-shadow: none;
}

.alvd-admin-tabs .alvd-nav-section-label {
  padding: 0 2px 7px;
  color: rgba(148, 163, 184, .78);
  font-size: 10px;
}

.alvd-admin-tabs .alvd-admin-tab {
  min-height: 44px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--desk-text-soft);
}

.alvd-admin-tabs .alvd-admin-tab svg {
  width: 16px;
  height: 16px;
}

.alvd-admin-tab-copy strong {
  font-size: 12px;
}

.alvd-admin-tab-copy small {
  font-size: 10px;
}

.alvd-user-box {
  margin: 8px 12px 14px;
  padding: 10px;
  border: 1px solid var(--desk-border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .024);
}

.alvd-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(242, 198, 109, .12);
  color: var(--desk-accent-clean);
  box-shadow: none;
}

.alvd-user-name {
  font-size: 13px;
  font-weight: 760;
}

.alvd-user-role {
  color: var(--desk-text-muted-clean);
  font-size: 11px;
}

.alvd-header {
  min-height: 72px;
  padding: 0 clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--desk-border-soft);
  background: rgba(9, 10, 13, .92);
  box-shadow: none;
}

.alvd-header h1 {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.alvd-header-right {
  gap: 8px;
}

.alvd-header .alvd-btn,
.alvd-header .alvd-btn-icon,
.alvd-sidebar .alvd-btn-icon {
  min-height: 40px;
  border-radius: 9px;
}

.alvd-header .alvd-btn {
  padding: 0 13px;
}

.alvd-content {
  padding: 22px clamp(14px, 2vw, 24px) 30px;
  background: linear-gradient(180deg, #0a0b0f 0%, var(--desk-bg-clean) 240px);
}

.alvd-cases-workbench {
  width: min(100%, 1220px);
  margin: 0 auto;
  gap: 12px;
}

.alvd-cases-workbench .alvd-case-head {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 98px;
  padding: 14px 16px;
  border-color: var(--desk-border-clean);
  border-radius: 10px;
  background: var(--desk-surface-clean);
  box-shadow: none;
}

.alvd-cases-workbench .alvd-case-head h2 {
  font-size: 21px;
}

.alvd-cases-workbench .alvd-case-head p {
  color: var(--desk-text-muted-clean);
}

.alvd-case-head-stats {
  gap: 5px;
  min-width: 304px;
  padding: 5px;
  border-color: var(--desk-border-soft);
  border-radius: 10px;
  background: rgba(0, 0, 0, .16);
}

.alvd-case-head-stats span {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .035);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
}

.alvd-case-head-stats strong {
  font-size: 14px;
}

.alvd-case-head-stats small {
  color: var(--desk-text-muted-clean);
  font-size: 9px;
}

.alvd-cases-workbench .alvd-case-toolbar {
  padding: 7px;
  border-color: var(--desk-border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
}

.alvd-case-toolbar .alvd-input {
  min-height: 40px;
  border-color: rgba(148, 163, 184, .10);
  border-radius: 7px;
  background: rgba(2, 6, 12, .55);
}

.alvd-cases-workbench .alvd-case-grid {
  grid-template-columns: minmax(282px, 340px) minmax(0, 1fr);
  gap: 12px;
}

.alvd-cases-workbench .alvd-case-list,
.alvd-cases-workbench .alvd-case-detail {
  border-color: var(--desk-border-clean);
  border-radius: 10px;
  background: var(--desk-surface-clean);
  box-shadow: none;
}

.alvd-cases-workbench .alvd-case-list {
  padding: 7px;
}

.alvd-cases-workbench .alvd-case-row {
  min-height: 76px;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.alvd-cases-workbench .alvd-case-row:hover {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .03);
  transform: none;
}

.alvd-cases-workbench .alvd-case-row.active {
  border-color: rgba(242, 198, 109, .34);
  background: rgba(242, 198, 109, .075);
  box-shadow: inset 2px 0 0 rgba(242, 198, 109, .88);
}

.alvd-case-row-main strong {
  font-size: 13px;
  font-weight: 820;
}

.alvd-cases-workbench .alvd-case-detail {
  padding: 15px;
}

.alvd-cases-workbench .alvd-case-detail-head {
  gap: 12px;
  padding-bottom: 13px;
}

.alvd-cases-workbench .alvd-case-detail-head h2 {
  font-size: 22px;
}

.alvd-case-detail-actions {
  gap: 7px;
}

.alvd-case-detail-actions .alvd-btn {
  min-height: 32px;
  padding: 7px 10px;
}

.alvd-cases-workbench .alvd-case-info-card {
  border-color: var(--desk-border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .026);
}

.alvd-case-info-card h3,
.alvd-shop-kicker {
  color: var(--desk-accent-clean);
  letter-spacing: .055em;
}

.alvd-case-problem-card p,
.alvd-cases-workbench .alvd-case-messages,
.alvd-cases-workbench .alvd-case-reply {
  border-color: var(--desk-border-soft);
  border-radius: 9px;
  background: rgba(0, 0, 0, .13);
}

.alvd-cases-workbench .alvd-case-message {
  border-color: var(--desk-border-soft);
  border-radius: 9px;
}

.alvd-cases-workbench .alvd-case-message.is-customer {
  border-color: rgba(242, 198, 109, .26);
  background: rgba(242, 198, 109, .08);
}

.alvd-case-reply textarea {
  border-color: rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(2, 6, 12, .58);
}

.alvd-case-reply-tools {
  border-color: var(--desk-border-soft);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .alvd-content {
    padding: 16px 14px 26px;
  }

  .alvd-cases-workbench .alvd-case-grid {
    grid-template-columns: 1fr;
  }

  .alvd-cases-workbench .alvd-case-list {
    max-height: 320px;
  }
}

@media (max-width: 900px) {
  .alvd-sidebar {
    width: min(286px, 86vw);
    box-shadow: 18px 0 40px rgba(0, 0, 0, .42);
  }

  .alvd-header {
    min-height: 74px;
    padding: 0 14px;
  }

  .alvd-header h1 {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .alvd-cases-workbench .alvd-case-head {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px;
  }

  .alvd-case-head-side {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }

  .alvd-case-head-stats {
    width: 100%;
    min-width: 0;
  }

  .alvd-cases-workbench .alvd-case-detail {
    padding: 12px;
  }

  .alvd-case-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .alvd-case-detail-actions .alvd-case-badge,
  .alvd-case-detail-actions #case-copy-link {
    grid-column: 1 / -1;
  }

  .alvd-case-detail-actions .alvd-case-badge {
    justify-self: start;
    width: auto;
    max-width: 100%;
  }

  .alvd-case-detail-actions .alvd-btn {
    width: 100%;
  }

  .alvd-case-reply-foot {
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .alvd-content {
    padding: 13px 12px 24px;
  }

  .alvd-cases-workbench {
    gap: 10px;
  }

  .alvd-case-head-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-cases-workbench .alvd-case-head h2,
  .alvd-cases-workbench .alvd-case-detail-head h2 {
    font-size: 20px;
  }

  .alvd-cases-workbench .alvd-case-row {
    min-height: 92px;
  }

  .alvd-case-detail-actions {
    grid-template-columns: 1fr;
  }
}

.alvd-admin-tabs .alvd-admin-tab > svg {
  box-sizing: border-box;
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px;
  padding: 6px !important;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .032);
  color: rgba(203, 213, 225, .78) !important;
  opacity: 1;
}

.alvd-admin-tabs .alvd-admin-tab > svg * {
  stroke: currentColor !important;
}

.alvd-admin-tabs .alvd-admin-tab:hover > svg,
.alvd-admin-tabs .alvd-admin-tab:focus-visible > svg,
.alvd-admin-tabs .alvd-admin-tab.active > svg {
  border-color: rgba(242, 198, 109, .28);
  background: rgba(242, 198, 109, .10);
  color: var(--desk-accent-clean) !important;
}

/* ==========================================================================
   DESK CASES V2 - cleaner support workbench
   ========================================================================== */
body[data-alvd-view="cases"] .alvd-content {
  background:
    linear-gradient(180deg, rgba(242, 198, 109, .035) 0, rgba(242, 198, 109, 0) 210px),
    #090a0d;
}

body[data-alvd-view="cases"] .alvd-cases-workbench {
  width: min(100%, 1280px);
  display: grid;
  gap: 10px;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head,
body[data-alvd-view="cases"] .alvd-case-list-panel,
body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail {
  border: 1px solid rgba(148, 163, 184, .105);
  border-radius: 8px;
  background: #101116;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(242, 198, 109, .08), rgba(45, 212, 191, .035) 54%, rgba(255, 255, 255, .018)),
    #101116;
}

body[data-alvd-view="cases"] .alvd-case-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-head-copy .alvd-shop-kicker {
  color: rgba(242, 198, 109, .78);
  font-size: 10px;
  letter-spacing: .08em;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head p {
  max-width: 620px;
  margin: 0;
  color: rgba(203, 213, 225, .68);
  font-size: 13px;
  line-height: 1.45;
}

body[data-alvd-view="cases"] .alvd-case-head-side {
  display: grid;
  grid-template-columns: minmax(312px, auto) auto;
  align-items: center;
  gap: 10px;
}

body[data-alvd-view="cases"] .alvd-case-head-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 312px;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, .10);
  border-radius: 8px;
  background: rgba(2, 6, 12, .40);
}

body[data-alvd-view="cases"] .alvd-case-head-stats span {
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .035);
}

body[data-alvd-view="cases"] .alvd-case-head-stats strong {
  color: #f8fafc;
  font-size: 15px;
  line-height: 1;
}

body[data-alvd-view="cases"] .alvd-case-head-stats small {
  margin-top: 4px;
  color: rgba(148, 163, 184, .78);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .08em;
}

body[data-alvd-view="cases"] #cases-refresh {
  min-height: 42px;
  border-radius: 8px;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .09);
  border-radius: 8px;
  background: rgba(16, 17, 22, .84);
  box-shadow: none;
}

body[data-alvd-view="cases"] .alvd-case-toolbar .alvd-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, .11);
  border-radius: 7px;
  background: rgba(2, 6, 12, .54);
  color: #f8fafc;
}

body[data-alvd-view="cases"] .alvd-case-toolbar .alvd-input:focus {
  border-color: rgba(242, 198, 109, .42);
  box-shadow: 0 0 0 3px rgba(242, 198, 109, .10);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-grid {
  grid-template-columns: minmax(300px, 368px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

body[data-alvd-view="cases"] .alvd-case-list-panel {
  min-width: 0;
  overflow: hidden;
}

body[data-alvd-view="cases"] .alvd-case-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .09);
  background: rgba(255, 255, 255, .018);
}

body[data-alvd-view="cases"] .alvd-case-list-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-list-head span {
  color: rgba(242, 198, 109, .76);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-alvd-view="cases"] .alvd-case-list-head strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-list-head small {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, .10);
  border-radius: 999px;
  color: rgba(203, 213, 225, .72);
  font-size: 10px;
  font-weight: 800;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-list {
  max-height: calc(100vh - 292px);
  min-height: 360px;
  padding: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: auto;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-row {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 6px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, .024);
  color: #f8fafc;
  text-align: left;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-row:hover {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .045);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-row.active {
  border-color: rgba(242, 198, 109, .34);
  background:
    linear-gradient(90deg, rgba(242, 198, 109, .12), rgba(242, 198, 109, .035)),
    rgba(255, 255, 255, .026);
  box-shadow: inset 3px 0 0 rgba(242, 198, 109, .82);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-row.is-unread {
  border-color: rgba(45, 212, 191, .24);
}

body[data-alvd-view="cases"] .alvd-case-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-row-title strong,
body[data-alvd-view="cases"] .alvd-case-row-main > strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-row-title em {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #2dd4bf;
  color: #04100f;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

body[data-alvd-view="cases"] .alvd-case-row-main small {
  overflow: hidden;
  color: rgba(203, 213, 225, .80);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-row-sub {
  overflow: hidden;
  color: rgba(148, 163, 184, .72);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-row-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 108px;
}

body[data-alvd-view="cases"] .alvd-case-row-meta small {
  color: rgba(148, 163, 184, .74);
  font-size: 10px;
  line-height: 1;
}

body[data-alvd-view="cases"] .alvd-case-badge {
  max-width: 100%;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-empty {
  min-height: 292px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px dashed rgba(148, 163, 184, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .018);
  text-align: center;
}

body[data-alvd-view="cases"] .alvd-case-empty strong {
  color: #f8fafc;
  font-size: 14px;
}

body[data-alvd-view="cases"] .alvd-case-empty p {
  max-width: 280px;
  margin: 0;
  color: rgba(203, 213, 225, .66);
  font-size: 12px;
  line-height: 1.55;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail {
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .024), rgba(255, 255, 255, 0) 170px),
    #101116;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail.is-empty {
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .055), rgba(242, 198, 109, .04)),
    #101116;
  text-align: center;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail.is-empty svg {
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(242, 198, 109, .18);
  border-radius: 8px;
  background: rgba(242, 198, 109, .08);
  color: #f2c66d;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail.is-empty h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 18px;
  letter-spacing: 0;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail.is-empty p {
  max-width: 360px;
  margin: 0;
  color: rgba(203, 213, 225, .68);
  font-size: 13px;
  line-height: 1.55;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(148, 163, 184, .09);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail-head h2 {
  margin: 3px 0 4px;
  color: #f8fafc;
  font-size: 22px;
  letter-spacing: 0;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail-head p {
  margin: 0;
  color: rgba(203, 213, 225, .66);
}

body[data-alvd-view="cases"] .alvd-case-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 560px;
}

body[data-alvd-view="cases"] .alvd-case-detail-actions .alvd-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-info-card {
  border: 1px solid rgba(148, 163, 184, .09);
  border-radius: 7px;
  background: rgba(255, 255, 255, .022);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-messages,
body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-reply,
body[data-alvd-view="cases"] .alvd-case-problem-card p {
  border-radius: 7px;
  background: rgba(2, 6, 12, .30);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-message {
  border-radius: 7px;
  background: rgba(255, 255, 255, .024);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-message.is-customer {
  border-color: rgba(45, 212, 191, .22);
  background: rgba(45, 212, 191, .055);
}

body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-message.is-support {
  border-color: rgba(242, 198, 109, .20);
  background: rgba(242, 198, 109, .055);
}

@media (max-width: 1120px) {
  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-head-side {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  body[data-alvd-view="cases"] .alvd-case-head-stats {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-grid {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-list {
    max-height: 330px;
    min-height: 160px;
  }
}

@media (max-width: 720px) {
  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head {
    gap: 10px;
    padding: 11px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head h2 {
    font-size: 20px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head p {
    font-size: 12px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail-head {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-actions .alvd-case-badge,
  body[data-alvd-view="cases"] .alvd-case-detail-actions #case-copy-link {
    grid-column: 1 / -1;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-actions .alvd-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  body[data-alvd-view="cases"] .alvd-content {
    padding: 12px 10px 22px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench {
    gap: 8px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-head p {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-head-side {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
  }

  body[data-alvd-view="cases"] .alvd-case-head-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
  }

  body[data-alvd-view="cases"] .alvd-case-head-stats span {
    padding: 6px 4px;
  }

  body[data-alvd-view="cases"] .alvd-case-head-stats strong {
    font-size: 13px;
  }

  body[data-alvd-view="cases"] .alvd-case-head-stats small {
    font-size: 8px;
    letter-spacing: 0;
  }

  body[data-alvd-view="cases"] #cases-refresh {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  body[data-alvd-view="cases"] #cases-refresh span {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-list-head {
    min-height: 52px;
    padding: 9px 10px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-list {
    padding: 6px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 11px;
  }

  body[data-alvd-view="cases"] .alvd-case-row-meta {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    min-width: 0;
  }

  body[data-alvd-view="cases"] .alvd-case-row-meta small {
    justify-self: end;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail {
    padding: 11px;
  }

  body[data-alvd-view="cases"] .alvd-cases-workbench .alvd-case-detail.is-empty {
    min-height: 300px;
    padding: 22px;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-actions {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DESK CASES V3 - ticket-style inbox and detail rebuild
   ========================================================================== */
body[data-alvd-view="cases"] .alvd-content {
  background:
    linear-gradient(180deg, rgba(242, 198, 109, .035) 0, rgba(242, 198, 109, 0) 230px),
    #0b0b10;
}

body[data-alvd-view="cases"] .alvd-cases-workbench,
body[data-alvd-view="cases"] .alvd-case-detail-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

body[data-alvd-view="cases"] .alvd-case-inbox-view {
  display: grid;
  gap: 12px;
}

body[data-alvd-view="cases"] .alvd-case-inbox-topline h2 {
  font-size: 24px;
  letter-spacing: 0;
}

body[data-alvd-view="cases"] .alvd-case-inbox-topline .alvd-delivery-pill {
  border-color: rgba(242, 198, 109, .22);
  color: var(--gold);
  background: rgba(242, 198, 109, .075);
}

body[data-alvd-view="cases"] .alvd-case-quickbar {
  margin-bottom: 0;
}

body[data-alvd-view="cases"] .alvd-case-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) auto;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 10px;
  background: rgba(255, 255, 255, .022);
}

body[data-alvd-view="cases"] .alvd-case-toolbar .alvd-search-box,
body[data-alvd-view="cases"] .alvd-case-toolbar .alvd-select,
body[data-alvd-view="cases"] .alvd-case-toolbar .alvd-btn {
  min-height: 38px;
}

body[data-alvd-view="cases"] .alvd-case-inbox-card {
  border-radius: 10px;
  background: rgba(13, 14, 20, .86);
}

body[data-alvd-view="cases"] .alvd-case-inbox-list {
  padding: 8px;
}

body[data-alvd-view="cases"] .alvd-case-list-head-row,
body[data-alvd-view="cases"] .alvd-case-row-card {
  grid-template-columns: 54px minmax(150px, .78fr) minmax(230px, 1.22fr) minmax(124px, .48fr) minmax(120px, .44fr) minmax(88px, .34fr);
}

body[data-alvd-view="cases"] .alvd-case-row-card {
  min-height: 76px;
  border-radius: 9px;
}

body[data-alvd-view="cases"] .alvd-case-row-card.active {
  border-color: rgba(242, 198, 109, .42);
  background:
    linear-gradient(90deg, rgba(242, 198, 109, .11), rgba(242, 198, 109, .026)),
    rgba(255, 255, 255, .028);
}

body[data-alvd-view="cases"] .alvd-case-row-card.is-waiting::after {
  background: var(--gold);
}

body[data-alvd-view="cases"] .alvd-case-row-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(242, 198, 109, .16);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(242, 198, 109, .07);
}

body[data-alvd-view="cases"] .alvd-case-row-icon svg {
  width: 15px;
  height: 15px;
}

body[data-alvd-view="cases"] .alvd-case-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .035);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-badge.is-live {
  border-color: rgba(52, 211, 153, .22);
  color: var(--success);
  background: rgba(52, 211, 153, .08);
}

body[data-alvd-view="cases"] .alvd-case-badge.is-waiting,
body[data-alvd-view="cases"] .alvd-case-badge.is-pending {
  border-color: rgba(242, 198, 109, .26);
  color: var(--gold);
  background: rgba(242, 198, 109, .085);
}

body[data-alvd-view="cases"] .alvd-case-badge.is-muted {
  color: rgba(203, 213, 225, .76);
  background: rgba(255, 255, 255, .03);
}

body[data-alvd-view="cases"] .alvd-case-current-view {
  display: none;
}

body[data-alvd-view="cases"] .alvd-case-detail-page {
  display: grid;
  gap: 14px;
}

body[data-alvd-view="cases"] .alvd-case-ticket-header {
  align-items: center;
  margin-bottom: 0;
  padding: 0;
}

body[data-alvd-view="cases"] .alvd-case-ticket-header h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 24px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .alvd-case-actionbar {
  margin: -2px 0 0;
}

body[data-alvd-view="cases"] .alvd-case-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 14px;
}

body[data-alvd-view="cases"] .alvd-case-summary-card,
body[data-alvd-view="cases"] .alvd-case-chat,
body[data-alvd-view="cases"] .alvd-case-right .alvd-card,
body[data-alvd-view="cases"] .alvd-case-info-card {
  border-radius: 9px;
  border-color: rgba(255, 255, 255, .08);
  background: rgba(16, 17, 23, .88);
  box-shadow: none;
}

body[data-alvd-view="cases"] .alvd-case-summary-card .alvd-card-header,
body[data-alvd-view="cases"] .alvd-case-right .alvd-card-header {
  min-height: 48px;
}

body[data-alvd-view="cases"] .alvd-case-details-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-alvd-view="cases"] .alvd-case-issue-box {
  margin-top: 10px;
}

body[data-alvd-view="cases"] .alvd-case-chat {
  overflow: hidden;
}

body[data-alvd-view="cases"] .alvd-case-chat-messages {
  min-height: 430px;
  max-height: 58vh;
  padding: 14px;
}

body[data-alvd-view="cases"] .alvd-case-msg .alvd-msg-sender {
  gap: 6px;
}

body[data-alvd-view="cases"] .alvd-case-agent {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

body[data-alvd-view="cases"] .alvd-case-reply {
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(9, 10, 14, .58);
}

body[data-alvd-view="cases"] .alvd-case-reply.is-locked {
  display: grid;
  min-height: 70px;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

body[data-alvd-view="cases"] .alvd-case-reply .alvd-textarea-row textarea {
  min-height: 84px;
}

body[data-alvd-view="cases"] .alvd-case-reply-foot {
  align-items: center;
}

body[data-alvd-view="cases"] .alvd-case-reply-foot > span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

body[data-alvd-view="cases"] .alvd-case-right {
  display: grid;
  align-content: start;
  gap: 12px;
}

body[data-alvd-view="cases"] .alvd-case-workflow-card .alvd-card-body,
body[data-alvd-view="cases"] .alvd-case-access-card .alvd-card-body,
body[data-alvd-view="cases"] .alvd-case-policy-card .alvd-card-body {
  padding: 12px;
}

body[data-alvd-view="cases"] .alvd-case-action-grid,
body[data-alvd-view="cases"] .alvd-case-access-actions {
  display: grid;
  gap: 8px;
}

body[data-alvd-view="cases"] .alvd-case-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-alvd-view="cases"] .alvd-case-access-actions .alvd-btn,
body[data-alvd-view="cases"] .alvd-case-action-grid .alvd-btn {
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
}

body[data-alvd-view="cases"] .alvd-case-access-tools {
  display: grid;
  gap: 10px;
}

body[data-alvd-view="cases"] .alvd-case-magic-link {
  grid-template-columns: minmax(0, 1fr) 42px;
}

body[data-alvd-view="cases"] .alvd-case-magic-link .alvd-input {
  min-width: 0;
  font-size: 12px;
}

body[data-alvd-view="cases"] .alvd-case-magic-link .alvd-btn {
  min-width: 42px;
  padding: 0;
}

body[data-alvd-view="cases"] .alvd-case-access-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-alvd-view="cases"] .alvd-case-side-stack {
  display: grid;
  gap: 10px;
}

body[data-alvd-view="cases"] .alvd-case-info-card {
  padding: 12px;
}

body[data-alvd-view="cases"] .alvd-case-info-card h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-alvd-view="cases"] .alvd-case-info-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-alvd-view="cases"] .alvd-case-info-row {
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-info-row.is-wide {
  grid-column: 1 / -1;
}

body[data-alvd-view="cases"] .alvd-case-info-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

body[data-alvd-view="cases"] .alvd-case-info-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

body[data-alvd-view="cases"] .alvd-case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

body[data-alvd-view="cases"] .alvd-case-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(242, 198, 109, .24);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(242, 198, 109, .08);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

body[data-alvd-view="cases"] .alvd-case-policy-list {
  display: grid;
  gap: 8px;
}

body[data-alvd-view="cases"] .alvd-case-policy-list span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: start;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 8px;
  background: rgba(255, 255, 255, .026);
}

body[data-alvd-view="cases"] .alvd-case-policy-list strong {
  grid-row: 1 / span 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: #0d0d12;
  background: var(--gold);
  font-size: 12px;
  font-weight: 950;
}

body[data-alvd-view="cases"] .alvd-case-policy-list b {
  color: var(--text-primary);
  font-size: 12px;
}

body[data-alvd-view="cases"] .alvd-case-policy-list small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

body[data-alvd-view="cases"] .alvd-case-pending-attachments {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

body[data-alvd-view="cases"] .alvd-case-reply > .alvd-case-pending-attachments {
  padding: 0 2px;
}

body[data-alvd-view="cases"] .alvd-case-pending-attachment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  width: min(100%, 235px);
  min-height: 42px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
}

body[data-alvd-view="cases"] .alvd-case-pending-attachment img,
body[data-alvd-view="cases"] .alvd-case-pending-file {
  width: 34px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, .22);
}

body[data-alvd-view="cases"] .alvd-case-pending-file {
  display: grid;
  place-items: center;
  color: var(--gold);
}

body[data-alvd-view="cases"] .alvd-case-pending-attachment strong {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-alvd-view="cases"] .case-remove-attachment {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

body[data-alvd-view="cases"] .case-remove-attachment:hover,
body[data-alvd-view="cases"] .case-remove-attachment:focus-visible {
  outline: 0;
  border-color: rgba(248, 113, 113, .34);
  color: var(--danger);
  background: rgba(248, 113, 113, .08);
}

body[data-alvd-view="cases"] .alvd-case-loading-card {
  min-height: 360px;
  display: grid;
  place-items: center;
}

@media (max-width: 1120px) {
  body[data-alvd-view="cases"] .alvd-case-list-head-row,
  body[data-alvd-view="cases"] .alvd-case-row-card {
    grid-template-columns: 42px minmax(150px, .8fr) minmax(220px, 1.25fr) minmax(112px, .45fr) minmax(92px, .35fr);
  }

  body[data-alvd-view="cases"] .alvd-case-list-head-row span:nth-child(6),
  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-activity {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body[data-alvd-view="cases"] .alvd-case-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-inbox-card {
    overflow: hidden;
  }

  body[data-alvd-view="cases"] .alvd-case-list-head-row {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 7px 10px;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-pin {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-main {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-request {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-state {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-owner {
    grid-column: 2;
    grid-row: 3;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header {
    align-items: flex-start;
    gap: 8px;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar::-webkit-scrollbar {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar .alvd-ticket-action {
    flex: 0 0 auto;
  }

  body[data-alvd-view="cases"] .alvd-case-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-alvd-view="cases"] .alvd-case-chat-messages {
    min-height: 340px;
    max-height: 56vh;
  }
}

@media (max-width: 520px) {
  body[data-alvd-view="cases"] .alvd-case-inbox-topline h2,
  body[data-alvd-view="cases"] .alvd-case-ticket-header h2 {
    font-size: 21px;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-pin {
    display: none;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-main,
  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-request,
  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-state,
  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-owner {
    grid-column: 1;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-state {
    grid-row: 3;
  }

  body[data-alvd-view="cases"] .alvd-case-row-card .alvd-ticket-row-owner {
    grid-row: 4;
  }

  body[data-alvd-view="cases"] .alvd-case-details-grid,
  body[data-alvd-view="cases"] .alvd-case-info-rows,
  body[data-alvd-view="cases"] .alvd-case-action-grid {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-reply-foot {
    display: grid;
    gap: 8px;
  }
}

/* Desk cases V4 - mobile composition pass */
@media (max-width: 640px) {
  body[data-alvd-view="cases"] .alvd-content {
    padding-inline: 10px;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-page {
    gap: 10px;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 2px;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header #case-back {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-height: 34px;
    padding-inline: 10px;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header h2 {
    grid-column: 1;
    grid-row: 2;
    font-size: 21px;
    line-height: 1.05;
    white-space: normal;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header .alvd-case-badge {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    justify-self: end;
    max-width: 116px;
    min-height: 28px;
    text-align: center;
    white-space: normal;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 8px;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar .alvd-ticket-action {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 42px;
  }

  body[data-alvd-view="cases"] .alvd-case-actionbar .alvd-ticket-action.is-primary {
    grid-column: 1 / -1;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-grid,
  body[data-alvd-view="cases"] .alvd-ticket-left,
  body[data-alvd-view="cases"] .alvd-case-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-ticket-left,
  body[data-alvd-view="cases"] .alvd-case-detail-grid > .alvd-case-right {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  body[data-alvd-view="cases"] .alvd-ticket-left > .alvd-case-summary-card {
    order: 1;
  }

  body[data-alvd-view="cases"] .alvd-ticket-left > .alvd-case-chat {
    order: 2;
  }

  body[data-alvd-view="cases"] .alvd-case-summary-card .alvd-card-body,
  body[data-alvd-view="cases"] .alvd-case-chat .alvd-card-body,
  body[data-alvd-view="cases"] .alvd-case-right .alvd-card-body {
    padding: 12px;
  }

  body[data-alvd-view="cases"] .alvd-case-details-grid,
  body[data-alvd-view="cases"] .alvd-case-info-rows,
  body[data-alvd-view="cases"] .alvd-case-action-grid,
  body[data-alvd-view="cases"] .alvd-case-access-actions {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-detail-box,
  body[data-alvd-view="cases"] .alvd-case-info-row,
  body[data-alvd-view="cases"] .alvd-items-text {
    overflow-wrap: anywhere;
  }

  body[data-alvd-view="cases"] .alvd-case-chat-messages {
    min-height: 300px;
    max-height: none;
    padding: 12px;
  }

  body[data-alvd-view="cases"] .alvd-qr-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-alvd-view="cases"] .alvd-qr-pick {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  body[data-alvd-view="cases"] .alvd-case-reply .alvd-textarea-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  body[data-alvd-view="cases"] .alvd-case-reply .alvd-textarea-row textarea {
    min-height: 96px;
  }

  body[data-alvd-view="cases"] .alvd-case-reply-foot {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-reply-foot .alvd-btn {
    width: 100%;
  }

  body[data-alvd-view="cases"] .alvd-case-magic-link {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
}

@media (max-width: 360px) {
  body[data-alvd-view="cases"] .alvd-qr-bar {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header {
    grid-template-columns: 1fr;
  }

  body[data-alvd-view="cases"] .alvd-case-ticket-header .alvd-case-badge {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    max-width: 100%;
  }
}

/* Desk QOL - ticket save feedback */
.alvd-save-row {
  display: grid;
  gap: 7px;
}

.alvd-save-state {
  min-height: 17px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.alvd-save-state[data-state="saved"] {
  color: #55d890;
}

.alvd-save-state[data-state="error"] {
  color: var(--danger);
}

/* Desk QOL - clearer ticket request details */
.alvd-request-card .alvd-card-body {
  display: grid;
  gap: 12px;
}

.alvd-request-head {
  align-items: center;
  gap: 10px;
}

.alvd-request-card .alvd-card-header h3 {
  min-width: 0;
}

.alvd-request-card svg {
  display: inline-block;
  flex: 0 0 auto;
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.alvd-request-head-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.alvd-request-status,
.alvd-request-order {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.alvd-request-status {
  border: 1px solid rgba(143, 105, 255, 0.2);
  background: rgba(143, 105, 255, 0.12);
  color: #c9b8ff;
}

.alvd-request-order {
  border: 1px solid rgba(249, 200, 108, 0.18);
  background: rgba(249, 200, 108, 0.06);
  color: var(--gold);
}

.alvd-request-brief {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 2px 0 1px;
}

.alvd-request-kicker,
.alvd-request-chip small,
.alvd-request-money-item span,
.alvd-request-items label,
.alvd-request-meta-item span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-request-goal {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.alvd-request-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.alvd-request-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(180, 190, 210, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-request-chip strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.alvd-request-items {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(249, 200, 108, 0.16);
  border-radius: 8px;
  background: rgba(249, 200, 108, 0.045);
}

.alvd-request-items label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.alvd-request-items label svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  color: var(--gold);
}

.alvd-request-items div {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.alvd-request-money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  min-width: 0;
  padding: 1px;
  border-radius: 8px;
  background: rgba(180, 190, 210, 0.12);
  overflow: hidden;
}

.alvd-request-money-item {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-request-money-item strong {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.alvd-request-money-item small {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.alvd-request-money-item.is-primary strong,
.alvd-request-money-item.is-customer strong {
  color: var(--gold);
}

.alvd-request-money-item.is-paid strong {
  color: #55d890;
}

.alvd-request-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  min-width: 0;
  padding-top: 2px;
}

.alvd-request-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.alvd-request-meta-item strong {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.alvd-focus-pulse {
  animation: alvdFocusPulse 1.45s ease;
}

@keyframes alvdFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 200, 108, 0.44);
    border-color: rgba(249, 200, 108, 0.52);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(249, 200, 108, 0);
  }
}

@media (max-width: 980px) {
  .alvd-request-money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .alvd-request-card .alvd-card-body {
    gap: 10px;
  }

  .alvd-request-goal {
    font-size: 22px;
  }

  .alvd-request-chip {
    padding: 5px 7px;
  }

  .alvd-request-money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alvd-request-money-item {
    min-height: 58px;
    padding: 9px 10px;
  }

  .alvd-request-meta {
    grid-template-columns: 1fr;
  }
}

/* Desk redesign - ticket workspace */
.alvd-ticket-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(12, 12, 18, 0.78);
}

.alvd-ticket-header h2 {
  min-width: 0;
  margin: 0;
  color: var(--gold);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.alvd-ticket-back {
  min-height: 40px;
}

.alvd-ticket-actionbar {
  gap: 7px;
  margin-bottom: 12px;
}

.alvd-mobile-work-card {
  display: none;
}

.alvd-action-dock {
  border-color: rgba(249, 200, 108, 0.16);
  background:
    linear-gradient(180deg, rgba(249, 200, 108, 0.05), rgba(249, 200, 108, 0) 190px),
    rgba(15, 15, 21, 0.96);
}

.alvd-action-dock .alvd-card-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.alvd-dock-panel {
  min-width: 0;
  border: 1px solid rgba(180, 190, 210, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-dock-panel-head span,
.alvd-dock-details summary span,
.alvd-mobile-work-grid small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.alvd-dock-panel-head strong,
.alvd-dock-details summary strong,
.alvd-mobile-work-grid strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.alvd-dock-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
}

.alvd-dock-panel-head,
.alvd-dock-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.alvd-dock-panel-head > div,
.alvd-dock-details summary {
  min-width: 0;
}

.alvd-dock-panel-head span,
.alvd-dock-details summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.alvd-dock-panel-head svg,
.alvd-dock-details summary svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

/* Ticket detail icon guard: prevents inline SVGs from expanding into full-width art. */
body[data-alvd-view="ticket"] .alvd-ticket-header svg,
body[data-alvd-view="ticket"] .alvd-ticket-actionbar svg,
body[data-alvd-view="ticket"] .alvd-request-card svg,
body[data-alvd-view="ticket"] .alvd-action-dock svg,
body[data-alvd-view="ticket"] .alvd-mobile-work-card svg,
body[data-alvd-view="ticket"] .alvd-chat .alvd-card-header svg,
body[data-alvd-view="ticket"] .alvd-chat-copy svg {
  --alvd-ticket-icon-size: 16px;
  display: inline-block !important;
  flex: 0 0 var(--alvd-ticket-icon-size) !important;
  width: var(--alvd-ticket-icon-size) !important;
  height: var(--alvd-ticket-icon-size) !important;
  min-width: var(--alvd-ticket-icon-size) !important;
  min-height: var(--alvd-ticket-icon-size) !important;
  max-width: var(--alvd-ticket-icon-size) !important;
  max-height: var(--alvd-ticket-icon-size) !important;
  vertical-align: -0.15em;
}

body[data-alvd-view="ticket"] .alvd-ticket-actionbar svg,
body[data-alvd-view="ticket"] .alvd-action-dock .alvd-btn svg,
body[data-alvd-view="ticket"] .alvd-mobile-work-card .alvd-btn svg,
body[data-alvd-view="ticket"] .alvd-chat-copy svg {
  --alvd-ticket-icon-size: 18px;
}

body[data-alvd-view="ticket"] .alvd-request-items label svg,
body[data-alvd-view="ticket"] .alvd-dock-panel-head svg,
body[data-alvd-view="ticket"] .alvd-dock-details summary svg {
  --alvd-ticket-icon-size: 14px;
}

.alvd-dock-details {
  padding: 0;
}

.alvd-dock-details summary {
  padding: 11px;
  cursor: pointer;
  list-style: none;
}

.alvd-dock-details summary::-webkit-details-marker {
  display: none;
}

.alvd-dock-details summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 950;
}

.alvd-dock-details[open] summary::after {
  content: "-";
}

.alvd-dock-panel-body {
  display: grid;
  gap: 10px;
  padding: 0 11px 11px;
}

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

.alvd-dock-actions .alvd-btn {
  min-width: 0;
}

.alvd-dock-workflow .alvd-primary-grid {
  gap: 8px;
}

.alvd-display-panel .alvd-form-group {
  margin: 0;
}

.alvd-showcase-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.alvd-showcase-add-actions .alvd-btn {
  min-height: 42px;
}

.alvd-display-panel .alvd-showcase-list {
  gap: 8px;
}

.alvd-display-panel .alvd-showcase-item {
  border-radius: 8px;
}

.alvd-display-panel .alvd-showcase-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.alvd-display-panel .alvd-showcase-thumb {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.alvd-display-panel .alvd-showcase-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alvd-display-panel .alvd-showcase-clear-img {
  position: absolute;
  top: 4px;
  right: 4px;
}

.alvd-mobile-work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(180, 190, 210, 0.12);
}

.alvd-mobile-work-grid span {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.alvd-mobile-work-grid .is-ready strong,
.alvd-mobile-work-grid .is-locked strong {
  color: #55d890;
}

.alvd-mobile-work-grid .is-missing strong {
  color: var(--gold);
}
