* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1d2430; background: #f3f5f8; }
a { color: #1f5fbf; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: 13px; background: #eef1f5; padding: 0 3px; border-radius: 3px; }
small { color: #6b7685; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
       padding: 8px 16px; background: #24364f; color: #fff; }
.top a, .top .link { color: #fff; }
.top small { color: #b9c6d8; }
.brand { font-weight: 600; font-size: 16px; }
.brand .po { background: #3d5878; border-radius: 4px; padding: 1px 6px; margin-left: 4px; font-size: 13px; }
.top nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.layout { display: flex; min-height: calc(100vh - 90px); }
.side { width: 210px; flex: none; background: #fff; border-right: 1px solid #dde2e9; padding: 10px 0; }
.folders { list-style: none; margin: 0; padding: 0; }
.folders li { display: flex; justify-content: space-between; align-items: center; padding: 5px 14px; }
.folders li.active { background: #e3ecf8; font-weight: 600; }
.folders a { color: inherit; flex: 1; }
.badge { background: #1f5fbf; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; }
.newfolder { display: flex; gap: 4px; padding: 10px 14px; }
.newfolder input { flex: 1; min-width: 0; }

main { flex: 1; padding: 14px 20px; min-width: 0; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bar h1 { margin: 0 auto 0 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }

.btn, button { font: inherit; padding: 5px 12px; border: 1px solid #c4ccd7; border-radius: 4px; background: #fff;
               color: #1d2430; cursor: pointer; display: inline-block; }
.btn:hover, button:hover { background: #eef2f7; text-decoration: none; }
.btn.primary { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.btn.primary:hover { background: #194f9e; }
.btn.small { padding: 2px 8px; font-size: 12px; }
button.link { background: none; border: none; padding: 0; text-decoration: underline; }
input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid #c4ccd7; border-radius: 4px; background: #fff; }

.card { background: #fff; border: 1px solid #dde2e9; border-radius: 6px; padding: 16px 20px; max-width: 980px; }
.card label { display: block; margin-bottom: 10px; color: #4a5565; }
.card label input:not([type=checkbox]), .card textarea { display: block; width: 100%; margin-top: 3px; color: #1d2430; }
.card label.row { display: inline-flex; gap: 6px; align-items: center; margin-right: 18px; }
.card textarea { font-family: inherit; resize: vertical; }
.login { max-width: 380px; margin: 40px auto; }
.opts { margin-bottom: 10px; }
.hint { color: #6b7685; font-size: 13px; }

.flash { background: #e6f4ea; border: 1px solid #b7dfc3; padding: 7px 12px; border-radius: 4px; margin-bottom: 12px; }
.flash.err { background: #fdecea; border-color: #f2b8b5; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #dde2e9; }
.list th, .list td { padding: 6px 10px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.list th { background: #f7f9fb; font-weight: 600; color: #4a5565; }
.list tbody tr { cursor: default; }
.list tbody tr[onclick] { cursor: pointer; }
.list tbody tr:hover { background: #f5f8fc; }
.list tr.unread td { font-weight: 600; }
.list tr.off td { color: #9aa3ae; }
.list .num, .list .date { white-space: nowrap; text-align: right; color: #4a5565; }
.list .pri, .list .att { width: 1%; white-space: nowrap; }
.urgent { color: #c62828; font-weight: 700; }
.pager { display: flex; gap: 16px; margin-top: 10px; }
.empty { color: #6b7685; }

.msg h1 { margin-bottom: 10px; }
.hdr { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; margin: 0 0 12px; }
.hdr dt { color: #6b7685; }
.hdr dd { margin: 0; }
.files { list-style: none; padding: 8px 10px; margin: 0 0 12px; background: #f7f9fb; border-radius: 4px; }
.files li { display: inline-block; margin-right: 18px; }
.body { white-space: pre-wrap; word-wrap: break-word; font: 14px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
        margin: 0; border-top: 1px solid #edf0f4; padding-top: 12px; }

footer { text-align: center; color: #8a94a3; font-size: 12px; padding: 8px; }
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .side { width: auto; border-right: none; border-bottom: 1px solid #dde2e9; }
}
