/* NGO Portal Sylhet — admin. Same government palette as the public site, quieter. */
@import url("site.css") layer(base);

:root {
  --side: #003d2c;
  --side-ink: #e1efe9;
  --side-muted: #9cc3b3;
  --signal: #f42a41;
  --radius-sm: 6px;
  --leaf-soft: #e7f2ee;
  --haor: #00624a;
  --tea: #006a4e;
  --ok: #006a4e; --ok-bg: #e4f2ec;
  --warn: #8a4a0c; --warn-bg: #fdf0dd;
  --err: #8c1d18; --err-bg: #fdecea;
}

body.admin { font-size: 15.5px; line-height: 1.6; background: var(--paper); }
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side a { color: var(--side-ink); text-decoration: none; }
.side-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; padding: 4px 6px; }
.switcher label { display: block; font-size: .78rem; color: var(--side-muted); margin: 0 6px 4px; }
.switcher select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #2b4a3c; background: #18342a; color: #fff; font: inherit; font-size: .9rem; }
.side-visit { font-size: .82rem; color: var(--side-muted) !important; padding: 0 6px; word-break: break-all; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a { padding: 7px 10px; border-radius: 8px; font-size: .93rem; display: flex; justify-content: space-between; align-items: center; }
.side-nav a:hover { background: #1b3a2e; }
.side-nav a[aria-current="page"] { background: #24503d; color: #fff; font-weight: 600; }
.side-label { margin: 14px 10px 4px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted); }
.badge { background: var(--signal); color: #1b1006; border-radius: 999px; font-size: .74rem; padding: 0 7px; font-weight: 700; }
.side-user { margin-top: auto; border-top: 1px solid #24443a; padding: 12px 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.side-user .linklike { color: var(--side-muted); }
.main { padding: 28px 36px 60px; max-width: 1240px; width: 100%; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-label { width: 100%; }
  .main { padding: 20px 16px 48px; }
}

.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: 1.65rem; margin: 0; }
.count { font-family: var(--body); font-size: .95rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; vertical-align: middle; }
.crumb { margin: 0; font-size: .88rem; }
.crumb a { text-decoration: none; }
.crumb a::before { content: "← "; }
.lead { color: var(--muted); max-width: 70ch; }
.panel, .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.box h2, .panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.box.highlight { border-color: var(--signal); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.tile { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--paper); }
.tile strong { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile.warn { border-color: var(--signal); background: var(--warn-bg); }
.tile.accent { border-color: var(--accent); background: var(--ok-bg); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
.note { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 10px; margin: 0; }

.button.small { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.button.full { width: 100%; }
.button.danger { background: transparent; color: var(--err); border-color: var(--err); }
.button.danger:hover { background: var(--err); color: #fff; }
.linklike { background: none; border: 0; padding: 0; color: var(--haor); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--err) !important; }

.flash { padding: 11px 14px; border-radius: 10px; margin: 0 0 14px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--err-bg); color: var(--err); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .94rem; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--paper); padding: 9px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .strong { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .strong:hover { color: var(--accent); text-decoration: underline; }
.table tr.unread td { background: var(--ok-bg); }
.table tr.warn-row td { background: var(--warn-bg); }
.table-scroll { overflow-x: auto; }
.small-table { font-size: .86rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.logo-cell img { object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--muted); }
.status-published, .status-active { background: var(--ok-bg); color: var(--ok); }
.status-draft, .status-invited { background: var(--warn-bg); color: var(--warn); }
.status-disabled, .status-suspended { background: var(--err-bg); color: var(--err); }
.flag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); margin-left: 6px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
.filter-bar input[type=search] { flex: 1 1 220px; }
.check { display: inline-flex; gap: 8px; align-items: center; margin: 4px 0; font-size: .94rem; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.stack-sm input, .copy-url { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .85rem; }
.field small { display: block; margin-top: 2px; }
.field-row > input { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; }
.field-row { margin-bottom: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); }
legend { font-weight: 600; padding: 0 6px; }
.narrow-form { max-width: 760px; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.cols-2 .box { margin: 0; }
.cols-1, .cols-2 > form { display: block; }
form.cols-2 { display: grid; }
.input-lg { font-size: 1.2rem !important; font-weight: 600; }
.input-xs { width: 4.2rem; }
.slug-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.slug-row .muted { font-size: .88rem; }
.slug-row input { flex: 1 1 200px; }

.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.edit-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.edit-side .box { margin: 0; }
@media (max-width: 1000px) { .edit-grid { grid-template-columns: 1fr; } .edit-side { position: static; } }
.below-form { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 22px; }
.below-form .box { flex: 1 1 400px; margin: 0; }
.rev-list { list-style: none; padding: 0; margin: 10px 0 0; }
.rev-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

trix-editor { min-height: 340px; background: var(--surface); border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important; padding: 12px 14px !important; color: var(--ink); }
trix-toolbar .trix-button-group { background: var(--surface); }
trix-toolbar .trix-button-group--file-tools { display: none; }
.editor-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.trix-content img { max-width: 100%; height: auto; }

.media-field { display: flex; flex-direction: column; gap: 8px; }
.mf-label { font-weight: 600; font-size: .92rem; }
.mf-preview img { max-width: 100%; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.mf-doc { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem; }
.slide-row { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }

.upload-zone { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.upload-zone label { flex: 1 1 100%; }
.media-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.media-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; font-size: .88rem; }
.mi-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--paper); border-radius: 8px; overflow: hidden; }
.mi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-item summary { cursor: pointer; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-edit { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery-edit li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.gallery-edit img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.gallery-edit input[name^="g_caption"] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .88rem; background: var(--paper); color: var(--ink); }
.ge-tools { display: flex; gap: 10px; }

.media-dialog { width: min(920px, 94vw); max-height: 86vh; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); }
.media-dialog::backdrop { background: rgba(10, 20, 16, .55); }
.md-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); flex-wrap: wrap; }
.md-head h2 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.md-head input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
#md-status { padding: 0 16px; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 14px 16px 18px; }
.md-item { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 2px solid transparent; border-radius: 10px; padding: 6px; cursor: pointer; font: inherit; font-size: .8rem; color: var(--ink); text-align: left; }
.md-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.md-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-item:hover, .md-item:focus-visible { border-color: var(--accent); }
.md-item.is-picked { border-color: var(--signal); }

.menu-table input, .menu-table select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .9rem; min-width: 120px; }
.menu-table .input-xs { min-width: 0; width: 4rem; }
.menu-table input.indent { margin-left: 18px; width: calc(100% - 18px); }
.menu-table tr.is-child td { background: color-mix(in srgb, var(--leaf-soft) 40%, transparent); }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; max-height: 360px; overflow-y: auto; padding: 4px; }
.access-grid label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; border-bottom: 1px solid var(--line); padding: 4px 0; }
.access-grid select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .85rem; background: var(--paper); color: var(--ink); }
.message-body { white-space: normal; background: var(--paper); border-radius: 10px; padding: 14px 16px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; list-style: none; padding: 0; font-size: 1.05rem; }
.codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }

