/* Meherpur IT Academy - Metadata admin panel. Colours from the logo: navy + orange/gold. */
:root {
  --bg: #06122b;
  --panel: #0f1f40;
  --panel-2: #152a52;
  --line: #1f3563;
  --text: #e6ecf7;
  --muted: #8196be;
  --accent: #e86a00;
  --accent-hover: #ff8a1f;
  --gold: #ffb000;
  --ok: #22c55e;
  --bad: #ef4444;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 8px 0 20px; display: flex; align-items: center; gap: 12px; }
h2 { font-size: 16px; margin: 0 0 14px; }
small { display: block; color: var(--muted); font-size: 12px; }
td small, h1 small { display: block; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px; background: #0b1a38; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand strong { display: block; font-size: 16px; }
.brand small { color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a, .me a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.topbar nav a:hover, .me a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topbar nav a.active, .me a.active { color: #fff; background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.me { display: flex; align-items: center; gap: 6px; }

main.page { max-width: 1400px; margin: 0 auto; padding: 24px; }
main.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* Cards and layout */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 460px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.stack { display: grid; gap: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { display: block; font-size: 30px; margin-top: 4px; }

/* Forms */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: #081330; border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1 1 260px; width: auto; }
.filters select { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; font: inherit; font-weight: 600; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: transparent; border-color: #7f1d1d; color: #fca5a5; }
.btn.danger:hover { background: #7f1d1d; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 10px; }
button.link:hover { color: var(--text); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sign-in card */
.auth { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; }
.auth h1 { justify-content: center; margin: 0; }
.auth p { margin: 0; }
.auth label { text-align: left; }
.auth-logo { width: 84px; height: 84px; margin: 0 auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #13284d; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.plus { color: var(--ok); font-weight: 700; }
td.minus { color: #fca5a5; font-weight: 700; }
td.note { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td form { margin: 0; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.active { background: rgba(34, 197, 94, .15); color: #86efac; }
.badge.blocked { background: rgba(239, 68, 68, .15); color: #fca5a5; }
.badge.plain { background: var(--panel-2); color: var(--muted); }
.count { font-size: 14px; background: var(--panel-2); color: var(--muted); padding: 2px 10px; border-radius: 999px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash.success { background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35); color: #86efac; }
.flash.error { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); color: #fca5a5; }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 8px 0 24px; color: var(--muted); }

/* User page */
.user-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.user-head h1 { margin: 0; }
.user-head p { margin: 4px 0 0; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.avatar.letter { display: grid; place-items: center; background: var(--panel-2); font-size: 28px; font-weight: 700; color: var(--gold); }
.balance { margin-left: auto; text-align: right; }
.balance span { color: var(--muted); font-weight: 600; font-size: 13px; }
.balance strong { display: block; font-size: 40px; line-height: 1.1; color: var(--gold); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }

/* Dashboard chart (heights are classes so no inline styles are needed) */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; align-items: end; height: 180px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-fill { width: 100%; max-width: 38px; background: linear-gradient(180deg, var(--gold), var(--accent)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-value { font-size: 12px; font-weight: 700; color: var(--text); }
.bar-label { font-size: 11px; color: var(--muted); }
.h0 { height: 2px; } .h1 { height: 5%; } .h2 { height: 10%; } .h3 { height: 15%; } .h4 { height: 20%; }
.h5 { height: 25%; } .h6 { height: 30%; } .h7 { height: 35%; } .h8 { height: 40%; } .h9 { height: 45%; }
.h10 { height: 50%; } .h11 { height: 55%; } .h12 { height: 60%; } .h13 { height: 65%; } .h14 { height: 70%; }
.h15 { height: 75%; } .h16 { height: 80%; } .h17 { height: 85%; } .h18 { height: 90%; } .h19 { height: 95%; } .h20 { height: 100%; }
.bar-fill.h0 { background: var(--line); }

@media (max-width: 640px) {
  main.page { padding: 16px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .balance { margin-left: 0; text-align: left; }
  h1 { font-size: 22px; }
}

/* Credit validity */
.badge.warn { background: rgba(255, 176, 0, .15); color: #ffcf66; }
.balance .badge { margin-top: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.small-note { font-size: 13px; margin: 0; }
h2.gap { margin-top: 24px; }
.create-user { margin-bottom: 20px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row h1 { margin-bottom: 20px; }
[hidden] { display: none !important; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
