/* ==========================================================================
   MTITR — Premium theme layer (visual only).
   Loaded after tokens / components / layout: it restyles what is already there and never changes
   markup, behaviour or content. Remove the <link> to theme.css to return to the previous look.
   Colours come from the design tokens, so the light and dark themes both follow automatically.
   ========================================================================== */

@media screen {
:root {
  /* one hue per area of the site: the sidebar groups, the home cards and the page icons use them */
  --c-blue: #2563EB;   --c-sky: #0284C7;  --c-teal: #0D9488;  --c-violet: #7C3AED;
  --c-indigo: #4F46E5; --c-pink: #DB2777; --c-amber: #D97706; --c-emerald: #059669;
  --grad-aurora: linear-gradient(120deg, #2563EB 0%, #4F46E5 35%, #7C3AED 65%, #0EA5E9 100%);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px -6px rgba(37, 99, 235, .12);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 36px -12px rgba(79, 70, 229, .28);
  --radius: 14px;
  --radius-lg: 20px;
  --t-spring: .35s cubic-bezier(.2, .9, .25, 1.15);
}

/* ---------- page backdrop: soft aurora behind every page ---------- */
body {
  background:
    radial-gradient(900px 520px at 100% -10%, color-mix(in srgb, var(--c-violet) 9%, transparent), transparent 65%),
    radial-gradient(800px 480px at -10% 30%, color-mix(in srgb, var(--c-sky) 8%, transparent), transparent 60%),
    radial-gradient(700px 420px at 60% 110%, color-mix(in srgb, var(--c-indigo) 7%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { letter-spacing: -.012em; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- headers ---------- */
.site-header, .app-header {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.app-header::after, .site-header::after { background: var(--grad-aurora); opacity: .7; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 4px 14px rgba(37, 99, 235, .25); transition: transform var(--t-spring); }
.brand:hover img { transform: rotate(-6deg) scale(1.05); }
.site-nav a { border-radius: 10px; transition: background var(--t-fast), color var(--t-fast); }
.site-nav a:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.site-nav a.active, .site-nav a[aria-current="page"] { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.gov-strip { background: linear-gradient(90deg, #0A1834, #13306B 55%, #2B1C6B); }

/* ---------- sidebar: every group has its own colour ---------- */
.nav-group { --g: var(--c-blue); }
.nav-group[data-group="edu"] { --g: var(--c-teal); }
.nav-group[data-group="reports"] { --g: var(--c-amber); }
.nav-group[data-group="content"] { --g: var(--c-violet); }
.nav-group[data-group="comm"] { --g: var(--c-pink); }
.nav-group[data-group="admin"] { --g: var(--c-indigo); }
.nav-group > .nav-title { color: color-mix(in srgb, var(--g) 70%, var(--muted)); }
.nav-group > .nav-title span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--g); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 18%, transparent); }
.nav-item { transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.nav-item .ic {
  box-sizing: content-box; padding: 6px; margin: -6px 0; border-radius: 9px;
  color: var(--g); background: color-mix(in srgb, var(--g) 10%, transparent);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-spring);
}
.nav-item:hover { background: color-mix(in srgb, var(--g) 7%, transparent); color: var(--text); transform: translateX(2px); }
.nav-item:hover .ic { color: var(--g); background: color-mix(in srgb, var(--g) 18%, transparent); transform: scale(1.06); }
.nav-item.active { background: linear-gradient(90deg, color-mix(in srgb, var(--g) 16%, transparent), color-mix(in srgb, var(--g) 4%, transparent)); color: color-mix(in srgb, var(--g) 80%, var(--text)); }
.nav-item.active::before { background: var(--g); }
.nav-item.active .ic { color: var(--on-color); background: var(--g); box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--g) 60%, transparent); }
body.sb-collapsed .nav-item .ic { margin: 0; }

/* ---------- page heading ---------- */
.page-ic { background: var(--grad-aurora); background-size: 200% 200%; box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55); border-radius: 15px; }

/* ---------- cards ---------- */
.card, .table-card { border-radius: var(--radius); box-shadow: var(--shadow-card); border-color: color-mix(in srgb, var(--border) 85%, transparent); }
.card-h h2 .ic, .card-h h3 .ic { color: var(--primary); }
.stat-card { border-radius: var(--radius); box-shadow: var(--shadow-card); transition: transform var(--t-spring), box-shadow var(--t), border-color var(--t); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.stat-ic { border-radius: 14px; transition: transform var(--t-spring); }
.stat-card:hover .stat-ic { transform: scale(1.08) rotate(-4deg); }
.stat-value { letter-spacing: -.02em; }

/* stat cards take the colour of their icon: a thin top line and a soft tint */
.stat-card { --s: var(--primary); position: relative; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--s) 6%, var(--surface)) 0%, var(--surface) 55%); }
.stat-card:has(.tone-secondary) { --s: var(--secondary); }
.stat-card:has(.tone-accent) { --s: var(--accent); }
.stat-card:has(.tone-success) { --s: var(--success); }
.stat-card:has(.tone-warning) { --s: var(--warning); }
.stat-card:has(.tone-danger) { --s: var(--danger); }
.stat-card:has(.tone-info) { --s: var(--info); }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--s), color-mix(in srgb, var(--s) 25%, transparent)); }
.stat-card:hover { border-color: color-mix(in srgb, var(--s) 35%, var(--border)); }

