/* NDM starter: admin panel. Deliberately plain and high-contrast. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.5; color: #1d2327; background: #f3f4f6; }
a { color: #1f4e8c; }
:focus-visible { outline: 3px solid #f0a020; outline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
.muted { color: #5b6670; }
.small { font-size: 0.875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #16232b; color: #e9eef1; padding: 1.25rem 0; display: flex; flex-direction: column; }
.side .logo { color: #fff; font-weight: 700; text-decoration: none; padding: 0 1.25rem 1rem; font-size: 1.05rem; }
.side nav { display: flex; flex-direction: column; }
.side nav a { color: #d3dde3; text-decoration: none; padding: 0.6rem 1.25rem; border-left: 3px solid transparent; }
.side nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side nav a.on { border-left-color: #f0a020; background: rgba(255,255,255,0.08); color: #fff; }
.side .me { margin-top: auto; padding: 1rem 1.25rem 0; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.linkish { background: none; border: none; color: #d3dde3; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.main { padding: 2rem 2.5rem 4rem; max-width: 960px; }

.card, fieldset.card { background: #fff; border: 1px solid #dfe3e6; border-radius: 8px; padding: 1.25rem 1.5rem; margin: 0 0 1.25rem; }
fieldset.card legend { font-weight: 700; padding: 0 0.4rem; }
.field { margin-bottom: 1rem; display: grid; gap: 0.3rem; }
.field label, .flabel { font-weight: 600; }
.field small, .flabel small { display: block; font-weight: 400; color: #5b6670; }
input:not([type=checkbox]):not([type=file]), select, textarea { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid #8a959d; border-radius: 6px; width: 100%; background: #fff; }
textarea { resize: vertical; }
label.inline { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; margin: 0.4rem 0; }
.thumb { max-width: 220px; max-height: 140px; border-radius: 6px; border: 1px solid #dfe3e6; object-fit: cover; }

.btn { display: inline-block; background: #1f4e8c; color: #fff; border: none; border-radius: 6px; padding: 0.6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #173c6c; color: #fff; }
.btn.sm { padding: 0.35rem 0.7rem; font-size: 0.875rem; }
.btn.grey { background: #e3e7ea; color: #1d2327; }
.btn.grey:hover { background: #d3d9de; }
.btn.red { background: #b42318; }
.btn.red:hover { background: #8f1c13; }
.tools { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.5rem; }
.sticky-save { position: sticky; bottom: 0; background: #f3f4f6; padding: 0.75rem 0; border-top: 1px solid #dfe3e6; }

.flash { padding: 0.8rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.ok { background: #e7f5ec; color: #14532d; border: 1px solid #a9d8b8; }
.flash.err { background: #fdecea; color: #7f1d1d; border: 1px solid #f1b3ab; }
.flash.warn { background: #fff6e0; color: #6b4600; border: 1px solid #f0d08a; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.tile { background: #fff; border: 1px solid #dfe3e6; border-radius: 8px; padding: 1rem; text-decoration: none; color: #1d2327; }
.tile strong { display: block; font-size: 1.1rem; color: #1f4e8c; }
.tile:hover { border-color: #1f4e8c; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #dfe3e6; border-radius: 8px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid #eef0f2; vertical-align: top; }
table.list th { background: #f8f9fa; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6670; }
tr.unread td, li.unread { font-weight: 700; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { padding: 0.5rem 0; border-bottom: 1px solid #e5e8eb; }
.badge { background: #e3e7ea; border-radius: 10px; padding: 1px 8px; font-size: 0.75rem; font-weight: 600; }
details summary { cursor: pointer; color: #1f4e8c; margin-top: 0.4rem; }
details .stack { margin: 0.75rem 0; padding: 0.75rem; background: #f8f9fa; border-radius: 6px; }
.msg { background: #f8f9fa; border-radius: 6px; padding: 1rem; margin: 1rem 0; white-space: normal; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card.photo { padding: 0.75rem; }
.card.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; margin-bottom: 0.5rem; }

body.login { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-box { background: #fff; border: 1px solid #dfe3e6; border-radius: 10px; padding: 2rem; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.login-box .btn { width: 100%; margin-top: 0.5rem; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding: 0.75rem 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; padding: 0 0.75rem; }
  .side nav a { border-left: none; border-bottom: 3px solid transparent; padding: 0.5rem 0.6rem; }
  .side nav a.on { border-bottom-color: #f0a020; }
  .side .me { margin-top: 0.75rem; }
  .main { padding: 1.25rem 1rem 3rem; }
}
