/* Sakib AI — app styles */

:root {
    --bg:         #0f1117;
    --bg-side:    #0a0c11;
    --panel:      #171a24;
    --panel-2:    #1d2130;
    --border:     #242938;
    --border-soft:#1c202c;
    --text:       #e8eaf0;
    --text-dim:   #a2aabc;
    --muted:      #7c8598;
    --accent:     #4f7cff;
    --accent-soft:#2a3a70;
    --danger:     #e0555f;
    --ok:         #3fbf7f;
    --radius:     14px;
    --side-w:     264px;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3145; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4258; }

/* ============ auth ============ */

.auth-body {
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 50% -10%, #1a2340 0%, transparent 62%),
        radial-gradient(800px 500px at 50% 0%, rgba(79, 124, 255, .07) 0%, transparent 65%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.auth-logo {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: #b9c8ff;
    margin-bottom: 18px;
}

.auth-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.auth-field { display: block; margin-bottom: 14px; }
.auth-field span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }

.auth-field input {
    width: 100%;
    padding: 11px 13px;
    background: #0e1119;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 124, 255, .16); }

.auth-submit {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.auth-submit:hover { background: #3f6bec; }

.auth-error {
    background: #2a1519;
    border: 1px solid #55212a;
    color: #ffb4bd;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

/* ============ layout ============ */

.app { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
    width: var(--side-w);
    flex: 0 0 var(--side-w);
    background: var(--bg-side);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-top { padding: 14px 12px 10px; }

.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 12px; }
.brand-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(79, 124, 255, .9);
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }

.btn-new {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 550;
    transition: background .15s, border-color .15s;
}
.btn-new:hover { background: var(--panel-2); border-color: #313852; }

.conv-list { flex: 1; overflow-y: auto; padding: 6px 8px 12px; min-height: 0; }

.conv-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 11px;
    margin-bottom: 2px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.conv-item:hover { background: #14171f; color: var(--text); }
.conv-item.active { background: var(--panel-2); color: var(--text); }
.conv-item .ct { display: block; font-size: 13.5px; font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .cp { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-empty { padding: 18px 14px; color: var(--muted); font-size: 13px; text-align: center; }

.sidebar-foot {
    border-top: 1px solid var(--border-soft);
    padding: 10px 12px;
    display: flex; align-items: center; gap: 8px;
}
.who { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.avatar {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: #c3d0ff;
    font-size: 13px; font-weight: 650;
}
.who-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.signout {
    color: var(--muted);
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    text-decoration: none;
}
.signout:hover { background: var(--panel-2); color: var(--text); }
button.signout { border: 0; background: transparent; cursor: pointer; padding: 0; }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(15, 17, 23, .85);
    backdrop-filter: blur(8px);
    z-index: 10;
}
.conv-title {
    flex: 1;
    margin: 0;
    font-size: 14.5px;
    font-weight: 580;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 4px; }

.icon-btn {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 0; border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .32; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { background: #2a1519; color: #ff9aa4; }
.only-mobile { display: none; }

/* ============ messages ============ */

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

.messages { max-width: 780px; margin: 0 auto; padding: 26px 20px 12px; }

.msg { display: flex; margin-bottom: 22px; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.msg.assistant { justify-content: flex-start; }
.msg.user { justify-content: flex-end; }

.msg-inner { max-width: 100%; min-width: 0; }
.msg.assistant .msg-inner { width: 100%; }
.msg.user .msg-inner { max-width: 82%; }

.msg.user .bubble {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 16px 16px 4px 16px;
    padding: 11px 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.msg.user.is-error .bubble { border-color: #55212a; background: #2a1519; color: #ffb4bd; }

.msg.assistant .body { overflow-wrap: anywhere; }
.msg.assistant.streaming .body::after {
    content: "▋";
    margin-left: 2px;
    color: var(--accent);
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.msg .meta {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 8px;
    display: flex; gap: 10px; flex-wrap: wrap;
}
.msg.user .meta { justify-content: flex-end; }

/* markdown */
.body > *:first-child { margin-top: 0; }
.body > *:last-child { margin-bottom: 0; }
.body p { margin: 0 0 13px; }
.body h1, .body h2, .body h3, .body h4 { margin: 22px 0 10px; line-height: 1.3; letter-spacing: -.01em; }
.body h1 { font-size: 22px; }
.body h2 { font-size: 19px; }
.body h3 { font-size: 17px; }
.body h4 { font-size: 15px; }
.body ul, .body ol { margin: 0 0 13px; padding-left: 24px; }
.body li { margin-bottom: 5px; }
.body li > p { margin-bottom: 6px; }
.body a { color: #7ea2ff; text-decoration: none; border-bottom: 1px solid rgba(126, 162, 255, .35); }
.body a:hover { border-bottom-color: #7ea2ff; }
.body blockquote {
    margin: 0 0 13px;
    padding: 2px 0 2px 14px;
    border-left: 3px solid #333c56;
    color: var(--text-dim);
}
.body hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 14px;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}
.body th, .body td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.body th { background: var(--panel); font-weight: 600; }
.body img { max-width: 100%; border-radius: 10px; }
.body code {
    background: #1b1f2c;
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1.5px 5px;
    font-size: .875em;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.body pre {
    margin: 0 0 14px;
    padding: 13px;
    background: #0c0e14;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow-x: auto;
}
.body pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.62;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* code blocks */
.code-block {
    position: relative;
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
    background: #0c0e14;
}
.code-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px 6px 12px;
    background: #12141c;
    border-bottom: 1px solid var(--border-soft);
}
.code-lang { font-size: 11.5px; color: var(--muted); text-transform: lowercase; letter-spacing: .04em; }
.code-btns { display: flex; align-items: center; gap: 2px; }
.code-copy, .code-run {
    display: flex; align-items: center; gap: 5px;
    border: 0; background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    padding: 3px 7px;
    border-radius: 6px;
    cursor: pointer;
}
.code-copy:hover, .code-run:hover { background: var(--panel-2); color: var(--text); }
.code-copy.done { color: var(--ok); }

.code-run {
    color: #cfe0ff;
    background: rgba(79, 124, 255, .16);
    font-weight: 600;
}
.code-run:hover { background: rgba(79, 124, 255, .3); color: #fff; }
.code-block pre { margin: 0; padding: 13px; overflow-x: auto; }
.code-block pre code {
    background: none; border: 0; padding: 0;
    font-size: 13px; line-height: 1.62;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* thinking */
.thinking {
    margin-bottom: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #12141c;
    overflow: hidden;
}
.thinking > summary {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--muted);
    list-style: none;
    display: flex; align-items: center; gap: 8px;
    user-select: none;
}
.thinking > summary::-webkit-details-marker { display: none; }
.thinking > summary::before {
    content: "▸";
    font-size: 10px;
    transition: transform .15s;
}
.thinking[open] > summary::before { transform: rotate(90deg); }
.thinking > summary:hover { color: var(--text-dim); }
.thinking-body {
    padding: 2px 12px 11px;
    font-size: 13px;
    color: var(--text-dim);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--border-soft);
}

/* attachments in a message */
.msg-atts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; justify-content: flex-end; }
.msg-atts .att-img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.msg-atts .att-file {
    display: flex; align-items: center; gap: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--text-dim);
    text-decoration: none;
    max-width: 240px;
}
.msg-atts .att-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg.assistant .msg-atts { justify-content: flex-start; }
.msg.assistant .msg-atts .att-img { max-width: 340px; max-height: 340px; cursor: zoom-in; }

.img-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    padding: 3px 0;
}
.img-loading::before {
    content: "";
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: img-spin .7s linear infinite;
}
@keyframes img-spin { to { transform: rotate(360deg); } }

/* empty state */
.empty { max-width: 640px; margin: 0 auto; padding: 46px 24px 20px; text-align: center; }
.empty-logo {
    width: 62px; height: 62px;
    margin: 0 auto 18px;
    display: grid; place-items: center;
    border-radius: 18px;
    background: var(--accent-soft);
    color: #b9c8ff;
}
.empty h2 { margin: 0 0 22px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chip {
    text-align: left;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text-dim);
    font-size: 13.5px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--panel-2); border-color: #333c56; color: var(--text); }

/* ============ composer ============ */

.composer-area { padding: 8px 20px 14px; }
.pending { max-width: 780px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }

.chip-att {
    display: flex; align-items: center; gap: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px 6px 6px;
    font-size: 12.5px;
    color: var(--text-dim);
    max-width: 260px;
}
.chip-att img, .chip-att .thumb {
    width: 30px; height: 30px;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 30px;
    background: var(--panel-2);
    display: grid; place-items: center;
    font-size: 11px;
    color: var(--muted);
}
.chip-att .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-att .sz { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.chip-att button {
    border: 0; background: transparent; color: var(--muted);
    cursor: pointer; font-size: 15px; line-height: 1;
    padding: 0 2px; border-radius: 4px;
}
.chip-att button:hover { color: var(--danger); }
.chip-att.uploading { opacity: .6; }

.composer {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 7px 8px 7px 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
    transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: #3d4a6e; box-shadow: 0 8px 26px rgba(0, 0, 0, .3), 0 0 0 3px rgba(79, 124, 255, .1); }
.composer.drag { border-color: var(--accent); }

.composer textarea {
    flex: 1;
    border: 0;
    background: transparent;
    resize: none;
    outline: none;
    padding: 8px 4px;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.55;
}
.composer textarea::placeholder { color: #5f6779; }

.attach {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 9px;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.attach:hover { background: var(--panel-2); color: var(--text); }

.send {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.send:hover { background: #3f6bec; }
.send:disabled { background: #2b3145; color: #5f6779; cursor: default; }
.send.stop { background: #2b3145; color: #e8eaf0; }
.send.stop:hover { background: #3a4258; }

.composer-hint {
    max-width: 780px;
    margin: 8px auto 0;
    text-align: center;
    font-size: 11.5px;
    color: #5f6779;
}

/* ============ toasts ============ */

.toasts {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px;
    z-index: 120;
    pointer-events: none;
    width: min(460px, calc(100vw - 32px));
}
.toast {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13.5px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
    animation: toastIn .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ modal ============ */

.modal-wrap {
    position: fixed; inset: 0;
    background: rgba(6, 8, 12, .68);
    display: grid; place-items: center;
    z-index: 110;
    padding: 20px;
}
.modal {
    width: 100%; max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 22px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .6);
}
.modal h2 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 16px; color: var(--text-dim); font-size: 13.5px; }
.modal input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: #0e1119;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
}
.modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 124, 255, .16); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-ghost, .btn-primary {
    padding: 9px 15px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 550;
    border: 1px solid var(--border);
}
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #3f6bec; }
.btn-primary.danger { background: var(--danger); border-color: var(--danger); }
.btn-primary.danger:hover { background: #c94a54; }

/* ============ drop overlay ============ */

.drop-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 12, 17, .8);
    z-index: 85;
    display: grid; place-items: center;
    pointer-events: none;
}
.drop-box {
    border: 2px dashed var(--accent);
    border-radius: 18px;
    padding: 36px 54px;
    font-size: 16px;
    color: #b9c8ff;
    background: rgba(79, 124, 255, .07);
}

/* ============ code preview ============ */

.preview-wrap {
    position: fixed; inset: 0;
    background: rgba(6, 8, 12, .75);
    z-index: 95;
    display: flex;
    padding: 22px;
}
.preview-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.preview-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 9px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: #12141c;
}
.preview-title { flex: 1; font-size: 13px; color: var(--text-dim); }
.preview-actions { display: flex; gap: 6px; }
.preview-frame { flex: 1; width: 100%; border: 0; background: #fff; }

@media (max-width: 860px) {
    .preview-wrap { padding: 0; }
    .preview-panel { border-radius: 0; border: 0; }
}

/* ============ admin ============ */

.admin-wrap {
    position: fixed; inset: 0;
    background: rgba(6, 8, 12, .78);
    z-index: 96;
    display: flex;
    padding: 22px;
}
.admin-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.admin-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px 9px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: #12141c;
}
.admin-title { font-size: 13px; font-weight: 650; }
.admin-tabs { display: flex; gap: 4px; flex: 1; }
.admin-tab {
    padding: 7px 12px;
    border: 0; border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px; font-weight: 550;
    cursor: pointer;
}
.admin-tab:hover { background: var(--panel-2); color: var(--text); }
.admin-tab.active { background: var(--panel-2); color: var(--text); }

.admin-body { flex: 1; overflow-y: auto; padding: 18px; }

.admin-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}
.admin-card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-dim); }

.admin-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.admin-input {
    flex: 1 1 150px;
    min-width: 0;
    padding: 9px 11px;
    background: #0e1119;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    font-size: 13.5px;
}
.admin-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 124, 255, .16); }
select.admin-input { flex: 0 0 auto; }

.admin-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.admin-actions .btn-ghost, .admin-actions .btn-primary { padding: 7px 11px; font-size: 12.5px; }
.admin-actions .btn-ghost.danger { color: #ff9aa4; }
.admin-actions .btn-ghost.danger:hover { background: #2a1519; color: #ffb4bd; }

.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-card-head h3 { margin: 0; }
.admin-card-head select.admin-input { flex: 0 0 auto; min-width: 210px; }

.admin-table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13.5px;
}
.admin-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #14171f; }
.admin-table tbody tr.is-me { background: rgba(79, 124, 255, .07); }
.admin-table tbody tr.inactive td { opacity: .55; }
.admin-table tbody tr.inactive td.col-actions { opacity: 1; }
.admin-table tbody tr.clickable { cursor: pointer; }

.admin-table .admin-input {
    flex: none;
    width: 100%;
    padding: 7px 9px;
    font-size: 13px;
}
.admin-table .admin-actions { justify-content: flex-end; }
.admin-table .admin-actions .btn-ghost,
.admin-table .admin-actions .btn-primary { padding: 6px 10px; font-size: 12px; white-space: nowrap; }

.admin-table .col-id { width: 44px; color: var(--muted); }
.admin-table .col-role { width: 1%; }
.admin-table .col-role select { min-width: 92px; }
.admin-table .col-status,
.admin-table .col-chats { width: 1%; white-space: nowrap; }
.admin-table .col-chats { text-align: center; }
.admin-table .col-actions { width: 1%; text-align: right; }
.admin-table .col-owner { white-space: nowrap; }
.admin-table .col-date { white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.admin-table .title-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cell-inline { display: flex; align-items: center; gap: 7px; }
.cell-inline .admin-input { flex: 1 1 auto; }

.admin-badge {
    display: inline-block;
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0e1119;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
    white-space: nowrap;
}
.admin-badge.on { color: #a8e6bd; border-color: #235c38; background: #122a1c; }
.admin-badge.off { color: #ffb4bd; border-color: #55212a; background: #2a1519; }
.admin-badge.you { color: #b9c8ff; border-color: var(--accent-soft); background: var(--accent-soft); }

.admin-note { padding: 12px 4px; font-size: 13.5px; color: var(--text-dim); }
.admin-note.error { color: #ffb4bd; }

.admin-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.admin-transcript { max-width: 780px; margin: 0 auto; padding: 4px; }
.admin-transcript .msg { animation: none; }

@media (max-width: 860px) {
    .admin-wrap { padding: 0; }
    .admin-panel { border-radius: 0; border: 0; }
}

/* ============ responsive ============ */

@media (max-width: 860px) {
    .only-mobile { display: grid; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .5);
    }
    .sidebar.open { transform: none; }
    .messages { padding: 18px 14px 8px; }
    .composer-area { padding: 8px 12px 12px; }
    .chips { grid-template-columns: 1fr; }
    .msg.user .msg-inner { max-width: 92%; }
}
