/* Mikata customer portal — app shell styles (instructor + enterprise admin).
   Light, dense, dashboard-grade. Shares the brand indigo with the marketing site. */
:root {
  --ai: #2b3a8f; --ai-deep: #1d2a6e; --ai-soft: #eef1ff;
  --sakura: #ff8aa6; --good: #1c9d6b; --warn: #d98a00; --bad: #d6455d;
  --ink: #161a2b; --body: #3a3f55; --muted: #6b7088;
  --bg: #f4f6fb; --panel: #ffffff; --line: #e6e8f2;
  --radius: 12px; --shadow: 0 6px 20px rgba(27,33,73,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--body);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; }
a { color: var(--ai); text-decoration: none; } a:hover { text-decoration: underline; }
h1,h2,h3 { color: var(--ink); margin: 0; }

.proto { background: var(--ai-deep); color: #fff; text-align: center; font-size: .8rem; padding: 5px; }

/* layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow:auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.1rem; padding: 6px 8px 16px; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ai), #4d63d6); color: #fff; }
.side .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 8px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--body); font-weight: 500; }
.side nav a:hover { background: var(--ai-soft); text-decoration: none; }
.side nav a.active { background: var(--ai); color: #fff; }
.side nav a .ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side nav a .ic svg { width: 18px; height: 18px; }

/* inline icon (in body text, capability rows, badges) */
.ico { display: inline-flex; align-items: center; justify-content: center; vertical-align: -0.18em; color: var(--ai); }
.ico svg { width: 18px; height: 18px; }
.cap-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.cap-row:last-child { margin-bottom: 0; }
.cap-row .ico { width: 30px; height: 30px; border-radius: 8px; background: var(--ai-soft); flex-shrink: 0; }
.cap-row .cap-label { flex: 1; }
.cap-row .btn { margin-left: auto; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.25rem; }
.topbar .spacer { flex: 1; }
.switcher { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.switcher select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.who { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sakura); color: #fff; display: grid; place-items: center; font-weight: 700; }
.content { padding: 26px; max-width: 1180px; width: 100%; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tile .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile .value { font-size: 1.9rem; font-weight: 800; color: var(--ink); margin-top: 6px; }
.tile .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* cards & sections */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.card .hd { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card .hd h2 { font-size: 1.05rem; }
.card .hd .spacer { flex: 1; }
.card .bd { padding: 18px; }
.card .bd.flush { padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #fafbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }

/* badges & bars */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.green { background: #e6f6ee; color: var(--good); }
.badge.amber { background: #fdf2dd; color: var(--warn); }
.badge.red { background: #fbe6ea; color: var(--bad); }
.badge.blue { background: var(--ai-soft); color: var(--ai); }
.badge.grey { background: #eef0f6; color: var(--muted); }
.bar { background: #eef0f6; border-radius: 999px; height: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ai); }
.bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: .9rem; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn:hover { border-color: var(--ai); text-decoration: none; }
.btn.primary { background: var(--ai); color: #fff; border-color: var(--ai); }
.btn.primary:hover { background: var(--ai-deep); }
.btn.sm { padding: 5px 11px; font-size: .82rem; }
.btn.danger { color: var(--bad); border-color: #f3c6cf; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.muted { color: var(--muted); }
.right { text-align: right; }

/* roster progress */
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: var(--ai-soft); color: var(--ai); display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; margin-right: 8px; vertical-align: middle; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(22,26,43,.45); display: none; place-items: center; z-index: 40; }
.modal-bg.open { display: grid; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 92vw); max-height: 88vh; overflow: auto; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.modal .hd { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .hd h3 { flex: 1; } .modal .bd { padding: 20px; } .modal .ft { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; color: var(--muted); font-size: 1.3rem; border: 0; background: none; }

/* role visibility */
.ent-only { display: none; }
body.role-enterprise .ent-only { display: revert; }
body.role-enterprise .inst-note { display: none; }

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .grid2 { grid-template-columns: 1fr; }
}
