@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0a0010;
  --card: #110018;
  --card2: #16001f;
  --border: rgba(180, 0, 230, 0.18);
  --border-bright: rgba(220, 0, 255, 0.38);
  --accent: #c026d3;
  --accent2: #7c3aed;
  --accent-glow: rgba(192, 38, 211, 0.25);
  --accent2-glow: rgba(124, 58, 237, 0.22);
  --text: #f0e6ff;
  --text2: #c4b5d4;
  --muted: #8b7aa0;
  --danger: #e11d48;
  --danger-soft: #1b0010;
  --success: #a855f7;
  --green: #10b981;
  --yellow: #f59e0b;
}

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

body {
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(124, 58, 237, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(192, 38, 211, 0.14) 0%, transparent 60%);
}

/* ── LAYOUT ─────────────────────────────────────────── */
.layout {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 20px 12px;
}

.panel {
  width: min(1680px, calc(100vw - 24px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.08), 0 0 0 1px var(--border);
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.app-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.app-title h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #e879f9, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── SESSION ROW ────────────────────────────────────── */
.session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* ── STATUS PILL ────────────────────────────────────── */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(180, 0, 230, 0.3);
  background: rgba(120, 0, 180, 0.08);
  color: var(--text2);
  font-size: 13px;
  min-height: 36px;
  margin: 10px 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ── LINKED BANNER ──────────────────────────────────── */
.linked-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(124, 58, 237, 0.1);
  border-radius: 12px;
  margin-bottom: 16px;
}

.linked-banner strong {
  color: #c084fc;
  font-size: 14px;
}

.linked-banner span {
  color: #a78bfa;
  font-size: 13px;
}

/* ── QR BLOCK ────────────────────────────────────────── */
.qr-block {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(120, 0, 180, 0.05);
  margin: 16px 0;
}

#pairQr {
  width: 160px;
  height: 160px;
  background: white;
  border-radius: 10px;
  padding: 6px;
}

.pairing-data {
  display: grid;
  align-content: start;
  gap: 8px;
}

/* ── FORM CONTROLS ──────────────────────────────────── */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

input {
  background: rgba(10, 0, 20, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.15);
}

textarea {
  background: rgba(10, 0, 20, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.15);
}

input {
  min-width: 160px;
}

#pairLink {
  width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.25);
}

button:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 20px rgba(192, 38, 211, 0.4);
}

button:active {
  transform: scale(0.97);
}

button.secondary {
  background: rgba(120, 0, 180, 0.12);
  border: 1px solid var(--border);
  color: var(--text2);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #9f0025, #e11d48);
  box-shadow: 0 2px 12px rgba(225, 29, 72, 0.3);
}

button.danger:hover {
  box-shadow: 0 4px 20px rgba(225, 29, 72, 0.5);
}

button.danger-soft {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #f87171;
  box-shadow: none;
}

button.icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

button.icon-btn.active-mute {
  background: linear-gradient(135deg, #9f0025, #e11d48);
  box-shadow: 0 2px 14px rgba(225, 29, 72, 0.45);
}

/* ── CONTACTS ────────────────────────────────────────── */
.contacts {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.contacts h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

thead tr {
  background: rgba(124, 58, 237, 0.07);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(120, 0, 180, 0.06);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.contact-row-calling {
  background: rgba(245, 158, 11, 0.2);
}

tbody tr.contact-row-calling td {
  border-bottom-color: rgba(245, 158, 11, 0.45);
}

tbody tr.contact-row-called {
  background: rgba(245, 158, 11, 0.18);
}

tbody tr.contact-row-called td {
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

tbody tr.contact-row-status-r,
tbody tr.contact-row-status-r:hover {
  background: rgba(220, 38, 38, 0.2);
}

tbody tr.contact-row-status-r td {
  border-bottom-color: rgba(220, 38, 38, 0.38);
}

tbody tr.contact-row-status-lc,
tbody tr.contact-row-status-lc:hover {
  background: rgba(245, 158, 11, 0.22);
}

tbody tr.contact-row-status-lc td {
  border-bottom-color: rgba(245, 158, 11, 0.45);
}

tbody tr.contact-row-status-sc,
tbody tr.contact-row-status-sc:hover {
  background: rgba(22, 163, 74, 0.2);
}

tbody tr.contact-row-status-sc td {
  border-bottom-color: rgba(22, 163, 74, 0.36);
}

.call-count-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.28);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.actions-cell button {
  font-size: 12px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
}

.actions-cell .wa-action-btn {
  background: linear-gradient(135deg, #1b8f44, #25d366);
  border: 1px solid rgba(37, 211, 102, 0.55);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(37, 211, 102, 0.3);
}

.contact-action-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: none;
}

.contact-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  background: #ffffff;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.contact-action-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.contact-action-badge.is-active {
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 16px rgba(0, 0, 0, 0.3);
}

.contact-action-badge.badge-r {
  color: #ef4444;
}

.contact-action-badge.badge-r.is-active {
  background: #dc2626;
  color: #ffffff;
}

.contact-action-badge.badge-lc {
  color: #f59e0b;
}

.contact-action-badge.badge-lc.is-active {
  background: #f59e0b;
  color: #ffffff;
}

.contact-action-badge.badge-sc {
  color: #22c55e;
}

.contact-action-badge.badge-sc.is-active {
  background: #16a34a;
  color: #ffffff;
}

.contact-status-legend {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(124, 58, 237, 0.08);
}

.contact-status-legend-title {
  color: var(--text2);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
}

#contactInlineRow {
  display: none;
}

.floating-add-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
  z-index: 1300;
  box-shadow: 0 10px 30px rgba(192, 38, 211, 0.45);
}

