/* ============================================================
   SOKOHAI — CHAT + ADMIN TOGGLES + SOKOPAY POLISH (14)
   ------------------------------------------------------------
   1) Admin: switch moja ya ON/OFF yenye muonekano mmoja kila mahali
      (inaondoa "switch systems" mbili zilizokuwa zikichanganya).
   2) Chat: orodha ya mawasiliano yenye DP, kadi ya bidhaa, strip ya
      bidhaa iliyoambatishwa.
   3) SokoPay: kitufe cha "Rudi" kilichoboreshwa.
   ============================================================ */

/* ============================================================
   ADMIN — VIDHIBITI VYA MFUMO (unified switches)
   ============================================================ */
.sys-group {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sys-group-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #0f172a;
    padding: 2px 4px 6px;
    border-bottom: 1px solid #e2e8f0;
}

.sys-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sys-toggle:hover {
    border-color: #18A982;
    box-shadow: 0 4px 14px rgba(0, 80, 157, 0.10);
}

.sys-toggle[data-on="1"] {
    border-color: rgba(16, 185, 129, 0.5);
    background: #f0fdf4;
}

/* Wakati wa ku-save (busy): isibonyezwe mara mbili + ionekane inafanya kazi */
.sys-toggle[data-busy="1"] {
    pointer-events: none;
    opacity: 0.82;
}
.sys-toggle[data-busy="1"] .sys-switch::after { background: #e2e8f0; }

.sys-toggle-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sys-toggle-label {
    font-weight: 800;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
}

.sys-toggle-note {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.sys-state {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
}

.sys-state.on  { background: #dcfce7; color: #15803d; }
.sys-state.off { background: #f1f5f9; color: #64748b; }

.sys-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.18s ease;
}

.sys-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease;
}

.sys-toggle[data-on="1"] .sys-switch { background: #10b981; }
.sys-toggle[data-on="1"] .sys-switch::after { transform: translateX(20px); }

/* ============================================================
   CHAT — ORODHA YA MAWASILIANO (contact list with DP)
   ============================================================ */
.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.chat-contact:hover { background: #f0f9ff; }
.chat-contact:last-child { border-bottom: none; }

.chat-contact .cc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-contact .cc-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-contact .cc-msg {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-contact .cc-time {
    font-size: 12.5px;
    color: #94a3b8;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
}

/* Kichwa cha mazungumzo — DP ya mwenzako */
.chat-head-avatar {
    flex-shrink: 0;
}

/* Kadi ya bidhaa ndani ya bubble ya chat */
.chat-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.10);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.chat-product-card:hover {
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.18);
    transform: translateY(-1px);
}

.chat-product-card img {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.chat-product-card .cpc-info {
    flex: 1;
    min-width: 0;
}

.chat-product-card .cpc-title {
    font-size: 12px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.25;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-product-card .cpc-link {
    font-size: 12.5px;
    color: #ea580c;
    font-weight: 900;
    display: inline-block;
    margin-top: 2px;
}

/* Strip ya bidhaa iliyoambatishwa (juu ya composer) */
.chat-attached {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbe6;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 8px 10px;
    margin: 0 10px 8px;
}

.chat-attached .ca-remove {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #b45309;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
    line-height: 1;
}

.chat-attached .ca-remove:hover { background: #fef3c7; }

/* Kichwa cha maoni (author avatar + jina) */
.comment-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
}

/* ============================================================
   SOKOPAY — KITUFE CHA "RUDI" KILICHOBORESHWA
   ============================================================ */
.sp-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    flex-shrink: 0;
    background: #ffffff;
    color: #00509d;
    border: 1.5px solid #00509d;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 80, 157, 0.12);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sp-back-btn:hover {
    background: #18A982;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 80, 157, 0.24);
    transform: translateY(-1px);
}

.sp-back-btn:active { transform: scale(0.97); }
.sp-back-btn svg { flex-shrink: 0; }
.sp-back-label { white-space: nowrap; }

/* Avatar halisi ya mtumiaji kwenye SokoPay header */
.sp-header-avatar {
    object-fit: cover;
    background: #e2e8f0;
}
