/* ==========================================================================
   Trackers + Connections — shared by tracker-setup.html and connections.html.
   Same anatomy as whatsapp-payments.html / invoices.html.
   ========================================================================== */

html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: #F5F7FA; }
@media (min-width: 1025px) {
  html, body { overflow: hidden; }
  .tk-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px 1fr; }
  .tk-shell > * { min-height: 0; min-width: 0; overflow: hidden; }
  .tk-shell .app-sidebar { position: relative; top: auto; height: 100%; }
}
.tk-main { display: flex; flex-direction: column; background: #FFFFFF; height: 100%; min-height: 0; }

.admin-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: #0B1F35; color: #15B5C7; font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.soon-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; background: #F0F4F8; color: #64748B; font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

/* Topbar */
.crm-topbar { flex-shrink: 0; background: #FFFFFF; border-bottom: 1px solid #E2E8F0; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: #94A3B8; }
.topbar-heading { font-size: 18px; font-weight: 800; color: #0F172A; letter-spacing: -0.015em; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; background: transparent; border: 1px solid #E2E8F0; color: #1E293B; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; transition: all 150ms cubic-bezier(0.32, 0.72, 0, 1); white-space: nowrap; }
.topbar-btn:hover { background: #F0F4F8; border-color: #CBD5E1; }
.topbar-btn.primary { background: #0B1F35; color: #FFFFFF; border-color: #0B1F35; }
.topbar-btn.primary:hover { background: #15324F; }
.topbar-btn.sm { padding: 5px 10px; font-size: 12px; }
.draft-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(245,158,11,0.12); color: #B45309; font-size: 11.5px; font-weight: 700; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(34,197,94,0.08); color: #15803D; font-size: 11.5px; font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; }

/* Underline tabs */
.view-tabs { flex-shrink: 0; display: flex; padding: 0 28px; border-bottom: 1px solid #E2E8F0; background: #FFFFFF; overflow-x: auto; }
.view-tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 4px; margin-right: 20px; border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: #64748B; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.view-tab:hover { color: #0F172A; }
.view-tab.active { color: #0F172A; border-bottom-color: #15B5C7; }
.view-tab i { font-size: 15px; }
.view-tab.active i { color: #0E9DAE; }
.view-tab .n { font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: #F0F4F8; color: #64748B; }
.view-tab .n.warn { background: rgba(245,158,11,0.15); color: #B45309; }
.views { flex: 1; min-height: 0; overflow-y: auto; }
.view { display: none; }
.view.active { display: block; }
.pane { padding: 22px 28px 40px; }

/* Cards */
.card { background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 14px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid #EDF1F5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head .h { font-size: 14px; font-weight: 800; color: #0F172A; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 11.5px; color: #64748B; margin-top: 2px; line-height: 1.45; }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sec-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: #94A3B8; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #94A3B8; font-weight: 700; padding: 9px 12px; border-bottom: 1px solid #E2E8F0; background: #FAFBFC; white-space: nowrap; }
.mini-table td { padding: 10px 12px; border-bottom: 1px solid #EDF1F5; color: #1E293B; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table td.num, .mini-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.badge.red { background: rgba(220,38,38,0.1); color: #DC2626; }
.badge.amber { background: rgba(245,158,11,0.12); color: #B45309; }
.badge.cyan { background: rgba(21,181,199,0.1); color: #0E9DAE; }
.badge.navy { background: rgba(11,31,53,0.08); color: #0B1F35; }
.badge.green { background: rgba(34,197,94,0.1); color: #15803D; }
.badge.muted { background: #F0F4F8; color: #64748B; }

/* Form controls */
.in, .sel, .ta { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid #E2E8F0; background: #FFFFFF; font-family: inherit; font-size: 12.5px; color: #0F172A; }
.in:focus, .sel:focus, .ta:focus { outline: 0; border-color: #15B5C7; box-shadow: 0 0 0 3px rgba(21,181,199,0.12); }
.ta { resize: vertical; min-height: 56px; line-height: 1.5; }
.sel { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 256 256'%3E%3Cpath fill='%2394A3B8' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.lbl { display: block; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 5px; }
.hint { font-size: 11px; color: #94A3B8; margin-top: 4px; line-height: 1.45; }
.toggle { position: relative; width: 32px; height: 18px; border-radius: 999px; background: #CBD5E1; border: 0; cursor: pointer; flex-shrink: 0; transition: background 150ms ease; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; transition: transform 150ms cubic-bezier(0.32,0.72,0,1); }
.toggle.on { background: #15B5C7; }
.toggle.on::after { transform: translateX(14px); }

.type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; background: #F0F4F8; color: #334155; font-size: 11px; font-weight: 700; white-space: nowrap; }
.type-chip i { color: #0E9DAE; font-size: 12px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(21,181,199,0.1); color: #0B1F35; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ricon { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: #64748B; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; }
.ricon:hover { background: #E2E8F0; color: #0F172A; }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #F0F4F8; font-size: 12px; color: #475569; line-height: 1.55; }
.note i { color: #0E9DAE; font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.note.warn { background: #FFFBEB; color: #92400E; }
.note.warn i { color: #B45309; }

.add-row { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 11px; border-radius: 10px; border: 1.5px dashed #CBD5E1; background: transparent; color: #475569; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all 150ms ease; }
.add-row:hover { border-color: #15B5C7; color: #0E9DAE; background: rgba(21,181,199,0.04); }

/* Modal parts (app.css supplies .modal-overlay / .modal-card) */
.mh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mh .e { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; color: #64748B; }
.mt { font-weight: 800; color: #0F172A; font-size: 18px; margin-bottom: 12px; letter-spacing: -0.01em; }

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .crm-topbar, .pane { padding-left: 16px; padding-right: 16px; }
  .view-tabs { padding: 0 16px; }
}

.modal-card { max-height: 90vh; overflow-y: auto; }
