﻿:root {
    color-scheme: dark;
    --bg: #171b20;
    --panel: #20262d;
    --panel-2: #252c34;
    --panel-3: #2d3540;
    --border: #3b4652;
    --border-soft: #313a44;
    --text: #e6ebf0;
    --muted: #97a3af;
    --blue: #4094e8;
    --blue-hover: #55a5f3;
    --green: #55b884;
    --orange: #d79a4a;
    --red: #d96666;
    --purple: #aa82df;
    --shadow: 0 16px 44px rgba(0, 0, 0, .35);
    font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: #13171b; border-right: 1px solid #2d353e; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #387fc6, #245a90); font-weight: 800; letter-spacing: .5px; }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 7px; color: var(--text); text-decoration: none; }
.side-nav a.active { background: #243344; box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { font-size: 18px; color: #70b4f6; }
.sidebar-bottom { margin-top: auto; padding: 12px 9px; color: var(--muted); font-size: 12px; }
.sidebar-bottom span, .sidebar-bottom small { display: block; }
.sidebar-bottom small { margin-top: 3px; opacity: .7; }
.main-content { min-width: 0; }

.workspace { min-height: 100vh; display: grid; grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto; padding: 14px 16px 10px; gap: 9px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.workspace-header h1 { margin: 0; font-size: 22px; font-weight: 650; }
.workspace-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.mode-badge { padding: 5px 9px; border: 1px solid #477aa8; border-radius: 5px; color: #77b9f6; background: #1f3040; font-size: 11px; font-weight: 700; letter-spacing: .12em; }

.toolbar, .filterbar, .tabs, .statusbar { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border-soft); }
.toolbar { flex-wrap: wrap; padding: 7px; border-radius: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: 6px 11px; border: 1px solid #46515d; border-radius: 4px; background: #343d47; color: var(--text); text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; white-space: nowrap; }
.button:hover:not(:disabled):not(.disabled) { background: #414c58; border-color: #5b6978; }
.button.primary { background: #2f78bb; border-color: #428dd0; }
.button.primary:hover:not(:disabled) { background: #3788d0; }
.button.success { background: #2f7855; border-color: #418d69; }
.button.warning { background: #775d31; border-color: #967641; }
.button.small { min-height: 27px; padding: 4px 9px; font-size: 12px; }
.button:disabled, .button.disabled { opacity: .42; cursor: default; pointer-events: none; }
.local-only { margin-left: auto; }

.filterbar { padding: 7px; border-radius: 6px; flex-wrap: wrap; }
.filterbar input, .filterbar select, .form-grid input, .form-grid select, .form-grid textarea { border: 1px solid #45515d; border-radius: 4px; background: #181d22; color: var(--text); outline: none; }
.filterbar input:focus, .filterbar select:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(64,148,232,.16); }
.search-box { min-width: 280px; flex: 1 1 320px; display: flex; align-items: center; gap: 7px; padding: 0 9px; height: 32px; border: 1px solid #45515d; border-radius: 4px; background: #181d22; color: var(--muted); }
.search-box input { width: 100%; border: 0; background: transparent; box-shadow: none !important; }
.filterbar > select { min-width: 150px; height: 32px; padding: 0 8px; }
.check-filter { display: flex; align-items: center; gap: 5px; padding: 0 5px; color: #cad1d8; font-size: 13px; white-space: nowrap; }

.notice { white-space: pre-line; display: flex; justify-content: space-between; align-items: center; min-height: 34px; padding: 7px 10px; border-radius: 5px; font-size: 13px; }
.notice.ok { color: #bce8d0; background: #1d3b2d; border: 1px solid #2e674b; }
.notice.error { color: #f3c2c2; background: #482626; border: 1px solid #824040; }
.notice button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 18px; }

.tabs { align-items: stretch; padding: 0 7px; border-radius: 6px 6px 0 0; border-bottom-color: var(--border); }
.tabs button { position: relative; padding: 10px 13px 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #aab4be; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--blue); background: rgba(64, 148, 232, .07); }
.tabs button span { margin-left: 5px; padding: 1px 5px; border-radius: 9px; background: #38424d; font-size: 10px; color: #cbd2d9; }

.content-grid { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 9px; }
.table-panel, .details-panel { min-height: 0; }
.table-panel { display: flex; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.fragment-root { min-width: 0; width: 100%; min-height: 0; display: flex; flex-direction: column; }
.table-actions { min-height: 37px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-bottom: 1px solid var(--border-soft); background: #222931; }
.selection-count { margin-right: 4px; color: var(--muted); font-size: 12px; }
.table-scroll { min-height: 0; overflow: auto; flex: 1; scrollbar-color: #56616d #20262d; }
.data-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table.dense { min-width: 1800px; }
.data-table th, .data-table td { padding: 6px 8px; border-right: 1px solid #333d47; border-bottom: 1px solid #303942; text-align: left; vertical-align: top; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 2; background: #303943; color: #d7dde3; font-weight: 600; box-shadow: inset 0 -1px #4a5561; }
.data-table tbody tr { background: #20262d; cursor: default; }
.data-table tbody tr:nth-child(even) { background: #232a32; }
.data-table tbody tr:hover { background: #293746; }
.data-table tbody tr.selected { background: #24466a; }
.data-table tbody tr.confirmed { box-shadow: inset 3px 0 #4fad7c; }
.data-table tbody tr.has-change td:first-child { box-shadow: inset 3px 0 #b9843f; }
.data-table tbody tr.has-remark td:nth-child(2) { color: #e5c67a; }
.strong-cell { color: #f1f4f7; font-weight: 600; }
.old-value { color: #df9a9a; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.new-value { color: #9ed8b8; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.status-pill, .row-state, .change-type, .severity { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border: 1px solid; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.blue { color: #9ed0ff; background: #203d57; border-color: #376789; }
.green { color: #a9e2c3; background: #214434; border-color: #39775a; }
.orange { color: #efd0a1; background: #4a3821; border-color: #805f31; }
.red { color: #efb0b0; background: #4b2929; border-color: #814343; }
.purple { color: #d4b9f5; background: #3e3150; border-color: #654d83; }
.gray { color: #b7c0c9; background: #343c44; border-color: #505c67; }
.critical { color: #fff; background: #812b38; border-color: #d05a6c; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 24px; color: var(--muted); text-align: center; }

.details-panel { overflow: auto; display: flex; flex-direction: column; gap: 9px; }
.detail-card { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.detail-card-title { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px; border-bottom: 1px solid var(--border-soft); background: #29313a; }
.detail-card-title h3 { margin: 0; font-size: 13px; }
.detail-card-title span { color: var(--muted); font-size: 11px; }
.detail-card dl { margin: 0; display: grid; grid-template-columns: 105px minmax(0, 1fr); font-size: 12px; }
.detail-card dt, .detail-card dd { margin: 0; padding: 6px 9px; border-bottom: 1px solid #2f3841; }
.detail-card dt { color: var(--muted); background: #232a31; }
.detail-card dd { min-width: 0; overflow-wrap: anywhere; }
.source-text { max-height: 110px; overflow: auto; white-space: pre-wrap; }
.empty-card { padding: 20px 11px; color: var(--muted); font-size: 12px; }
.version-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.version-list button { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 7px; padding: 7px; border: 1px solid #394550; border-radius: 4px; background: #242c34; color: var(--text); text-align: left; cursor: pointer; }
.version-list button:hover, .version-list button.active { border-color: #4d88ba; background: #293c4d; }
.version-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.version-list b { color: var(--green); }

.statusbar { min-height: 28px; padding: 5px 8px; border-radius: 5px; flex-wrap: wrap; color: #aab5bf; font-size: 11px; }
.statusbar span:not(:last-child)::after { content: ""; display: inline-block; height: 12px; margin-left: 9px; border-right: 1px solid #46515b; vertical-align: -2px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6, 8, 10, .72); backdrop-filter: blur(2px); }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #52606d; border-radius: 7px; background: #222930; box-shadow: var(--shadow); }
.modal.compact { width: min(480px, 100%); }
.modal.wide { width: min(920px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border); background: #2b333c; }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header button { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 11px; padding: 15px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label { display: flex; flex-direction: column; gap: 5px; color: #c6ced6; font-size: 12px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 34px; padding: 7px 8px; }
.form-grid textarea { min-height: 76px; resize: vertical; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span-two { grid-column: span 2; }
.file-chip { margin: -3px 15px 0; padding: 7px 9px; border: 1px solid #3c596f; border-radius: 4px; background: #243746; color: #b6d9f5; font-size: 12px; }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--border); background: #272f37; }
.error-panel { min-height: 100vh; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
    .sidebar { padding: 14px 8px; align-items: center; }
    .brand { padding: 0 0 18px; }
    .brand > div:last-child, .side-nav a span:last-child, .sidebar-bottom { display: none; }
    .side-nav a { justify-content: center; width: 46px; }
    .content-grid { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: 54px; flex-direction: row; justify-content: space-between; padding: 7px 10px; border-right: 0; border-bottom: 1px solid #2d353e; }
    .brand { padding: 0; }
    .brand-mark { width: 36px; height: 36px; }
    .side-nav a { width: auto; padding: 8px 11px; }
    .side-nav a span:last-child { display: inline; }
    .workspace { min-height: calc(100vh - 54px); padding: 10px 8px 8px; }
    .workspace-header p { display: none; }
    .toolbar { overflow-x: auto; flex-wrap: nowrap; }
    .toolbar .button { flex: 0 0 auto; }
    .local-only { margin-left: 0; }
    .search-box { min-width: 100%; }
    .filterbar > select { flex: 1; min-width: 135px; }
    .tabs { overflow-x: auto; }
    .tabs button { flex: 0 0 auto; }
    .content-grid { display: block; min-height: 500px; }
    .table-panel { min-height: 470px; }
    .details-panel { margin-top: 9px; max-height: none; }
    .form-grid.two-columns, .form-grid.three-columns { grid-template-columns: 1fr; }
    .form-grid .full, .form-grid .span-two { grid-column: auto; }
    .modal-backdrop { padding: 8px; }
    .modal { max-height: calc(100vh - 16px); }
}

.settings-list { display: grid; gap: 1px; padding: 14px; }
.settings-list > div { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 10px; padding: 9px; background: #252d35; border-bottom: 1px solid #35404a; }
.settings-list span { color: var(--muted); }
.settings-list code { white-space: normal; overflow-wrap: anywhere; color: #b8d7f2; }

.content-grid.no-details { grid-template-columns: minmax(0, 1fr); }

.data-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.structure-panel { min-height: 0; overflow: auto; padding: 7px; border-right: 1px solid var(--border-soft); background: #1d2329; }
.structure-title { position: sticky; top: 0; z-index: 1; margin: -7px -7px 6px; padding: 9px 10px; background: #29313a; color: #d7dde3; font-size: 12px; font-weight: 600; }
.structure-panel button { display: block; width: 100%; margin: 0 0 3px; padding: 7px 8px; overflow: hidden; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #aeb8c1; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.structure-panel button:hover { background: #28333d; color: #fff; }
.structure-panel button.active { border-color: #477ca7; background: #29445b; color: #fff; }
.data-table-area { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) { .data-layout { grid-template-columns: minmax(0, 1fr); } .structure-panel { display: none; } }

.resizable-table th { position: sticky; }
.column-resizer { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; touch-action: none; user-select: none; }
.column-resizer:hover { background: rgba(100, 179, 244, .35); }

/* Authentication, navigation, chat and developer tools */
.startup-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.brand-mark.large { width: 58px; height: 58px; border-radius: 14px; font-size: 20px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 50% 20%, #233546 0, #171b20 48%, #101317 100%); }
.login-card { width: min(430px, 100%); padding: 24px; border: 1px solid #44515e; border-radius: 10px; background: rgba(31, 38, 45, .96); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-brand h1 { margin: 0; font-size: 25px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); }
.login-fields { display: grid; gap: 13px; }
.login-fields label { display: grid; gap: 6px; color: #cbd3da; font-size: 13px; }
.login-fields input { min-height: 40px; width: 100%; padding: 8px 10px; border: 1px solid #4a5865; border-radius: 5px; background: #151a1f; color: var(--text); outline: 0; }
.login-fields input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(64,148,232,.17); }
.login-button { width: 100%; min-height: 40px; margin-top: 16px; }
.login-error { margin-top: 13px; padding: 9px 10px; border: 1px solid #7f3f45; border-radius: 5px; background: #47282c; color: #f3c3c7; font-size: 13px; }
.login-footer { margin-top: 18px; padding-top: 13px; border-top: 1px solid #36414b; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-note { display: grid; gap: 4px; margin-bottom: 14px; padding: 10px; border-radius: 5px; font-size: 12px; }
.login-note span { color: #c6ced5; }
.warning-note { border: 1px solid #715b36; background: #443720; }

.side-nav { display: grid; gap: 4px; }
.side-nav button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.side-nav button:hover { background: #1d2731; }
.side-nav button.active { background: #243344; box-shadow: inset 3px 0 0 var(--blue); }
.nav-group { padding: 3px 0 5px; }
.nav-group-title { display: flex; align-items: center; gap: 10px; padding: 8px 12px 5px; color: #cdd5dc; font-size: 13px; }
.side-nav button.sub { min-height: 31px; padding: 7px 10px 7px 42px; color: #aeb9c3; font-size: 12px; }
.side-nav button.sub.active { color: #fff; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 0; border-top: 1px solid #2d353e; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sidebar-user button { width: 31px; height: 31px; flex: 0 0 auto; border: 1px solid #3b4651; border-radius: 4px; background: #252c33; color: #cbd3da; cursor: pointer; }
.sidebar-user button:hover { background: #38434e; }

.chat-workspace { grid-template-rows: auto auto minmax(0, 1fr); }
.chat-layout { min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--panel); }
.chat-layout.single-chat { grid-template-columns: minmax(0, 1fr); }
.chat-list-panel { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #1b2127; }
.chat-list-header { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); background: #28313a; }
.chat-list-header span { color: var(--muted); font-size: 11px; }
.mini-button { width: 28px; height: 28px; border: 1px solid #46535f; border-radius: 4px; background: #35404a; color: #fff; cursor: pointer; }
.chat-list-scroll { min-height: 0; overflow: auto; flex: 1; padding: 6px; }
.chat-list-item { position: relative; width: 100%; display: grid; gap: 4px; margin-bottom: 4px; padding: 9px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.chat-list-item:hover { background: #27323c; }
.chat-list-item.active { border-color: #477da9; background: #294359; }
.chat-list-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-list-item span { color: var(--muted); font-size: 10px; }
.chat-list-item em { position: absolute; top: 8px; right: 8px; color: #e3bc78; font-size: 9px; font-style: normal; }
.empty-list { padding: 20px 9px; color: var(--muted); text-align: center; font-size: 12px; }
.topic-create { display: grid; gap: 7px; padding: 8px; border-bottom: 1px solid var(--border-soft); background: #222b33; }
.topic-create input { min-width: 0; padding: 7px 8px; border: 1px solid #46535f; border-radius: 4px; background: #151a1f; color: var(--text); }
.topic-create > div { display: flex; gap: 5px; }
.topic-create .button { min-height: 27px; padding: 4px 8px; font-size: 11px; }
.chat-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #20262d; }
.chat-panel-header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--border); background: #29323b; }
.chat-panel-header strong, .chat-panel-header span { display: block; }
.chat-panel-header span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.chat-header-actions { display: flex; gap: 5px; }
.chat-header-actions .button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.message-list { min-height: 0; overflow: auto; padding: 13px; }
.chat-message { position: relative; width: min(760px, 88%); margin: 0 auto 10px 0; padding: 9px 11px; border: 1px solid #3a4651; border-radius: 7px 7px 7px 2px; background: #272f37; }
.chat-message.own { margin-left: auto; margin-right: 0; border-color: #3f6e91; border-radius: 7px 7px 2px 7px; background: #263d50; }
.message-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.message-meta strong { color: #dbe3ea; font-size: 11px; }
.message-meta time { margin-left: auto; }
.developer-label { padding: 1px 5px; border-radius: 8px; background: #523d6b; color: #dbc2fb; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 13px; }
.message-image-link { display: block; margin-top: 8px; }
.message-image { display: block; max-width: min(100%, 680px); max-height: 480px; border: 1px solid #4c5965; border-radius: 5px; object-fit: contain; background: #101418; }
.attachment-caption { margin-top: 4px; color: var(--muted); font-size: 10px; }
.message-actions { display: flex; gap: 8px; margin-top: 7px; }
.message-actions button { padding: 0; border: 0; background: transparent; color: #8ebde4; cursor: pointer; font-size: 10px; }
.message-actions button:last-child { color: #e1a2a2; }
.deleted-message { color: #818d98; font-style: italic; font-size: 12px; }
.message-edit { display: grid; gap: 6px; }
.message-edit textarea { min-height: 76px; padding: 7px; border: 1px solid #4c5d6a; border-radius: 4px; background: #161c21; color: #fff; resize: vertical; }
.message-edit > div { display: flex; justify-content: flex-end; gap: 5px; }
.message-edit .button { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.chat-empty { display: grid; place-items: center; min-height: 150px; padding: 20px; color: var(--muted); text-align: center; }
.chat-composer { padding: 8px; border-top: 1px solid var(--border); background: #252d35; }
.chat-composer textarea { width: 100%; min-height: 72px; max-height: 190px; padding: 8px 9px; border: 1px solid #46535f; border-radius: 5px; background: #151a1f; color: var(--text); resize: vertical; outline: 0; }
.chat-composer textarea:focus { border-color: var(--blue); }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer-actions > span { flex: 1; color: var(--muted); font-size: 10px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pending-attachment { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 6px 8px; border: 1px solid #3f6784; border-radius: 4px; background: #243849; color: #b8d9f1; font-size: 11px; }
.pending-attachment button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 17px; }

.developer-workspace { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
.mode-badge.developer { border-color: #72599a; background: #382b4a; color: #d6bbfa; }
.admin-summary { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(260px, 2fr); gap: 7px; }
.admin-summary > div { min-width: 0; display: grid; gap: 4px; padding: 9px 11px; border: 1px solid var(--border-soft); border-radius: 5px; background: var(--panel); }
.admin-summary span { color: var(--muted); font-size: 10px; }
.admin-summary strong { font-size: 18px; }
.admin-summary code { overflow: hidden; color: #a9cee9; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.admin-tabs { border-radius: 6px; }
.admin-grid { min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 9px; }
.admin-card { min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--panel); }
.admin-card-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); background: #29323a; }
.admin-card-header .button { min-height: 27px; padding: 4px 8px; font-size: 11px; }
.static-actions { position: static; }
.admin-hint { padding: 10px 13px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 11px; line-height: 1.5; }
.user-list-card, .activity-card { display: flex; flex-direction: column; }
.admin-table-scroll { min-height: 0; overflow: auto; flex: 1; }
.admin-table { min-width: 920px; }
.activity-table { min-width: 800px; }
.disabled-row { opacity: .6; }
.inline-actions { display: flex; gap: 8px; }
.inline-actions button { padding: 0; border: 0; background: transparent; color: #8fc0e8; cursor: pointer; font-size: 11px; }
.inline-actions button.danger-link { color: #e59a9a; }
.storage-card { align-self: start; }
.storage-warning { margin: 0 14px 14px; padding: 10px; border: 1px solid #796239; border-radius: 5px; background: #443820; color: #edd2a4; font-size: 12px; line-height: 1.5; }

@media (max-width: 1050px) {
    .side-nav button { justify-content: center; width: 46px; }
    .side-nav button span:last-child, .nav-group-title span:last-child, .side-nav button.sub { display: none; }
    .sidebar-user > div { display: none; }
    .sidebar-user { justify-content: center; padding-left: 0; padding-right: 0; }
    .admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .side-nav { display: flex; align-items: center; }
    .side-nav button { width: auto; min-height: 36px; padding: 8px 10px; }
    .side-nav button span:last-child { display: inline; }
    .nav-group { display: flex; padding: 0; }
    .nav-group-title { display: none; }
    .side-nav button.sub { display: inline-flex; padding: 8px 10px; }
    .sidebar-user { margin: 0 0 0 auto; padding: 0; border: 0; }
    .chat-workspace, .developer-workspace { min-height: calc(100vh - 54px); }
    .chat-layout { grid-template-columns: minmax(0, 1fr); }
    .chat-list-panel { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--border); }
    .chat-panel { min-height: 520px; }
    .chat-message { width: 96%; }
    .composer-actions { flex-wrap: wrap; }
    .composer-actions > span { order: 3; flex-basis: 100%; }
    .admin-summary { grid-template-columns: minmax(0, 1fr); }
}
.load-image-button { margin-top: 8px; }
