:root {
  --blue: #1557C0;
  --blue-dark: #0D3B8C;
  --blue-mid: #2B6DE8;
  --blue-soft: #EAF1FF;
  --red: #E31B23;
  --red-soft: #FDECEC;
  --ink: #12203A;
  --muted: #5B6B82;
  --line: #E4EAF3;
  --bg: #F5F7FB;
  --white: #FFFFFF;
  --gold: #C9A227;
  --gold-soft: #FBF4DE;
  --green: #0F9D58;
  --green-soft: #E8F7EE;
  --orange: #E67E22;
  --orange-soft: #FEF3E8;
  --shadow: 0 10px 30px rgba(18, 32, 58, 0.08);
  --shadow-sm: 0 4px 14px rgba(18, 32, 58, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: "Segoe UI", Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.45; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.page { min-height: 100vh; background: var(--bg); }
.page-white { background: var(--white); }

.container { width: 1200px; max-width: calc(100% - 48px); margin: 0 auto; }
.row { display: flex; gap: 24px; }
.col { flex: 1; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; } .gap24 { gap: 24px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }

h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
.lead { font-size: 18px; color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; color: var(--muted); }
.strong { font-weight: 700; }

.site-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: 0.02em; color: var(--blue-dark); }
.logo img { width: 36px; height: 36px; }
.logo span b { color: var(--red); font-weight: 800; }
.olymp-nav { display: flex; gap: 22px; flex: 1; align-items: center; }
.olymp-nav a { color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.olymp-nav a.active, .olymp-nav a:hover { color: var(--blue-dark); }

/* Kill Moodle/Boost chrome on portal pages */
body.olymp-clean #page-header,
body.olymp-clean .navbar,
body.olymp-clean .navbar.fixed-top,
body.olymp-clean [data-region="drawer"],
body.olymp-clean .drawer,
body.olymp-clean .drawer-toggles,
body.olymp-clean .btn-footer-popover,
body.olymp-clean #page-footer,
body.olymp-clean .footer-popover,
body.olymp-clean .editmode-switch-form,
body.olymp-clean .usermenu,
body.olymp-clean .popover-region,
body.olymp-clean a[href="#maincontent"],
body.olymp-clean .skip-block,
body.olymp-clean .sr-only-focusable {
  display: none !important;
}
body.olymp-clean #maincontent {
  display: block !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}
body.olymp-clean #page,
body.olymp-clean #page.olymp-page {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.olymp-clean .olymp-page-content,
body.olymp-clean #region-main {
  border-top: 0 !important;
}
body.olymp-clean #page.drawers {
  margin-top: 0 !important;
}
body.olymp-clean #topofscroll,
body.olymp-clean #page-content,
body.olymp-clean .main-inner,
body.olymp-clean #region-main-box,
body.olymp-clean #region-main,
body.olymp-clean .region-main {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}
body.olymp-clean #region-main {
  border: 0 !important;
  background: transparent !important;
}
body.olymp-clean .header-maxwidth,
body.olymp-clean .container-fluid {
  max-width: none !important;
  padding: 0 !important;
}
body.olymp-clean,
html.olymp-clean {
  background: var(--bg) !important;
  overflow-x: hidden;
  margin: 0 !important;
  padding: 0 !important;
}
body.olymp-clean .app.olymp-app {
  margin: 0 !important;
  min-height: 100vh;
  border-top: 0 !important;
}
body.olymp-clean #page,
body.olymp-clean .olymp-page,
body.olymp-clean .olymp-page-content,
body.olymp-clean #region-main {
  border-top: 0 !important;
  box-shadow: none !important;
}
@media (min-width: 1101px) {
  body.olymp-clean .app-topbar {
    display: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
}

.site-header .header-inner { width: 1200px; max-width: calc(100% - 48px); margin: 0 auto; }

@media (max-width: 1100px) {
  .hero > .container { flex-direction: column !important; }
  .hero-panel { width: 100%; }
  .grid-3, .grid-4, .grid-2, .steps, .auth-wrap, .test-layout, .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .app.olymp-app {
    display: flex; flex-direction: column; min-height: 100vh;
    grid-template-columns: unset; grid-template-areas: unset;
  }
  .app-topbar {
    display: flex !important; flex: 0 0 auto; order: -1;
    width: 100%; padding: 10px 14px !important; min-height: 52px !important;
    border-bottom: 1px solid var(--line) !important; margin: 0 !important;
    position: sticky; top: 0; z-index: 50;
    background: #fff; box-shadow: 0 1px 0 rgba(14, 27, 51, .06);
    padding-top: max(10px, env(safe-area-inset-top)) !important;
  }
  body.olymp-clean .app-topbar { display: flex !important; }
  .app-topbar .btn-outline {
    width: 40px; height: 40px; padding: 0; border-radius: 10px; flex-shrink: 0;
  }
  .app-topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .app-topbar-brand img { flex-shrink: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 60; display: none;
    background: rgba(14, 27, 51, .45);
  }
  .sidebar-backdrop.is-open { display: block; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 88vw);
    z-index: 70; transform: translateX(-105%); transition: transform .2s ease;
    min-height: 100vh; max-height: 100vh; overflow-y: auto;
    grid-area: unset; margin: 0; padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main {
    flex: 1 1 auto; width: 100%; min-width: 0; order: 1;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  body.olymp-nav-open { overflow: hidden; }
  body.olymp-nav-open .main { touch-action: none; }
  .hero-meta { flex-wrap: wrap; }
  .auth-form { padding: 32px 24px; }
  .main { padding: 16px; }
  h2 { font-size: 22px; }
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; background: var(--bg); border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 700; }
.lang span { padding: 6px 9px; }
.lang .on { background: var(--blue); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer;
  font-weight: 700; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid #C9D8F5; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn:disabled, .btn.disabled { background: #D5DCE8; color: #8A97AB; cursor: not-allowed; }
.btn:hover { filter: brightness(0.97); }
.btn-primary:hover { background: var(--blue-dark); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gold { background: var(--gold-soft); color: #8A6D12; }
.badge-gray { background: #EEF2F7; color: #5B6B82; }
.badge-orange { background: var(--orange-soft); color: var(--orange); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.hero {
  background: linear-gradient(120deg, #0D3B8C 0%, #1557C0 52%, #1E6BFF 100%);
  color: #fff; padding: 48px 0 56px; position: relative; overflow: hidden;
}
.hero:after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { color: #fff; max-width: 720px; margin: 16px 0 12px; }
.hero p { color: rgba(255,255,255,.86); max-width: 620px; font-size: 18px; }
.hero-meta { display: flex; gap: 28px; margin: 22px 0 28px; }
.hero-meta div b { display: block; font-size: 20px; }
.hero-meta div span { font-size: 12px; opacity: .8; }
.hero-actions { display: flex; gap: 12px; }
.hero .btn-primary { background: #fff; color: var(--blue-dark); }
.hero .btn-red { background: var(--red); }
.hero-panel { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 18px; backdrop-filter: blur(8px); width: 320px; }
.hero-panel h3 { margin-bottom: 12px; }
.stat-mini { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.stat-mini:last-child { border-bottom: 0; }

.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-head p { color: var(--muted); max-width: 520px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-5 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }

.olymp-card { overflow: hidden; }
.olymp-card .cover { height: 110px; background: linear-gradient(135deg, #1557C0, #3B7BFF); position: relative; }
.olymp-card .cover.red { background: linear-gradient(135deg, #C81E25, #E85A5A); }
.olymp-card .cover.teal { background: linear-gradient(135deg, #0E6B7A, #1AA3B8); }
.olymp-card .cover.gold { background: linear-gradient(135deg, #8A6D12, #C9A227); }
.olymp-card .body { padding: 16px 18px 18px; }
.olymp-card h3 { margin: 8px 0 6px; font-size: 17px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: 13px; margin: 10px 0 14px; }
.price { font-size: 20px; font-weight: 800; color: var(--blue-dark); }

.icon-box { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px; }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--muted); margin-top: 8px; }

.site-footer { background: #0E1B33; color: #C9D4E6; padding: 36px 0 18px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; margin-bottom: 12px; }
.site-footer a, .site-footer p { color: #A9B7CC; font-size: 13px; display: block; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 24px; padding-top: 14px; display: flex; justify-content: space-between; font-size: 12px; color: #7E8DA3; }

.form-card { max-width: 760px; margin: 28px auto 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.olymp-public-pad { padding: 28px 0 48px; }
.olymp-course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: 20px;
  align-items: start;
}
.olymp-course-side { min-width: 0; }
.olymp-course-head { gap: 16px; flex-wrap: wrap; }
.pay-box .stat-mini { border-bottom: 1px solid var(--line); color: var(--ink); }
.pay-box .stat-mini span { color: var(--muted); }
.form-row.check label { font-weight: 500; color: var(--muted); }
.form-row input, .form-row select {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff;
}
.form-row > label:not(.check) { font-weight: 700; font-size: 13px; }
@media (max-width: 900px) {
  .olymp-course-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
label { font-size: 12px; font-weight: 700; color: var(--muted); }
input, select, textarea {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; color: var(--ink);
}
textarea { height: 92px; padding: 10px 12px; resize: none; }
.check {
  display: inline-flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted);
  font-weight: 500; cursor: pointer; line-height: 1.35; margin: 0;
}
.check span { color: var(--muted); }
.check input[type="checkbox"],
.check input[type="radio"] {
  width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--blue); cursor: pointer;
}
.form-row > label.check { flex-direction: row; align-items: center; }
.form-row-checks { flex-direction: row; flex-wrap: wrap; gap: 12px 20px; }
.form-row-checks > .check { width: auto; }
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px; width: 100%;
}
.check-grid .check { width: 100%; }
.filters-form { align-items: end; }
.filters-form .form-row { min-width: 0; }
.filters-form .form-actions { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }

.file-upload { display: flex; flex-direction: column; gap: 8px; }
.file-upload-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 10px; border: 1px dashed #C9D8F5;
  background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; cursor: pointer;
}
.file-upload-btn:hover { background: #dce8ff; }
.file-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-upload-name { font-size: 13px; color: var(--muted); min-height: 18px; }

.olymp-back-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 10050;
  background: var(--blue); color: #fff !important; padding: 12px 16px; border-radius: 12px;
  font-weight: 700; box-shadow: var(--shadow); text-decoration: none !important;
}
.olymp-back-fab:hover { background: var(--blue-dark); color: #fff !important; }

/* Right column stretches to form height so sticky preview can ride the scroll. */
.diploma-editor-layout { align-items: stretch; }
.diploma-editor-preview-col {
  align-self: stretch; min-height: 0; position: relative;
}
.diploma-editor-preview-stick {
  position: sticky; top: 20px; z-index: 5;
  max-height: calc(100vh - 40px);
}
.diploma-editor-preview-stick .card {
  max-height: calc(100vh - 40px);
  overflow: auto;
}
@media (max-width: 1100px) {
  .diploma-editor-preview-stick,
  .diploma-editor-preview-stick .card {
    position: static; max-height: none; overflow: visible;
  }
}
.diploma-preview-stage {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  aspect-ratio: 1.414 / 1; margin-top: 12px; overflow: hidden; box-shadow: inset 0 0 0 8px #f3f6fb;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
.diploma-preview-item {
  position: absolute; box-sizing: border-box;
  white-space: normal; word-break: break-word; line-height: 1.15;
  color: #111; font-weight: 400; pointer-events: none;
}
.diploma-preview-qr {
  position: absolute; border: 1px dashed var(--muted); display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.8);
}
.tabs { display: flex; background: var(--bg); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 18px; }
.tab { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.tab.on { background: #fff; color: var(--blue-dark); box-shadow: var(--shadow-sm); }

.app {
  display: grid; grid-template-columns: 248px 1fr; grid-template-areas: "side main";
  min-height: 100vh; align-items: stretch; position: relative;
}
.app-topbar {
  display: none; grid-area: top; grid-column: 1 / -1;
  align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: #fff; position: sticky; top: 0; z-index: 30;
}
.app-topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-topbar-title { font-weight: 800; font-size: 16px; color: var(--blue-dark); line-height: 1; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 35; pointer-events: none; }
.sidebar-backdrop.is-open { pointer-events: auto; }
.sidebar {
  grid-area: side; background: #0E1B33; color: #C9D4E6; padding: 20px 14px;
  position: sticky; top: 0; align-self: stretch; min-height: 100vh; z-index: 40;
  margin-top: 0; border-top: 0;
}
.main { grid-area: main; }
.sidebar-close {
  display: none; position: absolute; top: 12px; right: 10px; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 20px;
  line-height: 1; cursor: pointer;
}
.side-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; padding: 6px 8px 18px; }
.side-user { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.side-lang { padding: 0 4px 14px; }
.sidebar .olymp-lang-switch { margin-left: 0; width: 100%; background: rgba(255,255,255,.08); }
.sidebar .olymp-lang-switch a { color: #A9B7CC; flex: 1; justify-content: center; }
.sidebar .olymp-lang-switch a.on { background: var(--blue); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #A9B7CC; font-weight: 600; margin-bottom: 4px; }
.side-nav a.on { background: var(--blue); color: #fff; }
.main { padding: 24px 28px 40px; min-width: 0; }
.olymp-app { min-height: 100vh !important; }
body.olymp-clean #page, body.olymp-clean .olymp-page, body.olymp-clean .olymp-page-content, body.olymp-clean #region-main {
  max-width: none !important; padding: 0 !important; margin: 0 !important;
}
body.olymp-clean #region-main { overflow: visible !important; }
body.olymp-clean .toast-wrapper, body.olymp-clean .toast-container { display: none !important; }
.kpi { padding: 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 4px; }
.kpi .delta { font-size: 12px; color: var(--green); font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFE; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFCFF; }

.olymp-table { width: 100%; font-size: 13px; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .olymp-table,
.table-scroll table,
.card:has(> table) > table,
.card:has(> .olymp-table) > .olymp-table { min-width: 680px; }
.card:has(> table),
.card:has(> .olymp-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin: 2px 0; }
.col-hide-lg, .col-hide-md, .col-hide-sm { }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters select, .filters input { height: 38px; min-width: 140px; }
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.filters-bar .form-row { min-width: 140px; flex: 1 1 160px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.empty-state { text-align: center; padding: 32px 20px; color: var(--muted); }
.empty-state .btn { margin-top: 12px; }
.empty-row td { text-align: center !important; padding: 28px 16px !important; color: var(--muted); }

.appeal-review-form { display: flex; flex-direction: column; gap: 8px; min-width: 180px; max-width: 280px; }
.appeal-review-form input { width: 100%; height: 36px; }
.appeal-review-form .btn-group { justify-content: flex-start; }
.appeal-panel { display: none; padding: 12px 0 4px; }
.appeal-panel.is-open { display: block; }
.audit-diff { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 11px; }

@media (max-width: 1200px) {
  .col-hide-lg { display: none !important; }
}
@media (max-width: 900px) {
  .col-hide-md { display: none !important; }
  .between { flex-direction: column; align-items: stretch !important; gap: 12px; }
  .between > .btn, .between > .toolbar-actions { width: 100%; }
  .between > .btn { justify-content: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { flex: 0 0 auto; min-width: 110px; }
  .container { max-width: calc(100% - 24px); }
}
@media (max-width: 640px) {
  .col-hide-sm { display: none !important; }
  .main { padding: 12px; }
  .card-pad { padding: 14px; }
  .kpi .value { font-size: 22px; }
}

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.count-box { background: #fff; border-radius: 16px; text-align: center; padding: 22px 8px; border: 1px solid var(--line); }
.count-box b { display: block; font-size: 42px; letter-spacing: -0.04em; color: var(--blue-dark); }
.count-box span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }

.test-shell { min-height: 100vh; background: #F3F6FB; }
.test-top { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.timer { background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 20px; padding: 8px 14px; border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }
.test-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 24px; align-items: start; }
@media (max-width: 960px) {
  .test-layout { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
}
.question { padding: 28px; }
.q-progress { height: 6px; background: #E6EDF7; border-radius: 99px; overflow: hidden; margin: 12px 0 22px; }
.q-progress span { display: block; height: 100%; width: 20%; background: var(--blue); }
.answer { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.answer.on { border-color: var(--blue); background: var(--blue-soft); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #B8C4D8; }
.answer.on .radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.proctor { padding: 16px; }
.cam { height: 180px; border-radius: 12px; background: linear-gradient(180deg, #1B2A44, #0E1B33); position: relative; overflow: hidden; }
.cam:before { content: ""; position: absolute; left: 50%; top: 42%; width: 86px; height: 86px; margin-left: -43px; border: 2px dashed rgba(255,255,255,.35); border-radius: 50%; }
.cam-face { position: absolute; left: 50%; top: 38%; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%; background: #3D5478; }
.live { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.check-list { margin-top: 12px; }
.check-item { display: flex; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.ok { color: var(--green); font-weight: 800; }
.warn { color: var(--orange); font-weight: 800; }

.diploma-wrap { background: #E9EEF6; min-height: 1100px; padding: 32px 0; }
.diploma {
  width: 920px; margin: 0 auto; background: #fff; border: 12px solid #0D3B8C; padding: 36px 48px;
  position: relative; min-height: 920px;
}
.diploma:before { content: ""; position: absolute; inset: 10px; border: 2px solid #C9A227; pointer-events: none; }
.diploma-head { text-align: center; }
.diploma h1 { font-size: 36px; color: var(--blue-dark); margin: 12px 0 4px; letter-spacing: .12em; }
.diploma .deg { color: var(--red); font-size: 22px; font-weight: 800; letter-spacing: .18em; }
.diploma .who { font-size: 32px; font-weight: 800; text-align: center; margin: 28px 0 8px; }
.diploma .meta { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 24px; font-size: 16px; }
.diploma-foot { display: flex; justify-content: space-between; align-items: end; margin-top: 48px; }

.verify { max-width: 720px; margin: 48px auto; text-align: center; }
.verify-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; margin: 0 auto 16px; }
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; margin-top: 24px; }
.verify-item { background: var(--bg); border-radius: 12px; padding: 14px; }
.verify-item span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.verify-item b { font-size: 16px; }

.chart { height: 180px; display: flex; align-items: end; gap: 8px; padding: 8px 4px 0; }
.bar { flex: 1; background: linear-gradient(180deg, #4C84F0, #1557C0); border-radius: 6px 6px 0 0; }
.bar.alt { background: linear-gradient(180deg, #F06A6F, #E31B23); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }

.pay-box { max-width: 560px; margin: 40px auto; }
.kaspi { background: linear-gradient(90deg, #F14635, #E31B23); color: #fff; border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; margin: 16px 0; font-weight: 800; }
.success-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; margin: 8px auto 16px; }

.dropzone { border: 2px dashed #C9D8F5; border-radius: 16px; background: var(--blue-soft); padding: 28px; text-align: center; }
.error-row td { background: #FDECEC; }

.page-title { margin-bottom: 6px; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.note { background: var(--blue-soft); color: var(--blue-dark); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.note-warning { background: #fff3cd; color: #856404; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.note-danger { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.page-toolbar { margin-bottom: 16px; gap: 16px; align-items: flex-start; }
.page-toolbar .page-title { margin-bottom: 4px; }
.crumbs a { color: var(--blue); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.public-nav-toggle { display: none; }
@media (max-width: 1100px) {
  .public-nav-toggle {
    display: inline-flex; width: 40px; height: 40px; padding: 0; border-radius: 10px; flex-shrink: 0;
  }
  .site-header { position: sticky; top: 0; z-index: 40; }
  .site-header .header-inner {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
    height: auto; min-height: var(--header-h); padding: 8px 0;
  }
  .site-header .logo { flex: 1 1 auto; min-width: 0; font-size: 18px; }
  .site-header .header-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  }
  .site-header .header-actions .btn { height: 36px; padding: 0 12px; font-size: 12px; }
  .site-header .lang { display: none; }
  .olymp-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px 16px;
    flex-direction: column; align-items: stretch; gap: 4px; z-index: 45; box-shadow: var(--shadow);
  }
  .olymp-nav.is-open { display: flex; }
  .olymp-nav a { padding: 10px 8px; border-radius: 8px; }
}

.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.progress-dots { display: flex; gap: 6px; }
.progress-dots i { width: 28px; height: 6px; border-radius: 99px; background: #D7E1F0; }
.progress-dots i.on { background: var(--blue); }
.progress-dots i.now { background: var(--red); }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-visual { background: linear-gradient(160deg, #0D3B8C, #1557C0); color: #fff; padding: 48px; }
.auth-form { background: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; }

/* Login: hide Moodle duplicate headings / guest / cookies chrome */
body.olymp-login .olymp-login-form h1,
body.olymp-login .olymp-login-form .login-heading,
body.olymp-login .olymp-login-form .login-instructions,
body.olymp-login .olymp-login-form .login-identityproviders,
body.olymp-login .loginguest,
body.olymp-login .login-form-guest,
body.olymp-login #guestlogin,
body.olymp-login form[data-login="guest"],
body.olymp-login .login-divider,
body.olymp-login .login-divider-text,
body.olymp-login .login-languagemenu,
body.olymp-login .btn-footer-popover,
body.olymp-login [data-action="show-cookies"],
body.olymp-login a[href*="cookies"],
body.olymp-login .footer-content-popover,
body.olymp-login .potentialidps,
body.olymp-login .login-signup,
body.olymp-login .login-form .forgetpass + .mt-3,
body.olymp-login .olymp-login-form > .mb-3:has(h1),
body.olymp-login .olymp-login-form .card-body > h1,
body.olymp-login .olymp-login-form .card-body > h2 {
  display: none !important;
}
/* Hide guest login block even if Moodle uses different markup */
body.olymp-login .olymp-login-form form[action*="guest"],
body.olymp-login .olymp-login-form button[name="guestlogin"],
body.olymp-login .olymp-login-form input[name="loginguest"],
body.olymp-login .olymp-hide-guest {
  display: none !important;
}
body.olymp-login .olymp-login-form .login-form,
body.olymp-login .olymp-login-form .loginform {
  max-width: 420px;
}
body.olymp-login .olymp-login-form input[type="text"],
body.olymp-login .olymp-login-form input[type="password"],
body.olymp-login .olymp-login-form input[type="email"] {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; width: 100%;
}
body.olymp-login .olymp-login-form .btn-primary,
body.olymp-login .olymp-login-form button[type="submit"] {
  background: var(--blue) !important; border: 0 !important; border-radius: 10px !important;
  height: 44px; font-weight: 700; width: 100%;
}

.result-score { font-size: 56px; font-weight: 800; color: var(--blue-dark); letter-spacing: -0.04em; }
.place-I { color: #C9A227; } .place-II { color: #7D8A9A; } .place-III { color: #B87333; }

.olymp-error-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--bg);
}
.olymp-error-visual {
  background: linear-gradient(160deg, #0D3B8C, #1557C0); color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.olymp-error-visual h1 { color: #fff; font-size: 36px; margin-top: 48px; }
.olymp-error-visual p { color: rgba(255,255,255,.85); font-size: 17px; max-width: 420px; margin-top: 14px; }
.olymp-error-panel {
  background: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
.olymp-error-panel h2 { margin-bottom: 4px; }
.olymp-error-trace {
  white-space: pre-wrap; word-break: break-word; font-size: 11px; margin: 8px 0 0;
  max-height: 220px; overflow: auto; background: #f7f9fc; padding: 10px; border-radius: 8px;
}
body.olymp-error #maincontent {
  display: block !important; height: 0 !important; margin: 0 !important; padding: 0 !important;
  border: 0 !important; overflow: hidden !important; visibility: hidden !important;
}
@media (max-width: 900px) {
  .olymp-error-wrap { grid-template-columns: 1fr; }
  .olymp-error-visual { padding: 32px 24px; min-height: 220px; }
  .olymp-error-visual h1 { font-size: 28px; margin-top: 24px; }
  .olymp-error-panel { padding: 28px 24px 40px; border-left: 0; border-top: 1px solid var(--line); }
}

/* Language switcher */
.olymp-lang-switch {
  display: inline-flex; align-items: center; gap: 2px; margin-left: auto;
  background: var(--bg); border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 700;
}
.app-topbar .olymp-lang-switch { margin-left: auto; flex-shrink: 0; }
.olymp-lang-switch a {
  padding: 6px 10px; color: var(--muted); text-decoration: none; display: inline-flex;
}
.olymp-lang-switch a.on { background: var(--blue); color: #fff; }

/* Mobile admin shell — must stay last for cascade */
@media (max-width: 1100px) {
  body.olymp-clean,
  body.olymp-clean #page,
  body.olymp-clean .olymp-page,
  body.olymp-clean .olymp-page-content,
  body.olymp-clean #region-main {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  body.olymp-clean .app.olymp-app {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    overflow-x: hidden !important;
  }
  body.olymp-clean .app.olymp-app > .app-topbar {
    display: flex !important;
    order: -1 !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 80 !important;
    background: #fff !important;
    padding: 10px 14px !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 1px 0 rgba(14, 27, 51, .06) !important;
  }
  body.olymp-clean .app.olymp-app > .sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 90 !important;
  }
  body.olymp-clean .app.olymp-app > .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(280px, 88vw) !important;
    z-index: 100 !important;
    transform: translateX(-105%) !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    grid-area: unset !important;
    margin: 0 !important;
  }
  body.olymp-clean .app.olymp-app > .sidebar.is-open {
    transform: translateX(0) !important;
  }
  body.olymp-clean .app.olymp-app > .main {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px 16px 24px !important;
    grid-area: unset !important;
  }
  body.olymp-clean .app.olymp-app .between,
  body.olymp-clean .app.olymp-app .page-toolbar,
  body.olymp-clean .app.olymp-app .grid-2,
  body.olymp-clean .app.olymp-app .form-grid {
    max-width: 100% !important;
  }
}