/* home: services / about cards — a different colour for each card */
.features .feature { --f: var(--c-blue); position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-card); transition: transform var(--t-spring), box-shadow var(--t), border-color var(--t); }
.features .feature:nth-child(8n+2) { --f: var(--c-teal); }
.features .feature:nth-child(8n+3) { --f: var(--c-violet); }
.features .feature:nth-child(8n+4) { --f: var(--c-amber); }
.features .feature:nth-child(8n+5) { --f: var(--c-pink); }
.features .feature:nth-child(8n+6) { --f: var(--c-sky); }
.features .feature:nth-child(8n+7) { --f: var(--c-emerald); }
.features .feature:nth-child(8n+8) { --f: var(--c-indigo); }
.features .feature::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--f), color-mix(in srgb, var(--f) 30%, transparent)); opacity: 0; transition: opacity var(--t); }
.features .feature:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--f) 35%, var(--border)); }
.features .feature:hover::before { opacity: 1; }
.features .feat-ic { color: var(--f); background: color-mix(in srgb, var(--f) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--f) 22%, transparent); transition: transform var(--t-spring), background var(--t), color var(--t); }
.features .feature:hover .feat-ic { color: var(--on-color); background: var(--f); transform: scale(1.08) rotate(-5deg); }

/* news / book / document tiles */
.tile { border-radius: var(--radius); box-shadow: var(--shadow-card); transition: transform var(--t-spring), box-shadow var(--t); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.tile-media img { transition: transform .6s ease; }
.tile:hover .tile-media img { transform: scale(1.05); }
.doc-row, .file-row, .search-hit { transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.doc-row:hover, .file-row:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.doc-ic, .file-ic { box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .35); }

/* ---------- buttons ---------- */
.btn { border-radius: 11px; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t), transform var(--t-fast); }
.btn:not(:disabled):active { transform: translateY(1px) scale(.99); }
.btn-primary { background-image: var(--grad-aurora); background-size: 180% 100%; background-position: 0 0; transition: background-position .5s ease, box-shadow var(--t), transform var(--t-fast); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 10px 26px -8px rgba(79, 70, 229, .6); filter: none; }
.btn-outline:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.btn-ghost:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.chip, .chip-btn { transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.chip:hover, .chip-btn:hover { transform: translateY(-1px); }

/* ---------- forms ---------- */
.input { border-radius: 11px; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.input:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 35%, var(--border-strong)); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.dropzone { border-radius: var(--radius); transition: border-color var(--t-fast), background var(--t-fast); }
.dropzone:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.file-folder { display: inline-flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; margin-top: 8px; cursor: pointer; }

/* ---------- tables ---------- */
.table th { background: color-mix(in srgb, var(--primary) 5%, var(--surface-2)); color: var(--text-2); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }

/* ---------- badges, tabs, settings ---------- */
.badge { border-radius: 999px; }
.tabs a, .tabs button { border-radius: 10px; }
.settings-nav a { border-radius: 11px; transition: background var(--t-fast), color var(--t-fast); }
.settings-nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent); color: var(--primary); }

