:root {
  --sc-ink: #17212b;
  --sc-muted: #657184;
  --sc-line: #dfe5eb;
  --sc-bg: #f5f7fa;
  --sc-panel: #ffffff;
  --sc-primary: #1d6fd6;
  --sc-teal: #0f9f8f;
  --sc-green: #279653;
  --sc-orange: #d97706;
  --sc-red: #d23f31;
  --sc-purple: #7c3aed;
}

[v-cloak] {
  display: none;
}

body {
  background: var(--sc-bg);
  color: var(--sc-ink);
  font-family: Inter, Roboto, Arial, sans-serif;
}

.body--dark {
  --sc-ink: #eef3f8;
  --sc-muted: #a6b2c1;
  --sc-line: #2b3644;
  --sc-bg: #111820;
  --sc-panel: #17212b;
}

.app-header {
  background: #182633;
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(29, 111, 214, 0.12), transparent 340px),
    var(--sc-bg);
}

.login-card {
  width: min(440px, 100%);
  border-radius: 8px;
}

.login-card p {
  margin: 8px 0 0;
  color: var(--sc-muted);
}

.user-chip {
  max-width: 260px;
  overflow: hidden;
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--sc-teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.18);
}

.app-page {
  min-height: calc(100vh - 50px);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(29, 111, 214, 0.08), transparent 260px),
    var(--sc-bg);
}

.page-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 24px 0 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sc-teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--sc-ink);
  letter-spacing: 0;
}

h1 {
  max-width: 860px;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.08;
  font-weight: 800;
}

h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  background: var(--sc-panel);
  border: 1px solid var(--sc-line);
  border-radius: 8px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 16px;
}

.metric-card strong {
  display: block;
  color: var(--sc-ink);
  font-size: 1.65rem;
  line-height: 1;
}

.metric-card span:last-child {
  display: block;
  margin-top: 6px;
  color: var(--sc-muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 22px;
}

.metric-icon.blue {
  background: var(--sc-primary);
}

.metric-icon.green {
  background: var(--sc-green);
}

.metric-icon.teal {
  background: var(--sc-teal);
}

.metric-icon.red {
  background: var(--sc-red);
}

.metric-icon.purple {
  background: var(--sc-purple);
}

.metric-icon.orange {
  background: var(--sc-orange);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--sc-line);
}

.panel-header.compact {
  min-height: 48px;
  padding: 12px 14px;
}

.dialog-card {
  width: min(560px, calc(100vw - 32px));
  border-radius: 8px;
}

.sla-green,
.sla-yellow,
.sla-orange,
.sla-red,
.sla-black {
  min-width: 72px;
  justify-content: center;
  color: #ffffff;
}

.sla-green {
  background: var(--sc-green);
}

.sla-yellow {
  background: #c89d16;
}

.sla-orange {
  background: var(--sc-orange);
}

.sla-red {
  background: var(--sc-red);
}

.sla-black {
  background: #111111;
}

.q-table__container {
  background: transparent;
}

.settings-panel {
  padding-bottom: 18px;
}

.settings-tabs {
  color: var(--sc-ink);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  padding: 18px;
}

.settings-full,
.settings-grid .q-toggle {
  grid-column: 1 / -1;
}

.prompt-box textarea {
  min-height: 150px;
}

.whatsapp-chat {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: 650px;
}

.conversation-list,
.chat-panel {
  min-height: 650px;
}

.conversation-list .q-list {
  max-height: 590px;
  overflow: auto;
}

.chat-panel {
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--sc-line);
}

.chat-header span {
  display: block;
  margin-top: 4px;
  color: var(--sc-muted);
  font-size: 0.86rem;
}

.sender-input {
  width: min(260px, 40vw);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.attendance-inline {
  border-bottom: 1px solid var(--sc-line);
  background: var(--sc-panel);
}

.attendance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.attendance-grid .q-field,
.attendance-grid .q-field__control {
  height: 136px;
}

.attendance-grid textarea {
  min-height: 86px;
  resize: none;
}

.message-stack {
  flex: 1;
  min-height: 420px;
  max-height: 520px;
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(15, 159, 143, 0.04), transparent 220px),
    var(--sc-bg);
}

.message-row {
  display: flex;
  margin-bottom: 12px;
}

.message-row.outbound {
  justify-content: flex-end;
}

.message-bubble {
  width: fit-content;
  max-width: min(620px, 82%);
  padding: 12px 14px;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: var(--sc-panel);
}

.message-row.outbound .message-bubble {
  border-color: rgba(29, 111, 214, 0.25);
  background: rgba(29, 111, 214, 0.1);
}

.message-meta {
  margin-bottom: 6px;
  color: var(--sc-muted);
  font-size: 0.75rem;
}

.message-bubble strong {
  display: block;
  margin-bottom: 4px;
  color: var(--sc-ink);
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--sc-line);
  background: var(--sc-panel);
}

.composer-input {
  flex: 1;
}

.empty-chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--sc-muted);
}

.ticket-action-dialog {
  width: min(880px, calc(100vw - 32px));
  border-radius: 8px;
}

.ticket-action-dialog p {
  margin: 6px 0 0;
  color: var(--sc-muted);
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 920px) {
  .app-page {
    padding: 16px;
  }

  .page-band,
  .split-layout,
  .whatsapp-chat {
    display: block;
  }

  .page-band .q-btn {
    margin-top: 16px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .panel + .panel {
    margin-top: 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .conversation-list,
  .chat-panel {
    min-height: auto;
  }

  .chat-panel {
    margin-top: 16px;
  }

  .chat-header,
  .composer {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-grid {
    grid-template-columns: 1fr;
  }

  .sender-input {
    width: 100%;
  }

  .message-stack {
    max-height: 56vh;
  }
}

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

  .metric-card {
    min-height: 82px;
  }
}
