:root { --brand: #2f6fed; }
body { background: #12151b; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #2159cc; --bs-btn-hover-border-color: #2159cc;
  --bs-btn-active-bg: #1c4fb5; --bs-btn-active-border-color: #1c4fb5; }
a { color: #6c9bff; }
.badge.text-bg-primary { background-color: var(--brand) !important; }

/* вход */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #1a1e27; border: 1px solid #2a3040; border-radius: 12px; padding: 28px; }
.login-brand { font-size: 1.3rem; font-weight: 600; margin-bottom: 20px; }
.login-brand .bi { color: var(--brand); }

/* веб-почта */
.wm-top { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #1a1e27; border-bottom: 1px solid #2a3040; position: sticky; top: 0; z-index: 5; }
.wm-brand { font-weight: 600; color: #fff; text-decoration: none; margin-right: 8px; white-space: nowrap; }
.wm-brand .bi { color: var(--brand); }
.wm-search { flex: 1; max-width: 480px; }
.wm-user { margin-left: auto; color: #9aa3b5; font-size: .9rem; }
.wm-layout { display: flex; min-height: calc(100vh - 53px); }
.wm-side { width: 220px; flex: none; padding: 16px 12px; border-right: 1px solid #2a3040; background: #161a22; }
.wm-folder { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: #c5cbd8; text-decoration: none; }
.wm-folder:hover { background: #222838; }
.wm-folder.active { background: var(--brand); color: #fff; }
.wm-main { flex: 1; min-width: 0; padding: 14px 20px; }
.wm-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid #2a3040; margin-bottom: 4px; }
.wm-list { display: flex; flex-direction: column; }
.wm-row { display: grid; grid-template-columns: 24px 220px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid #222838; }
.wm-row:hover { background: #1a1f2b; }
.wm-row a { color: #c5cbd8; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-row.unread a { color: #fff; font-weight: 600; }
.wm-date { color: #8b94a7; font-size: .85rem; white-space: nowrap; }
.wm-pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px 0; }
.wm-h1 { font-size: 1.35rem; margin: 14px 0 10px; word-break: break-word; }
.wm-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; color: #c5cbd8; font-size: .92rem; }
.wm-meta dt { color: #8b94a7; font-weight: 400; }
.wm-meta dd { margin: 0; word-break: break-word; }
.wm-atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wm-att { border: 1px solid #2a3040; border-radius: 8px; padding: 5px 10px; text-decoration: none; font-size: .9rem; }
.wm-frame { width: 100%; height: 68vh; border: 1px solid #2a3040; border-radius: 8px; background: #fff; margin-top: 10px; }
.wm-imgnote { margin-top: 10px; padding: 6px 10px; background: #222838; border-radius: 8px; font-size: .9rem; }
.wm-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin-top: 12px; color: #dfe4ee; }
.wm-compose { max-width: 980px; }

/* управление */
.adm-tabs .nav-link { color: #c5cbd8; }
.adm-tabs .nav-link.active { background: var(--brand); color: #fff; }
.adm .card { background: #1a1e27; border-color: #2a3040; }
.adm code, .adm .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.adm .dns-val { max-width: 560px; }
.copy-btn { cursor: pointer; }

@media (max-width: 860px) {
  .wm-layout { flex-direction: column; }
  .wm-side { width: auto; border-right: 0; border-bottom: 1px solid #2a3040; display: flex; flex-wrap: wrap; gap: 6px; }
  .wm-side .btn { width: auto !important; margin: 0 !important; }
  .wm-row { grid-template-columns: 24px 1fr auto; }
  .wm-from { display: none; }
}
