/* Anon Bridge Panel — дизайн в стиле ROAD ADMIN */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #181818;
    --glass: rgba(255, 255, 255, 0.055);
    --glass-strong: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.11);
    --border-soft: rgba(255, 255, 255, 0.07);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.45);
    --muted-2: rgba(255, 255, 255, 0.68);
    --accent: #ff4e50;
    --accent-2: #ff3335;
    --accent-soft: rgba(255, 78, 80, 0.15);
    --green: #4ade80;
    --yellow: #fbbf24;
    --blue: #60a5fa;
    --purple: #c084fc;
    --red: #f87171;
    --radius: 24px;
    --radius-sm: 12px;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Водяной знак как в ROAD ADMIN */
body::before {
    content: "ANON";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26vw;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.028);
    z-index: 0;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

button, input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
button { color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-wrapper {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ------------------------------- Sidebar ------------------------------- */

.sidebar {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 15px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.sidebar-header .logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0 10px 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .logo span {
    color: var(--accent);
    font-size: 12px;
    vertical-align: super;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
    width: 20px;
    display: inline-flex;
    justify-content: center;
    opacity: 0.9;
    font-size: 15px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-profile .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4e50, #ff8a5c);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.user-profile .profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-profile .profile-text strong {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile .profile-text small {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-state {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
}

/* ------------------------------- Main ------------------------------- */

.main-content {
    padding: 30px;
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    min-width: 0;
}

.admin-page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.admin-page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.quick-link:hover {
    background: var(--accent-soft);
    border-color: rgba(255, 78, 80, 0.4);
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ------------------------------- Stats ------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -60% auto;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 78, 80, 0.18), transparent 70%);
    pointer-events: none;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.15;
    word-break: break-word;
}

.stat-value.small { font-size: 18px; }
.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }

.stat-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------- Tiles ------------------------------- */

.tile {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    min-width: 0;
}

.tile-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tile-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tile-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

/* ------------------------------- Buttons ------------------------------- */

.btn-primary,
.btn-outline,
.btn-danger,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.85);
}
.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}
.btn-outline:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-danger {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
    background: transparent;
    color: var(--muted-2);
    padding: 8px 12px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.btn-icon {
    padding: 7px 9px;
    min-width: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted-2);
    cursor: pointer;
    transition: 0.2s;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon:disabled:hover { background: rgba(255, 255, 255, 0.05); color: var(--muted-2); }
.btn-icon.danger:hover { background: rgba(248, 113, 113, 0.15); color: var(--red); }

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ------------------------------- Badges ------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success { background: rgba(74, 222, 128, 0.13); color: var(--green); border-color: rgba(74, 222, 128, 0.3); }
.badge-danger { background: rgba(248, 113, 113, 0.13); color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.badge-warning { background: rgba(251, 191, 36, 0.13); color: var(--yellow); border-color: rgba(251, 191, 36, 0.3); }
.badge-info { background: rgba(96, 165, 250, 0.13); color: var(--blue); border-color: rgba(96, 165, 250, 0.3); }
.badge-neutral { background: rgba(255, 255, 255, 0.07); color: var(--muted-2); border-color: rgba(255, 255, 255, 0.13); }
.badge-accent { background: var(--accent-soft); color: #ff8a8c; border-color: rgba(255, 78, 80, 0.35); }

/* ------------------------------- Status ------------------------------- */

.status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}
.status-line:last-child { border-bottom: none; }
.status-line > span:first-child { color: var(--muted); flex: 0 0 auto; }
.status-line > span:last-child { text-align: right; word-break: break-word; }

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    margin-right: 8px;
    flex: 0 0 auto;
}
.status-dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(74, 222, 128, 0.55); }
.status-dot.fail { background: var(--red); box-shadow: 0 0 10px rgba(248, 113, 113, 0.55); }
.status-dot.warn { background: var(--yellow); box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

.kv-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; }
.kv-row span:first-child { color: var(--muted); }
.kv-row span:last-child { text-align: right; word-break: break-word; }

/* ------------------------------- Slot cards ------------------------------- */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.slot-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.slot-card::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 78, 80, 0.16), transparent 68%);
    pointer-events: none;
}

