/* ==========================================================================
   Admin Dashboard — clean, professional, RTL-first
   ========================================================================== */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e5e9f0;
  --line-strong: #d3d9e4;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #059669;
  --primary-600: #047857;
  --primary-50: #ecfdf5;
  --blue: #0284c7;
  --blue-50: #f0f9ff;
  --amber: #d97706;
  --amber-50: #fffbeb;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --violet: #7c3aed;
  --violet-50: #f5f3ff;
  --side: #0b1220;
  --side-2: #131c2e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --font: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); font-size: .9rem; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; transition: .18s; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px -2px rgba(5, 150, 105, .5); }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-ghost { background: var(--surface); border: 1px solid #fecaca; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-block { width: 100%; padding: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; color: var(--text-2); transition: .15s; border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-family: inherit; font-size: .92rem; color: var(--text); transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.input[dir="ltr"], .ltr { direction: ltr; text-align: left; }
.hint { font-size: .76rem; color: var(--text-3); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- Login ---------- */
.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1000px 500px at 80% 10%, rgba(16, 185, 129, .35), transparent), linear-gradient(160deg, #0b1220, #0f2a24); color: #fff; display: grid; place-items: center; padding: 48px; }
.login-art-inner { max-width: 440px; }
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 22px; backdrop-filter: blur(8px); }
.login-art h2 { font-size: 1.9rem; margin-bottom: 10px; }
.login-art p { color: rgba(255, 255, 255, .72); margin-bottom: 24px; }
.login-points { list-style: none; display: grid; gap: 12px; }
.login-points i { color: #34d399; margin-inline-end: 8px; }
.login-form-side { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.lock-badge { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-size: 1.5rem; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card .field { margin: 22px 0 14px; }
.pin-field { text-align: center; letter-spacing: .5em; font-size: 1.2rem; padding: 13px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--text-2); font-size: .85rem; }
.back-link:hover { color: var(--primary); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Shell ---------- */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #10b981, #059669); display: grid; place-items: center; color: #fff; font-size: 1.1rem; box-shadow: 0 6px 16px -4px rgba(16, 185, 129, .6); }
.sidebar-brand strong { display: block; color: #fff; font-size: .98rem; }
.sidebar-brand small { color: #64748b; font-size: .76rem; }
.side-nav { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #475569; padding: 14px 10px 6px; font-weight: 700; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; font-size: .9rem; color: #94a3b8; transition: .15s; width: 100%; text-align: start; position: relative; }
.side-link i { font-size: 1rem; width: 18px; text-align: center; }
.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.active { background: rgba(16, 185, 129, .14); color: #34d399; font-weight: 600; }
.side-link.active::before { content: ''; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #10b981; }
.count-pill { margin-inline-start: auto; font-style: normal; font-size: .7rem; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #94a3b8; }
.count-pill.alert { background: #ef4444; color: #fff; }
.count-pill.alert[data-zero="1"] { background: rgba(255, 255, 255, .08); color: #94a3b8; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-overlay { display: none; }

.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-title h1 { font-size: 1.2rem; }
.topbar-title p { font-size: .82rem; color: var(--text-2); }
.topbar-actions { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.mobile-toggle { display: none; }
.view-container { padding: 24px 28px 48px; max-width: 1400px; width: 100%; margin-inline: auto; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 1rem; }
.card-head small { color: var(--text-3); }
.card-body { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.grid-2.even { grid-template-columns: 1fr 1fr; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: center; transition: .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.kpi-icon.green { background: var(--primary-50); color: var(--primary); }
.kpi-icon.blue { background: var(--blue-50); color: var(--blue); }
.kpi-icon.amber { background: var(--amber-50); color: var(--amber); }
.kpi-icon.violet { background: var(--violet-50); color: var(--violet); }
.kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; font-family: var(--mono); }
.kpi-label { font-size: .82rem; color: var(--text-2); }
.kpi-sub { font-size: .72rem; color: var(--text-3); }

/* Bar chart */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 10px 6px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #34d399, #059669); min-height: 4px; transition: height .6s cubic-bezier(.16, 1, .3, 1); position: relative; cursor: default; }
.bar:hover { filter: brightness(1.1); }
.bar:hover::after { content: attr(data-val); position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); }
.bar-label { font-size: .68rem; color: var(--text-3); font-family: var(--mono); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); transition: .15s; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: .78rem; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.list-meta i { font-size: .72rem; margin-inline-end: 3px; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.thumb { width: 64px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: 10px; opacity: .6; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge.green { background: var(--primary-50); color: var(--primary); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.gray { background: #f1f5f9; color: var(--text-2); }
.badge.red { background: var(--danger-50); color: var(--danger); }
.tag-chip { display: inline-block; background: #f1f5f9; color: var(--text-2); padding: 2px 9px; border-radius: 6px; font-size: .74rem; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-box i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box .input { padding-inline-start: 36px; }
.seg { display: inline-flex; background: #e9edf4; padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { padding: 6px 14px; border-radius: 7px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Cards grid (projects, skills) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.item-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: .2s; }
.item-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.item-card h4 { font-size: .98rem; line-height: 1.4; }
.item-card p { font-size: .84rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Article editor ---------- */
.editor-layout { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.lang-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.lang-tabs button { padding: 9px 18px; font-weight: 600; font-size: .88rem; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lang-tabs button.active { color: var(--primary); border-color: var(--primary); }
.title-input { font-size: 1.35rem; font-weight: 700; border: none; padding: 6px 0; box-shadow: none !important; }
.title-input:focus { border: none; }
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.md-toolbar button { height: 32px; min-width: 32px; padding: 0 8px; border-radius: 6px; color: var(--text-2); font-size: .82rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.md-toolbar button:hover { background: #e2e8f0; color: var(--text); }
.md-toolbar .sep { width: 1px; background: var(--line-strong); margin: 4px 4px; }
.md-toolbar .spacer { flex: 1; }
.md-area { border-radius: 0 0 var(--radius-sm) var(--radius-sm); min-height: 360px; font-family: var(--mono); font-size: .86rem; line-height: 1.8; }
.md-preview { border: 1px solid var(--line-strong); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 22px; min-height: 360px; background: #fff; }
.cover-box { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); position: relative; aspect-ratio: 16/9; display: grid; place-items: center; text-align: center; color: var(--text-3); cursor: pointer; transition: .15s; }
.cover-box:hover { border-color: var(--primary); color: var(--primary); }
.cover-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-box .cover-actions { position: absolute; inset-inline-end: 8px; top: 8px; display: flex; gap: 6px; z-index: 2; }
.cover-box .cover-actions button { background: rgba(15, 23, 42, .75); color: #fff; width: 30px; height: 30px; border-radius: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: .9rem; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: .2s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { inset-inline-start: 20px; }
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.tags-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }
.tags-input input { border: none; outline: none; flex: 1; min-width: 80px; padding: 4px; font-family: inherit; font-size: .88rem; }
.tags-input .tag-chip { background: var(--primary-50); color: var(--primary); display: inline-flex; gap: 6px; align-items: center; }
.tags-input .tag-chip button { color: inherit; font-size: .7rem; opacity: .7; }
.translate-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--blue); background: var(--blue-50); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.translate-chip:hover { filter: brightness(.96); }
.word-count { font-size: .76rem; color: var(--text-3); text-align: end; padding-top: 6px; }

/* Rendered markdown (preview + public share the same look) */
.md-preview h2, .md-preview h3, .md-preview h4 { margin: 1.4em 0 .5em; }
.md-preview p { margin: .8em 0; line-height: 1.9; }
.md-preview img { max-width: 100%; border-radius: 10px; }
.md-preview blockquote { border-inline-start: 4px solid var(--primary); background: var(--primary-50); padding: 12px 16px; border-radius: 8px; margin: 1em 0; }
.md-preview pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; direction: ltr; text-align: left; font-family: var(--mono); font-size: .85rem; margin: 1em 0; }
.md-preview code { font-family: var(--mono); background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: .86em; }
.md-preview pre code { background: none; padding: 0; }
.md-preview ul, .md-preview ol { margin: .8em 0; padding-inline-start: 1.5em; }
.md-preview figure { margin: 1.2em 0; text-align: center; }
.md-preview figcaption { font-size: .8rem; color: var(--text-3); margin-top: 6px; }

/* ---------- Messages ---------- */
.msg-layout { display: grid; grid-template-columns: 360px 1fr; gap: 0; min-height: 480px; }
.msg-list { border-inline-end: 1px solid var(--line); max-height: 640px; overflow-y: auto; }
.msg-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .15s; }
.msg-row:hover { background: var(--surface-2); }
.msg-row.active { background: var(--primary-50); }
.msg-row.unread .list-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-inline-end: 8px; }
.msg-preview { font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-detail { padding: 24px; }
.msg-detail h3 { font-size: 1.15rem; margin-bottom: 4px; }
.msg-body { margin-top: 18px; padding: 18px; background: var(--surface-2); border-radius: 10px; white-space: pre-wrap; line-height: 1.9; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); animation: fade .2s; }
.modal-card { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.16, 1, .3, 1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } }

/* Uploading spinner */
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.stat-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.stat-edit { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); position: relative; }
.skill-edit { padding: 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; background: var(--surface-2); }
.skill-edit .remove { position: absolute; inset-inline-start: 10px; top: 10px; }
.avatar-uploader { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.avatar-uploader img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-50); box-shadow: var(--shadow); }
.section-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--line-strong); }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); padding: 16px 0 0; margin-top: 16px; display: flex; justify-content: flex-end; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 860px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 60; transform: translateX(100%); transition: .25s; }
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none !important; }
  .sidebar-overlay.open { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 50; }
  .mobile-toggle { display: inline-grid; }
  .topbar, .view-container { padding-inline: 16px; }
  .msg-layout { grid-template-columns: 1fr; }
  .msg-list { border-inline-end: none; border-bottom: 1px solid var(--line); max-height: 300px; }
  .row, .row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-title p { display: none; }
}
