/* ============================================
   অ্যাডমিন প্যানেল স্টাইলশিট
   ============================================ */

:root {
  --paper: #faf9f6;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --red: #b3121f;
  --red-dark: #8c0e18;
  --line: #e7e2da;
  --white: #fff;
  --green: #15803d;
  --serif: 'Noto Serif Bengali', serif;
  --sans: 'Noto Sans Bengali', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.7; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}

.brand-mark { width: 12px; height: 12px; background: var(--red); transform: rotate(45deg); display: inline-block; flex: none; }

/* ---------- লেআউট ---------- */
.admin-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.admin-side { background: var(--ink); color: #d6d3d1; padding: 20px 0; }
.admin-brand { display: flex; gap: 10px; align-items: center; padding: 0 20px 20px; border-bottom: 1px solid #34302c; }
.admin-brand strong { color: #fff; font-family: var(--serif); font-size: 17px; display: block; line-height: 1.4; }
.admin-brand small { font-size: 12px; color: #a8a29e; }
.admin-nav { display: flex; flex-direction: column; padding-top: 12px; }
.admin-nav a { padding: 10px 20px; font-size: 14.5px; }
.admin-nav a:hover, .admin-nav a.active { background: var(--red); color: #fff; }
.admin-nav a.logout { margin-top: 16px; border-top: 1px solid #34302c; color: #f3a6ac; }

.admin-main { display: flex; flex-direction: column; }
.admin-top {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 12px 24px; font-size: 14px;
  display: flex; align-items: center; gap: 12px;
}
.side-toggle { display: none; background: none; border: 1px solid var(--line); padding: 4px 10px; font-size: 16px; cursor: pointer; }
.admin-content { padding: 24px; max-width: 1100px; width: 100%; }

.page-title { font-family: var(--serif); font-size: 24px; font-weight: 800; margin-bottom: 18px; }

/* ---------- স্ট্যাট কার্ড ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  padding: 16px; text-align: center; font-size: 13.5px; color: var(--ink-soft);
}
.stat-num { display: block; font-family: var(--serif); font-size: 28px; font-weight: 800; color: var(--ink); }

/* ---------- প্যানেল / টেবিল ---------- */
.panel { background: var(--white); border: 1px solid var(--line); padding: 18px; margin-bottom: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2, .panel-h { font-family: var(--serif); font-size: 18px; font-weight: 800; }
.panel-h { margin-bottom: 12px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: right; background: var(--paper);
  padding: 9px 10px; border-bottom: 2px solid var(--line); font-weight: 600;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: #fcfbf8; }
.data-table a:hover { color: var(--red); }

.badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; color: #fff; }
.badge.green { background: var(--green); }
.badge.gray { background: #78716c; }

.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline; }

/* ---------- বাটন ---------- */
.btn-primary, .btn-secondary, .btn-small {
  display: inline-block; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
}
.btn-primary { background: var(--red); color: #fff; padding: 9px 20px; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary.full { width: 100%; }
.btn-secondary { background: var(--white); border: 1px solid var(--line); color: var(--ink); padding: 8px 18px; }
.btn-secondary:hover { border-color: var(--ink); }
.btn-small { font-size: 12.5px; padding: 4px 12px; background: var(--paper); border: 1px solid var(--line); }
.btn-small:hover { border-color: var(--ink); }
.btn-small.danger { color: var(--red); border-color: #f1c6c9; }
.btn-small.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- ফর্ম ---------- */
.form-panel label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.form-panel input[type="text"],
.form-panel input[type="number"],
.form-panel input[type="password"],
.form-panel input[type="file"],
.form-panel select,
.form-panel textarea {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 12px; border: 1px solid var(--line);
  font-family: var(--sans); font-size: 15px; background: var(--paper);
  font-weight: 400;
}
.form-panel textarea { line-height: 1.9; resize: vertical; }
.form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-row { display: flex; gap: 24px; flex-wrap: wrap; margin: 4px 0 16px; }
.check { font-weight: 500 !important; display: flex !important; align-items: center; gap: 8px; margin-bottom: 0 !important; }
.check input { width: auto !important; display: inline !important; margin: 0 !important; }
.form-foot { display: flex; gap: 10px; align-items: center; }
.form-panel.narrow { max-width: 460px; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 14px; }
.current-img { margin-bottom: 16px; }
.current-img img { max-width: 220px; border: 1px solid var(--line); margin-bottom: 4px; }
.current-img small { color: var(--ink-soft); font-size: 12.5px; }

.filter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-form input, .filter-form select {
  padding: 7px 12px; border: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px; background: var(--paper);
}

.cat-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }

/* ---------- অ্যালার্ট ---------- */
.alert { padding: 11px 16px; margin-bottom: 16px; font-size: 14px; border-right: 4px solid; }
.alert.error { background: #fdf0f1; border-color: var(--red); color: var(--red-dark); }
.alert.success { background: #f0fdf4; border-color: var(--green); color: var(--green); }

/* ---------- লগইন পেজ ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--ink); padding: 16px;
}
.login-card {
  background: var(--white); width: 100%; max-width: 380px;
  padding: 32px 28px; border-top: 5px solid var(--red);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand h1 { font-family: var(--serif); font-size: 26px; font-weight: 800; margin-top: 10px; }
.login-brand p { color: var(--ink-soft); font-size: 13.5px; }
.login-card label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.login-card input {
  display: block; width: 100%; margin-top: 5px;
  padding: 10px 12px; border: 1px solid var(--line);
  font-family: var(--sans); font-size: 15px; background: var(--paper);
}
.login-card input:focus { border-color: var(--red); }
.login-foot { text-align: center; margin-top: 18px; font-size: 13.5px; }
.login-foot a:hover { color: var(--red); }

/* ---------- রেসপনসিভ ---------- */
@media (max-width: 860px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-side.open { display: block; }
  .side-toggle { display: block; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ===== ভার্সন ২ অ্যাডমিন ===== */
.nav-section { display:block; padding:14px 18px 4px; font-size:11px; letter-spacing:.06em; color:#a8a29e; text-transform:uppercase; }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.tabs a { background:#fff; border:1px solid var(--line, #e7e5e4); padding:7px 16px; border-radius:6px; font-size:13.5px; font-weight:600; color:inherit; text-decoration:none; }
.tabs a.current { background:var(--red, #b91c1c); border-color:var(--red, #b91c1c); color:#fff; }
.tabs a.trash-tab { margin-right:auto; }
.badge.orange { background:#ffedd5; color:#9a3412; }
.badge.red { background:#fee2e2; color:#991b1b; }
.btn-small.approve { background:#dcfce7; border-color:#86efac; color:#166534; }
.btn-small.approve:hover { background:#16a34a; border-color:#16a34a; color:#fff; }
.alert.info { background:#e0f2fe; border:1px solid #7dd3fc; color:#075985; }
.form-grid { display:grid; grid-template-columns:1fr 320px; gap:18px; align-items:start; }
.form-col-side { position:sticky; top:14px; display:grid; gap:14px; }
.check-col { display:grid; gap:8px; margin-bottom:14px; }
.gallery-admin { display:grid; grid-template-columns:repeat(auto-fill, minmax(110px, 1fr)); gap:10px; margin-bottom:14px; }
.g-item { display:block; border:1px solid var(--line, #e7e5e4); border-radius:6px; padding:6px; font-size:12px; text-align:center; cursor:pointer; }
.g-item img { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:4px; margin-bottom:4px; }
.btn-secondary.full.center, .btn-secondary.full { display:block; width:100%; text-align:center; box-sizing:border-box; margin-top:8px; }
.hint code { background:#f5f5f4; padding:2px 8px; border-radius:4px; }
.sep { border:0; border-top:1px solid var(--line, #e7e5e4); margin:16px 0; }
.user-cell { display:flex; align-items:center; gap:10px; }
.user-cell .avatar { width:36px; height:36px; border-radius:50%; object-fit:cover; }
@media (max-width: 900px) { .form-grid { grid-template-columns:1fr; } .form-col-side { position:static; } }
