:root{
  --bg: #f7f8fb;
  --card: #ffffff;
  --card-2:#ffffff;
  --text:#0b1020;
  --muted:#5b6476;
  --accent:#0b1020;
  --accent-2:#0b1020; /* keep primary buttons black */
  --ok:#16a34a;
  --danger:#dc2626;
  --border:#e6e9ef;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 8px 20px rgba(11,16,32,.06);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color:var(--text);
}
.hidden{display:none !important;}
#app{min-height:100vh;}

/* ---------- TOPBAR ---------- */
.topbar{
  position:sticky; top:0; z-index:5;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 18px; background:rgba(255,255,255,.98);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; align-items:center;}
.brand-logo{height:44px; width:auto; display:block;}
.header-actions{display:flex; gap:8px; align-items:center;}

/* ---------- LAYOUT ---------- */
.container{
  max-width:1160px;
  margin:16px auto;
  padding:0 14px;
  display:grid;
  gap:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:16px;
  box-shadow:var(--shadow);
}

.row{display:flex; align-items:center;}
.center{align-items:center;}
.space-between{justify-content:space-between;}
.right{justify-content:flex-end;}
.gap{gap:10px;}
.wrap{flex-wrap:wrap;}
.grow{flex:1; min-width:200px;}
.full{width:100%;}

/* ---------- AUTH PILLS ---------- */
.auth-area{display:flex; gap:8px; align-items:center;}
.pill{
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:#f1f3f7;
  color:var(--text);
}
.pill.admin{
  border-color:#cbd5e1;
  background:#0b1020;
  color:#fff;
}

/* ---------- BUTTONS ---------- */
.btn{
  background:#fff;
  color:var(--text);
  border:1px solid var(--border);
  padding:9px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition:.12s transform, .12s background, .12s border-color, .12s box-shadow;
  text-decoration:none;
  display:inline-flex;
  gap:8px;
  align-items:center;
  justify-content:center;
}
.btn:hover{transform:translateY(-1px); border-color:#cfd6e3; box-shadow:0 6px 14px rgba(11,16,32,.06);}
.btn.primary{
  background:#0b1020;
  color:#fff;
  border:1px solid #0b1020;
}
.btn.primary:hover{filter:brightness(1.06);}
.btn.ghost{background:transparent;}
.icon-btn{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
  width:34px; height:34px;
  border-radius:8px;
  cursor:pointer;
}

/* ---------- FORMS ---------- */
.form{display:grid; gap:10px; margin-top:8px;}
label{display:grid; gap:6px; font-size:13px; color:var(--muted);}
input, textarea, .select{
  background:#fff;
  color:var(--text);
  border:1px solid var(--border);
  padding:10px 11px;
  border-radius:10px;
  outline:none;
  min-height:40px;
}
input::placeholder, textarea::placeholder{color:#9aa3b2;}
input:focus, textarea:focus, .select:focus{
  border-color:#0b1020;
  box-shadow:0 0 0 3px rgba(11,16,32,.08);
}
.search{flex:1; font-size:15px;}

.dropzone{
  display:flex; gap:10px; align-items:center;
  border:2px dashed #cfd6e3;
  padding:14px;
  border-radius:12px;
  cursor:pointer;
  background:#fbfcfe;
}
.dropzone:hover{border-color:#0b1020;}
.dropzone input{display:none;}

.progress{
  height:8px;
  background:#eef1f6;
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--border);
}
.progress .bar{height:100%; width:0%; background:var(--ok);} 

/* ---------- TAGS ---------- */
.tags-row{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px;}
.tag{
  font-size:12px;
  padding:5px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#f1f3f7;
  color:var(--text);
  cursor:pointer;
  user-select:none;
}
.tag.active{
  background:#0b1020;
  color:#fff;
  border-color:#0b1020;
}

/* ---------- GRID / CARDS ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap:12px;
}
.item{
  padding:14px;
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
  background:#fff;
  display:grid;
  gap:8px;
  min-height:175px;
}
.item h3{margin:0; font-size:16px; letter-spacing:.1px;}
.item .desc{color:var(--muted); font-size:13px; line-height:1.45; max-height:3.8em; overflow:hidden;}
.item .meta{color:var(--muted); font-size:12px;}
.item .actions{display:flex; flex-wrap:wrap; gap:6px; margin-top:auto;}
.badge{
  font-size:11px;
  padding:3px 7px;
  border-radius:6px;
  border:1px solid var(--border);
  background:#f1f3f7;
  color:var(--text);
  width:max-content;
}

/* ---------- MODALS ---------- */
.modal{position:fixed; inset:0; display:grid; place-items:center; z-index:20;}
.modal-backdrop{position:absolute; inset:0; background:rgba(11,16,32,.55);} 
.modal-card{
  position:relative;
  width:min(1000px,95vw);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:var(--shadow);
}
.modal-card.small{width:min(520px,95vw);}
.preview-wrap{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  height:min(70vh,700px);
  display:grid; place-items:center;
}
.preview-wrap iframe{width:100%; height:100%; border:0; background:#fff;}
.preview-wrap .video{width:100%; aspect-ratio:16/9; border:0;}

/* ---------- FOOTER ---------- */
.footer{padding:24px; text-align:center;}
.tiny{font-size:12px;}
.muted{color:var(--muted);}

.lang-select{min-width:120px;}

@media (max-width: 640px){
  .topbar{padding:10px 12px;}
  .brand-logo{height:36px;}
  .container{margin:10px auto; gap:10px;}
  .card{padding:12px;}
  .item{min-height:auto;}
}
