:root {
  --bg: #f4f1ea;
  --ink: #1a1a1a;
  --brand: #7a1f2b;
  --line: #d6d0c4;
  --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Georgia, "Times New Roman", serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #2b1518; color: #fff; padding: 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.side a { color: #f3e9ea; padding: 0.5rem 0.75rem; border-radius: 4px; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.side a.active, .side a:hover { background: var(--brand); }
.main { padding: 1.5rem; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--brand); padding-bottom: 0.75rem; margin-bottom: 1rem; }
.top h1 { margin: 0; font-size: 1.6rem; }
.muted { color: #666; font-size: 0.9rem; font-family: system-ui, sans-serif; }
.flash { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: #fff; font-family: system-ui, sans-serif; }
.flash.ok { border-color: #2f6b3a; background: #eaf6ee; }
.flash.error { border-color: #8b1e1e; background: #fbeaea; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-family: system-ui, sans-serif; font-size: 0.92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 0.65rem 0.5rem; text-align: left; vertical-align: top; }
.btn, button, .button {
  display: inline-block; background: var(--brand); color: #fff; border: 0; padding: 0.55rem 0.9rem;
  cursor: pointer; font-family: system-ui, sans-serif; font-size: 0.9rem;
}
.btn.secondary { background: #444; }
.form { max-width: 860px; display: grid; gap: 0.85rem; background: var(--card); padding: 1rem; border: 1px solid var(--line); }
.form label { display: grid; gap: 0.35rem; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=date], .form input[type=datetime-local], .form input[type=number], .form select, .form textarea {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--line); font: inherit;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.checks { display: flex; flex-wrap: wrap; gap: 1rem; font-family: system-ui, sans-serif; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(380px, 92vw); background: #fff; border: 1px solid var(--line); padding: 1.5rem; display: grid; gap: 0.75rem; }
.login-card h1 { margin: 0; color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.card { background: #fff; border: 1px solid var(--line); padding: 1rem; font-family: system-ui, sans-serif; }
.card strong { display: block; font-size: 1.6rem; color: var(--brand); }
.card-link { color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.card-link:hover { border-color: var(--brand); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.side-brand { font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; padding: 0.35rem 0.75rem 0.15rem; color: #fff; }
.side-note { font-family: system-ui, sans-serif; font-size: 0.72rem; color: #cbb; margin: 0 0.75rem 0.75rem; line-height: 1.35; }
.side-group {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a88;
  padding: 0.85rem 0.75rem 0.2rem;
}
.side-ext { margin-top: 0.75rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: 0.75rem !important; }
.thumb { max-width: 120px; max-height: 80px; object-fit: cover; border: 1px solid var(--line); }
img, video, iframe { max-width: 100%; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .side a { min-height: 44px; display: inline-flex; align-items: center; }
  .row { grid-template-columns: 1fr; }
  .main { padding: 1rem; }
  .form { max-width: 100%; }
  .btn, button { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
}
