:root{--purple:#b66dff;--ink:#34324a;--bg:#f5f3fa}*{box-sizing:border-box}body{background:var(--bg);color:var(--ink);font:14px/1.5 Inter,system-ui,sans-serif}.sidebar{position:fixed;inset:0 auto 0 0;width:240px;background:#fff;border-right:1px solid #ebe7f1;padding:24px 18px;z-index:20}.brand{display:flex;align-items:center;gap:10px;font-size:22px;font-weight:800;color:#5e35a8;text-decoration:none}.brand span{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:linear-gradient(135deg,#b66dff,#7e57c2);color:#fff}.sidebar nav{display:grid;gap:7px;margin-top:35px}.sidebar nav a{padding:11px 14px;border-radius:10px;color:#6d687c;text-decoration:none}.sidebar nav a:hover{background:#f4eaff;color:#8e44d4}.topbar{position:fixed;left:240px;right:0;top:0;height:68px;background:#fff;display:flex;align-items:center;gap:20px;padding:0 30px;border-bottom:1px solid #eeeaf3;z-index:10}.topbar input{border:0;background:#f7f5fa;border-radius:20px;padding:9px 16px}.menu{display:none}.content{margin-left:240px;padding:98px 30px 40px}.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.page-head h1{font-size:27px;margin:0}.page-head p{color:#8c8798;margin:4px 0}.card{border:1px solid #ece8f1;border-radius:14px;box-shadow:0 4px 18px rgba(49,35,73,.04)}.btn-purple{background:linear-gradient(135deg,#b66dff,#9254d5);border:0;color:#fff}.btn-purple:hover{color:#fff;filter:brightness(.96)}.stat{color:#fff;border-radius:14px;padding:22px;min-height:122px;box-shadow:0 8px 22px #bbb4}.stat small,.stat strong{display:block}.stat strong{font-size:30px;margin-top:15px}.purple{background:linear-gradient(135deg,#b66dff,#8e55dc)}.coral{background:linear-gradient(135deg,#ff8a8a,#ff647d)}.blue{background:linear-gradient(135deg,#6aa8ff,#5578e9)}.teal{background:linear-gradient(135deg,#48d6c6,#23a7b9)}.empty{color:#999;text-align:center;padding:30px!important}.failure{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid #eee}.failure span{color:#d65368}.drop-zone{border:2px dashed #d7c4ed;border-radius:12px;text-align:center;padding:30px;background:#fcfaff}.drop-zone input{max-width:300px}.counts{display:flex;gap:8px;flex-wrap:wrap}.counts span{background:#f2edf8;padding:6px 10px;border-radius:20px}.skeleton{height:20px;border-radius:5px;background:linear-gradient(90deg,#eee,#fafafa,#eee);background-size:200%;animation:pulse 1.2s infinite}@keyframes pulse{to{background-position:-200%}}.auth-shell{min-height:100vh;display:grid;place-items:center;padding:20px}.auth-card{width:min(430px,100%)}.message-preview{white-space:pre-wrap;background:#faf8fc;padding:20px;border-radius:10px}.invalid-row{background:#fff3f4!important}.phone-link{cursor:pointer;color:#8d45d4;text-decoration:underline}
.campaign-stats .col{min-width:130px}.campaign-stats strong{display:block;font-size:1.5rem}.preview-cell{max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge[class*="state-"]{background:#6c757d}.badge.state-processing{background:#0d6efd}.badge.state-accepted,.badge.state-sent{background:#198754}.badge.state-delivered,.badge.state-read{background:#157347}.badge.state-failed,.badge.state-invalid{background:#dc3545}.badge.state-skipped,.badge.state-cancelled{background:#6c757d}
@media(max-width:850px){.sidebar{transform:translateX(-100%);transition:.2s}.nav-open .sidebar{transform:none}.topbar{left:0}.content{margin-left:0;padding:90px 16px}.menu{display:block}.topbar input,.topbar>span{display:none}.page-head{align-items:flex-start;gap:15px;flex-direction:column}}
.message-log-card { overflow: hidden; }
.message-table thead th {
  background: var(--bs-body-bg);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
.message-table td { vertical-align: middle; }
.message-preview { color: inherit; max-width: 32rem; text-decoration: none; }
.message-preview:hover { text-decoration: underline; }
.status-badge { border: 0; }
.state-pending, .state-accepted { background: #fff3cd; color: #664d03; }
.state-sent { background: #cff4fc; color: #055160; }
.state-delivered { background: #d1e7dd; color: #0f5132; }
.state-read, .state-played { background: #e2d9f3; color: #432874; }
.state-failed { background: #f8d7da; color: #842029; }
.state-deleted { background: #e2e3e5; color: #41464b; }
.state-unknown { background: #f1f3f5; color: #495057; }
.delivery-note { white-space: nowrap; margin-top: .25rem; }
.message-actions { min-width: 19rem; }
.message-status-cell{min-width:8.5rem}.status-badge-updated{transition:opacity .18s ease,color .18s ease;opacity:.82}
@keyframes message-highlight {
  from { background: #fff3cd; }
  to { background: transparent; }
}
.attempt-card { border: 1px solid #dee2e6; border-radius: .75rem; padding: 1rem; margin-bottom: .75rem; }
.safe-json { background: #111827; color: #e5e7eb; border-radius: .5rem; max-height: 18rem; overflow: auto; padding: .75rem; white-space: pre-wrap; }
.message-full { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-skeleton {
  min-height: 18rem;
  border-radius: .5rem;
  background: linear-gradient(90deg, #f1f3f5 25%, #e9ecef 37%, #f1f3f5 63%);
  background-size: 400% 100%;
  animation: skeleton 1.2s ease infinite;
}
@keyframes skeleton { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* Shared, semantic delivery badges and responsive log cards. */
.app-status{display:inline-flex;align-items:center;gap:.35rem;border-radius:999px;padding:.28rem .62rem;font-size:.78rem;font-weight:700;line-height:1.1;white-space:nowrap}.app-status--queued,.app-status--skipped,.app-status--cancelled{background:#e9ecef;color:#343a40}.app-status--processing{background:#dbeafe;color:#124aa0}.app-status--accepted,.app-status--pending{background:#fff3cd;color:#765500}.app-status--sent{background:#cff4fc;color:#075c70}.app-status--delivered{background:#d1e7dd;color:#0d5132}.app-status--read,.app-status--played{background:#cde8d7;color:#084c2c}.app-status--failed,.app-status--invalid{background:#f8d7da;color:#842029}.app-status--deleted{background:#495057;color:#fff}.message-table .message-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:28rem;white-space:normal}.message-table .message-campaign{max-width:12rem}.message-table .message-time{white-space:nowrap;font-variant-numeric:tabular-nums}.action-more{display:inline-block;position:relative;text-align:left}.action-more summary{list-style:none}.action-more summary::-webkit-details-marker{display:none}.action-more>div{position:absolute;right:0;z-index:5;min-width:8rem;padding:.45rem;background:#fff;border:1px solid #e4ddec;border-radius:.6rem;box-shadow:0 .5rem 1.25rem rgba(38,22,55,.14)}.action-more>div .btn{display:block;width:100%;margin:.15rem 0;text-align:left}
.live-status-sync{font-size:.82rem;color:#52606d;min-height:1.25rem}.live-status-sync>span{color:#198754}@media (prefers-reduced-motion:reduce){.status-badge-updated{transition:none}}
.media-feedback{min-height:1.3rem}.media-feedback.is-pending{color:#6c757d}.media-feedback.is-ready{color:#198754;font-weight:600}.media-feedback.is-error{color:#b02a37;font-weight:600}
@media (max-width: 767px) {
  .message-actions { min-width: 12rem; }
  .message-actions .btn { margin-bottom: .25rem; }
  .message-preview { min-width: 14rem; }
  .message-table thead{display:none}.message-table,.message-table tbody,.message-table tr,.message-table td{display:block;width:100%}.message-table tr{position:relative;margin:.75rem;border:1px solid #ebe6f1;border-radius:.8rem;padding:.8rem;background:#fff}.message-table td{border:0;padding:.22rem 0}.message-table td:first-child{position:absolute;right:.55rem;top:.55rem;width:auto}.message-table td:nth-child(2){display:none}.message-table td:nth-child(3){font-weight:700;padding-right:2rem}.message-table td:nth-child(5)::before{content:"Campaign · ";color:#777}.message-table td:nth-child(7)::before{content:"Updated · ";color:#777}.message-table .message-preview{max-width:none}.message-table .message-actions{text-align:left!important;margin-top:.45rem}
}
.app-table-card{background:#fff;border:1px solid #ece8f1;border-radius:14px;box-shadow:0 4px 18px rgba(49,35,73,.04)}
.app-table{margin-bottom:0}.app-table thead th{position:sticky;top:0;z-index:2;background:#fff;white-space:nowrap}.app-table th:first-child,.app-table td:first-child{width:42px}.app-table tbody tr{height:54px}.app-table tbody tr:hover{background:#faf7ff}.app-table-toolbar,.app-table-selection{flex-wrap:wrap}.app-table-selection{position:sticky;top:68px;z-index:3;display:flex;gap:.5rem;align-items:center;padding:.65rem;background:#f8f4ff;border:1px solid #e7dafa;border-radius:.75rem;margin-bottom:1rem}.app-status-badge{border-radius:999px}.app-actions{display:flex;gap:.35rem;flex-wrap:wrap}.app-empty-state{padding:3rem;text-align:center;color:#777}.message-phone{font-variant-numeric:tabular-nums}.btn{min-height:34px;border-radius:.55rem}.btn:focus-visible{box-shadow:0 0 0 .25rem rgba(182,109,255,.3)}.btn.disabled,.btn:disabled{pointer-events:none;opacity:.55}
