:root { --bg: #f4f6f5; --surface: #fff; --ink: #14221b; --muted: #5d6e64; --brand: #0f6b43; --line: #dde5e0; --danger: #b3261e; }
* { box-sizing: border-box; margin: 0; }
body { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); }
body.login { display: grid; place-items: center; padding: 1rem; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

aside { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; background: var(--surface); border-right: 1px solid var(--line); }
aside nav { display: grid; gap: .25rem; flex: 1; align-content: start; }
aside nav a { padding: .5rem .75rem; color: var(--ink); text-decoration: none; border-radius: 8px; }
aside nav a:hover { background: var(--bg); }
aside nav a.on { color: #fff; background: var(--brand); }
main { max-width: 980px; width: 100%; padding: 2rem; }
h1 { margin-bottom: 1.25rem; font-size: 1.6rem; }
h2 { margin-bottom: .75rem; font-size: 1.15rem; }

.btn { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; color: #fff; background: var(--brand); border: 1.5px solid var(--brand); border-radius: 8px; }
.btn.ghost { color: var(--brand); background: transparent; }
button.link { padding: 0; font: inherit; cursor: pointer; color: var(--brand); background: none; border: 0; text-decoration: underline; }
button.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.25rem; }

.note { margin-bottom: 1rem; padding: .7rem 1rem; border-radius: 8px; }
.note.ok { color: #0b4d31; background: #dff2e8; }
.note.err { color: #7a1a14; background: #fbe4e2; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats a { padding: 1.1rem; color: var(--muted); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stats b { display: block; font-size: 2rem; line-height: 1.2; color: var(--ink); }

table { width: 100%; margin-bottom: 1.25rem; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; }
.row-actions > * { margin-right: .9rem; }
.row-actions form { display: inline; }
.thumb { display: block; width: 48px; height: 48px; object-fit: contain; background: var(--bg); border-radius: 8px; }

.form, .box { display: grid; gap: 1rem; max-width: 560px; margin-bottom: 2.5rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.box { width: 100%; max-width: 380px; margin: 0; }
label { display: grid; gap: .3rem; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
label.check { display: flex; align-items: center; gap: .5rem; }
input, select, textarea { width: 100%; padding: .55rem .75rem; font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
input[type=checkbox] { width: auto; }
input.narrow { width: 80px; }
input[type=file] { padding: .4rem; }
.inline { display: flex; gap: .6rem; max-width: 520px; }
.logo-prev { max-height: 56px; width: auto; max-width: 200px; object-fit: contain; }

@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  aside nav { display: flex; flex-wrap: wrap; flex-basis: 100%; order: 3; }
  main { padding: 1.25rem; overflow-x: auto; }
}
