:root {
  --bg: #f6f6f3;
  --panel: #fff;
  --ink: #1f211e;
  --muted: #777a73;
  --line: #e5e5df;
  --accent: #2f6048;
  --accent-soft: #e6efe9;
  --danger: #a23b32;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--panel); padding: 38px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 55px #262b2510; }
.logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent); color: white; font-weight: 800; font-size: 22px; }
.logo.small { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
h1 { margin: 18px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.muted { margin: 0 0 28px; color: var(--muted); }
label { display: grid; gap: 7px; color: #5c5f58; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; color: var(--ink); background: white; border: 1px solid #d9dad3; border-radius: 9px; padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card label + label { margin-top: 15px; }
button[type="submit"] { margin-top: 22px; padding: 11px 17px; border-radius: 9px; color: white; background: var(--accent); font-weight: 700; }
.login-card button { width: 100%; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 13px 0 0; }
.app { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
aside { position: sticky; top: 0; height: 100vh; padding: 25px 18px; border-right: 1px solid var(--line); background: #fbfbf8; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; }
nav { display: grid; gap: 4px; }
.nav-item { text-align: left; padding: 11px 13px; border-radius: 9px; background: transparent; color: #555851; }
.nav-item:hover, .nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.account { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); display: grid; gap: 5px; font-size: 13px; }
.text-button { background: transparent; color: var(--muted); text-align: left; padding: 0; font-size: 12px; }
.content { width: min(1050px, 100%); padding: 46px 54px; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
header h1 { margin: 0; }
header p { color: var(--muted); margin: 4px 0 0; }
.menu { display: none; background: transparent; font-size: 22px; }
.tab { display: none; }
.tab.active { display: block; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.form-row { display: flex; align-items: end; gap: 13px; }
.form-row label { min-width: 170px; }
.form-row .grow { flex: 1; }
.form-row button[type="submit"] { margin: 0; white-space: nowrap; }
.form-row.compact { margin-bottom: 17px; }
.toolbar { display: flex; gap: 10px; margin: 18px 0 10px; }
.toolbar input { flex: 1; }
.toolbar select { width: 210px; }
.list { display: grid; gap: 9px; margin-top: 18px; }
.item { display: grid; grid-template-columns: minmax(80px, .45fr) 2fr auto; align-items: center; gap: 18px; padding: 15px 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.item strong { display: block; }
.item small { color: var(--muted); }
.badge { justify-self: start; padding: 5px 9px; color: var(--accent); background: var(--accent-soft); border-radius: 7px; font-size: 12px; font-weight: 750; }
.icon-button { background: transparent; color: var(--muted); padding: 7px; border-radius: 7px; }
.icon-button:hover { color: var(--danger); background: #f9e9e7; }
.empty { color: var(--muted); text-align: center; padding: 48px 15px; border: 1px dashed #d5d6cf; border-radius: 11px; }
.notice { margin: -10px 0 20px; padding: 11px 13px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; font-size: 13px; }
.notice.bad { color: var(--danger); background: #f9e9e7; }
.editor-form > label { margin-top: 8px; }
.editor-form button[type="submit"] { width: auto; margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.secondary { padding: 11px 17px; background: #ededE8; border-radius: 9px; }
.CodeMirror { min-height: 330px; border-color: var(--line); }
.editor-toolbar { border-color: var(--line); }
.note-item { grid-template-columns: 1fr auto; cursor: pointer; }
.note-item p { margin: 5px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 650px; }

@media (max-width: 760px) {
  .app { display: block; }
  aside { position: fixed; z-index: 10; width: 230px; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 30px #0002; }
  aside.open { transform: translateX(0); }
  .content { padding: 26px 18px; }
  .menu { display: block; }
  .form-row { align-items: stretch; flex-direction: column; }
  .form-row label { width: 100%; min-width: 0; }
  .form-row button[type="submit"] { margin-top: 5px; }
  .toolbar { flex-direction: column; }
  .toolbar select { width: 100%; }
  .item { grid-template-columns: 1fr auto; gap: 8px; }
  .item .badge { grid-column: 1; }
  .item .item-main { grid-column: 1; }
  .item .icon-button { grid-column: 2; grid-row: 1 / 3; }
}
