/* madrasa.host owner's panel */
* { box-sizing: border-box; }
body { margin: 0; background: #f2f5f4; color: #1d2a24; font: 15px/1.55 "Hind Siliguri", system-ui, sans-serif; }
a { color: #0f6b4f; }
.ap-top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 22px; background: #0f3d2e; color: #fff; }
.ap-brand { color: #fff; font-size: 19px; text-decoration: none; }
.ap-brand b { color: #e3c56b; }
.ap-top nav { display: flex; gap: 4px; flex: 1; }
.ap-top nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; color: #d5e6de; text-decoration: none; }
.ap-top nav a.is-on, .ap-top nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ap-me { display: flex; align-items: center; gap: 10px; margin: 0; }
.ap-me a, .ap-me button { border: 0; background: none; color: #d5e6de; font-size: 18px; cursor: pointer; }
.ap-main { max-width: 1240px; margin: 0 auto; padding: 22px; }
.ap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.ap-head h1 { margin: 0; font-size: 24px; }
.ap-head > :first-child { margin-right: auto; }
.ap-head input[type="search"] { min-width: 240px; }
.ap-card { margin-bottom: 16px; padding: 18px; border: 1px solid #dfe7e3; border-radius: 16px; background: #fff; }
.ap-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ap-grid--form { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ap-col { display: flex; flex-direction: column; }
.ap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ap-stats > div { padding: 14px 16px; border: 1px solid #dfe7e3; border-radius: 14px; background: #fff; }
.ap-stats span { display: block; color: #6b7b73; font-size: 13px; }
.ap-stats b { font-size: 24px; }
.ap-stats small { display: block; color: #6b7b73; font-size: 12px; }
.ap-stats .is-warn { border-color: #e7b74a; background: #fff8e6; }
.ap-stats .is-bad { border-color: #e9a3a3; background: #fdeeee; }
.ap-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e3eae6; color: inherit; text-decoration: none; }
.ap-row > :first-child { flex: 1; }
.ap-row form { margin: 0; }
.ap-muted { color: #7a8a82; }
.ap-table-wrap { overflow-x: auto; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-table th { padding: 8px; border-bottom: 2px solid #e3eae6; color: #5c6c64; font-weight: 600; text-align: left; white-space: nowrap; }
.ap-table td { padding: 9px 8px; border-bottom: 1px solid #edf2ef; vertical-align: top; }
.ap-table td small { display: block; color: #7a8a82; font-size: 12px; }
.ap-table .num { text-align: right; white-space: nowrap; }
.ap-table small.is-bad, .is-bad { color: #b42318; }
.ap-domain { display: block; font-size: 13px; }
.ap-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef2f0; color: #4d5c55; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ap-badge--ok { background: #dcf5e8; color: #0f6b4f; }
.ap-badge--warn { background: #fff1cc; color: #8a5a00; }
.ap-badge--bad { background: #fde2e2; color: #b42318; }
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 10px; background: #0f6b4f; color: #fff; font: 600 14px inherit; text-decoration: none; cursor: pointer; }
.ap-btn--wide { width: 100%; padding: 12px; }
.ap-btn--sm { padding: 7px 12px; font-size: 13px; }
.ap-btn--ghost { border: 1px solid #c9d6cf; background: #fff; color: #1d2a24; }
.ap-link { border: 0; background: none; color: #0f6b4f; font: inherit; font-size: 14px; cursor: pointer; }
.ap-link--bad { color: #b42318; }
.ap-form label, .ap-auth label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13.5px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #cfdad4; border-radius: 9px; background: #fff; font: inherit; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid #0f6b4f; outline-offset: 1px; }
.ap-form h2 { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e3eae6; }
.ap-form h2:first-of-type { margin-top: 0; padding-top: 0; border: 0; }
.ap-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ap-inline input, .ap-inline select { width: auto; flex: 1 1 140px; }
.ap-check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 400 !important; }
.ap-check input { width: auto; }
.ap-help ol { padding-left: 18px; }
.ap-help li { margin-bottom: 8px; }
.ap-flash { margin-bottom: 14px; padding: 11px 14px; border-radius: 12px; }
.ap-flash--ok { background: #dcf5e8; color: #0f5a43; }
.ap-flash--bad { background: #fde2e2; color: #9e1c13; }
.ap-flash--info { display: flex; flex-direction: column; gap: 6px; background: #e6f1fb; color: #154b7a; }
.ap-copy { font-family: monospace; font-size: 13px; }
.ap-auth { max-width: 400px; margin: 8vh auto; padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .08); text-align: center; }
.ap-auth--wide { max-width: 480px; }
.ap-auth h1 { margin: 0 0 6px; font-size: 22px; }
.ap-auth h1 b { color: #b58b16; }
.ap-auth label { text-align: left; }
.ap-code { font-size: 26px; letter-spacing: 8px; text-align: center; }
.ap-qr { display: inline-block; padding: 8px; border: 1px solid #e3eae6; border-radius: 12px; background: #fff; }
.ap-qr svg { display: block; width: 200px; height: 200px; }
.ap-secret { display: block; margin: 8px 0 14px; font-size: 14px; letter-spacing: 1px; word-break: break-all; }
.ap-alt { margin: 10px 0; }
.ap-steps { padding-left: 18px; text-align: left; }
.ap-note { padding: 8px 10px; border-radius: 8px; background: #fff8e6; font-size: 13px; }
@media (max-width: 860px) { .ap-grid, .ap-grid--form, .ap-two { grid-template-columns: 1fr; } .ap-top nav { order: 3; flex-basis: 100%; overflow-x: auto; } }

/* Recovery codes */
.ap-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 14px 0; padding-left: 22px; text-align: left; }
.ap-codes code { font-size: 17px; letter-spacing: 1px; }
.ap-small { font-size: 13px; }
@media print { .ap-top, .ap-inline, .ap-btn, .ap-link { display: none !important; } .ap-auth { box-shadow: none; } }
