/* ===== Sticky Poster — Admin theme (white · red · black) ===== */
:root {
  --red: #e21f26;
  --red-dark: #b8161c;
  --red-tint: #fdecec;
  --ink: #161616;
  --grey: #6b6b6f;
  --line: #e4e4e7;
  --sand: #f4f4f5;
  --paper: #ffffff;
  --head: 'Poppins', sans-serif;
  --body: 'Inter', sans-serif;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
body { font-family: var(--body); color: var(--ink); background: var(--sand); }
h1, h2, h3, h4, h5, h6, .font-head { font-family: var(--head); }
a { text-decoration: none; }

/* ---------- Buttons / forms ---------- */
.btn-red { background: var(--red); border: 1px solid var(--red); color: #fff; font-weight: 600; border-radius: 8px; padding: .55rem 1.1rem; font-size: .9rem; }
.btn-red:hover, .btn-red:focus { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-ink { background: var(--ink); border: 1px solid var(--ink); color: #fff; font-weight: 600; border-radius: 8px; padding: .55rem 1.1rem; font-size: .9rem; }
.btn-ink:hover { background: #000; color: #fff; }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; border-radius: 8px; padding: .5rem 1rem; font-size: .9rem; }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.text-red { color: var(--red) !important; }

.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .35rem; }
.form-label .req { color: var(--red); }
.form-control, .form-select { border-radius: 8px; border-color: var(--line); font-size: .92rem; padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--red); box-shadow: 0 0 0 .2rem rgba(226, 31, 38, .15); }
.form-control-color { padding: .25rem; height: 42px; width: 100%; }
.form-check-input:checked { background-color: var(--red); border-color: var(--red); }
.form-check-input:focus { border-color: var(--red); box-shadow: 0 0 0 .2rem rgba(226, 31, 38, .15); }
.input-group-text { background: var(--sand); border-color: var(--line); color: var(--grey); font-size: .88rem; }
.form-text { font-size: .75rem; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.pin-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--sand); display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.logo-text { font-family: var(--head); font-weight: 800; font-size: 1.15rem; line-height: 1; letter-spacing: -.3px; display: block; }
.logo-text .accent { color: var(--red); }
.logo-sub { display: block; font-family: var(--head); font-size: 1.15rem; font-weight: 700; letter-spacing: -.3px; margin-top: -2px; }
.admin-tag { font-size: .62rem; font-weight: 700; letter-spacing: .12em; background: var(--ink); color: #fff; padding: .12rem .45rem; border-radius: 4px; margin-left: .3rem; vertical-align: middle; }

/* ---------- Login ---------- */
.login-side {
  background: var(--ink) url(../design/img/wall-bg.jpg) center/cover;
  position: relative; color: #fff;
}
.login-side::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0, 0, 0, .78), rgba(120, 10, 14, .85)); }
.login-side > * { position: relative; z-index: 1; }
.mini-poster {
  position: absolute; width: 130px; aspect-ratio: 3/4; border-radius: 6px; box-shadow: 8px 12px 26px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: .6rem;
  font-family: var(--head); font-weight: 800; font-size: .95rem; line-height: 1.15; color: #fff;
}
.mini-poster.p1 { background: linear-gradient(160deg, #e21f26, #7a0f13); top: 9%; left: 9%; transform: rotate(-7deg); color: #ffd400; }
.mini-poster.p2 { background: linear-gradient(160deg, #2b2f77, #12142e); top: 7%; right: 8%; transform: rotate(6deg); }
.mini-poster.p3 { background: linear-gradient(160deg, #ffd400, #e8a900); bottom: 9%; left: 22%; transform: rotate(-3deg); color: #12142e; }
.login-card { max-width: 400px; width: 100%; }
.login-hint { background: var(--sand); border: 1px dashed var(--line); border-radius: 8px; padding: .65rem .85rem; font-size: .8rem; color: var(--grey); }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: #fff; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.1rem .9rem; overflow-y: auto; }
.nav-section { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--grey); text-transform: uppercase; margin: 1.3rem .7rem .4rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 8px; color: var(--grey); font-weight: 500; font-size: .9rem; }
.side-link:hover { background: var(--sand); color: var(--ink); }
.side-link.active { background: var(--ink); color: #fff; font-weight: 600; }
.side-link.active i { color: var(--red); }
.side-link i { font-size: 1.05rem; }
.side-foot { margin-top: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.content { padding: 1.6rem; flex: 1; }
@media (max-width: 575.98px) { .content { padding: 1rem; } .topbar { padding: .7rem 1rem; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-head p { margin: 0; color: var(--grey); font-size: .9rem; }

/* ---------- Cards ---------- */
.card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-box .card-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-box .card-head h2 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-box .card-head h2 i { color: var(--red); }
.card-box .card-body-pad { padding: 1.25rem; }

.stat { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: 1rem; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: 0 0 48px; }
.stat-icon.red { background: var(--red-tint); color: var(--red); }
.stat-icon.ink { background: var(--ink); color: #fff; }
.stat-icon.gray { background: var(--sand); color: var(--ink); }
.stat .num { font-family: var(--head); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { font-size: .8rem; color: var(--grey); }

/* Horizontal bars (pure CSS) */
.hbar { margin-bottom: .95rem; }
.hbar .top { display: flex; justify-content: space-between; font-size: .84rem; margin-bottom: .3rem; }
.hbar .track { height: 9px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: var(--red); }
.hbar:nth-child(even) .fill { background: var(--ink); }

/* ---------- Table ---------- */
.table-admin { margin: 0; font-size: .88rem; }
.table-admin thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); background: var(--sand); border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; padding: .75rem 1rem; }
.table-admin td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--line); }
.thumb { width: 42px; height: 56px; border-radius: 5px; background-size: cover; background-position: center; border: 1px solid var(--line); flex: 0 0 42px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-s { padding: .3rem .65rem; border-radius: 99px; font-size: .72rem; font-weight: 600; display: inline-block; }
.badge-active { background: var(--ink); color: #fff; }
.badge-draft { background: var(--sand); color: var(--grey); border: 1px solid var(--line); }
.badge-expired { background: var(--red-tint); color: var(--red-dark); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-grid; place-items: center; font-size: .9rem; }
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--grey); }
.empty i { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* ---------- Poster form ---------- */
.sec-num { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; flex: 0 0 26px; }
.upload-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 1.4rem 1rem; text-align: center; cursor: pointer; color: var(--grey); transition: .2s; background: var(--sand); }
.upload-zone:hover, .upload-zone.drag { border-color: var(--red); color: var(--red); background: var(--red-tint); }
.upload-zone i { font-size: 1.8rem; display: block; }
.branch-row { background: var(--sand); border: 1px solid var(--line); border-radius: 10px; padding: .85rem; margin-bottom: .7rem; }

.preview-sticky { position: sticky; top: 84px; }
.poster-card { display: block; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); max-width: 230px; margin: 0 auto; }
.poster-art { aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; text-align: center; padding: .8rem; font-family: var(--head); font-weight: 800; font-size: 1.15rem; line-height: 1.15; color: var(--poster-fg, #fff); position: relative; overflow: hidden; }
.poster-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-foot { display: flex; align-items: center; justify-content: space-between; padding: .5rem .65rem; font-size: .82rem; font-weight: 600; background: #fff; }
.b-dot { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: .7rem; display: grid; place-items: center; font-weight: 700; }

.sticky-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: .85rem 1.25rem; display: flex; gap: .6rem; justify-content: flex-end; border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }

.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; }

/* ---------- Keyword tags ---------- */
.tag-box { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .5rem; background: #fff; cursor: text; min-height: 44px; }
.tag-box:focus-within { border-color: var(--red); box-shadow: 0 0 0 .2rem rgba(226, 31, 38, .15); }
.tag-box input { border: 0; outline: 0; flex: 1; min-width: 160px; font-size: .92rem; padding: .2rem .3rem; background: transparent; }
.tag { background: var(--ink); color: #fff; border-radius: 99px; font-size: .8rem; font-weight: 500; padding: .25rem .35rem .25rem .75rem; display: inline-flex; align-items: center; gap: .3rem; }
.tag button { border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 18px; height: 18px; border-radius: 50%; line-height: 1; font-size: .85rem; padding: 0; }
.tag button:hover { background: var(--red); }