.reminder-float-container {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  z-index: 1290;
}

.reminder-float-card {
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(48, 20, 5, 0.92);
  color: #fde68a;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.reminder-float-card.is-due {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(62, 9, 24, 0.95);
  color: #fecdd3;
}

.reminder-float-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.reminder-float-meta {
  font-size: 12px;
  color: #f9a8d4;
  margin-bottom: 8px;
}

.reminder-float-actions {
  display: flex;
  gap: 8px;
}

.reminder-float-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

/* ── EDIT MODAL ─────────────────────────────────────── */
.edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1200;
}

.edit-card {
  width: min(480px, 100%);
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.edit-card h3 {
  font-size: 20px;
  margin-bottom: 14px;
}

.whatsapp-card {
  width: min(520px, 100%);
}

.quotation-card {
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
}

.quotation-form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 12px;
}

.quotation-form-grid label {
  margin-top: 2px;
}

.quotation-table-wrap {
  margin-top: 12px;
}

.quotation-totals {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(120, 0, 180, 0.05);
  display: grid;
  gap: 8px;
}

.quotation-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.quotation-total-line.grand {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 16px;
}

.quotation-igv-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.quotation-igv-label input {
  min-width: auto;
  min-height: auto;
}

.quote-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quote-item-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.quotation-preview-modal {
  z-index: 1400;
}

.quotation-preview-card {
  width: min(1260px, 100%);
  height: 94vh;
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  overflow: hidden;
}

.quotation-preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quotation-send-feedback {
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--muted);
}

.quotation-send-feedback.is-sending {
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.quotation-send-feedback.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.quotation-send-feedback.is-error {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fda4af;
  background: rgba(225, 29, 72, 0.16);
}

.quotation-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f5f5f5;
}

.whatsapp-phone {
  font-family: monospace;
  font-size: 13px;
  margin-bottom: 14px;
}

.whatsapp-panel {
  display: grid;
  gap: 12px;
}

.wa-connect-ok {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.wa-connect-ok.is-offline {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(225, 29, 72, 0.12);
}

.wa-connect-ok strong {
  color: #86efac;
  font-size: 14px;
}

.wa-connect-ok.is-offline strong {
  color: #fda4af;
}

.wa-connect-ok small {
  color: #d1fae5;
  font-family: monospace;
}

.wa-connect-ok.is-offline small {
  color: #ffe4e6;
}

.whatsapp-templates {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.whatsapp-template-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.whatsapp-template-create-row input {
  min-width: 0;
}

.whatsapp-template-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.whatsapp-template-btn {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  color: var(--text2);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}

.whatsapp-template-remove-btn {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(225, 29, 72, 0.45);
  background: rgba(225, 29, 72, 0.14);
  color: #fda4af;
  box-shadow: none;
}

.whatsapp-template-btn:hover {
  background: rgba(192, 38, 211, 0.18);
  border-color: var(--accent);
}

.whatsapp-template-remove-btn:hover {
  background: rgba(225, 29, 72, 0.24);
  border-color: rgba(225, 29, 72, 0.7);
}

.whatsapp-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(120, 0, 180, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.whatsapp-drop-zone:hover {
  border-color: var(--accent);
  background: rgba(192, 38, 211, 0.08);
  box-shadow: 0 0 15px var(--accent-glow);
}

.whatsapp-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(192, 38, 211, 0.15);
  transform: scale(1.02);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.drop-text {
  font-size: 13px;
  color: var(--text2);
}

#whatsappQrImg {
  width: 220px;
  height: 220px;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  justify-self: center;
}

.edit-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.edit-form label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.edit-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  box-shadow: none;
  padding: 0;
}

.pagination {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.pagination button {
  min-height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── CALL MODAL ──────────────────────────────────────── */
.call-modal {
  position: fixed;
  inset: 0;
  background: linear-gradient(140deg, rgba(8, 0, 20, 0.82), rgba(17, 0, 31, 0.78));
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  transition: opacity 0.22s ease;
}

.call-card {
  width: min(500px, 100%);
  border: 1px solid var(--border-bright);
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(15, 0, 24, 0.72);
  backdrop-filter: blur(12px);
  padding: 28px;
  box-shadow:
    0 0 0 1px var(--border),
    0 35px 90px rgba(124, 58, 237, 0.3),
    0 0 60px rgba(192, 38, 211, 0.1);
}

.call-pulse-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: grid;
  place-items: center;
  font-size: 36px;
  margin: 0 auto 20px;
  position: relative;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: pulse-ring 2.2s ease-in-out infinite;
}

.call-pulse-ring img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
}

@keyframes pulse-ring {

  0%,
  100% {
    box-shadow: 0 0 20px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 50px rgba(192, 38, 211, 0.5), 0 0 80px rgba(124, 58, 237, 0.3);
  }
}

.call-card-inner {
  text-align: center;
}

.call-kicker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c084fc;
  margin-bottom: 6px;
}

