/* admin.css - the glow tokens (DESIGN-BRIEF §2.2/2.3), plain CSS, mobile
   first. No web fonts: the admin CSP has no font-src, so only system faces
   load - and Thai system faces on iOS/Android are good. */
:root {
  --cream: #fff8e9; --surface-2: #fdf5e2; --surface-3: #f8edd4;
  --orange: #e47b54; --orange-deep: #cf6741; --coral: #e56a54;
  --peach: #f7b984; --pink: #ffd8d1; --sage: #dce2c9; --sky: #c7d9dd;
  --ink: #241f1a; --ink-soft: #5d5348; --ink-mute: #7a6f61;
  --line: #ece0c4; --line-strong: #dfd0ac;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Sarabun", Tahoma, sans-serif;
}
.bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .6rem 1rem; background: var(--orange); color: var(--ink);
  border-bottom: 1px solid var(--orange-deep);
}
.bar a, .bar a:visited { color: var(--ink); text-decoration: none; font-weight: 600; }
.bar-user { color: var(--ink); }
.bar-out { margin-left: auto; }
.bar-out button {
  background: transparent; border: 1px solid var(--ink); color: var(--ink);
  border-radius: 999px; padding: .25rem .8rem; font: inherit; font-size: .9rem;
}
main { padding: 1rem; max-width: 40rem; margin: 0 auto; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1.25rem 1rem; margin-bottom: 1rem;
}
.card.login { margin-top: 2rem; }
h1 { font-size: 1.25rem; margin: 0 0 .5rem; }
.en { color: var(--ink-mute); font-weight: 400; font-size: .85em; }
.hint { color: var(--ink-soft); font-size: .95rem; margin: 0 0 1rem; }
.msg { background: var(--sage); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 1rem; }
.msg-bad { background: var(--pink); }
label { display: block; margin: 0 0 .9rem; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  display: block; width: 100%; margin-top: .3rem; font: inherit;
  padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
button.primary {
  width: 100%; padding: .85rem; font: inherit; font-weight: 700; border: 0;
  border-radius: 999px; background: var(--orange); color: var(--ink);
}
button.primary:active { background: var(--orange-deep); }

/* ---- T06: forms, lists, nav ------------------------------------------- */
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.crumb { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .5rem; }
.crumb a { color: var(--ink-soft); }
.req { color: var(--coral); font-weight: 700; }
.field { margin: 0 0 1rem; }
.field label { margin: 0; }
.field-bad input, .field-bad textarea, .field-bad select { border-color: var(--coral); outline: 2px solid var(--pink); }
.help { color: var(--ink-mute); font-size: .85rem; margin: .25rem 0 0; }
.field .msg { margin: .4rem 0 0; font-size: .9rem; padding: .4rem .6rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; padding: .35rem 0; }
label.check input { width: 1.25rem; height: 1.25rem; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.checks label.check { font-weight: 500; }
fieldset.group {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: .6rem .8rem .2rem;
  margin: 0 0 1rem; min-width: 0;
}
fieldset.group legend { font-weight: 700; padding: 0 .3rem; }
.row { border-top: 1px dashed var(--line-strong); padding-top: .6rem; margin-top: .4rem; }
.row-n { font-size: .8rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.row-blank { opacity: .75; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.actions button, .btn { flex: 1 1 100%; text-align: center; padding: .8rem; font: inherit; font-weight: 700; border-radius: 999px; border: 0; }
button.primary { width: auto; }
.btn { display: inline-block; text-decoration: none; }
.btn.primary { background: var(--orange); color: var(--ink); }
button.secondary { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-strong); }
button.danger { background: #fff; color: var(--coral); border: 1px solid var(--coral); }
table.rows { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.rows th { text-align: left; font-size: .8rem; color: var(--ink-mute); font-weight: 600; padding: .3rem .2rem; border-bottom: 1px solid var(--line-strong); }
table.rows td { padding: .55rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows td.c { text-align: center; }
table.rows a { color: var(--ink); font-weight: 600; text-decoration: none; }
nav.cols { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
nav.cols .col {
  display: block; padding: .8rem .7rem; border-radius: 10px; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 600;
}
nav.cols .col .en { display: block; font-size: .8rem; }
@media (min-width: 560px) { .actions button, .btn { flex: 0 1 auto; min-width: 10rem; } }

/* ---- T07: dashboard, gallery, history ---------------------------------- */
.build { padding: .7rem .9rem; border-radius: 10px; background: var(--surface-3); margin: 0 0 .8rem; }
.build-ok { background: var(--sage); }
.build-bad { background: var(--pink); }
.btn.small, button.small { display: inline-block; padding: .45rem .9rem; font-size: .9rem; font-weight: 600; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); text-decoration: none; margin: .15rem .3rem .15rem 0; }
ul.saves { list-style: none; padding: 0; margin: 0; }
ul.saves li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
input[type=file] { display: block; margin: .4rem 0 .8rem; font: inherit; max-width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.gallery figure { margin: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.gallery figcaption { padding: .4rem .5rem; font-size: .8rem; word-break: break-all; }
img.thumb { display: block; max-width: 160px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); margin: .4rem 0; }
ul.commits { list-style: none; padding: 0; margin: 0; }
.commit { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.commit-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .15rem; }
.commit-row form { margin: 0; flex: 0 0 auto; }
.commit-row .subject { font-weight: 600; word-break: break-word; }
.commit-row .now { color: var(--ink-mute); font-size: .85rem; white-space: nowrap; }
.commit-row button.small { white-space: nowrap; }
