/* NB CMS — WordPress-admin look, no external fonts or frameworks. */
:root {
  --bar: #1d2327; --bar-hover: #2c3338; --side: #1d2327; --side-sub: #2c3338; --side-text: #f0f0f1;
  --accent: #2271b1; --accent-dark: #135e96; --bg: #f0f0f1; --panel: #fff; --border: #c3c4c7;
  --text: #1d2327; --muted: #646970; --danger: #b32d2e; --ok: #00a32a; --warn: #dba617;
  --font: "Noto Sans Bengali", "Nirmala UI", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.6 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 23px; font-weight: 400; margin: 0 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0 0 10px; }
code { background: #f6f7f7; padding: 1px 4px; border-radius: 3px; font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---- admin bar ---- */
.adminbar { position: fixed; top: 0; left: 0; right: 0; height: 36px; background: var(--bar); color: #fff; display: flex; align-items: center; gap: 4px; z-index: 50; padding: 0 8px; }
.adminbar a, .adminbar button { color: #f0f0f1; text-decoration: none; padding: 0 10px; line-height: 36px; background: none; border: 0; font: inherit; cursor: pointer; }
.adminbar a:hover { background: var(--bar-hover); color: #72aee6; }
.adminbar-toggle { display: none; font-size: 18px !important; }
.adminbar-user { margin-left: auto; position: relative; display: flex; align-items: center; gap: 6px; padding: 0 10px; cursor: default; }
.adminbar-menu { display: none; position: absolute; right: 0; top: 36px; background: var(--bar-hover); min-width: 200px; padding: 6px 0; }
.adminbar-user:hover .adminbar-menu, .adminbar-user:focus-within .adminbar-menu { display: block; }
.adminbar-menu a, .adminbar-menu button { display: block; width: 100%; text-align: left; line-height: 32px; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }

/* ---- sidebar ---- */
.sidebar { position: fixed; top: 36px; bottom: 0; left: 0; width: 180px; background: var(--side); overflow-y: auto; z-index: 40; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar > ul > li > a { display: flex; gap: 8px; color: var(--side-text); text-decoration: none; padding: 8px 12px; }
.sidebar > ul > li > a:hover { background: var(--bar-hover); color: #72aee6; }
.sidebar .ico { width: 20px; text-align: center; opacity: .75; }
.sidebar li ul { display: none; background: var(--side-sub); padding: 6px 0; }
.sidebar li.open ul, .sidebar li:hover ul { display: block; }
.sidebar li ul a { display: block; color: #c3c4c7; text-decoration: none; padding: 4px 12px 4px 40px; font-size: 13px; }
.sidebar li ul a:hover { color: #72aee6; }
.sidebar li.current > a { background: var(--accent); color: #fff; }

/* ---- content ---- */
.content { margin: 36px 0 0 180px; padding: 20px 24px 60px; max-width: 1400px; }
.panel { background: var(--panel); border: 1px solid var(--border); padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.panel.narrow { max-width: 760px; }
.panel.wide { grid-column: 1 / -1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.description { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.warning { color: #8a6116; }
.ok { color: var(--ok); }
.inline { display: inline; }

/* ---- notices ---- */
.notice { background: #fff; border-left: 4px solid var(--accent); padding: 8px 12px; margin: 0 0 16px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.notice p { margin: 2px 0; }
.notice-success { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--danger); }
.notice-warning { border-left-color: var(--warn); }

/* ---- forms ---- */
label { display: block; margin: 0 0 12px; font-weight: 500; }
label.check { display: flex; gap: 6px; align-items: center; font-weight: 400; margin: 2px 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid #8c8f94; border-radius: 4px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid transparent; box-shadow: 0 0 0 1px var(--accent); }
input.short { width: 160px; display: inline-block; letter-spacing: 4px; font-size: 20px; text-align: center; }
textarea.code, .editor-html { font-family: Consolas, Monaco, monospace; font-size: 13px; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset:disabled { opacity: .6; }

.button { display: inline-block; padding: 5px 12px; border: 1px solid var(--accent); color: var(--accent); background: #f6f7f7; border-radius: 3px; font: inherit; cursor: pointer; text-decoration: none; line-height: 1.6; }
.button:hover { background: #f0f0f1; color: var(--accent-dark); border-color: var(--accent-dark); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); color: #fff; }
.button-danger { border-color: var(--danger); color: var(--danger); }
.button-small { padding: 2px 8px; font-size: 13px; }
.button-block { width: 100%; margin-top: 8px; padding: 8px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.link.danger, .danger { color: var(--danger); }
.page-title-action { font-size: 13px; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 3px; text-decoration: none; background: #f6f7f7; }

/* ---- list tables ---- */
.subsubsub { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.subsubsub a { text-decoration: none; }
.subsubsub a.current { color: var(--text); font-weight: 600; }
.count { color: var(--muted); font-weight: 400; }
.search-box, .media-filters, .tablenav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.search-box input, .search-box select, .media-filters select, .media-filters input, .tablenav select { width: auto; display: inline-block; margin: 0; }
.search-box { justify-content: flex-end; }
.tablenav-pages { margin-left: auto; display: flex; gap: 4px; align-items: center; font-size: 13px; }
.page-btn { display: inline-block; min-width: 28px; text-align: center; border: 1px solid var(--border); background: #f6f7f7; padding: 0 6px; text-decoration: none; }
.page-btn.disabled { color: #a7aaad; }
.widefat { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); }
.widefat th, .widefat td { text-align: left; padding: 8px 10px; vertical-align: top; }
.widefat thead { border-bottom: 1px solid var(--border); }
.widefat.striped tbody tr:nth-child(odd) { background: #f6f7f7; }
.widefat.compact td, .widefat.compact th { padding: 4px 8px; font-size: 13px; }
.widefat td.check, .widefat th.check { width: 32px; }
.title-col { display: block; }
.row-thumb { width: 48px; height: 48px; object-fit: cover; float: left; margin-right: 10px; border: 1px solid #ddd; }
.row-actions { font-size: 13px; visibility: hidden; margin-top: 2px; }
tr:hover .row-actions, tr:focus-within .row-actions { visibility: visible; }
tr.suspended { opacity: .6; }
.status { font-size: 12px; padding: 0 6px; border-radius: 10px; background: #dcdcde; color: var(--text); font-weight: 400; }
.status-publish, .status-approved { background: #d1f0d8; }
.status-draft { background: #f0f0f1; }
.status-pending, .status-future { background: #fcf0c3; }
.status-trash, .status-spam, .status-suspended { background: #f7d7d7; }

/* ---- dashboard ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.dash-grid .panel { margin: 0; }
.glance { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { padding: 4px 0; border-bottom: 1px solid #f0f0f1; }

/* ---- editor ---- */
.editor-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.title-input { font-size: 22px !important; padding: 8px 10px !important; margin: 0 0 8px !important; }
.permalink { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; margin-bottom: 12px; }
.permalink label { margin: 0; }
.permalink input { width: auto; flex: 1 1 200px; margin: 0; padding: 2px 6px; }
.editor { background: #fff; border: 1px solid var(--border); margin-bottom: 18px; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-bottom: 1px solid #dcdcde; background: #f6f7f7; }
.editor-tabs .tab { background: #ebebeb; border: 1px solid #dcdcde; padding: 3px 10px; cursor: pointer; font: inherit; }
.editor-tabs .tab.active { background: #fff; border-bottom-color: #fff; }
.editor-buttons { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; border-bottom: 1px solid #dcdcde; }
.editor-buttons button { min-width: 32px; height: 30px; border: 1px solid transparent; background: none; cursor: pointer; font: inherit; border-radius: 3px; }
.editor-buttons button:hover { border-color: #8c8f94; background: #f6f7f7; }
.editor-visual { min-height: 420px; max-height: 75vh; overflow-y: auto; padding: 14px 18px; outline: none; font-size: 16px; line-height: 1.8; }
.editor-visual img { max-width: 100%; height: auto; }
.editor-visual table { border-collapse: collapse; } .editor-visual td, .editor-visual th { border: 1px solid #ddd; padding: 4px; }
.editor-html { border: 0 !important; border-radius: 0 !important; margin: 0 !important; min-height: 420px; }
.editor .description { padding: 0 10px; }
.postbox { background: #fff; border: 1px solid var(--border); padding: 12px 14px; margin-bottom: 16px; }
.postbox > summary { font-weight: 600; cursor: pointer; margin: -2px 0 8px; }
.postbox h2 { font-size: 14px; border-bottom: 1px solid #f0f0f1; padding-bottom: 8px; }
.publish-actions { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 8px; }
.checklist { max-height: 220px; overflow-y: auto; border: 1px solid #dcdcde; padding: 6px 8px; margin-bottom: 6px; }
.featured-preview img { max-width: 100%; display: block; margin-bottom: 8px; border: 1px solid #ddd; }
.revision-preview { max-height: 240px; overflow: auto; background: #f6f7f7; padding: 8px; white-space: pre-wrap; font-size: 13px; }

/* ---- media ---- */
.media-grid { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-grid li { aspect-ratio: 1; background: #dcdcde; border: 3px solid transparent; position: relative; }
.media-grid li.selected { border-color: var(--accent); box-shadow: 0 0 0 1px #fff inset; }
.media-grid a, .media-grid button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-icon { display: grid; place-content: center; text-align: center; width: 100%; height: 100%; font-weight: 700; color: var(--muted); background: #f6f7f7; }
.file-icon small { display: block; font-weight: 400; font-size: 11px; padding: 0 4px; }
.file-icon.big { width: 240px; height: 240px; font-size: 32px; }
.view-switch a { text-decoration: none; font-size: 20px; color: #a7aaad; padding: 0 4px; }
.view-switch a.current { color: var(--text); }
.attachment { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.attachment-preview { background: #fff; border: 1px solid var(--border); padding: 10px; text-align: center; }
.attachment-preview img, .attachment-preview video { max-width: 100%; height: auto; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 0 0 14px; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; word-break: break-all; }
.facts input { display: inline-block; width: calc(100% - 60px); margin: 0; font-size: 12px; }
.dropzone { border: 3px dashed #c3c4c7; text-align: center; padding: 40px; }
.dropzone.drag { border-color: var(--accent); background: #f0f6fc; }
.media-modal { width: min(1100px, 94vw); height: min(760px, 90vh); padding: 0; border: 0; box-shadow: 0 5px 30px rgba(0,0,0,.4); }
.media-modal[open] { display: flex; flex-direction: column; }
.media-modal::backdrop { background: rgba(0,0,0,.6); }
.media-modal header, .media-modal footer, .media-modal-bar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #dcdcde; }
.media-modal header { justify-content: space-between; } .media-modal header h2 { margin: 0; }
.media-modal footer { border-top: 1px solid #dcdcde; border-bottom: 0; margin-top: auto; justify-content: flex-end; }
.media-modal footer label { flex: 1; margin: 0; display: flex; gap: 8px; align-items: center; }
.media-modal footer input { margin: 0; }
.media-modal-bar input[type=search] { max-width: 280px; margin: 0; }
.media-modal .media-grid { flex: 1; overflow-y: auto; padding: 12px 16px; margin: 0; grid-auto-rows: 130px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.media-modal .media-grid li { aspect-ratio: auto; }

.term-cols { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 200px; margin: 0; }
.codes { columns: 2; font-size: 16px; } .codes code { font-size: 16px; }
.qr { background: #fff; padding: 8px; border: 1px solid #ddd; margin: 8px 0; }
.secret { letter-spacing: 1px; }
.steps li { margin-bottom: 10px; }

/* ---- sign-in screens ---- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-logo { justify-content: center; font-size: 30px; font-weight: 700; color: var(--bar); letter-spacing: 1px; }
.auth-logo span { color: var(--accent); }
.auth-note, .auth-alt { text-align: center; font-size: 13px; color: var(--muted); }
.recovery { margin: 8px 0 12px; font-size: 13px; } .recovery summary { cursor: pointer; color: var(--accent); }

/* ---- small screens ---- */
@media (max-width: 960px) {
  .editor-cols, .attachment, .term-cols { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
  .adminbar-toggle { display: inline-block; }
  .adminbar-site, .adminbar-new { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 220px; }
  body.menu-open .sidebar { transform: none; }
  .content { margin-left: 0; padding: 16px; }
  .glance { grid-template-columns: 1fr; }
  .widefat { display: block; overflow-x: auto; }
}
