/* admin.css — blog-adm.davestj.com. Our own admin chrome (no third-party CSS):
 * fixed topbar + sidebar, dark surface, brand-green accents to match the public brand.
 */
:root {
  --bg: #0a0e14; --surface: #0e141c; --surface-2: #131b25;
  --border: #1e2b38; --border-bright: #2a3f52;
  --text: #e6f0f5; --text-dim: #8ba0ae; --text-faint: #566875;
  --accent: #3ddc84; --amber: #f5b301; --danger: #ff5c5c; --link: #5fd0ff;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --body: 'Inter', system-ui, sans-serif;
  --topbar-h: 56px; --side-w: 220px; --radius: 9px;
}
* , *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
a { color: var(--link); text-decoration: none; }

/* topbar */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 1rem; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .brand { font-family: var(--mono); font-weight: 700; }
.topbar .brand .accent { color: var(--accent); }
.topbar .spacer { margin-left: auto; }
.topbar .who { font-family: var(--mono); font-size: .78rem; color: var(--text-dim); }

/* sidebar */
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--side-w);
  background: var(--surface); border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; }
.sidebar a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--text-dim);
  font-size: .86rem; margin-bottom: 2px; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: rgba(61,220,132,.12); color: var(--accent); }
.sidebar .grp { font-family: var(--mono); font-size: .64rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-faint); padding: 14px 12px 6px; }

/* main */
.main { margin-left: var(--side-w); padding: calc(var(--topbar-h) + 24px) 28px 60px; }
.page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.page-header h1 { font-family: var(--mono); font-size: 1.4rem; margin: 0; }

/* cards / stat grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card .k { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); }
.card .v { font-family: var(--mono); font-size: 1.7rem; color: var(--accent); margin-top: .2rem; }

/* forms / buttons */
.field { margin-bottom: 1rem; }
.field label { display: block; font-family: var(--mono); font-size: .72rem; color: var(--text-dim); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-family: var(--body); font-size: .95rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.btn { font-family: var(--mono); font-size: .82rem; padding: 10px 20px; border-radius: 7px;
  border: 1px solid var(--border-bright); background: transparent; color: var(--text); cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { background: transparent; color: var(--accent); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-card h1 { font-family: var(--mono); font-size: 1.2rem; text-align: center; margin: 0 0 .3rem; }
.login-card .sub { text-align: center; color: var(--text-faint); font-family: var(--mono); font-size: .72rem; margin-bottom: 1.5rem; }
.err { color: var(--danger); font-family: var(--mono); font-size: .78rem; min-height: 1.2em; margin-top: .5rem; }

/* toast */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--accent);
  color: var(--text); padding: 12px 18px; border-radius: 8px; font-size: .88rem; opacity: 0; transform: translateY(10px);
  transition: all .25s; z-index: 200; }
.toast.show { opacity: 1; transform: translateY(0); }

/* WYSIWYG editor */
.wysiwyg { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; }
.wysiwyg-btn { font-family: var(--mono); font-size: .74rem; padding: 5px 9px; background: transparent; border: 1px solid transparent; border-radius: 5px; color: var(--text-dim); cursor: pointer; }
.wysiwyg-btn:hover { background: var(--surface-2); color: var(--accent); border-color: var(--border); }
.wysiwyg-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.wysiwyg-area { min-height: 340px; padding: 18px 20px; color: var(--text); font-family: var(--body); font-size: 1rem; line-height: 1.65; outline: none; }
.wysiwyg-area h2 { font-family: var(--mono); font-size: 1.5rem; }
.wysiwyg-area h3 { font-family: var(--mono); font-size: 1.2rem; }
.wysiwyg-area blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: .3em 1em; color: var(--text-dim); }
.wysiwyg-area pre { background: #06090d; border: 1px solid var(--border); border-radius: 7px; padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: .85rem; }
.wysiwyg-area img { max-width: 100%; border-radius: 7px; }
.wysiwyg-area a { color: var(--link); }

/* editor page layout */
.edit-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 1.4rem; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-family: var(--mono); font-size: .72rem; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border-bright); color: var(--text-dim); cursor: pointer; user-select: none; }
.chip.on { background: rgba(61,220,132,.14); color: var(--accent); border-color: var(--accent); }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .88rem; }
table.list th { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
table.list tr:hover td { background: var(--surface-2); }
.badge { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; }
.badge.published { color: var(--accent); } .badge.draft { color: var(--text-faint); } .badge.scheduled { color: var(--amber); }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: .8rem; }
.media-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; position: relative; }
.media-item.sel { border-color: var(--accent); }
.media-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px; background: var(--surface-2); }
.media-item .mt { font-family: var(--mono); font-size: .62rem; color: var(--text-faint); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) { .edit-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .sidebar { display: none; } .main { margin-left: 0; } }
