/* SysAutomator FIX47 recovery stylesheet */
.app-toast[hidden] { display: none !important; pointer-events: none !important; }
.app-toast:not(.is-visible) { pointer-events: none !important; }
.app-toast.is-visible { display: flex !important; pointer-events: auto !important; }

.sa-page-head,
.sa-livechat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.sa-page-head h1,
.sa-livechat-head h1 { margin: 2px 0 0; font-size: 1.65rem; }
.sa-page-head p { margin: 5px 0 0; color: #64748b; }

.sa-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.sa-card-head h2 { margin: 0; font-size: 1.1rem; }
.sa-card-head p { margin: 4px 0 0; color: #64748b; font-size: .88rem; }
.sa-count {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}
.sa-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.sa-regional-defaults { margin-bottom: 16px; }
.sa-regional-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 16px;
}
.sa-regional-card { padding: 16px; min-width: 0; }
.sa-currency-list,
.sa-language-list { display: grid; gap: 8px; }
.sa-currency-row {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.sa-currency-row > summary {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 85px auto 24px;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}
.sa-currency-row > summary::-webkit-details-marker { display: none; }
.sa-currency-row > summary:hover { background: #f8fafc; }
.sa-currency-code { font-weight: 850; color: #075985; }
.sa-currency-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.sa-currency-symbol { color: #64748b; text-align: right; }
.sa-chevron { color: #64748b; transition: transform .15s ease; }
.sa-currency-row[open] .sa-chevron { transform: rotate(180deg); }
.sa-currency-form {
    padding: 14px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.sa-inline-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.sa-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 800;
}
.sa-status.is-default { background: #dbeafe; color: #1d4ed8; }
.sa-status.is-active { background: #dcfce7; color: #15803d; }
.sa-status.is-disabled { background: #f1f5f9; color: #64748b; }
.sa-add-panel {
    margin-top: 12px;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    padding: 12px;
}
.sa-add-panel > summary { cursor: pointer; color: #075985; font-weight: 800; }
.sa-add-panel > form { margin-top: 14px; }
.sa-language-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}
.sa-language-row > div { display: grid; min-width: 0; }
.sa-language-row small { color: #64748b; }

.sa-livechat { display: grid; gap: 10px; }
.sa-online-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
}
.sa-online-count strong { font-size: 1.35rem; color: #0369a1; }
.sa-online-count span { color: #475569; font-size: .82rem; font-weight: 700; }
.sa-livechat-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #dbe3ec;
}
.sa-livechat-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 8px 8px 0 0;
    color: #475569;
    text-decoration: none;
    font-weight: 750;
}
.sa-livechat-tabs a span {
    display: inline-grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: .72rem;
}
.sa-livechat-tabs a.is-active { background: #1767b1; color: #fff; }
.sa-livechat-tabs a.is-active span { background: rgba(255,255,255,.2); }
.sa-livechat-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    height: calc(100vh - 230px);
    min-height: 570px;
    max-height: 820px;
    border: 1px solid #dbe3ec;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
}
.sa-livechat-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    border-right: 1px solid #dbe3ec;
}
.sa-chat-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 10px;
    border-bottom: 1px solid #dbe3ec;
    background: #f8fafc;
}
.sa-chat-search input { min-width: 0; height: 39px; }
.sa-chat-search button {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 0 12px;
    background: #fff;
    cursor: pointer;
}
.sa-chat-list { min-height: 0; overflow-y: auto; padding: 7px; }
.sa-chat-list-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 8px;
    border-radius: 8px;
    color: #0f172a;
    text-decoration: none;
}
.sa-chat-list-row:hover,
.sa-chat-list-row.is-active { background: #eff6ff; }
.sa-chat-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dbeafe;
    color: #075985;
    font-size: .75rem;
    font-weight: 850;
}
.sa-chat-identity { display: grid; min-width: 0; }
.sa-chat-identity strong,
.sa-chat-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-chat-identity small { color: #64748b; font-size: .75rem; }
.sa-chat-list-row time { color: #64748b; font-size: .7rem; white-space: nowrap; }
.sa-chat-empty-list { padding: 28px 12px; text-align: center; color: #64748b; }
.sa-chat-pagination {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-top: 1px solid #dbe3ec;
    font-size: .78rem;
}
.sa-chat-thread {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
}
.sa-chat-thread-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-bottom: 1px solid #dbe3ec;
}
.sa-chat-thread-head > div { display: grid; min-width: 0; }
.sa-chat-thread-head small { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-chat-transcript {
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}
.sa-chat-message {
    width: fit-content;
    max-width: min(78%, 720px);
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #fff;
}
.sa-chat-message.is-agent {
    margin-left: auto;
    border-color: #93c5fd;
    background: #dbeafe;
}
.sa-chat-message p { margin: 5px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sa-chat-message time { display: block; margin-top: 5px; color: #64748b; font-size: .7rem; }
.sa-chat-attachments { display: grid; gap: 5px; margin-top: 7px; }
.sa-chat-attachments a { color: #075985; overflow-wrap: anywhere; }
.sa-chat-reply {
    padding: 11px;
    border-top: 1px solid #dbe3ec;
    background: #fff;
}
.sa-chat-reply textarea { width: 100%; min-height: 72px; max-height: 130px; resize: vertical; }
.sa-chat-reply > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.sa-chat-empty-thread {
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: #64748b;
}
.sa-chat-empty-thread > div { font-size: 3rem; }
.sa-chat-empty-thread h2 { margin: 8px 0 2px; color: #0f172a; }
.sa-livechat.has-new-message { box-shadow: 0 0 0 4px rgba(23,103,177,.15); }

@media (max-width: 1000px) {
    .sa-regional-columns { grid-template-columns: 1fr; }
    .sa-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sa-livechat-shell { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .sa-form-grid { grid-template-columns: 1fr; }
    .sa-currency-row > summary { grid-template-columns: 60px minmax(0, 1fr) auto 22px; }
    .sa-currency-symbol { display: none; }
    .sa-language-row { grid-template-columns: minmax(0, 1fr) auto; }
    .sa-language-row form { grid-column: 1 / -1; }
    .sa-livechat-head { align-items: flex-start; }
    .sa-livechat-shell { grid-template-columns: 1fr; height: auto; max-height: none; }
    .sa-livechat-sidebar { height: 390px; border-right: 0; border-bottom: 1px solid #dbe3ec; }
    .sa-chat-thread { height: 610px; }
    .sa-chat-reply > div { align-items: stretch; flex-direction: column; }
    .sa-chat-reply .button { width: 100%; }
}
