/* ============================================================
   ZEE RENDERS — Admin / CMS dashboard styles
   ============================================================ */

:root {
  --a-bg: #0a0a0a;
  --a-panel: #101010;
  --a-panel-2: #151515;
  --a-border: rgba(255,255,255,0.1);
  --a-accent: #d8d0c4;
}

.admin-body { background: var(--a-bg); color: #fff; font-family: var(--font-body); min-height: 100vh; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-visual { position: relative; overflow: hidden; }
.login-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55) saturate(0.9); }
.login-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(8,8,8,0.4), rgba(8,8,8,0.85)); }
.login-visual .lv-text { position: absolute; bottom: 3rem; left: 3rem; z-index: 2; }
.login-visual .lv-text h2 { font-family: var(--font-head); font-size: 2.5rem; font-weight: 700; text-transform: uppercase; line-height: 1; }
.login-visual .lv-text p { color: var(--muted); margin-top: 0.8rem; max-width: 30ch; }

.login-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card {
  width: 100%; max-width: 400px;
  background: rgba(20,20,20,0.6); backdrop-filter: blur(20px);
  border: 1px solid var(--a-border); padding: 3rem 2.5rem;
}
.login-card .brand { display: block; margin-bottom: 2.5rem; font-size: 1.1rem; }
.login-card h1 { font-family: var(--font-head); font-size: 1.6rem; margin-bottom: 0.5rem; }
.login-card .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 0; bottom: 0.8rem; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pw-toggle:hover { color: var(--a-accent); }
.panel-hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.4rem; line-height: 1.6; }
.afield label .opt { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
.login-error { background: rgba(224,90,90,0.12); border-left: 2px solid #e05a5a; padding: 0.8rem 1rem; font-size: 0.85rem; margin-bottom: 1.5rem; display: none; }
.login-error.show { display: block; }

/* ---------- Shell ---------- */
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--a-panel); border-right: 1px solid var(--a-border); padding: 1.8rem 1.2rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { font-size: 1rem; margin-bottom: 2.5rem; padding: 0 0.6rem; }
.side-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0.8rem; color: var(--muted); font-size: 0.88rem; border-radius: 4px; transition: background 0.25s, color 0.25s; }
.side-nav a .ic { width: 18px; text-align: center; opacity: 0.8; }
.side-nav a:hover { background: var(--a-panel-2); color: #fff; }
.side-nav a.active { background: var(--a-accent); color: #000; font-weight: 600; }
.side-nav a.active .ic { opacity: 1; }
.side-foot { border-top: 1px solid var(--a-border); padding-top: 1rem; margin-top: 1rem; }
.side-foot .logout { color: #e0918f; }

.admin-main { padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem); overflow-x: hidden; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; gap: 1rem; flex-wrap: wrap; }
.admin-topbar h1 { font-family: var(--font-head); font-size: 1.8rem; }
.admin-topbar .who { color: var(--muted); font-size: 0.85rem; }
.admin-topbar .who b { color: var(--a-accent); }

/* mobile sidebar toggle */
.admin-menu-btn { display: none; }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--a-panel); border: 1px solid var(--a-border); padding: 1.6rem; }
.stat-card .n { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; line-height: 1; }
.stat-card .l { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; margin-top: 0.6rem; }
.stat-card.accent { border-color: var(--a-accent); }
.stat-card.accent .n { color: var(--a-accent); }

