/* GRG Studio Admin — minimal, calm, focused. */
:root {
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e7e5e1;
  --bg: #faf9f7;
  --panel: #ffffff;
  --accent: #9a7b4f;     /* warm bronze */
  --accent-dark: #7c6340;
  --danger: #b3402f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: .9em; }
.hint { color: var(--muted); font-style: italic; margin: 1rem 0; }

/* Top bar */
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 60px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.admin-top .brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.admin-top .brand .mark { color: var(--accent); }
.admin-top nav { display: flex; align-items: center; gap: 1.25rem; }
.admin-top nav a { color: var(--ink); font-weight: 500; }
.admin-top .who { color: var(--muted); font-size: .85rem; }
.admin-top .logout { color: var(--danger); }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
}
.back { display: inline-block; color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-block; padding: .6rem 1.1rem; border-radius: 8px;
  font-weight: 600; font-size: .9rem; cursor: pointer; border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); text-decoration: none; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.flash-success { background: #eef6ee; color: #2c6e3f; }
.flash-error { background: #fbecea; color: var(--danger); }

/* Project grid */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem;
}
.project-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.project-card .thumb { display: block; position: relative; aspect-ratio: 4/3; background: #f0eee9; }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card .no-img { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.badge { position: absolute; top: .6rem; left: .6rem; padding: .15rem .5rem; border-radius: 5px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-published { background: #2c6e3f; color: #fff; }
.badge-draft { background: #d9d4cc; color: #56503f; }
.card-body { padding: .85rem 1rem 1rem; }
.card-body h3 { font-size: 1rem; margin: 0 0 .15rem; }
.card-actions { display: flex; align-items: center; gap: .9rem; margin-top: .7rem; font-size: .85rem; }
.card-actions form { margin: 0; }

.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty .btn-primary { margin-top: 1rem; }

/* Forms */
.project-form, .card-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card-panel { margin-bottom: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
label { display: block; font-weight: 500; font-size: .85rem; margin-bottom: 1rem; }
.project-form label:last-child { margin-bottom: 0; }
.full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; margin-top: .35rem; padding: .6rem .7rem; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154,123,79,.12); }
textarea { resize: vertical; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }

/* Image manager */
.image-manager { margin-top: 2.5rem; }
.dropzone {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2.5rem 1rem; text-align: center; cursor: pointer; background: var(--panel);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #fffdf8; }
.dz-inner { color: var(--muted); }
.dz-inner strong { color: var(--ink); }
.upload-progress { margin: .75rem 0; }
.upload-row { font-size: .85rem; color: var(--muted); padding: .25rem 0; }

.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.img-tile { position: relative; margin: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f0eee9; border: 2px solid transparent; cursor: grab; }
.img-tile.dragging { opacity: .4; }
.img-tile.is-cover { border-color: var(--accent); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.img-tile figcaption { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: .4rem; opacity: 0; transition: opacity .15s; background: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 40%); }
.img-tile:hover figcaption { opacity: 1; }
.img-tile .star, .img-tile .del {
  border: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: .9rem;
  background: rgba(255,255,255,.92); color: var(--ink); line-height: 1;
}
.img-tile.is-cover .star { background: var(--accent); color: #fff; }
.img-tile .del:hover { background: var(--danger); color: #fff; }
.img-tile.is-cover::after { content: 'Cover'; position: absolute; bottom: .4rem; left: .4rem; background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; text-transform: uppercase; }

/* Slideshow manager — wide tiles since hero images are landscape */
.slide-manager { margin-top: .5rem; }
.slide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.slide-tile { position: relative; margin: 0; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #f0eee9; border: 2px solid transparent; cursor: grab; }
.slide-tile.dragging { opacity: .4; }
.slide-tile.is-hidden { opacity: .5; border-color: var(--line); }
.slide-tile.is-hidden img { filter: grayscale(1); }
.slide-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slide-tile figcaption { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: .5rem; opacity: 0; transition: opacity .15s; background: linear-gradient(to bottom, rgba(0,0,0,.4), transparent); }
.slide-tile:hover figcaption { opacity: 1; }
.slide-tile .toggle { border: none; cursor: pointer; border-radius: 6px; font-size: .72rem; font-weight: 600; padding: .3rem .6rem; background: rgba(255,255,255,.92); color: var(--ink); }
.slide-tile .toggle .off { display: none; }
.slide-tile.is-hidden .toggle .on { display: none; }
.slide-tile.is-hidden .toggle .off { display: inline; }
.slide-tile[data-active="1"] .toggle { background: #2c6e3f; color: #fff; }
.slide-tile .del { border: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: .9rem; background: rgba(255,255,255,.92); color: var(--ink); line-height: 1; }
.slide-tile .del:hover { background: var(--danger); color: #fff; }
.slide-tile .drag-hint { position: absolute; bottom: .45rem; left: .5rem; font-size: .68rem; color: #fff; background: rgba(0,0,0,.45); padding: .1rem .45rem; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.slide-tile:hover .drag-hint { opacity: 1; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: #f3f1ec; }
.login-card { background: #fff; padding: 2.5rem; border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 380px; }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand .mark { font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; font-weight: 600; letter-spacing: .1em; display: block; color: var(--ink); }
.login-brand small { color: var(--muted); letter-spacing: .15em; text-transform: uppercase; font-size: .7rem; }
.login-card h1 { font-size: 1.25rem; text-align: center; margin-bottom: 1.25rem; }
.login-card .btn-primary { width: 100%; text-align: center; margin-top: .5rem; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-top { flex-direction: column; height: auto; padding: .75rem 1rem; gap: .5rem; }
  .admin-top nav { flex-wrap: wrap; gap: .75rem; justify-content: center; }
  .admin-top .who { display: none; }
}
