/* IBN7 INDIA — admin panel */

:root {
  --red: #c8102e;
  --red-dark: #a00d25;
  --ink: #16162a;
  --gray: #5c5c6e;
  --line: #e6e6ec;
  --canvas: #f4f4f7;
  --card: #fff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(22, 22, 42, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Mukta', -apple-system, 'Segoe UI', sans-serif; background: var(--canvas); color: var(--ink); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
code { background: #eee; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* ----- shell ----- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #cfcfdd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: block; padding: 18px 16px 14px; background: #fff; }
.side-brand img { height: 48px; width: auto; }
.side nav { flex: 1; padding: 14px 0; display: flex; flex-direction: column; }
.side nav a { padding: 11px 18px; font-weight: 600; font-size: 15px; border-left: 3px solid transparent; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.on { background: rgba(200, 16, 46, .22); color: #fff; border-left-color: var(--red); }
.badge { background: var(--red); color: #fff; border-radius: 20px; font-size: 12px; padding: 0 8px; margin-left: 4px; }
.side-foot { padding: 14px 18px 20px; border-top: 1px solid #2b2b47; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.side-foot a:hover { color: #fff; }
.body { padding: 26px 30px 50px; min-width: 0; }

/* ----- page head / stats ----- */
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead h1 { font-size: 24px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; border-top: 3px solid var(--red); }
.stat-hot { background: #fdecee; }
.stat-n { display: block; font-size: 26px; font-weight: 800; color: var(--ink); }
.stat-l { color: var(--gray); font-size: 13.5px; font-weight: 600; }

/* ----- panels / tables ----- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--gray); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; padding: 7px 8px; border-bottom: 2px solid var(--line); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.t-title a:hover { color: var(--red); }
.t-thumb { width: 58px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.t-date { white-space: nowrap; color: var(--gray); }
.t-actions { display: flex; gap: 6px; align-items: center; }
.t-actions form { display: inline; }
.t-empty { text-align: center; color: var(--gray); padding: 20px; }
.t-order form { display: flex; gap: 3px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.pill-ok { background: #e7f6ec; color: #0a7a2f; }
.pill-mut { background: #eee; color: #666; }
.pill-hot { background: var(--red); color: #fff; }
.pill-feat { background: #fff3d6; color: #9a6b00; }

.mini { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 9px; font-size: 13px; cursor: pointer; font-family: inherit; }
.mini:hover { border-color: var(--red); color: var(--red); }
.mini:disabled { opacity: .35; cursor: default; }
.mini-del:hover { background: var(--red); color: #fff; border-color: var(--red); }

.toplist { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.toplist li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.toplist .rank { flex: none; width: 26px; height: 26px; background: var(--red); color: #fff; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; align-self: flex-start; }
.toplist a { flex: 1; font-weight: 600; }
.toplist a:hover { color: var(--red); }
.toplist .views { color: var(--gray); font-size: 12.5px; white-space: nowrap; }

/* ----- forms ----- */
.form-edit { display: flex; flex-direction: column; gap: 15px; }
.form-edit label, .login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.form-edit input[type=text], .form-edit input[type=url], .form-edit input[type=email], .form-edit input[type=password],
.form-edit textarea, .form-edit select, .filters input, .filters select,
.login-card input, .inline-edit input {
  border: 2px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 14.5px; outline: none; background: #fff; width: 100%;
}
.form-edit input:focus, .form-edit textarea:focus, .form-edit select:focus, .login-card input:focus { border-color: var(--red); }
.form-edit textarea { line-height: 1.8; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.check input { width: auto !important; }
.flags { display: flex; flex-direction: column; gap: 8px; background: var(--canvas); border-radius: 8px; padding: 14px 16px; }
.upload-box { background: var(--canvas); border-radius: 8px; padding: 14px 16px; }
.upload-box input[type=file] { border: 0; padding: 6px 0; background: none; }
.preview { margin-top: 10px; }
.preview img { max-height: 140px; border-radius: 8px; display: block; margin-bottom: 8px; }
.form-actions { display: flex; gap: 10px; }
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filters input { max-width: 260px; }
.filters select { max-width: 200px; width: auto; }
.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit input { min-width: 130px; }
.hint { margin-top: 14px; font-size: 13.5px; color: var(--gray); background: var(--canvas); border-radius: 8px; padding: 10px 14px; }

.btn { display: inline-block; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; padding: 10px 22px; border-radius: 8px; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--red-dark); }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-ghost { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn-ghost:hover { background: #fdecee; }
.btn-full { width: 100%; }

.alert { border-radius: 8px; padding: 11px 15px; margin-bottom: 16px; font-weight: 600; font-size: 14.5px; }
.alert-ok { background: #e7f6ec; color: #0a7a2f; border: 1px solid #bfe6cc; }
.alert-err { background: #fdecee; color: var(--red-dark); border: 1px solid #f5c6cd; }

/* ----- messages ----- */
.msg-new { border-left: 4px solid var(--red); }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.msg-meta { color: var(--gray); font-size: 13px; }
.msg-sub { font-weight: 700; font-size: 14.5px; margin: 4px 0; }
.msg-body { font-size: 14.5px; margin: 6px 0 12px; }
.msg-actions { display: flex; gap: 8px; align-items: center; }
.msg-actions form { display: inline; }

/* ----- login ----- */
.login-page { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, var(--ink), #2c2c4d); padding: 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 34px 32px 26px; width: 100%; max-width: 400px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); text-align: center; }
.login-logo { height: 62px; width: auto; margin: 0 auto 12px; }
.login-card h1 { font-size: 22px; margin-bottom: 2px; }
.login-card .sub { color: var(--gray); font-size: 14px; margin-bottom: 18px; }
.login-card form { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.login-card .back { display: inline-block; margin-top: 16px; color: var(--gray); font-size: 13.5px; }
.login-card .back:hover { color: var(--red); }

/* ----- responsive ----- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { padding: 10px 14px; } .side-brand img { height: 36px; }
  .side nav { flex-direction: row; flex-wrap: wrap; padding: 0; flex: 1; }
  .side nav a { padding: 10px 12px; font-size: 13.5px; border-left: 0; }
  .side-foot { flex-direction: row; border-top: 0; margin-left: auto; }
  .body { padding: 18px 14px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}

.pager { display: flex; gap: 8px; flex-wrap: wrap; }
.pager a, .pager .cur { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pager .cur { background: var(--red); color: #fff; border-color: var(--red); }
