/*
 * ==========================================================
 * WAQR ADMIN.CSS
 * ==========================================================
 *
 * WhatsApp QR app admin styles.
 *
 */

.sb-waqr-box {
    margin-top: 15px;
}

.sb-waqr-box .sb-waqr-status {
    font-size: 13px;
    line-height: 20px;
    margin-bottom: 10px;
}

.sb-waqr-box .sb-waqr-status[data-status="connected"] {
    color: #109d58;
}

.sb-waqr-box .sb-waqr-status[data-status="disconnected"] {
    color: #ca3434;
}

.sb-waqr-box .sb-waqr-qr {
    display: none;
    width: 220px;
    height: 220px;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    background: #fff;
    padding: 10px;
}

.sb-waqr-box .sb-waqr-actions {
    margin-top: 12px;
}

.sb-waqr-box .sb-waqr-disconnect {
    background: #ca3434;
    border-color: #ca3434;
}

.sb-waqr-box .sb-waqr-disconnect:hover {
    background: #b02a2a;
    border-color: #b02a2a;
}

.sb-waqr-box .sb-waqr-disconnect.sb-waqr-confirm {
    background: #8a1f1f;
    border-color: #8a1f1f;
}

.sb-waqr-box .sb-waqr-resync {
    margin-right: 8px;
    background: #d97706;
    border-color: #d97706;
}

.sb-waqr-box .sb-waqr-resync:hover {
    background: #b45f05;
    border-color: #b45f05;
}

.sb-waqr-box .sb-waqr-resync.sb-waqr-confirm {
    background: #8a1f1f;
    border-color: #8a1f1f;
}

/* Hide the unused license-validation settings in Settings > Users
   ("Envato purchase code validation" and "Boxcoin license key validation").
   Each setting renders as <div id="{id}">, so we target them by id. This only
   removes them from the admin UI — the backend settings are left untouched, and
   the following settings keep their place (no reflow of the list). */
#envato-validation,
#boxcoin-validation {
    display: none;
}

/* Hide the "Automatic updates" checkbox in Settings > Miscellaneous: updates
   are disabled in this fork (patch-core neutralizes sb_update/sb_app_update and
   forces auto_updates off), so the toggle would do nothing. */
#auto-updates {
    display: none;
}

/* Hide the WhatsApp QR infrastructure settings — Gateway URL, API key and
   Session name. These are deploy-time config, not day-to-day knobs: the URL is
   overridden by the WAQR_URL env var anyway (functions.php), the key is a shared
   secret, and the session is always "default". The QR channel screen keeps only
   the Connect / QR button + status.
   IMPORTANT: hide by id, do NOT remove them from settings.json — Support Board
   rebuilds the whole settings blob from the visible form on every save, so a
   removed field would be wiped from the DB (breaking gateway auth). Hidden here,
   the fields stay in the form and round-trip untouched. */
#waqr-url,
#waqr-key,
#waqr-session {
    display: none;
}

/* Inline rename of the customer from the conversation area: pencil on hover
   next to the name in the right user-details panel, swapped for an input +
   save/cancel while editing (Enter saves, Escape cancels). */
/* Always visible (discoverability), discreet by default, emphasized on hover. */
.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-btn {
    display: inline-block;
    cursor: pointer;
    font-size: 13px;
    line-height: 13px;
    padding: 4px;
    margin-left: 6px;
    border-radius: 4px;
    opacity: .4;
}

.sb-user-details .sb-profile.sb-waqr-rename:hover .sb-waqr-rename-btn {
    opacity: .7;
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .06);
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-form {
    display: none;
    align-items: center;
    min-width: 0;
    /* The panel-collapse icon (.sb-user-details-close) is absolutely positioned
       in the top-right corner: stop the form before it so the cancel cross
       never slides underneath it. */
    margin-right: 38px;
}

.sb-user-details .sb-profile.sb-waqr-rename.sb-waqr-renaming .sb-waqr-rename-form {
    display: flex;
}

.sb-user-details .sb-profile.sb-waqr-rename.sb-waqr-renaming .sb-name,
.sb-user-details .sb-profile.sb-waqr-rename.sb-waqr-renaming .sb-waqr-rename-btn {
    display: none;
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-form input {
    width: 100%;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 25px;
    padding: 0 8px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 4px;
    outline: none;
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-form input.sb-error {
    border-color: #ca3434;
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-form i {
    cursor: pointer;
    font-size: 13px;
    line-height: 13px;
    padding: 5px;
    margin-left: 4px;
    border-radius: 4px;
    opacity: .7;
}

.sb-user-details .sb-profile.sb-waqr-rename .sb-waqr-rename-form i:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .06);
}

/* New WhatsApp conversation: "+" button in the conversations-list header and
   its dialog (phone + optional name). The native header row (filter + search)
   nearly fills the column, so tighten the two 48px icon-buttons to 38px in
   THIS header only to seat the new button without overflow. */
.sb-admin-list > .sb-top > .sb-flex > .sb-filter-btn,
.sb-admin-list > .sb-top > .sb-flex > .sb-search-btn {
    width: 30px;
    min-width: 30px;
}

.sb-admin-list .sb-top .sb-waqr-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 40px;
    cursor: pointer;
    color: #24272a;
    flex: none;
}

.sb-admin-list .sb-top .sb-waqr-new-btn:hover {
    color: #109d58;
}

.sb-admin-list .sb-top .sb-waqr-new-btn i {
    font-size: 19px;
    line-height: 19px;
}

/* The overlay lives under <body>, outside .sb-admin which scopes the admin
   font — restate it here (same stack as .sb-admin, css/admin.css). */
.sb-waqr-new-overlay,
.sb-waqr-new-overlay input {
    font-family: "Support Board Font", "Helvetica Neue", "Apple Color Emoji", Helvetica, Arial, sans-serif;
}

.sb-waqr-new-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99995;
    background: rgba(15, 20, 25, .5);
    align-items: center;
    justify-content: center;
}

.sb-waqr-new-overlay.sb-waqr-open {
    display: flex;
}

.sb-waqr-new-dialog {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .25);
    width: min(360px, 90vw);
    padding: 24px;
}

.sb-waqr-new-dialog h3 {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.3;
}

.sb-waqr-new-dialog label {
    display: block;
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #7a828c;
    margin: 12px 0 5px;
}

.sb-waqr-new-dialog input {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 11px;
    border: 1px solid #d4dae0;
    border-radius: 6px;
    outline: none;
}

.sb-waqr-new-dialog input:focus {
    border-color: #109d58;
}

.sb-waqr-new-dialog input::placeholder {
    color: #a8b0b9;
}

.sb-waqr-new-hint {
    margin: 5px 0 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: #7a828c;
}

.sb-waqr-new-dialog input.sb-error {
    border-color: #ca3434;
}

.sb-waqr-new-error {
    min-height: 18px;
    margin: 10px 0 0;
    font-size: 12.5px;
    color: #ca3434;
}

.sb-waqr-new-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.sb-waqr-new-actions a {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    padding: 9px 16px;
}

.sb-waqr-new-cancel {
    color: #7a828c;
}

.sb-waqr-new-cancel:hover {
    color: #24292f;
}

.sb-waqr-new-go {
    background: #109d58;
    color: #fff;
}

.sb-waqr-new-go:hover {
    background: #0d7e47;
}

.sb-waqr-new-go.sb-waqr-loading {
    opacity: .6;
    pointer-events: none;
}
