/* Admin panel + NGO portal shell */
body.portal { background: #eef2f6; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 262px; flex: none; background: var(--navy-3); color: #cfdceb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar .brand-name { color: #fff; font-size: 1.02rem; }
.sidebar .brand-tag { color: #9fb6ca; }
.side-nav { padding: 10px 10px 20px; flex: 1; }
.side-nav h5 { margin: 16px 10px 6px; font-size: .68rem; letter-spacing: 1.4px; text-transform: uppercase; color: #7f98af; font-weight: 700; }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; color: #d7e3ee; text-decoration: none; font-weight: 600; font-size: .92rem; margin-bottom: 2px; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: var(--gold); color: #2b1c00; }
.side-nav .ico { width: 20px; text-align: center; flex: none; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.side-foot strong { color: #fff; display: block; }
.side-foot .role { color: #9fb6ca; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 90; min-height: 60px; }
.topbar h1 { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 10px; width: 44px; height: 42px; cursor: pointer; font-size: 1.4rem; color: var(--navy); }
.content { padding: 22px 20px 50px; max-width: 1400px; width: 100%; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel > h2, .panel > .panel-head h2 { font-size: 1.1rem; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.side-backdrop { display: none; }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 250; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .side-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .side-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 240; }
  .content { padding: 16px 12px 40px; }
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy-2); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline .t { font-size: .8rem; color: var(--muted); }
.step-flow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.step { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .84rem; text-align: center; color: var(--muted); font-weight: 600; }
.step.done { background: #e8f6ee; border-color: #b9e0c9; color: #17663f; }
.step.now { background: var(--gold-soft); border-color: var(--gold); color: #7a4b00; box-shadow: 0 0 0 2px rgba(216, 148, 43, .25); }
.locked-field { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: #f6f8fa; border-radius: 9px; margin-bottom: 6px; align-items: center; flex-wrap: wrap; }
.locked-field.unlocked { background: #fdf3df; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 8px; } }
.action-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fbfcfd; }
.action-box h3 { font-size: .98rem; margin-bottom: 10px; }
.mini-table td, .mini-table th { padding: 7px 10px; font-size: .86rem; }
.diff-old { color: #9c2f24; text-decoration: line-through; }
.diff-new { color: #17663f; font-weight: 600; }
code.k { background: #eef2f6; padding: 1px 6px; border-radius: 5px; font-size: .84rem; }
pre.json { background: #f3f6f9; padding: 8px 10px; border-radius: 8px; font-size: .78rem; margin: 0; white-space: pre-wrap; word-break: break-word; max-width: 340px; }

/* track manager */
.track-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1200px) { .track-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .track-board { grid-template-columns: 1fr; } }
.track-col { background: #f3f6f9; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 140px; }
.track-col h3 { font-size: .95rem; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.track-col.drag-over { background: #fdf3df; border-color: var(--gold); }
.tk-item { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; cursor: grab; font-size: .86rem; }
.tk-item.dragging { opacity: .5; }
.tk-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tk-item input[type=number] { width: 62px; padding: 4px 6px; border: 1px solid #c5d0db; border-radius: 6px; font: inherit; }
.tk-item .lvl { font-size: .68rem; }
.tk-item img, .tk-item .ini { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: #f3f6f9; flex: none; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; color: var(--navy); }

/* certificate designer */
.designer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .designer { grid-template-columns: 1fr; } }
.paper-wrap { background: #cfd8e1; padding: 12px; border-radius: 12px; overflow: auto; }
.paper { position: relative; background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .25); margin: 0 auto; background-size: 100% 100%; background-repeat: no-repeat; user-select: none; }
.paper .pf { position: absolute; border: 1px dashed rgba(23, 90, 135, .8); background: rgba(23, 90, 135, .06); cursor: move; overflow: hidden; line-height: 1.15; white-space: pre-wrap; }
.paper .pf.sel { border: 2px solid var(--gold); background: rgba(216, 148, 43, .12); z-index: 3; }
.paper .pf.off { display: none; }
.field-card { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.field-card summary { padding: 10px 12px; cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.field-card[open] summary { border-bottom: 1px solid var(--line); background: #f6f9fc; }
.field-card .fc-body { padding: 12px; }
.field-card .form-row { gap: 2px 10px; }
.field-card .form-group { margin-bottom: 8px; }
.field-card label { font-size: .8rem; }
.field-card .form-control { min-height: 38px; padding: 6px 9px; }
.preview-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* NGO portal specifics */
.status-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.status-hero .big { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.progress { height: 10px; background: #e3eaf1; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 7px 0; border-bottom: 1px solid #eef2f6; display: flex; gap: 10px; align-items: center; }
.checklist li:last-child { border-bottom: none; }
.checklist .mark { width: 22px; height: 22px; border-radius: 50%; background: #e3eaf1; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; flex: none; }
.checklist .done .mark { background: var(--ok); color: #fff; }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-3), var(--navy)); padding: 16px; }
.login-screen .auth-card { width: 100%; max-width: 420px; }
.logo-preview { width: 96px; height: 96px; object-fit: contain; background: #f3f6f9; border-radius: 12px; border: 1px solid var(--line); }
