/* Палитра — по эмблеме: зелёные стены Сакаара, красный с золотом. */
:root {
  --bg: #f4f1ea; --panel: #ffffff; --ink: #1d2422; --muted: #6b716e; --line: #ddd6c8;
  --accent: #b81f2a; --accent-ink: #fff; --gold: #b58a1c; --green: #1f4a43; --hover: #f0ebe0;
  --flash: #fff6d6; --danger: #9b1c1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101816; --panel: #17221f; --ink: #e8e4da; --muted: #96a09b; --line: #2a3a35;
    --accent: #d8343e; --gold: #d8b23a; --green: #2c6a5f; --hover: #1d2b27; --flash: #3a3216; --danger: #e05858;
  }
}
:root[data-theme="dark"] {
  --bg: #101816; --panel: #17221f; --ink: #e8e4da; --muted: #96a09b; --line: #2a3a35;
  --accent: #d8343e; --gold: #d8b23a; --green: #2c6a5f; --hover: #1d2b27; --flash: #3a3216; --danger: #e05858;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.top { display: flex; gap: 16px; align-items: center; padding: 10px 16px;
  background: var(--green); color: #f4efe2; border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; }
.brand img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.search { flex: 1; }
.search input { width: 100%; max-width: 520px; }
.me { display: flex; align-items: center; gap: 8px; }
.me form { margin: 0; }
.top .ghost { color: #f4efe2; border-color: rgba(255,255,255,.3); }
input, select, textarea, button, .btn { font: inherit; border-radius: 8px; border: 1px solid var(--line);
  padding: 8px 10px; background: var(--panel); color: var(--ink); }
textarea { width: 100%; resize: vertical; }
button, .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.pre, pre { white-space: pre-wrap; font: inherit; margin: 0; }
.flash { background: var(--flash); border: 1px solid var(--gold); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.error { color: var(--danger); margin: 8px 0; }
.crumbs { margin: 4px 0 14px; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--ink); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > input { flex: 1; min-width: 180px; }
label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
label input, label select, label textarea { display: block; width: 100%; margin-top: 3px; color: var(--ink); }
.row label { flex: 1; }
.login { max-width: 360px; margin: 10vh auto; text-align: center; }
.login .emblem { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold);
  box-shadow: 0 0 0 4px var(--accent); }
.login h1 { letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 0; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login input[name=code] { text-align: center; font-size: 24px; letter-spacing: .3em; }
.dev { background: var(--flash); padding: 6px; border-radius: 6px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.folder { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: 10px; text-decoration: none; }
.folder:hover { background: var(--hover); }
.folder.service { border-left-color: var(--muted); }
.folder .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-note { display: block; padding: 10px 12px; margin-bottom: 14px; border-radius: 10px; background: var(--flash);
  border: 1px solid var(--gold); text-decoration: none; }
.about { margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.about summary { cursor: pointer; color: var(--muted); }
.about pre { margin-top: 8px; font-size: 14px; }
table.docs { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.docs th, .docs td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.docs tr:hover td { background: var(--hover); }
.docs a { text-decoration: none; }
.kind { display: inline-block; min-width: 38px; font-size: 10px; font-weight: 700; text-align: center; padding: 1px 4px;
  border-radius: 4px; background: var(--line); color: var(--ink); margin-right: 4px; vertical-align: 1px; }
.k-pdf { background: var(--accent); color: #fff; }
.k-image { background: var(--green); color: #fff; }
.k-text { background: var(--gold); color: #fff; }
.tag { font-size: 12px; color: var(--green); text-decoration: none; }
.upload { margin-top: 18px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; margin-bottom: 8px; }
.drop.over { border-color: var(--accent); background: var(--hover); }
.drop input { display: block; margin: 0 auto 6px; }
.newfolder { margin-top: 8px; color: var(--muted); }
.newfolder form { margin-top: 8px; }
.doc-head h1 { margin: 0 0 4px; font-size: 22px; }
.doc-head .actions { margin: 10px 0 14px; display: flex; gap: 8px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.preview iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.preview img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
aside ul { padding-left: 18px; margin: 0; }
@media (max-width: 820px) {
  .top { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .brand span { display: none; }
  .doc-grid { grid-template-columns: 1fr; }
  .docs th:nth-child(3), .docs td:nth-child(3), .docs th:nth-child(4), .docs td:nth-child(4) { display: none; }
  .preview iframe { height: 60vh; }
}