.slot-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.slot-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #ff4e50, #ff8a5c);
}
.slot-card[data-slot="B"] .slot-avatar { background: linear-gradient(135deg, #7c3aed, #c084fc); }

.slot-head-text { min-width: 0; flex: 1; }
.slot-head-text h4 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.slot-head-text p { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slot-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.slot-meta .kv-row { font-size: 12px; }
.slot-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.slot-card select { margin-top: 6px; }

/* ------------------------------- Forms ------------------------------- */

label.field {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}

.form-control,
select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-control:focus,
select:focus,
input:focus,
textarea:focus {
    border-color: rgba(255, 78, 80, 0.55);
    background: rgba(0, 0, 0, 0.32);
}

textarea { resize: vertical; min-height: 90px; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.5) 50%), linear-gradient(135deg, rgba(255,255,255,.5) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.form-grid .full { grid-column: 1 / -1; }
.form-hint { color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.4; }

.switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted-2);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ------------------------------- Table ------------------------------- */

.table-container {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-size: 13px;
    min-width: 720px;
}

.admin-table th {
    text-align: left;
    padding: 16px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.2);
}

.admin-table td {
    padding: 14px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.admin-table tbody tr { transition: background 0.2s; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.cell-flex { display: flex; align-items: center; gap: 12px; }
.table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 78, 80, 0.18);
    border: 1px solid rgba(255, 78, 80, 0.35);
    flex: 0 0 auto;
}
.table-main { font-weight: 600; }
.table-sub { color: var(--muted); font-size: 11px; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.table-placeholder {
    padding: 34px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-accent { color: var(--accent); }
.text-small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ------------------------------- Chat ------------------------------- */

.chat-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 215px);
    min-height: 460px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.chat-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.chip:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.chip.active { background: var(--accent-soft); border-color: rgba(255, 78, 80, 0.45); color: #fff; }

.chat-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 6px 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.chat-feed::-webkit-scrollbar { width: 7px; }
.chat-feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 8px; }

.msg {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    padding: 12px 15px;
    max-width: min(560px, 84%);
    align-self: flex-start;
    animation: msg-in 0.18s ease-out;
    overflow: hidden;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.a { border-left-color: var(--blue); }
.msg.b { border-left-color: var(--purple); align-self: flex-end; }
.msg.admin {
    border-left-color: var(--accent);
    background: rgba(255, 78, 80, 0.08);
    align-self: flex-end;
}
.msg.system {
    border-left-color: var(--yellow);
    background: rgba(251, 191, 36, 0.06);
    max-width: 100%;
    align-self: stretch;
    font-size: 12.5px;
}
.msg.error { border-left-color: var(--red); background: rgba(248, 113, 113, 0.07); }

.msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
}

.msg-sender { font-weight: 700; color: rgba(255, 255, 255, 0.88); font-size: 12px; }
.msg.a .msg-sender { color: var(--blue); }
.msg.b .msg-sender { color: var(--purple); }
.msg.admin .msg-sender { color: var(--accent); }
.msg.system .msg-sender { color: var(--yellow); }

.msg-dir {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 10px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.msg-time { margin-left: auto; font-size: 10.5px; opacity: 0.75; white-space: nowrap; }
.msg-text { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }

.msg-media { margin-top: 8px; }
.msg-media img,
.msg-media video {
    display: block;
    max-width: 100%;
    max-height: 340px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0f0f0f;
}
.msg-media.sticker img { max-width: 180px; max-height: 180px; border: none; background: transparent; }
.msg-media audio { width: 100%; max-width: 340px; margin-top: 4px; }
.msg-media .file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--muted-2);
    font-size: 12px;
    max-width: 100%;
}
.msg-media .file-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.media-label { font-size: 10px; color: var(--muted); margin-top: 5px; }

.composer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.composer .composer-target { width: 170px; flex: 0 0 auto; }
.composer textarea {
    flex: 1;
    min-height: 44px;
    max-height: 130px;
    resize: none;
    padding: 12px 14px;
    line-height: 1.4;
}
.composer .btn-primary { min-height: 44px; }

.chat-empty {
    flex: 1;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    text-align: center;
    padding: 30px;
}
.chat-empty .big { font-size: 32px; opacity: 0.5; }

/* ------------------------------- Logs ------------------------------- */

.pre-logs {
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #a9b8cc;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: calc(100vh - 300px);
    min-height: 320px;
    overflow: auto;
}

/* ------------------------------- Toast ------------------------------- */

.admin-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    background: rgba(24, 24, 24, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 14px 20px;
    color: #fff;
    font-size: 13px;
    max-width: 380px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.25s;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.admin-toast.visible { opacity: 1; transform: translateY(0); }
.admin-toast.success { border-color: rgba(74, 222, 128, 0.45); }
.admin-toast.error { border-color: rgba(248, 113, 113, 0.55); }
.admin-toast.warning { border-color: rgba(251, 191, 36, 0.5); }

/* ------------------------------- Modal ------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal.open { display: flex; }

.modal-card {
    width: 100%;
    max-width: 500px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    max-height: 92vh;
    overflow-y: auto;
}
.modal-card.wide { max-width: 660px; }

.modal-card h3 { margin: 0 0 6px; font-size: 19px; }
.modal-hint { color: var(--muted); font-size: 12px; margin-bottom: 18px; line-height: 1.5; }

.modal-field { margin-bottom: 14px; }
.modal-error {
    display: none;
    margin: 10px 0 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #ff9b9b;
    font-size: 12px;
    line-height: 1.45;
}
.modal-error.visible { display: block; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.steps {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}
.step-dot {
    height: 5px;
    border-radius: 4px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
}
.step-dot.active { background: var(--accent); }

.detail-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.detail-head .slot-avatar { width: 52px; height: 52px; font-size: 18px; }

/* ------------------------------- Lock screen ------------------------------- */

.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 15, 0.93);
    backdrop-filter: blur(12px);
}
.lock-screen.open { display: grid; }
.lock-card {
    width: 100%;
    max-width: 380px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65);
}
.lock-card .lock-icon { font-size: 38px; margin-bottom: 14px; }
.lock-card h3 { font-size: 20px; margin-bottom: 8px; }
.lock-card p { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.lock-card input { text-align: center; margin-bottom: 12px; }

/* ------------------------------- Misc ------------------------------- */

.empty-block {
    padding: 26px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.section-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 18px;
}
.section-note.warn {
    background: rgba(251, 191, 36, 0.07);
    border-color: rgba(251, 191, 36, 0.25);
}

.view[hidden] { display: none !important; }

.divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 20px 0; }

.spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------- Responsive ------------------------------- */

@media (max-width: 1000px) {
    .admin-wrapper { grid-template-columns: 1fr; }
    .admin-grid-2 { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
        gap: 14px;
        flex-wrap: wrap;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 50;
    }
    .sidebar-header .logo { border-bottom: none; padding: 0; }
    .sidebar-nav { flex-direction: row; margin-top: 0; gap: 6px; overflow-x: auto; flex-grow: 1; min-width: 0; }
    .nav-item { width: auto; padding: 9px 12px; white-space: nowrap; }
    .nav-item.active { box-shadow: none; }
    .sidebar-footer { border-top: none; padding-top: 0; flex-direction: row; align-items: center; }
    .sidebar-footer .user-profile .profile-text { display: none; }
    .main-content { padding: 22px 18px; }
    .chat-shell { height: calc(100vh - 230px); }
}

@media (max-width: 720px) {
    .sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        padding: 12px 14px;
    }
    .sidebar-header { min-width: 0; }
    .sidebar-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        overflow-x: visible;
        flex-wrap: wrap;
        padding-bottom: 2px;
    }
    .sidebar-footer { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .admin-page-title { font-size: 22px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }
    .tile { padding: 18px; border-radius: 18px; }
    .msg { max-width: 94%; }
    .composer { flex-wrap: wrap; }
    .composer .composer-target { width: 100%; }
    .composer textarea { width: 100%; flex-basis: 100%; }
    .composer .btn-primary { width: 100%; }
    .sidebar-nav .nav-icon { display: none; }
    .chat-shell { height: auto; min-height: 520px; }
    .chat-feed { max-height: 60vh; }
    .form-grid.two { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
