/* ===== Почта в админке ===== */
.am { display: grid; grid-template-columns: 218px minmax(280px, 360px) minmax(0, 1fr); gap: 14px; min-height: 560px; }
.am-boxes, .am-list, .am-view { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; min-width: 0; }
.am-boxes { padding: 10px; display: flex; flex-direction: column; gap: 3px; align-self: start; }
.am-boxes-title { padding: 8px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.am-box { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.am-box:hover { background: var(--surface-2); }
.am-box.on { background: var(--surface-2); font-weight: 700; }
.am-box-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3, var(--surface-2)); color: var(--muted); flex: none; }
.am-box-ic svg { width: 13px; height: 13px; }
.am-box-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff3d81; color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; }
.am-boxes-note { margin-top: auto; padding: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.am-list { display: flex; flex-direction: column; overflow: hidden; align-self: start; max-height: 720px; }
.am-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; }
.am-list-head h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.am-list-head small { color: var(--muted); font-size: 12px; }
.am-list-actions { display: flex; align-items: center; gap: 6px; }
.am-folders { display: flex; gap: 4px; padding: 0 10px 8px; }
.am-folders button { flex: 1; padding: 7px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.am-folders button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.am-search { display: flex; align-items: center; gap: 6px; margin: 0 10px 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.am-search svg { width: 14px; height: 14px; flex: none; }
.am-search input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.am-rows { overflow-y: auto; padding: 0 6px 8px; }
.am-row { display: grid; gap: 2px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.am-row:hover, .am-row.on { background: var(--surface-2); }
.am-row.is-unread .am-subj, .am-row.is-unread .am-from { font-weight: 800; }
.am-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.am-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.am-subj, .am-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-subj { font-size: 13px; }
.am-prev { color: var(--muted); font-size: 12px; }
.am-clip { font-size: 11px; }
.am-view { padding: 18px; overflow: auto; min-height: 360px; max-height: 720px; }
.am-empty { display: grid; justify-items: center; gap: 6px; padding: 70px 18px; color: var(--muted); text-align: center; }
.am-empty svg { width: 30px; height: 30px; opacity: .5; }
.am-empty b { color: var(--text); font-size: 15px; }
.am-empty span { font-size: 12.5px; }
.am-msg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.am-msg-head h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.am-msg-meta { color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.am-msg-meta b { color: var(--text); }
.am-msg-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.am-msg-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.am-msg-body img { max-width: 100%; height: auto; }
.am-msg-body table { max-width: 100%; border-collapse: collapse; }
.am-msg-body td, .am-msg-body th { padding: 2px 4px; }
.am-msg-body a { color: var(--accent-ink); }
.am-msg-body pre { white-space: pre-wrap; font: inherit; margin: 0; }
.am-msg-body blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.am-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.am-att { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 12px; text-decoration: none; }
.am-att svg { width: 13px; height: 13px; color: var(--muted); }
.am-att small { color: var(--muted); }
.am-compose { display: grid; gap: 10px; }
.am-brand { margin: 0; font-size: 13px; }
.am-file-input { display: block; padding: 6px 0; font: inherit; font-size: 13px; color: var(--muted); }
.am-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.am-file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.am-file small { color: var(--muted); }
.am-file button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.am-file button:hover { color: var(--bad); }
.am-compose-actions { display: flex; justify-content: flex-end; }
@media (max-width: 1080px) { .am { grid-template-columns: 190px minmax(240px, 320px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .am { grid-template-columns: 1fr; }
  .am-boxes { flex-direction: row; flex-wrap: wrap; align-self: stretch; }
  .am-boxes-title, .am-boxes-note { display: none; }
  .am-box { width: auto; }
  .am-list { max-height: 420px; }
  .am-view { max-height: none; }
}