.panel { background: var(--a-panel); border: 1px solid var(--a-border); padding: 1.8rem; margin-bottom: 1.8rem; }
.panel h2 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 1.4rem; display: flex; justify-content: space-between; align-items: center; }
.panel-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--a-border); }
.tbl td { padding: 0.85rem 0.8rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:hover td { background: var(--a-panel-2); }
.tbl .thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; background: #222; }
.tbl-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.badge { display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--a-border); border-radius: 3px; }
.badge.pub { color: #6cc48f; border-color: rgba(108,196,143,0.4); }
.badge.draft { color: #d8b96c; border-color: rgba(216,185,108,0.4); }
.badge.feat { color: var(--a-accent); border-color: rgba(216,208,196,0.4); }
.badge.new { color: #6ca8e0; border-color: rgba(108,168,224,0.4); }

/* ---------- Admin buttons ---------- */
.abtn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; font-size: 0.78rem; font-weight: 500; border: 1px solid var(--a-border); background: transparent; color: #fff; transition: background 0.25s, color 0.25s, border-color 0.25s; border-radius: 4px; }
.abtn:hover { background: var(--a-panel-2); }
.abtn.primary { background: var(--a-accent); color: #000; border-color: var(--a-accent); font-weight: 600; }
.abtn.primary:hover { background: #fff; }
.abtn.danger { color: #e0918f; border-color: rgba(224,90,90,0.3); }
.abtn.danger:hover { background: rgba(224,90,90,0.12); }
.abtn.sm { padding: 0.4rem 0.7rem; font-size: 0.72rem; }

/* ---------- Forms ---------- */
.afield { margin-bottom: 1.3rem; }
.afield label { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.afield input, .afield textarea, .afield select {
  width: 100%; background: var(--a-bg); border: 1px solid var(--a-border); color: #fff;
  padding: 0.75rem 0.9rem; font-size: 0.9rem; border-radius: 4px; transition: border-color 0.25s;
}
.afield input:focus, .afield textarea:focus, .afield select:focus { outline: none; border-color: var(--a-accent); }
.afield textarea { resize: vertical; min-height: 90px; }
.afield .hint { color: var(--muted); font-size: 0.72rem; margin-top: 0.4rem; }
.afield select option { background: var(--a-panel); }
.afield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: #fff; }

.search-bar { display: flex; gap: 0.7rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.search-bar input, .search-bar select { background: var(--a-panel); border: 1px solid var(--a-border); color: #fff; padding: 0.6rem 0.9rem; border-radius: 4px; font-size: 0.85rem; }
.search-bar input { flex: 1; min-width: 200px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding: 3rem 1rem; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--a-panel); border: 1px solid var(--a-border); width: 100%; max-width: 720px; padding: 2.2rem; border-radius: 6px; }
.modal-lg { max-width: 900px; }
.modal h2 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 1.6rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid var(--a-border); }

/* confirm dialog */
.confirm-box { max-width: 440px; text-align: left; }
.confirm-box p { color: var(--muted); margin-bottom: 0.5rem; }

/* activity list */
.activity-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.85rem; }
.activity-item .act { color: #fff; } .activity-item .time { color: var(--muted); white-space: nowrap; font-size: 0.78rem; }
.activity-item .res-ok { color: #6cc48f; } .activity-item .res-fail { color: #e05a5a; }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.media-tile { background: var(--a-panel); border: 1px solid var(--a-border); border-radius: 5px; overflow: hidden; position: relative; }
.media-tile .mt-img { aspect-ratio: 4/3; background: #1a1a1a; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-tile .mt-img img, .media-tile .mt-img video { width: 100%; height: 100%; object-fit: cover; }
.media-tile .mt-info { padding: 0.6rem 0.7rem; }
.media-tile .mt-info .fn { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile .mt-actions { display: flex; gap: 0.3rem; margin-top: 0.5rem; }
.dropzone { border: 2px dashed var(--a-border); border-radius: 6px; padding: 2.5rem; text-align: center; color: var(--muted); cursor: pointer; transition: border-color 0.25s, background 0.25s; margin-bottom: 1.5rem; }
.dropzone:hover, .dropzone.drag { border-color: var(--a-accent); background: var(--a-panel-2); color: #fff; }
.dropzone-sm { padding: 1.2rem; margin-bottom: 0.7rem; }
.dropzone-sm p { margin: 0.15rem 0; font-size: 0.85rem; }
.dropzone .dz-link { color: var(--a-accent); text-decoration: underline; }
.dropzone .dz-hint { font-size: 0.72rem; opacity: 0.7; }
.dropzone.busy { opacity: 0.6; pointer-events: none; }

/* inline image upload for single fields (thumbnail / hero) */
.img-upload-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.img-upload-status { font-size: 0.75rem; color: var(--muted); }
.img-preview { margin-top: 0.6rem; }
.img-preview img { max-width: 140px; max-height: 90px; border-radius: 4px; border: 1px solid var(--a-border); object-fit: cover; }

.empty-state { text-align: center; padding: 3rem; color: var(--muted); }

/* welcome banner */
.welcome-banner { background: linear-gradient(120deg, var(--a-panel), var(--a-panel-2)); border: 1px solid var(--a-accent); padding: 1.6rem 1.8rem; margin-bottom: 2rem; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.welcome-banner h3 { font-family: var(--font-head); margin-bottom: 0.3rem; }
.welcome-banner p { color: var(--muted); font-size: 0.88rem; max-width: 52ch; }

/* gallery chips in project editor */
.gallery-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.gchip { position: relative; width: 90px; height: 68px; border-radius: 4px; overflow: hidden; border: 1px solid var(--a-border); }
.gchip img { width: 100%; height: 100%; object-fit: cover; }
.gchip button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,0.7); color: #fff; border-radius: 50%; font-size: 0.8rem; line-height: 1; }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 2000; width: 260px; transform: translateX(-100%); transition: transform 0.4s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .admin-menu-btn { display: inline-flex; }
  .panel-2col { grid-template-columns: 1fr; }
  .afield-row { grid-template-columns: 1fr; }
}