/* Sign-in pages */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(180deg, var(--leaf-soft), var(--paper)); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; margin-bottom: 18px; }
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 10px; }
.qr { margin: 10px 0; }
.qr img { background: #fff; border-radius: 10px; image-rendering: pixelated; }
.secret { display: inline-block; font-size: 1.05rem; letter-spacing: .08em; background: var(--paper); padding: 6px 10px; border-radius: 8px; word-break: break-all; }

@media print {
  .side, .page-title .button, .below-form { display: none !important; }
  .shell { display: block; }
}

/* Installer */
.install-card { width: min(620px, 100%); }
.install-steps { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0 0 18px; font-size: .8rem; color: var(--muted); counter-reset: s; }
.install-steps li { counter-increment: s; }
.install-steps li::before { content: counter(s) ". "; }
.install-steps .is-done { color: var(--ok); }
.install-steps .is-current { color: var(--ink); font-weight: 700; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ck-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.pass .ck-icon { background: var(--ok-bg); color: var(--ok); }
.fail .ck-icon { background: var(--err-bg); color: var(--err); }
.warn .ck-icon { background: var(--warn-bg); color: var(--warn); }
.progress .bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.info .ck-icon { background: var(--line); color: var(--muted); }

/* 1.1.0: roles, deferred invitations, portal theme settings */
.status-role { background: #e3eefa; color: #1d4f86; }
.invite-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.invite-bar h2 { margin: 0 0 4px; font-size: 1.05rem; }
.invite-bar p { margin: 0 0 4px; max-width: 70ch; }
.field-row.three { grid-template-columns: 1fr 1fr 9rem; margin-bottom: 8px; }
.field-row.three input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper, #fff); color: inherit; width: 100%; }
@media (max-width: 700px) { .field-row.three { grid-template-columns: 1fr; } }
#email-settings { margin-top: 18px; }
.brand-emblem { border-radius: 50%; background: #fff; }