.call-card h3 {
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 700;
  margin: 0 0 4px;
}

.call-card .call-number {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 4px;
}

.call-card .call-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.call-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.call-controls button {
  min-width: 88px;
  max-width: 180px;
}

.call-controls-main {
  margin-top: 6px;
}

.call-controls-main button {
  min-width: 130px;
  width: 100%;
}

.call-controls .icon-btn.secondary {
  background: rgba(120, 0, 180, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #dcc2ff;
}

/* ── BADGE ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(100, 0, 150, 0.4);
  background: rgba(120, 0, 180, 0.1);
  color: var(--muted);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge.state-idle,
.badge.state-ended {
  color: var(--muted);
}

.badge.state-dialing,
.badge.state-ringing {
  color: var(--yellow);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  animation: blink-badge 1.2s ease-in-out infinite;
}

.badge.state-in_call {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.badge.state-failed {
  color: #f87171;
  border-color: rgba(225, 29, 72, 0.5);
  background: rgba(225, 29, 72, 0.14);
}

.badge.ack-pending {
  color: var(--yellow);
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.badge.ack-ok {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.badge.ack-fail {
  color: #f87171;
  border-color: rgba(225, 29, 72, 0.5);
  background: rgba(225, 29, 72, 0.14);
}

@keyframes blink-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

/* ── MIC INDICATOR ──────────────────────────────────── */
.mic-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mic-indicator.on {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
}

.mic-indicator.muted {
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.4);
}

/* ── SECTION DIVIDER ─────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 18px 0 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.contacts-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.contacts-title {
  flex: 1;
  margin: 0;
}

.called-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fef3c7;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.called-counter strong {
  font-size: 14px;
}

/* ── MUTED TEXT ─────────────────────────────────────── */
.muted {
  color: var(--muted);
}

/* ── PHONE PAGE SPECIFIC ────────────────────────────── */
.phone-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.phone-card {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.1);
  text-align: center;
}

.phone-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: grid;
  place-items: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px var(--accent-glow);
}

.phone-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #e879f9, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.phone-status-box {
  background: rgba(120, 0, 180, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--text2);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  line-height: 1.4;
}

.phone-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.perm-item {
  background: rgba(120, 0, 180, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  font-size: 12px;
}

.perm-item .perm-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.perm-item .perm-val {
  font-weight: 600;
  font-size: 13px;
}

.perm-val.granted {
  color: var(--green);
}

.perm-val.denied {
  color: var(--danger);
}

.perm-val.pending {
  color: var(--yellow);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout {
    padding: 20px 12px;
  }

  .panel {
    width: 100%;
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .qr-block {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .call-card {
    padding: 22px 18px;
  }

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

  .apk-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .contacts-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── APK BAR ─────────────────────────────────────────── */
.apk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.apk-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apk-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.apk-icon-img {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 0;
  object-fit: cover;
  display: block;
  flex: 0 0 22px;
  box-shadow: none;
  background: transparent;
}

.apk-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.apk-info small {
  font-size: 12px;
  color: var(--muted);
}

.apk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.apk-version-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  color: var(--text2);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.btn-apk-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.3);
  transition: filter 0.2s, box-shadow 0.2s;
}

.btn-apk-dl:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 22px rgba(192, 38, 211, 0.5);
}

/* ── INSTALL GUIDE ───────────────────────────────────── */
.install-guide {
  background: rgba(120, 0, 180, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.install-guide ol {
  margin: 0;
  padding-left: 18px;
}

.install-guide li {
  margin-bottom: 4px;
}

.install-guide strong {
  color: #c084fc;
}

/* ── IMPORT PANEL ────────────────────────────────────── */
.import-panel {
  background: rgba(120, 0, 180, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0 16px;
}

.import-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.import-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(120, 0, 180, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
}

.import-tab.active,
.import-tab:hover {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(192, 38, 211, 0.3);
}

.import-body {
  min-height: 60px;
}

/* ── FILE LABEL ──────────────────────────────────────── */
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.25);
  transition: filter 0.2s, box-shadow 0.2s;
}

.file-label:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(192, 38, 211, 0.4);
}