/* ---------- public site sections ---------- */
.section-alt {
  background:
    radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--c-sky) 7%, transparent), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, color-mix(in srgb, var(--c-violet) 6%, transparent), transparent 70%),
    var(--surface);
}
.section-head .caption {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary);
  letter-spacing: .08em;
}
.section-dark .section-head .caption { background: rgba(255, 255, 255, .12); color: var(--hero-accent); }
.section-dark .features .feat-ic { color: color-mix(in srgb, var(--f) 45%, #fff); background: color-mix(in srgb, var(--f) 30%, transparent); }
.section-dark .features .feature:hover { border-color: color-mix(in srgb, var(--f) 60%, transparent); }
.hero { isolation: isolate; }
.hero::after {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(35% 40% at 20% 30%, rgba(56, 189, 248, .22), transparent 70%),
    radial-gradient(30% 35% at 80% 60%, rgba(167, 139, 250, .22), transparent 70%);
  animation: mt-aurora 18s ease-in-out infinite alternate;
}
.hero-panel .float-card, .float-card { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform var(--t-spring), background var(--t); }
.float-card:hover { transform: translateY(-4px); }
.hero-cta .btn { border-radius: 12px; }
.cta-band { background: linear-gradient(120deg, #1E3A8A 0%, #3730A3 35%, #5B21B6 65%, #1E40AF 100%); background-size: 200% 200%; animation: mt-flow 14s ease infinite; border-radius: var(--radius-lg); box-shadow: 0 24px 50px -20px rgba(79, 70, 229, .55); }
.site-footer { position: relative; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-aurora); }
.place, .podium .place { transition: transform var(--t-spring), box-shadow var(--t); }
.place:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.month-card, .event { transition: transform var(--t-spring), box-shadow var(--t), border-color var(--t); }
.month-card:hover, .event:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }

/* ---------- login / register ---------- */
.auth-card { border-radius: var(--radius-lg); box-shadow: 0 30px 60px -24px rgba(37, 99, 235, .35), 0 2px 6px rgba(15, 23, 42, .05); }
.auth-card img { filter: drop-shadow(0 6px 14px rgba(37, 99, 235, .3)); }

/* ---------- dashboard welcome ---------- */
.welcome { background-size: 180% 180%; animation: mt-flow 16s ease infinite; box-shadow: 0 24px 48px -24px rgba(29, 78, 216, .6); }

/* ---------- chats ---------- */
.msg.me { background: var(--grad-aurora); }
.conv { transition: background var(--t-fast); border-radius: 12px; }
.conv.active { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent); }
.chat, .g-side, .chat-list { border-radius: var(--radius); }

/* ---------- toasts & modals ---------- */
.toast { border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.modal-box { border-radius: var(--radius-lg); box-shadow: 0 40px 80px -30px rgba(15, 23, 42, .5); }

/* ---------- gentle entrance of every page ---------- */
#main > * { animation: mt-rise .38s ease both; }
.features .feature, .stats > *, .card-grid > * { animation: mt-rise .45s ease both; }
.features .feature:nth-child(2), .stats > :nth-child(2) { animation-delay: .04s; }
.features .feature:nth-child(3), .stats > :nth-child(3) { animation-delay: .08s; }
.features .feature:nth-child(4), .stats > :nth-child(4) { animation-delay: .12s; }
.features .feature:nth-child(n+5), .stats > :nth-child(n+5) { animation-delay: .16s; }

@keyframes mt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mt-flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes mt-aurora { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(3%, 2%, 0) scale(1.08); } }

/* ---------- dark theme: deeper backdrop, glowing accents ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background:
      radial-gradient(900px 520px at 100% -10%, rgba(124, 58, 237, .16), transparent 65%),
      radial-gradient(800px 480px at -10% 30%, rgba(2, 132, 199, .13), transparent 60%),
      var(--bg);
    background-attachment: fixed;
  }
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(124, 58, 237, .16), transparent 65%),
    radial-gradient(800px 480px at -10% 30%, rgba(2, 132, 199, .13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-theme="dark"] .nav-group[data-group] .nav-item .ic { background: color-mix(in srgb, var(--g) 18%, transparent); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .stat-card, :root[data-theme="dark"] .feature, :root[data-theme="dark"] .tile { box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 28px -14px rgba(0, 0, 0, .6); }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  body { background-attachment: scroll; }
  .features .feature:hover, .tile:hover, .stat-card:hover { transform: none; }
  .nav-item:hover { transform: none; }
}

/* registration: choose who you are */
.reg-choose { display: grid; gap: 10px; }
.reg-opt { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t), transform var(--t-fast); }
.reg-opt:hover, .reg-opt:focus-visible { border-color: var(--primary); box-shadow: var(--shadow-card); transform: translateY(-1px); }
.reg-opt b { display: block; font-size: 1rem; }
.reg-opt small { display: block; color: var(--muted); margin-top: 2px; }
.reg-opt .feat-ic { flex: 0 0 auto; }
.site-tiles { margin: 18px 0; }

/* people who asked for less motion get none */
@media (prefers-reduced-motion: reduce) {
  #main > *, .features .feature, .stats > *, .card-grid > *, .hero::after, .cta-band, .welcome { animation: none !important; }
  .btn-primary, .stat-card, .feature, .tile, .nav-item, .nav-item .ic { transition: none !important; }
}
}

