/* GName Admin — brand-consistent minimal UI */
:root {
  --bg: #f5f5f3;
  --panel: #ffffff;
  --line: #e7e7e4;
  --ink: #121212;
  --muted: #7d7d78;
  --soft: #f0f0ee;
  --danger: #b3423a;
  --ok: #2f7a50;
  --warn: #9a6b1f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -18px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ===== shell ===== */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: #0e0e0e;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .5em;
  margin-bottom: 6px;
  white-space: nowrap;
}
.brand small {
  display: block;
  margin-top: 6px;
  font-size: 8px;
  letter-spacing: .32em;
  color: #ffffff66;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 36px; }
.nav a {
  color: #ffffff99;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .22em;
  padding: 11px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav a:hover { color: #fff; background: #ffffff12; }
.nav a.active { color: #fff; background: #ffffff1c; }
.nav a .count {
  float: right;
  background: #fff;
  color: #111;
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0;
  padding: 1px 7px;
}
.sidebar .foot { margin-top: auto; }
.sidebar .foot button {
  width: 100%;
  background: none;
  border: 1px solid #ffffff2e;
  color: #ffffff99;
  border-radius: 8px;
  padding: 9px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sidebar .foot button:hover { color: #fff; border-color: #ffffff77; }

.main { padding: 34px 40px 80px; max-width: 1240px; }

/* ===== page header ===== */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* ===== panels ===== */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.panel-head .title { font-weight: 600; font-size: 13.5px; }
.panel-body { padding: 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfbfa; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-foot .hint, .hint { color: var(--muted); font-size: 12px; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 9px; border: 1px solid transparent;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  background: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: .85; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--panel); }
.btn-ghost:hover { border-color: #bdbdb8; }
.btn-danger { border-color: #e5c8c5; color: var(--danger); background: var(--panel); }
.btn-danger:hover { border-color: var(--danger); background: #fdf6f5; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ===== forms ===== */
.label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 70px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #111; box-shadow: 0 0 0 3px #11111114; }
.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: #111; cursor: pointer; }
input[type="file"].input { padding: 7px; }
input[type="file"]::file-selector-button {
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
  border-radius: 6px; padding: 5px 10px; margin-right: 10px; font: inherit; font-size: 12px; cursor: pointer;
}

/* ===== table ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafaf8; }
.table a.row-link { font-weight: 600; text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; }
.table .sub { color: var(--muted); font-size: 12px; }

/* ===== bits ===== */
.badge {
  display: inline-block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 99px; padding: 3px 10px; border: 1px solid var(--line); color: var(--muted); background: #fff;
  white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: #cfe4d7; background: #f3faf6; }
.badge-warn { color: var(--warn); border-color: #ecdcbb; background: #fdf8ec; }
.badge-dark { color: #fff; border-color: #111; background: #111; }

.thumb { width: 116px; height: 76px; object-fit: cover; border-radius: 8px; background: var(--soft); display: block; }
.thumb-ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }

.flash {
  background: #f0f8f3; border: 1px solid #cfe4d7; color: var(--ok);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 18px; font-size: 13px;
}
.error-text { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 34px; text-align: center; }

/* gallery tiles */
.gallery { display: flex; flex-wrap: wrap; gap: 14px; }
.tile { width: 168px; }
.tile .img, .tile img { width: 168px; height: 112px; object-fit: cover; border-radius: 9px; background: var(--soft); }
.tile .img { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--line); }
.tile .img.err { color: var(--danger); border-color: #e5c8c5; }
.tile .row { display: flex; gap: 6px; margin-top: 8px; }
.tile .row form { flex: 1; display: flex; }
.tile .row .btn { width: 100%; justify-content: center; }
.tile .cover-mark {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ok);
  border: 1px solid #cfe4d7; background: #f3faf6; border-radius: 7px; padding: 6px 0; flex: 1; text-align: center;
}

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0e0e0e; }
.login-card { width: 340px; background: #fff; border-radius: 14px; padding: 34px 30px 30px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.login-card .wordmark { text-align: center; letter-spacing: .5em; font-weight: 300; font-size: 16px; margin-bottom: 4px; }
.login-card .wordsub { text-align: center; font-size: 8.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }

/* content editor rows */
.text-key { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; background: var(--soft); border-radius: 6px; padding: 2px 8px; }
.updated-at { color: var(--muted); font-size: 12px; }

/* leads */
.lead-msg { white-space: pre-wrap; max-width: 520px; }
tr.unread td { background: #fffdf4; }

/* ===== responsive ===== */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 18px; padding: 14px 18px; }
  .brand small { display: none; }
  .nav { flex-direction: row; margin: 0; flex: 1; }
  .nav a { padding: 8px 10px; }
  .sidebar .foot { margin: 0; }
  .main { padding: 20px 16px 60px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}
