/* Unique Typing Tutor online panel - modern light theme (matches the desktop application).
   Designed & developed by EthicsComputer - www.ethicscomputer.in */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --muted: #667085;
  --accent: #d65c24;
  --accent-hover: #b84a18;
  --accent-soft: #fdf0e9;
  --accent-ink: #b04516;
  --success: #079455;
  --success-soft: #e8f7ef;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --warning: #dc6803;
  --warning-soft: #fef4e6;
  --info: #1570ef;
  --info-soft: #eaf2fe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
  --sidebar-w: 264px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Nirmala UI", "Mangal", "Noto Sans Devanagari", sans-serif;
  --hindi: "Nirmala UI", "Mangal", "Noto Sans Devanagari", "Segoe UI", sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.break { word-break: break-all; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent-ink); font-weight: 600; }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.hindi, .hindi-ok { font-family: var(--hindi); }
.hindi { font-size: 17px; line-height: 1.8; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand strong { display: block; font-size: 15.5px; }
.brand small { display: block; color: var(--muted); font-size: 12.5px; }
.nav { padding: 4px 12px 12px; flex: 1; }
.nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #98a2b3; padding: 16px 12px 6px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: var(--radius-sm); color: #344054; font-weight: 500; }
.nav-item .icon { color: #98a2b3; }
.nav-item:hover { background: #f2f4f7; text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.credit { padding: 14px 24px 20px; font-size: 12px; color: #98a2b3; line-height: 1.5; }
.credit a { color: #98a2b3; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); min-height: 68px; }
.topbar h1 { flex: 1; min-width: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 10px; }
.user form { margin: 0 0 0 6px; }
.user-link { display: flex; align-items: center; gap: 10px; color: var(--text); border-radius: var(--radius-sm); padding: 2px 6px 2px 2px; }
.user-link:hover { text-decoration: none; background: #f2f4f7; }
.user-text strong { display: block; font-size: 14px; }
.user-text small { display: block; color: var(--muted); font-size: 12px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; margin-right: 10px; vertical-align: middle; }
.content { padding: 24px 28px 40px; max-width: 1480px; width: 100%; }
.icon-btn.menu-btn { display: none; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; }

/* ---------------------------------------------------------------- cards and layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card.narrow, .form.narrow { max-width: 760px; }
.card.danger { border-color: #f9c9c4; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head > .muted { font-size: 13.5px; flex-basis: 100%; margin-top: -8px; }
.card-head .muted { font-size: 13.5px; }
.stack > .card:last-child { margin-bottom: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.grid-main.reverse { grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .grow, .grow { flex: 1; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.breadcrumb span { color: #d0d5dd; }
.section-title { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.danger-zone { margin: -6px 0 20px; display: flex; justify-content: flex-end; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: #fbd5c0; background: linear-gradient(90deg, #fff, var(--accent-soft)); }
.callout h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; color: var(--accent-ink); }
.empty, .empty-state { color: var(--muted); text-align: center; padding: 26px 10px; }

/* ---------------------------------------------------------------- tiles and charts */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: var(--text); }
a.tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.tile-label { color: var(--muted); font-size: 13px; padding-left: 16px; }
.tile strong { display: block; font-size: 28px; font-weight: 600; margin-top: 4px; line-height: 1.2; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile-dot { position: absolute; left: 18px; top: 23px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tile-dot.info { background: var(--info); } .tile-dot.success { background: var(--success); } .tile-dot.warning { background: var(--warning); }
.tile-dot.danger { background: var(--danger); } .tile-dot.muted { background: #98a2b3; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; max-width: 42px; min-height: 3px; background: linear-gradient(180deg, #ee8a57, var(--accent)); border-radius: 6px 6px 3px 3px; }
.bar-val { font-size: 12px; color: var(--muted); }
.bar-label { font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.t-time { color: var(--muted); white-space: nowrap; min-width: 82px; font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list a { display: block; padding: 10px 2px; color: var(--text); }
.list a:hover { text-decoration: none; background: var(--surface-alt); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table-wrap.scroll-y { max-height: 460px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-alt); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table.compact td { padding: 8px 12px; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fff8f4; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 14px; font-size: 14px; }
.pagination .muted { margin-right: auto; }
.table th.sortable a { color: inherit; }
.table th.sortable a:hover { color: var(--accent-ink); text-decoration: none; }
.table th[aria-sort] { color: var(--accent-ink); }
.table .check-col { width: 44px; padding-right: 0; }
.row-check { display: block; padding: 2px 4px; cursor: pointer; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13.5px; }
.bulk-bar .muted { margin-right: 4px; }
.role-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.role-form select { width: auto; min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13.5px; background-position: calc(100% - 17px) 13px, calc(100% - 12px) 13px; }
.ext { display: inline-block; margin: 0 14px 4px 0; white-space: nowrap; }
.log-box { margin: 0; font: 12.5px/1.55 var(--mono); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* ---------------------------------------------------------------- badges and dots */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: #05603a; }
.badge-danger { background: var(--danger-soft); color: #b42318; }
.badge-warning { background: var(--warning-soft); color: #b54708; }
.badge-info { background: var(--info-soft); color: #175cd3; }
.badge-muted { background: #f2f4f7; color: var(--muted); }
.badge-neutral { background: #f2f4f7; color: #344054; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot-ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-idle { background: #98a2b3; }
.dot-warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: #344054; font: 600 14px var(--font); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-alt); text-decoration: none; border-color: #b9c0cb; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-item:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(214, 92, 36, .2); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; }
.btn-danger-ghost { color: #b42318; border-color: #f4b5ae; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #f0958a; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-block { width: 100%; height: 44px; }
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- forms */
.form .field, .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13.5px; font-weight: 600; color: #344054; }
input, select, textarea { font: 14.5px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; min-height: 40px; transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; line-height: 1.6; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--accent); vertical-align: -3px; }
input[type=file] { padding: 7px; }
.filters select, .filters input { width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 18px 8px 0; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
.checks .check { flex: 1 1 280px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.inline-field input { width: auto; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }
.pair { display: flex; gap: 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.search { position: relative; display: inline-flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: #98a2b3; pointer-events: none; }
.search input { padding-left: 36px; min-width: 260px; }
.search.grow input { width: 100%; }
.table-filter { width: 220px; }
.typing-text { font-size: 16px; line-height: 1.8; min-height: 360px; }
.typing-text.hindi { font-size: 19px; }
textarea.code { font: 13px var(--mono); }
.text-box { white-space: normal; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; max-height: 360px; overflow: auto; line-height: 1.8; }
details summary { cursor: pointer; font-weight: 600; color: #344054; margin: 6px 0; display: flex; align-items: center; gap: 8px; }
details[open] summary { margin-bottom: 12px; }
.secret { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.api-check { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.api-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.api-row code { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- messages */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; font-size: 14.5px; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-success { background: var(--success-soft); border-color: #abefc6; color: #05603a; }
.flash-error { background: var(--danger-soft); border-color: #fecdca; color: #b42318; }
.flash-warning { background: var(--warning-soft); border-color: #fedf89; color: #b54708; }
.flash-info { background: var(--info-soft); border-color: #b2ddff; color: #175cd3; }
.banner { border-radius: var(--radius); padding: 16px 22px; margin-bottom: 20px; border: 1px solid transparent; }
.banner strong { font-size: 19px; letter-spacing: .02em; }
.banner p { margin: 4px 0 0; color: var(--text); }
.banner-success { background: var(--success-soft); border-color: #abefc6; color: #05603a; }
.banner-danger { background: var(--danger-soft); border-color: #fecdca; color: #b42318; }
.banner-muted { background: #f2f4f7; border-color: var(--border); color: #344054; }

/* ---------------------------------------------------------------- sign-in and installer */
body.auth { background: radial-gradient(1200px 600px at 0% 0%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 420px) minmax(320px, 460px); gap: 28px; align-content: center; justify-content: center; padding: 32px 20px; }
.auth-wrap.install { grid-template-columns: minmax(280px, 380px) minmax(320px, 680px); }
.auth-brand { text-align: center; align-self: center; }
.logo-card { width: 210px; height: 210px; margin: 0 auto 18px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 18px; }
.logo-card img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand h2 { font-size: 20px; margin-bottom: 4px; }
.auth-brand .credit { padding: 16px 0 0; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 32px; align-self: center; }
.auth-card.wide { max-width: 680px; }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: 18px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  /* minmax(0, ...) keeps wide tables scrolling inside their card instead of widening the page. */
  .grid-main, .grid-main.reverse, .grid-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 32px; }
  .user-text { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-wrap, .auth-wrap.install { grid-template-columns: 1fr; }
  .logo-card { width: 150px; height: 150px; }
  .callout { flex-direction: column; align-items: flex-start; }
  .search input, .table-filter { min-width: 0; width: 100%; }
}
@media print {
  .sidebar, .topbar, .toolbar, .btn, .danger-zone { display: none !important; }
  .card { box-shadow: none; }
}
/* Computers page (1.2.0): last error text and the warning below the joining settings. */
.text-danger { color: #b42318; }
.hint.warning { color: #b54708; background: var(--warning-soft); padding: 8px 10px; border-radius: 8px; }