/* printing: no backgrounds, no effects */
@media print {
  body { background: #fff !important; }
  #main > * { animation: none !important; }
  .hero::after, .site-footer::before { display: none; }
}

@media screen {
/* ---- site users (leadership page) ---- */
.su-charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 16px 0; }
.su-charts .card { margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.linklike:hover b { color: var(--primary); text-decoration: underline; }
.su-person { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.su-photo { width: 180px; height: 220px; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
@media (max-width: 600px) {
  .su-person { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .su-photo { width: 150px; height: 180px; }
}

/* narrow desktops (1241–1320px): the full nav and the login button do not fit together */
@media (min-width: 1241px) and (max-width: 1320px) {
  .site-header .header-actions .login-text { display: none; }
  .site-nav a { padding: 7px 5px; }
}

/* ---- pictures drawn by the AI assistant (SVG) ---- */
.ai-svg { margin: 10px 0; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 14px; max-width: 100%; }
.ai-svg img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 8px; }
.ai-svg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- lesson games launcher (everyone) ---- */
.games-launch { margin: 16px 0; }
.games-emoji { font-size: 2rem; line-height: 1; }

/* ==== Public site — the 5-screen design (banners, side menus, colourful tiles) ==== */
.site { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 6%, var(--bg)) 0%, var(--bg) 420px); }
.pd-home { padding-bottom: 8px; }

/* header: icon above the label, the active item is a filled blue tile */
@media (min-width: 1241px) {
  .site-header .container { min-height: 76px; }
  .site-nav { gap: 4px; }
  .site-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 9px; font-size: .76rem; line-height: 1.1; border-radius: 12px; min-width: 64px; }
  .site-nav a .ic { width: 20px; height: 20px; }
  .site-nav a.active, .site-nav a[aria-current="page"] { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
  .site-nav a.active:hover { color: #fff; }
}
@media (max-width: 1240px) {
  .site-nav a { display: flex; align-items: center; gap: 10px; }
}

/* blue banner with the photo on the right */
.pd-banner { position: relative; overflow: hidden; color: #fff; border-radius: 18px; margin: 18px auto 0; width: min(1200px, calc(100% - 40px));
  background: linear-gradient(110deg, #0a2f7a 0%, #1146b8 45%, #2563eb 100%);
  box-shadow: 0 14px 34px rgba(17, 70, 184, .22); }
/* the right part of the centre's picture (mountains, map, the city), fading into the blue */
.pd-banner::before, .page-hero.pd-banner::before { content: ""; position: absolute; inset: 0 0 0 auto; width: 48%; background: url(/assets/img/hero.jpg) 100% 16% / 330% auto no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%); pointer-events: none; }
.pd-banner::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.pd-banner-in { position: relative; z-index: 1; padding: 28px 32px; max-width: 720px; }
.pd-banner h1, .pd-banner h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.35rem, 1rem + 1.4vw, 2rem); line-height: 1.2; }
.pd-banner p { color: rgba(255, 255, 255, .95); margin: 0; }
.pd-banner .crumbs, .pd-banner .crumbs span { color: #fff; margin-bottom: 8px; }
.pd-banner .crumbs a { color: #fff; }
.page-hero.pd-banner { padding: 0; }
.page-hero.pd-banner .pd-banner-in { padding: 26px 32px; }
.pd-hero { min-height: 300px; display: flex; align-items: center; }
.pd-hero .pd-banner-in { padding: 40px 36px; }
.pd-hero h1 { font-size: clamp(1.5rem, 1.05rem + 1.6vw, 2.2rem); }
.pd-hero-cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pd-search { display: flex; align-items: center; gap: 8px; margin-top: 16px; max-width: 560px; background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px; color: #64748b; box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
.pd-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: #0f172a; padding: 8px 0; }
.pd-search .btn { flex: 0 0 auto; }

.pd-wrap { width: min(1200px, calc(100% - 40px)); margin: 18px auto 0; }
.pd-screen { padding-bottom: 26px; }
.pd-screen + .pd-screen { border-top: 1px dashed color-mix(in srgb, var(--primary) 18%, transparent); padding-top: 8px; }
.pd-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px rgba(37, 99, 235, .06); }
.pd-card h2 { font-size: 1.1rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.pd-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pd-card-h h2 { margin: 0; }
.pd-card-h a { font-size: .85rem; font-weight: 600; }
.pd-more { display: grid; gap: 16px; }
.pd-more-link { margin: 16px 0 0; text-align: center; }

/* tones */
.t1 { --c1: #3b82f6; --c2: #1d4ed8; } .t2 { --c1: #fb7185; --c2: #e11d48; } .t3 { --c1: #34d399; --c2: #059669; } .t4 { --c1: #fbbf24; --c2: #f97316; }
.t5 { --c1: #c084fc; --c2: #7c3aed; } .t6 { --c1: #60a5fa; --c2: #2563eb; } .t7 { --c1: #2dd4bf; --c2: #0d9488; } .t8 { --c1: #f472b6; --c2: #db2777; }

/* screen 1: category tiles, wide tiles, stats, three columns */
.pd-cats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.pd-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text); text-decoration: none; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.pd-cat:hover, .pd-wide:hover, .pd-lib:hover, .pd-news:hover, .pd-teacher:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(37, 99, 235, .14); }
.pd-cat b { font-size: .82rem; line-height: 1.2; }
.pd-cat small { color: var(--muted); font-size: .75rem; }
.pd-cat-ic { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--c2) 35%, transparent); flex: 0 0 auto; }
.pd-wides { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pd-wide { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.pd-wide .pd-cat-ic { width: 40px; height: 40px; border-radius: 11px; }
.pd-wide b { flex: 1; min-width: 0; font-size: .9rem; overflow-wrap: break-word; }
.pd-wide > .ic:last-child { color: var(--muted); }
.pd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.pd-stat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pd-stat b { display: block; font-size: 1.3rem; line-height: 1.1; }
.pd-stat small { color: var(--muted); font-size: .78rem; }
.pd-stat-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); flex: 0 0 auto; }
.pd-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.pd-news-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pd-news-mini .pd-news-body p { display: none; }
.pd-news-mini .pd-news-body h3 { font-size: .82rem; }
.pd-events { display: grid; gap: 10px; }
.pd-event { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 6px; border-radius: 12px; }
.pd-event:hover { background: var(--surface-2); }
.pd-event b { display: block; font-size: .86rem; line-height: 1.25; }
.pd-event small { color: var(--muted); font-size: .76rem; }
.pd-date { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: #fff; background: var(--c2); line-height: 1; flex: 0 0 auto; }
.pd-date b { font-size: 1.05rem; } .pd-date small { font-size: .66rem; color: #fff; }
.pd-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pd-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: .72rem; text-align: center; }
.pd-tool-logo { display: grid; place-items: center; width: 100%; height: 46px; border-radius: 12px; color: #fff; font-weight: 800; font-size: .86rem; }
.tool-k { background: #46178f; } .tool-q { background: #7a43b6; } .tool-w { background: #ffd447; color: #1e1b4b; } .tool-y { background: #cc0000; } .tool-c { background: linear-gradient(135deg, #0e7490, #6d28d9); } .tool-g { background: #0b7a43; }

/* screen 2: news cards */
.pd-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.pd-side { position: sticky; top: calc(var(--header-h) + 14px); display: grid; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.pd-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .88rem; }
.pd-side a span { flex: 1; min-width: 0; overflow-wrap: break-word; }
.pd-side a small { color: var(--muted); font-weight: 500; }
.pd-side a:hover { background: var(--surface-2); color: var(--primary); }
.pd-side a.on { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.pd-side a.on small { color: rgba(255, 255, 255, .85); }
.pd-grid3, .pd-list-3 .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pd-grid4, .pd-list-4 .card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pd-news { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.pd-news-media { aspect-ratio: 16 / 10; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--surface)), var(--surface-2)); display: grid; place-items: center; color: var(--primary); }
.pd-news-media img, .pd-news-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-news-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
.pd-news-body h3 { margin: 0; font-size: .95rem; line-height: 1.3; }
.pd-news-body p { margin: 0; color: var(--muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pd-news-body .btn { align-self: flex-start; margin-top: auto; }
.pd-news-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .74rem; color: var(--muted); }
.pd-tag { padding: 3px 8px; border-radius: 6px; background: #166534; color: #fff; font-weight: 700; font-size: .7rem; }

/* screen 3: teacher cards */
.pd-teacher { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 16px 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.pd-teacher-ph { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface-2)); }
.pd-teacher-ph img { width: 100%; height: 100%; object-fit: cover; }
.pd-teacher-ph .avatar { width: 96px; height: 96px; font-size: 1.7rem; }
.pd-teacher h3 { margin: 0; font-size: .95rem; }
.pd-teacher p { margin: 0; color: var(--text-2); font-size: .84rem; }
.pd-teacher small { color: var(--muted); font-size: .76rem; min-height: 1em; }
.pd-teacher .btn { margin-top: 8px; min-width: 110px; }

/* screen 4: library tiles */
.pd-libs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pd-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.pd-doc { padding: 12px 14px; }
.pd-doc .pd-lib-t { flex: 1; min-width: 0; }
.pd-doc b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pd-sub { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.02rem; }
.pd-cols.pd-cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pd-cols.pd-cols-2 > :first-child { grid-column: auto; }
.pd-lib { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text); text-decoration: none; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.pd-lib-t { flex: 1; min-width: 0; }
.pd-lib b { display: block; font-size: .9rem; overflow-wrap: break-word; hyphens: auto; }
.pd-lib small { color: var(--muted); font-size: .8rem; }
.pd-lib > .ic:last-child { color: var(--muted); }
.pd-list .toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; }

/* screen 5: about */
.pd-about { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pd-about-main, .pd-about-side { display: grid; gap: 16px; }
.pd-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.pd-values span { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: .8rem; font-weight: 600; padding: 12px 6px; border-radius: 14px; background: color-mix(in srgb, var(--c2) 9%, var(--surface)); color: var(--text); }
.pd-values span .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.pd-leaders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pd-leader { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.pd-leader img, .pd-leader .avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid color-mix(in srgb, var(--primary) 25%, var(--surface)); }
.pd-leader b { font-size: .86rem; }
.pd-leader small { color: var(--muted); font-size: .76rem; }
.pd-mini-stats { display: grid; gap: 12px; }
.pd-mini-stats > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.pd-mini-stats .pd-stat-ic { grid-row: span 2; }
.pd-mini-stats b { font-size: 1.25rem; line-height: 1; }
.pd-mini-stats small { color: var(--muted); }
.pd-contacts h3 { margin: 0 0 8px; color: var(--primary); }
.pd-contacts p { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: .88rem; }
.pd-contacts a { display: inline-flex; gap: 8px; align-items: center; }

/* footer */
.pd-footer { background: var(--surface); color: var(--text-2); border-top: 1px solid var(--border); margin-top: 20px; }
.pd-footer .brand-name { color: var(--text); }
.pd-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 18px 0; }
.pd-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pd-foot-links a { color: var(--text-2); font-weight: 600; font-size: .9rem; }
.pd-foot-links a:hover { color: var(--primary); }
.pd-foot-act { display: flex; align-items: center; gap: 8px; }
.pd-footer .btn-glass { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.pd-footer .footer-bottom { border-top: 1px solid var(--border); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 0; font-size: .82rem; }

/* tablets and phones */
@media (max-width: 1200px) {
  .pd-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pd-cols > :first-child { grid-column: 1 / -1; }
  .pd-grid4, .pd-list-4 .card-grid, .pd-libs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pd-layout, .pd-about { grid-template-columns: minmax(0, 1fr); }
  .pd-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
  .pd-side a { flex: 0 1 auto; max-width: 100%; padding: 8px 10px; font-size: .82rem; background: var(--surface-2); }
  .pd-side a span { flex: 0 1 auto; }
  .pd-wides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-grid3, .pd-list-3 .card-grid, .pd-grid4, .pd-list-4 .card-grid, .pd-libs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-leaders, .pd-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-banner::before { width: 60%; opacity: .45; }
}
@media (max-width: 600px) {
  .pd-banner, .pd-wrap { width: calc(100% - 24px); }
  .pd-cols.pd-cols-2, .pd-docs { grid-template-columns: minmax(0, 1fr); }
  .pd-banner::before, .page-hero.pd-banner::before { display: none; } /* phones: no photo download, faster first paint */
  .page-hero.pd-banner { width: calc(100% - 24px); }
  .pd-banner-in, .page-hero.pd-banner .pd-banner-in, .pd-hero .pd-banner-in { padding: 20px 16px; }
  .pd-hero { min-height: 240px; }
  .pd-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pd-cat { padding: 12px 4px; }
  .pd-cat-ic { width: 44px; height: 44px; }
  .pd-cat b { font-size: .74rem; }
  .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-cols, .pd-news-mini { grid-template-columns: minmax(0, 1fr); }
  .pd-grid3, .pd-list-3 .card-grid, .pd-libs { grid-template-columns: minmax(0, 1fr); }
  .pd-grid4, .pd-list-4 .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pd-teacher-ph .avatar { width: 72px; height: 72px; font-size: 1.3rem; }
  .pd-search .btn span, .pd-search .btn { font-size: .8rem; }
  .pd-foot-row { flex-direction: column; align-items: flex-start; }
  .pd-wide { padding: 10px; gap: 8px; }
  .pd-wide > .ic:last-child { display: none; }
  .pd-wide b { font-size: .8rem; }
}
@media (max-width: 360px) {
  .pd-banner h1, .pd-banner h2, .pd-hero h1 { font-size: 1.25rem; overflow-wrap: break-word; }
  .pd-search { padding-left: 10px; }
  .pd-search .btn { padding: 6px 8px; }
  .pd-banner-in { min-width: 0; }
}
}

/* ==== Cabinet (inside the site) in the same design as the public pages ==== */
@media screen {
.app-header { box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 8%, transparent), 0 6px 20px rgba(37, 99, 235, .06); }
.sidebar { background: var(--surface); }
/* the active menu item is a filled blue tile, as in the public header */
.nav-item { border-radius: 12px; }
.nav-item.active, .nav-group[data-group] .nav-item.active { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.nav-item.active::before { display: none; }
.nav-item.active .ic, .nav-group[data-group] .nav-item.active .ic { color: #fff; background: rgba(255, 255, 255, .18); box-shadow: none; }
.nav-item.active:hover { color: #fff; }

/* page title = blue banner with the centre's picture on the right */
.page-head { position: relative; overflow: hidden; align-items: center; color: #fff; padding: 22px 26px; border-radius: 18px;
  background: linear-gradient(110deg, #0a2f7a 0%, #1146b8 45%, #2563eb 100%); box-shadow: 0 14px 34px rgba(17, 70, 184, .2); }
.page-head::before { content: ""; position: absolute; inset: 0 0 0 auto; width: 42%; background: url(/assets/img/hero.jpg) 100% 16% / 330% auto no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%); mask-image: linear-gradient(90deg, transparent 0%, #000 60%); opacity: .9; pointer-events: none; }
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { color: #fff; }
.page-head p, .page-head .muted { color: rgba(255, 255, 255, .95); }
.page-head .page-ic { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.page-head .btn-primary { background: #fff; color: #1e40af; border-color: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .18); }
.page-head .btn-primary:hover { background: #eef2ff; color: #1e3a8a; }
.page-head .btn-outline, .page-head .btn-secondary, .page-head .btn-ghost { background: rgba(10, 47, 122, .45); color: #fff; border-color: rgba(255, 255, 255, .55); }
.page-head .btn-outline:hover, .page-head .btn-secondary:hover, .page-head .btn-ghost:hover { background: rgba(10, 47, 122, .65); color: #fff; }
.page-head a:not(.btn) { color: #fff; }

/* cards and stats like the design: rounded white cards, round colourful icons */
.card, .table-card, .tile, .feature { border-radius: 16px; }
.stat-card { border-radius: 16px; }
.stat-ic { border-radius: 50%; }
.stat-ic.tone-primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; }
.stat-ic.tone-secondary { background: linear-gradient(135deg, #c084fc, #7c3aed); color: #fff; }
.stat-ic.tone-accent { background: linear-gradient(135deg, #2dd4bf, #0d9488); color: #fff; }
.stat-ic.tone-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.stat-ic.tone-warning { background: linear-gradient(135deg, #fbbf24, #f97316); color: #fff; }
.stat-ic.tone-danger { background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; }
.stat-ic.tone-info { background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; }
.toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; }

@media (max-width: 600px) {
  .page-head { padding: 16px; border-radius: 14px; }
  .page-head::before { display: none; }
}
.dash-tiles { margin: 0 0 16px; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.pd-main > .pd-stats { margin: 0 0 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* chat-like pages keep a slim title so the message box stays on the screen */
@media (max-width: 900px) {
  .ai-page .page-head, .page-head:has(+ .chat) { padding: 10px 14px; border-radius: 12px; }
  .ai-page .page-head h1, .page-head:has(+ .chat) h1 { font-size: 1.1rem; }
  .ai-page .page-head .page-ic { width: 32px; height: 32px; }
}
@media (max-width: 600px) {
  .ai-page .page-head { padding: 8px 12px; }
  .ai-chat { height: calc(100dvh - var(--header-h) - 112px); }
}
}

/* ---- «Ҳозиршавӣ ва ғоибшавӣ» ---------------------------------------------------- */
.att-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.att-pick select { min-width: 180px; }
.att-mark { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 7px; font-weight: 800; font-size: .82rem; line-height: 1; }
.att-p { background: var(--success-soft); color: var(--success); }
.att-l { background: var(--warning-soft); color: var(--warning); }
.att-a { background: var(--danger-soft); color: var(--danger); }
.att-e { background: var(--info-soft); color: var(--info); }
.att-none { background: var(--surface-2); color: var(--muted); }
.chip.att-p, .chip.att-l, .chip.att-a, .chip.att-e { border-color: transparent; font-weight: 700; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.att-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.att-legend span { display: inline-flex; gap: 4px; align-items: center; }
.att-gate { text-align: center; }
.att-gate h2 { justify-content: center; display: flex; gap: 8px; align-items: center; }
/* scanner: big, one-hand friendly */
.att-scan { max-width: 720px; margin: 0 auto; }
.att-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.att-mode { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; cursor: pointer; }
.att-mode.in.on { background: var(--success); border-color: var(--success); color: var(--on-color); }
.att-mode.out.on { background: var(--primary); border-color: var(--primary); color: var(--on-color); }
.att-mode:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.att-video { position: relative; aspect-ratio: 4 / 3; background: #0b1220; border-radius: 14px; overflow: hidden; }
.att-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.att-cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #fff; background: rgba(11, 18, 32, .78); }
.att-cam-msg[hidden] { display: none; }
.att-cam-msg.err { background: rgba(127, 29, 29, .88); }
.att-cam-btns { margin: 12px 0; justify-content: center; }
.att-manual .row { display: flex; gap: 8px; }
.att-manual .input { flex: 1; min-width: 0; }
.att-result { border-radius: 16px; padding: 18px; margin-bottom: 16px; border: 2px solid; }
.att-result.ok { background: var(--success-soft); border-color: var(--success); }
.att-result.dup { background: var(--warning-soft); border-color: var(--warning); }
.att-result.bad { background: var(--danger-soft); border-color: var(--danger); }
.att-result-in { display: flex; gap: 16px; align-items: flex-start; }
.att-photo { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; }
.att-res-ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--surface); flex: 0 0 auto; }
.att-res-t { margin: 0; font-size: 1.7rem; font-weight: 900; line-height: 1.15; }
.att-result.ok .att-res-t { color: var(--success); }
.att-result.dup .att-res-t { color: var(--warning); }
.att-result.bad .att-res-t { color: var(--danger); }
.att-res-n { margin: 4px 0 0; font-size: 1.15rem; font-weight: 700; }
.att-res-time { margin: 4px 0 0; display: flex; gap: 6px; align-items: center; }
.att-warn { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.att-early { display: grid; gap: 6px; margin-top: 10px; }
.att-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.att-recent li.bad { color: var(--danger); }
/* journal */
.att-jwrap { max-height: 70vh; }
.att-journal { font-size: .82rem; }
.att-journal th, .att-journal td { padding: 4px 3px; text-align: center; white-space: nowrap; }
.att-journal thead th { position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; }
.att-journal th small { display: block; font-weight: 500; opacity: .7; }
.att-journal .att-sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 150px; max-width: 220px; white-space: normal; }
.att-journal thead .att-sticky { z-index: 3; }
.att-journal .att-off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); }
.att-journal .att-todaycol { box-shadow: inset 0 -3px 0 var(--primary); }
.att-journal .att-tot { font-weight: 700; background: var(--surface-2); }
.att-cellbtn { background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 8px; }
.att-cellbtn:hover .att-mark, .att-cellbtn:focus-visible .att-mark { outline: 2px solid var(--primary); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: left; }
.att-mark-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.att-mark-opt { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.att-mark-opt:has(input:checked) { outline: 3px solid currentColor; }
/* forms */
.att-guardian { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.att-guardian legend { font-weight: 700; padding: 0 6px; }
.att-g-flags { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.att-sensitive { margin: 12px 0; border: 1px dashed var(--warning); border-radius: 12px; padding: 8px 12px; }
.att-sensitive summary { cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.att-range { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.att-range .input { flex: 1 1 140px; min-width: 0; }
.att-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.att-day { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.att-lessons { border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.att-lessons label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.att-staff { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.att-staff-add, form.row[data-test] { display: flex; flex-wrap: wrap; gap: 8px; }
.att-alert-edit { display: grid; gap: 6px; min-width: 200px; }
.att-period { display: flex; flex-wrap: wrap; gap: 8px; }
.att-risk ul { margin: 0; padding-left: 18px; }
.att-risk-row td { background: var(--danger-soft) !important; }
.att-total th, .att-total td { font-weight: 800; border-top: 2px solid var(--border); }
.att-h2 { display: flex; gap: 8px; align-items: center; margin: 18px 0 10px; font-size: 1.1rem; }
.att-case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.att-case h4 { margin: 14px 0 6px; }
.att-pre { white-space: pre-wrap; margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.att-lesson-list { display: grid; gap: 8px; margin: 10px 0; }
.att-lesson-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.att-lesson-row[data-mark="A"] { background: var(--danger-soft); }
.att-lesson-name { display: flex; flex-direction: column; min-width: 0; }
.att-lesson-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.att-seg-b { min-width: 42px; min-height: 42px; border: 0; background: transparent; font-weight: 800; font-size: 1rem; cursor: pointer; color: inherit; }
.att-seg-b + .att-seg-b { border-left: 1px solid var(--border); }
.att-seg-b.on.att-seg-P { background: var(--success-soft); color: var(--success); }
.att-seg-b.on.att-seg-A { background: var(--danger); color: #fff; }
.att-seg-b.on.att-seg-L, .att-seg-b.on.att-seg-E { background: var(--warning-soft, #fff3cd); color: var(--warning, #8a5a00); }
.att-grade { min-height: 42px; }
.att-tt td { min-width: 150px; vertical-align: top; }
.att-tt td .input + .input { margin-top: 4px; }
.att-code { font: 800 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: 2px; text-align: center; margin: 10px 0; }
.pr-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pr-kid { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.pr-kid.active { outline: 2px solid var(--primary); }
.pr-today { margin: 6px 0 0; font-size: 1.05rem; }
.pr-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pr-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 1px solid var(--border); border-radius: 10px; min-height: 64px; font-size: .78rem; }
.pr-day.off { opacity: .45; }
.pr-day.today { outline: 2px solid var(--primary); }
.pr-dn { font-weight: 700; }
.pr-miss { color: var(--danger); font-weight: 700; }
.att-g { display: inline-block; min-width: 18px; margin-left: 2px; font-weight: 800; color: var(--primary); }
.att-review { border-left: 4px solid var(--warning); }
.pr-hw { display: grid; gap: 10px; }
.pr-hw .card-h h2 { font-size: 1rem; }
/* the journal as the paper page: «Фан ___», «Моҳ/Месяц», № + «Насаб ва номи хонанда», a grid of plain cells */
.paper { background: #fff; color: #111; }
.paper-head { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; padding: 4px 2px 12px; font-family: "Times New Roman", Georgia, serif; font-size: 1.05rem; }
.paper-head b { font-weight: 700; }
.paper-line { display: inline-block; min-width: 220px; border-bottom: 1px solid #111; padding: 0 6px; }
.paper-table { border-collapse: collapse; font-family: "Times New Roman", Georgia, serif; width: auto; }
.paper-table th, .paper-table td, .paper-table .linkish { text-transform: none !important; letter-spacing: 0 !important; }
.paper-table td.att-cell, .paper-table thead th:not(.paper-diag):not(.paper-no) { width: 34px; min-width: 34px; max-width: 46px; }
.paper-table .num { text-align: center !important; padding: 2px 6px !important; }
.paper-blank { background: #fff; }
.paper-table th, .paper-table td { border: 1px solid #222 !important; padding: 0; background: #fff; color: #111; }
.paper-table thead th { font-weight: 700; font-size: .82rem; text-align: center; padding: 4px 2px; min-width: 30px; vertical-align: bottom; }
.paper-table thead th small { display: block; font-weight: 400; font-size: .68rem; color: #444; }
.paper-table tbody th { text-align: left; padding: 3px 8px; font-weight: 400; white-space: nowrap; }
.paper-table .paper-no { width: 34px; min-width: 34px; text-align: center; font-size: .82rem; }
.paper-table .att-cellbtn { width: 100%; min-height: 28px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; position: relative; }
.paper-table .att-cellbtn:hover, .paper-table .att-cellbtn:focus-visible { background: #eef3ff; }
.paper-table .att-mark { border-radius: 4px; min-width: 20px; height: 20px; font-size: .8rem; }
.paper-table .att-mark.att-p { background: transparent; color: #111; }
.paper-empty { display: block; width: 100%; height: 20px; }
.paper-table .att-todaycol { background: #f3f7ff !important; }
.paper-diag { position: relative; min-width: 230px; height: 86px; padding: 0 !important; background: linear-gradient(to top right, #fff calc(50% - 1px), #222 calc(50% - .5px), #222 calc(50% + .5px), #fff calc(50% + 1px)) !important; }
.paper-diag .pd-top { position: absolute; top: 4px; right: 6px; font-size: .78rem; }
.paper-diag .pd-bot { position: absolute; bottom: 4px; left: 6px; text-align: left; font-size: .78rem; line-height: 1.2; }
.paper-sub { height: 6px; padding: 0 !important; }
.att-rv { position: absolute; top: 0; right: 2px; font-size: .7rem; color: var(--warning); }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .paper { box-shadow: none !important; border: 0 !important; }
  .paper-table .att-mark.att-a, .paper-table .att-mark.att-e, .paper-table .att-mark.att-l { background: transparent !important; color: #000 !important; }
  .paper-table .att-todaycol { background: #fff !important; }
}
@media (max-width: 560px) {
  .att-lesson-row { grid-template-columns: minmax(0, 1fr) 72px; }
  .att-lesson-row .att-seg { grid-column: 1 / -1; justify-self: stretch; display: grid; grid-template-columns: repeat(4, 1fr); }
  .pr-day small { display: none; }
}
/* QR cards */
.att-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.att-card { margin: 0; break-inside: avoid; }
.att-card-canvas { width: 100%; max-width: 300px; height: auto; border-radius: 10px; display: block; margin: 0 auto; }
@media (max-width: 600px) {
  .att-res-t { font-size: 1.4rem; }
  .att-photo { width: 72px; height: 72px; }
  .att-mark-pick { grid-template-columns: 1fr; }
  .att-pick, .att-pick select { min-width: 0; width: 100%; }
}
@media print {
  .att-tabs, .att .page-head .btn-group { display: none !important; }
  .att-cards { grid-template-columns: repeat(3, 1fr); gap: 8mm; }
  .att-card-canvas { max-width: none; border-radius: 0; }
  .att-jwrap { max-height: none; overflow: visible; }
  .att-journal { font-size: 7.5pt; }
}
