:root { --c: #1f4e8c; --bg: #f3f5f8; --b: #dde2ea; --red: #c62828; --ok: #2e7d32; --t: #1c2430; --m: #6b7685; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--t); }
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--c); color: #fff; }
header a, header .link { color: #fff; text-decoration: none; }
header nav { display: flex; align-items: center; gap: 14px; }
.logo { font-weight: 700; font-size: 18px; }
.bell { position: relative; font-size: 18px; }
.bell span { position: absolute; top: -6px; right: -10px; background: var(--red); border-radius: 9px; padding: 0 5px; font-size: 11px; font-weight: 700; }
main { max-width: 900px; margin: 0 auto; padding: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
h1 { font-size: 20px; margin: 0 0 12px; } h2 { font-size: 17px; margin: 0 0 10px; }
.card { background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.login { max-width: 360px; margin: 12vh auto; }
label { display: block; margin-bottom: 12px; color: var(--m); font-size: 13px; }
label.check { color: var(--t); font-size: 15px; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; color: var(--t);
  border: 1px solid var(--b); border-radius: 8px; background: #fff; }
.btn { display: inline-block; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--c); color: #fff; font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.small { padding: 5px 10px; font-size: 14px; background: rgba(255,255,255,.18); }
.btn.ghost { background: #e8edf5; color: var(--c); }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--c); }
form.inline { display: inline; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: #e3f2e5; }
.msg.error { background: #fde7e7; color: var(--red); }
.banner { background: #fff8d6; padding: 8px 16px; text-align: center; font-size: 14px; }
.banner .btn.small { background: var(--c); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--t); white-space: nowrap; }
.tabs a.on { background: var(--c); color: #fff; }
.tabs b { background: var(--c); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 12px; }
.tabs a.on b { background: #fff; color: var(--c); }
.tabs b.red, .tabs a.on b.red { background: var(--red); color: #fff; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--b); border-radius: 10px;
  margin-bottom: 8px; text-decoration: none; color: inherit; }
.card .row { border-width: 0 0 1px; border-radius: 0; margin: 0; padding: 10px 0; }
.row.late { border-left: 4px solid var(--red); }
.row.unread { font-weight: 600; }
.row small { display: block; color: var(--m); }
.grow { flex: 1; min-width: 0; } .grow b { display: block; overflow: hidden; text-overflow: ellipsis; }
.num { color: var(--m); font-size: 13px; }
.due { font-size: 13px; color: var(--m); white-space: nowrap; } .late .due { color: var(--red); font-weight: 600; }
.empty { text-align: center; color: var(--m); padding: 30px; }
.search input { margin: 0 0 10px; }
.task-head { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.status { padding: 4px 10px; border-radius: 20px; background: #e8edf5; color: var(--c); font-size: 13px; font-weight: 600; }
.status.red { background: #fde7e7; color: var(--red); } .status.ok { background: #e3f2e5; color: var(--ok); }
.red { color: var(--red); }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; }
.meta dt { color: var(--m); } .meta dd { margin: 0; }
.text { border-top: 1px solid var(--b); padding-top: 8px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.file { padding: 8px 12px; background: #f0f3f8; border-radius: 8px; text-decoration: none; color: var(--t); }
.file small { color: var(--m); }
.thumb { width: 120px; text-decoration: none; color: var(--m); font-size: 12px; }
.thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; display: block; }
.thumb span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act { border: 2px solid var(--c); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.files-pick { margin-bottom: 8px; }
.upload { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.upload span { flex: 0 1 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload i { flex: 1; height: 6px; background: #e8edf5; border-radius: 3px; overflow: hidden; }
.upload b { display: block; height: 100%; width: 0; background: var(--c); transition: width .2s; }
.upload.done b { background: var(--ok); } .upload.err { color: var(--red); }
.history { list-style: none; padding: 0; margin: 0 0 14px; }
.history li { border-left: 2px solid var(--b); padding: 0 0 12px 12px; }
.history small { color: var(--m); }
blockquote { margin: 4px 0; padding: 6px 10px; background: #f6f7f9; border-radius: 6px; }
table.list { width: 100%; border-collapse: collapse; } table.list td { padding: 8px 4px; border-bottom: 1px solid var(--b); }

/* телефон (в первую очередь для директора) */
@media (max-width: 640px) {
  .hide-m { display: none; }
  main { padding: 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .buttons .btn { flex: 1 1 100%; padding: 14px; font-size: 16px; }
  .meta { grid-template-columns: 1fr; } .meta dd { margin-bottom: 6px; }
  input, select, textarea { font-size: 16px !important; } /* без зума в iOS */
}
