:root {
    --xyoro-blue: #1767f2;
    --xyoro-navy: #071a33;
    --xyoro-dark: #051428;
    --xyoro-soft: #f4f7fb;
    --xyoro-border: #e7edf5;
    --xyoro-text: #111827;
    --xyoro-muted: #667085;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--xyoro-text); background: var(--xyoro-soft); }
a { color: var(--xyoro-blue); }
.btn-primary { background: #1767f2; border: 0; box-shadow: none; }
.btn-primary:hover { background: #0f57db; }
.form-control, .form-select { border-color: var(--xyoro-border); border-radius: 12px; padding: .72rem .9rem; }
.form-control:focus, .form-select:focus { border-color: #7ca8ff; box-shadow: 0 0 0 .2rem rgba(23,103,242,.12); }

.login-page { min-height: 100vh; background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-visual { align-items: center; justify-content: center; padding: 44px; }
.visual-card { width: min(860px, 100%); background: #fff; border: 1px solid var(--xyoro-border); border-radius: 34px; padding: 42px; box-shadow: 0 24px 70px rgba(10, 31, 68, .08); overflow: hidden; }
.login-logo-wide { width: 310px; height: auto; margin-bottom: 30px; }
.visual-card h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.04em; font-weight: 800; color: #06142f; max-width: 560px; }
.visual-card p { color: var(--xyoro-blue); font-size: 28px; font-weight: 700; }
.visual-dashboard { border-radius: 22px; overflow: hidden; border: 1px solid var(--xyoro-border); margin-top: 30px; box-shadow: 0 18px 40px rgba(15, 23, 42, .16); }
.visual-dashboard img { width: 100%; display: block; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 34px; }
.login-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--xyoro-border); border-radius: 28px; padding: 34px; box-shadow: 0 24px 70px rgba(10, 31, 68, .10); }
.login-logo { width: 160px; height: auto; }
.demo-hint { background: #f5f8ff; color: #375276; border-radius: 14px; padding: 12px 14px; font-size: 13px; text-align: center; }

.install-page { background: #f5f8ff; }
.install-card { max-width: 920px; background: #fff; border: 1px solid var(--xyoro-border); border-radius: 28px; padding: 34px; box-shadow: 0 24px 70px rgba(10, 31, 68, .08); }
.table-check { border: 1px solid var(--xyoro-border); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.table-check.ok { background: #ecfdf3; color: #05603a; }
.table-check.missing { background: #fff1f3; color: #b42318; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; position: fixed; left: 14px; top: 14px; bottom: 14px; background: #0a1a30; border-radius: 16px; padding: 18px 14px; color: #fff; overflow-y: auto; box-shadow: none; }
.brand-box { padding: 8px 10px 18px; }
.brand-box img { width: 140px; height: auto; display: block; filter: brightness(1.2); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: #d8e6ff; text-decoration: none; border-radius: 12px; font-size: 14px; font-weight: 600; }
.side-nav a span { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 10px; letter-spacing: -.03em; }
.side-nav a:hover, .side-nav a.active { background: #1767f2; color: #fff; }
.side-nav .logout-link { color: #ffb4b4; margin-top: 4px; }
.main-area { margin-left: 288px; width: calc(100% - 288px); min-height: 100vh; }
.topbar { height: 76px; background: rgba(255,255,255,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--xyoro-border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 10; }
.top-search { width: min(460px, 48vw); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.lang-pill { border: 1px solid var(--xyoro-border); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; color: var(--xyoro-blue); }
.avatar-circle { width: 42px; height: 42px; border-radius: 50%; background: #1767f2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.xsmall { font-size: 11px; }
.content-area { padding: 28px; }
.page-title-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.page-title-row h1 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.breadcrumb-line { margin-top: 4px; color: var(--xyoro-muted); font-size: 13px; }
.app-footer { padding: 18px 24px; margin-top: 8px; color: var(--xyoro-muted); font-size: 12px; text-align: center; border-top: 1px solid var(--xyoro-border); }
.app-footer a { color: var(--xyoro-muted); text-decoration: none; }
.app-footer a:hover { color: var(--xyoro-blue); text-decoration: underline; }
.app-footer-sep { opacity: .5; margin: 0 4px; }
.stat-card, .panel-card { background: #fff; border: 1px solid var(--xyoro-border); border-radius: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.045); }
.stat-card { padding: 20px; display: flex; align-items: center; gap: 16px; min-height: 108px; overflow: hidden; }
.stat-card-v { flex-direction: column; align-items: flex-start; gap: 8px; } /* dashboard KPI cards: icon on top, label below (matches super-admin) — avoids cramped mid-word wrap in narrow columns */
.stat-card.mini { min-height: 92px; }
.stat-card p { margin: 0 0 6px; color: var(--xyoro-muted); font-size: 13px; font-weight: 700; }
.stat-card h3 { margin: 0; font-size: clamp(18px, 1.4vw, 21px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
/* Keep long values (e.g. large currency amounts) inside the tile instead of spilling past its edge. */
.stat-card h3, .stat-card strong { min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.stat-card > strong { flex: 1 1 auto; }
.stat-card small { color: #039855; font-size: 12px; }
.stat-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: inset 0 -12px 24px rgba(0,0,0,.12); }
.stat-card > div:last-child { min-width: 0; }
/* Clickable stat card: a whole card that is an <a> drilling into the list it counts. Reusable across
   every role dashboard — gives the affordance (hover lift + chevron) without changing the card markup. */
a.stat-card-link { text-decoration: none; color: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
a.stat-card-link:hover, a.stat-card-link:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(15,23,42,.10); border-color: var(--xyoro-blue); }
a.stat-card-link .stat-go { opacity: .5; font-weight: 800; margin-left: 2px; }
a.stat-card-link:hover .stat-go { opacity: .9; }
.bg-purple { background: #7c3aed; }
.bg-green { background: #16a34a; }
.bg-blue { background: #2f6fed; }
.bg-orange { background: #f97316; }
.bg-teal { background: #0d9488; }
.bg-darkblue { background: #164e9f; }
.bg-red { background: #ef4444; }
.panel-card { padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 800; }
.panel-header span, .panel-header a { font-size: 12px; color: var(--xyoro-muted); text-decoration: none; }
.focus-list { display: grid; gap: 12px; }
.focus-list div { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--xyoro-border); border-radius: 14px; padding: 14px; }
.focus-list.compact div { align-items: flex-start; flex-direction: column; gap: 4px; }
.focus-list strong { font-size: 14px; }
.focus-list span { color: var(--xyoro-muted); font-size: 13px; }
.ask-card { display: flex; align-items: center; gap: 18px; min-height: 220px; }
.ask-card img { width: 115px; height: 115px; object-fit: contain; border-radius: 24px; background: #f6fbff; }
.xyoro-table thead th { background: #f7faff; color: #52637a; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--xyoro-border); }
.xyoro-table td, .xyoro-table th { padding: 15px 18px; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; background: #eef2f6; color: #344054; }
.status-active { background: #ecfdf3; color: #027a48; }
.status-trial { background: #eff8ff; color: #175cd3; }
.status-inactive { background: #f2f4f7; color: #344054; }
.status-suspended { background: #fffaeb; color: #b54708; }
.status-expired { background: #fff1f3; color: #c01048; }
.status-pending { background: #fffaeb; color: #b54708; }
.form-section-title { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-grid div { border: 1px solid var(--xyoro-border); border-radius: 14px; padding: 14px; }
.detail-grid label { display: block; color: var(--xyoro-muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.detail-grid strong { font-size: 14px; }

.status-blocked { background: #fff1f3; color: #c01048; }
.status-expired { background: #fff1f3; color: #c01048; }
.status-school, .status-tenant, .status-platform { background: #eff8ff; color: #175cd3; }

/* V8 responsive layout hardening */
html, body { max-width: 100%; overflow-x: hidden; }
.app-body.sidebar-open { overflow: hidden; }
.app-shell { display: flex; min-height: 100vh; width: 100%; }
.sidebar { width: 276px; position: fixed; left: 14px; top: 14px; bottom: 14px; z-index: 1040; background: #0b1b31; border-radius: 16px; padding: 18px 14px; color: #fff; overflow-y: auto; overflow-x: hidden; box-shadow: none; transition: transform .24s ease, width .24s ease; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }
.brand-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 18px; }
.brand-link { display: inline-flex; align-items: center; min-width: 0; }
.brand-box img { width: 148px; height: auto; max-width: 100%; display: block; filter: brightness(1.2); }
.sidebar-close { display: none; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; border-radius: 12px; font-weight: 800; line-height: 1; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: #d8e6ff; text-decoration: none; border-radius: 12px; font-size: 14px; font-weight: 600; min-width: 0; }
.side-nav a em { font-style: normal; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.side-nav a span { flex: 0 0 auto; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 10px; letter-spacing: -.03em; }
.side-nav a:hover, .side-nav a.active { background: #1767f2; color: #fff; }
.side-nav .logout-link { color: #ffb4b4; margin-top: 4px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 1030; background: rgba(8, 20, 38, .45); backdrop-filter: blur(2px); }
.main-area { margin-left: 306px; width: calc(100% - 306px); min-width: 0; min-height: 100vh; }
.topbar { min-height: 76px; height: auto; background: #fff; border-bottom: 1px solid var(--xyoro-border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 26px; position: sticky; top: 0; z-index: 1000; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.sidebar-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--xyoro-border); background: #fff; border-radius: 12px; padding: 9px; flex: 0 0 auto; }
.sidebar-toggle span { display: block; height: 2px; background: #0f2748; margin: 5px 0; border-radius: 4px; }
.top-search { width: min(460px, 48vw); min-width: 220px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.user-meta { max-width: 220px; min-width: 0; }
.content-area { padding: clamp(16px, 2.4vw, 30px); min-width: 0; }
/* Global i18n text containment: let grid/flex children shrink so long or translated text
   wraps inside its card/tile instead of spilling past the edge. Root-cause fix (Bootstrap
   columns default to min-width:auto); tables still scroll via .table-responsive. */
.content-area [class*="col-"] { min-width: 0; }
.stat-card p, .stat-card small, .panel-header h2,
.rail-item strong, .rail-item small,
.to-legend-row span, .to-legend-row strong,
.tenant-stat-card p, .tenant-stat-card small { overflow-wrap: break-word; min-width: 0; }
.page-title-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title-row > * { min-width: 0; }
.page-title-row h1 { font-size: clamp(21px, 2.4vw, 28px); }
.panel-card { max-width: 100%; }
.panel-header { gap: 12px; flex-wrap: wrap; padding-left: 0; padding-right: 0; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.xyoro-table { min-width: 760px; }
.xyoro-table td, .xyoro-table th { vertical-align: middle; }
.stat-card { height: 100%; }
.detail-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-control, .form-select, .btn { max-width: 100%; }
.login-shell { width: 100%; }
.visual-card h1 { font-size: clamp(30px, 4vw, 46px); }
.visual-card p { font-size: clamp(18px, 2.6vw, 28px); }

@media (max-width: 1199.98px) {
    .sidebar { width: 240px; }
    .main-area { margin-left: 270px; width: calc(100% - 270px); }
}

@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none !important; }
    .login-panel { min-height: 100vh; padding: 20px; }
    .sidebar { left: 0; top: 0; bottom: 0; width: min(320px, 86vw); border-radius: 0 22px 22px 0; transform: translateX(-105%); padding: 18px 14px; }
    .app-body.sidebar-open .sidebar { transform: translateX(0); }
    .app-body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .brand-box img { width: 138px; }
    .side-nav { flex-direction: column; }
    .side-nav a { justify-content: flex-start; font-size: 14px; min-width: 0; }
    .side-nav a em { display: inline; }
    .side-nav a span { font-size: 10px; }
    .main-area { margin-left: 0; width: 100%; padding-bottom: 0; }
    .sidebar-toggle { display: inline-block; }
    .top-search { display: block; width: min(420px, 45vw); min-width: 180px; }
}

@media (max-width: 767.98px) {
    .topbar { padding: 12px 16px; }
    .top-search { display: none; }
    .user-meta { display: none; }
    .content-area { padding: 16px; }
    .page-title-row { align-items: flex-start; flex-direction: column; }
    .panel-card { border-radius: 16px; }
    .stat-card { min-height: auto; padding: 16px; }
    .stat-icon { width: 48px; height: 48px; border-radius: 14px; }
    .xyoro-table { min-width: 680px; }
    .login-card { padding: 24px; border-radius: 22px; }
}

@media (max-width: 575.98px) {
    .content-area { padding: 12px; }
    .topbar { min-height: 66px; }
    .lang-pill { padding: 5px 9px; }
    .avatar-circle { width: 38px; height: 38px; }
    .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
    .xyoro-table { min-width: 620px; }
    .btn { white-space: normal; }
}

/* V9 admin CRUD enhancements */
.table-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.permission-matrix th, .permission-matrix td { white-space: nowrap; }
.permission-matrix .form-check-input { width: 1.05rem; height: 1.05rem; }
.permission-check-grid { max-height: 360px; overflow-y: auto; padding-right: 6px; }
.permission-check { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--xyoro-border); border-radius: 14px; padding: 12px; height: 100%; background: #fff; cursor: pointer; }
.permission-check input { margin-top: 3px; flex: 0 0 auto; }
.permission-check span { display: grid; gap: 2px; min-width: 0; }
.permission-check small { color: var(--xyoro-muted); overflow-wrap: anywhere; }
.status-archived, .status-cancelled, .status-failed { background: #fff1f3; color: #c01048; }
.status-captured, .status-paid, .status-authorized { background: #ecfdf3; color: #027a48; }
.status-draft, .status-created { background: #f2f4f7; color: #344054; }
.status-past_due, .status-partially_refunded { background: #fffaeb; color: #b54708; }
code { color: #164e9f; background: #eff8ff; border-radius: 6px; padding: 2px 5px; }
@media (max-width: 767.98px) { .table-actions { justify-content: flex-start !important; } }

/* V10 expandable integrations */
.integration-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.integration-card { min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.integration-card .panel-header { width: 100%; margin-bottom: 10px; }
.production-readiness { border-color: #fedf89; background: #fffcf5; }
.readiness-list { display: flex; flex-wrap: wrap; gap: 10px; }
.readiness-list span { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; background: #fffaeb; color: #b54708; font-size: 12px; font-weight: 800; border: 1px solid #fedf89; }
.api-key-create { background: #f7faff; }
.status-deprecated, .status-revoked { background: #fff1f3; color: #c01048; }
.status-testing { background: #eff8ff; color: #175cd3; }
.status-live, .status-enabled { background: #ecfdf3; color: #027a48; }
.status-draft { background: #f2f4f7; color: #344054; }
.status-suspended, .status-failed { background: #fffaeb; color: #b54708; }
@media (max-width: 1399.98px) { .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .integration-grid { grid-template-columns: 1fr; } .integration-card { min-height: auto; } .api-key-create .btn { width: 100%; } }

/* Shared profile photo upload */
.profile-photo-menu { flex: 0 0 auto; }
.avatar-button { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(23,103,242,.12); }
.avatar-button:focus-visible { outline: 3px solid rgba(23,103,242,.24); outline-offset: 2px; }
.avatar-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; background: #eef5ff; }
.profile-photo-dropdown { width: min(320px, calc(100vw - 24px)); padding: 14px; border: 1px solid var(--xyoro-border); border-radius: 16px; box-shadow: 0 18px 44px rgba(15,23,42,.16); }
.profile-photo-preview { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--xyoro-border); min-width: 0; }
.profile-photo-preview strong, .profile-photo-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-photo-preview span { color: var(--xyoro-muted); font-size: 12px; }
.profile-photo-large { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.profile-photo-large.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #1767f2; font-weight: 900; font-size: 21px; }
.profile-photo-form { display: grid; gap: 10px; }
.profile-photo-card-body { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.profile-photo-xl { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #eef5ff; box-shadow: 0 14px 34px rgba(15,23,42,.12); }
.profile-photo-xl.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #1767f2; font-size: 44px; font-weight: 900; }

@media (max-width: 575.98px) {
    .avatar-button, .avatar-img { width: 38px; height: 38px; }
    .profile-photo-dropdown { width: calc(100vw - 20px); }
    .profile-photo-xl { width: 108px; height: 108px; }
}

/* V11 production hardening */
.production-score { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; height: 72px; border-radius: 50%; background: #eff8ff; color: #175cd3; font-weight: 900; font-size: 20px; }
.status-ok, .status-ready, .status-completed, .status-verified, .status-success { background: #ecfdf3; color: #027a48; }
.status-warning, .status-retrying, .status-queued, .status-sending { background: #fffaeb; color: #b54708; }
.status-error, .status-critical, .status-missing, .status-disabled, .status-failed { background: #fff1f3; color: #c01048; }
.security-note { border: 1px solid #fedf89; background: #fffcf5; border-radius: 16px; padding: 14px; color: #7a4b00; }
@media (max-width: 767.98px) {
    .page-title-row .table-actions { width: 100%; }
    .page-title-row .table-actions .btn, .page-title-row form.table-actions .btn, .page-title-row form.table-actions .form-select { width: 100%; }
}

/* V12 dashboard graph and gateway scope hardening */
.dashboard-chart-card { overflow: hidden; }
.chart-box { position: relative; width: 100%; height: 300px; min-height: 260px; }
.chart-box-large { height: 330px; }
.chart-box canvas { width: 100% !important; height: 100% !important; display: block; }
.chart-fallback { display: none; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--xyoro-border); border-radius: 14px; color: var(--xyoro-muted); background: #f8fbff; font-size: 13px; }
.gateway-scope-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.gateway-scope-grid div { border: 1px solid var(--xyoro-border); border-radius: 16px; padding: 16px; background: #fff; }
.gateway-scope-grid span { display: block; color: var(--xyoro-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.gateway-scope-grid strong { display: block; font-size: 30px; line-height: 1.1; margin: 8px 0 4px; color: #071a33; }
.gateway-scope-grid small { color: var(--xyoro-muted); }
.gateway-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.gateway-matrix-card { border: 1px solid var(--xyoro-border); border-radius: 18px; padding: 16px; background: #fff; box-shadow: 0 12px 28px rgba(10, 31, 68, .05); }
.gateway-matrix-card h3 { font-size: 15px; margin: 0 0 10px; font-weight: 850; }
.gateway-matrix-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gateway-matrix-card .metrics span { display: block; border-radius: 12px; background: #f7faff; padding: 10px; font-size: 12px; color: var(--xyoro-muted); }
.gateway-matrix-card .metrics b { display: block; font-size: 20px; color: #071a33; }
.gateway-form-help { background: #f8fbff; border: 1px solid var(--xyoro-border); border-radius: 16px; padding: 14px; }
.gateway-form-help code { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 767.98px) {
    .chart-box, .chart-box-large { height: 260px; min-height: 240px; }
    .gateway-matrix-card .metrics { grid-template-columns: 1fr; }
}

/* V13 dynamic tenant command center */
.tenant-title-row .table-actions { align-items: stretch; }
.tenant-stat-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.tenant-stat-card { border: 1px solid var(--xyoro-border); background: #fff; border-radius: 18px; padding: 16px; min-height: 118px; box-shadow: 0 14px 30px rgba(10, 31, 68, .05); }
.tenant-stat-card span { display: block; color: var(--xyoro-muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.tenant-stat-card strong { display: block; color: #071a33; font-size: clamp(22px, 2vw, 30px); line-height: 1.1; margin: 9px 0 4px; font-weight: 900; overflow-wrap: anywhere; }
.tenant-stat-card small { color: var(--xyoro-muted); font-size: 12px; }
.tenant-stat-card.success { background: #f4fdf8; border-color: #abefc6; }
.tenant-stat-card.warning { background: #fffdf4; border-color: #fedf89; }
.tenant-stat-card.danger { background: #fff7f8; border-color: #fecdd6; }
.tenant-stat-card.info { background: #f6fbff; border-color: #b2ddff; }
.tenant-filter-card { position: relative; z-index: 1; }
.tenant-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--xyoro-border); background: #fff; flex-wrap: wrap; }
.tenant-dynamic-table { min-width: 1180px; }
.tenant-name-cell a { color: #071a33; text-decoration: none; }
.tenant-name-cell a:hover { color: var(--xyoro-blue); }
.tenant-domain-line { color: var(--xyoro-muted); font-size: 12px; margin-top: 4px; max-width: 240px; overflow-wrap: anywhere; }
.tenant-mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 220px; }
.tenant-mini-metrics span { background: #f7faff; border: 1px solid var(--xyoro-border); border-radius: 12px; padding: 9px; color: var(--xyoro-muted); font-size: 11px; }
.tenant-mini-metrics b { display: block; color: #071a33; font-size: 18px; }
.gateway-chip-row { display: flex; flex-wrap: wrap; gap: 5px; min-width: 190px; }
.gateway-chip { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 850; border: 1px solid var(--xyoro-border); background: #f2f4f7; color: #344054; }
.gateway-chip.ready { background: #ecfdf3; border-color: #abefc6; color: #027a48; }
.gateway-chip.missing { background: #fff1f3; border-color: #fecdd6; color: #c01048; }
.gateway-missing-card { border-color: #fecdd6; background: #fffafb; }
.detail-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-grid.compact div { padding: 10px; }
@media (max-width: 1599.98px) { .tenant-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .tenant-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tenant-table-toolbar { align-items: flex-start; } }
@media (max-width: 575.98px) { .tenant-stat-grid { grid-template-columns: 1fr; } .tenant-title-row .table-actions, .tenant-title-row .table-actions .btn { width: 100%; } .detail-grid.compact { grid-template-columns: 1fr; } }

/* V14 import-export enhancements */
.table-meta-box,
.import-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 16px;
    background: rgba(248, 250, 252, 0.72);
}
.import-panel h6 {
    font-weight: 800;
    margin-bottom: 12px;
}
.table-toolbar {
    max-width: 420px;
}
@media (max-width: 767.98px) {
    .btn-group.btn-group-sm {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .btn-group.btn-group-sm > .btn {
        border-radius: 10px !important;
    }
}

/* V15 import/export enhancements */
.cell-truncate {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.table-meta-box {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    padding: 1rem;
}
.import-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    padding: 1rem;
}
@media (max-width: 767.98px) {
    .btn-group.flex-wrap .btn {
        margin-bottom: .25rem;
    }
    .cell-truncate {
        max-width: 150px;
    }
}

/* V16 compact navbar, centered logo, login metadata cleanup, scoped API controls */
.topbar { position: sticky; }
.topbar-brand-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 112px;
    max-width: 220px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(231,237,245,.72);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.topbar-brand-center img {
    width: 136px;
    height: auto;
    display: block;
}
.brand-box img { width: 132px; }
.topbar-left, .top-actions { position: relative; z-index: 2; }
.topbar .form-control { background: #f8fbff; }
.individual-api-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.individual-api-card { border: 1px solid var(--xyoro-border); border-radius: 18px; background: #fff; padding: 16px; }
.individual-api-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.individual-api-card .api-school-list { display: grid; gap: 8px; max-height: 250px; overflow-y: auto; padding-right: 4px; }
.api-school-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--xyoro-border); border-radius: 12px; padding: 9px 10px; background: #fff; }
.api-school-row strong { font-size: 13px; line-height: 1.2; }
.api-school-row small { display: block; color: var(--xyoro-muted); }
.api-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gateway-form-help { border: 1px solid var(--xyoro-border); border-radius: 16px; padding: 14px; background: #f8fbff; }

@media (max-width: 1199.98px) {
    .topbar-brand-center img { width: 120px; }
    .topbar-brand-center { max-width: 180px; padding: 7px 10px; }
}

@media (max-width: 991.98px) {
    .topbar {
        min-height: 68px;
        padding: 10px 14px;
    }
    .topbar-brand-center {
        display: inline-flex;
        min-width: 104px;
        max-width: 154px;
        padding: 6px 8px;
        box-shadow: none;
        background: transparent;
        border-color: transparent;
    }
    .topbar-brand-center img { width: 112px; }
    .sidebar {
        top: 68px;
        bottom: 0;
        width: min(304px, 84vw);
        max-height: calc(100vh - 68px);
        border-radius: 0 22px 0 0;
        padding-top: 12px;
        z-index: 1040;
    }
    .sidebar-backdrop {
        top: 68px;
    }
    .brand-box {
        padding: 6px 8px 12px;
    }
    .brand-box img { width: 116px; }
    .side-nav a { padding: 10px 11px; }
    .individual-api-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .topbar { min-height: 62px; }
    .topbar-brand-center { max-width: 134px; }
    .topbar-brand-center img { width: 104px; }
    .sidebar { top: 62px; max-height: calc(100vh - 62px); }
    .sidebar-backdrop { top: 62px; }
    .top-actions { gap: 8px; }
    .lang-pill { font-size: 11px; }
    .avatar-circle { width: 34px; height: 34px; }
    .api-school-row { align-items: flex-start; flex-direction: column; }
    .api-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
    .topbar { padding-left: 10px; padding-right: 10px; }
    .topbar-brand-center img { width: 92px; }
    .topbar-brand-center { max-width: 110px; }
    .lang-pill { display: none; }
}


/* V17 navbar logo cleanup */
.topbar-brand-center { display: none !important; }
.sidebar .brand-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 10px 22px;
}
.sidebar .brand-link {
    width: 90%;
    max-width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.sidebar .brand-box img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}
.sidebar .sidebar-close {
    position: absolute;
    right: 8px;
    top: 8px;
}
.topbar { justify-content: space-between; }
.topbar-left { flex: 1 1 auto; }
.top-actions { flex: 0 0 auto; }
@media (max-width: 1199.98px) {
    .sidebar .brand-link { width: 90%; max-width: 200px; }
}
@media (max-width: 991.98px) {
    .sidebar .brand-box { padding-right: 52px; }
    .sidebar .brand-link { width: 90%; max-width: 210px; }
}
@media (max-width: 767.98px) {
    .topbar { gap: 10px; }
    .topbar-left { min-width: 0; }
}

/* V18 production runtime services and non-compact mobile topbar */
.runtime-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.runtime-action-card {
    border: 1px solid var(--xyoro-border);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 12px 28px rgba(10, 31, 68, .05);
}
.runtime-action-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 850;
    color: #071a33;
}
.runtime-action-card p {
    color: var(--xyoro-muted);
    min-height: 58px;
    font-size: 13px;
    margin-bottom: 12px;
}
.runtime-url-code {
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 1399.98px) {
    .runtime-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .runtime-action-grid { grid-template-columns: 1fr; }
    .runtime-title-row .table-actions { width: 100%; }
    .runtime-title-row .table-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 991.98px) {
    .topbar {
        min-height: 82px !important;
        padding: 12px 14px !important;
        align-items: center;
    }
    .topbar-left {
        flex: 1 1 58%;
        min-width: 0;
    }
    .top-search {
        display: block !important;
        width: min(100%, 430px);
    }
    .top-actions {
        display: flex !important;
        flex: 0 0 auto;
        min-width: 168px;
        justify-content: flex-end;
    }
    .top-actions .user-meta {
        display: block !important;
        max-width: 122px;
    }
    .lang-pill {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .sidebar {
        top: 82px !important;
        max-height: calc(100vh - 82px) !important;
    }
    .sidebar-backdrop {
        top: 82px !important;
    }
}
@media (max-width: 575.98px) {
    .topbar {
        min-height: 104px !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    .topbar-left {
        flex: 1 1 100%;
        order: 1;
    }
    .top-actions {
        flex: 1 1 100%;
        order: 2;
        justify-content: space-between;
        min-width: 0;
    }
    .top-search {
        width: 100% !important;
    }
    .sidebar {
        top: 104px !important;
        max-height: calc(100vh - 104px) !important;
    }
    .sidebar-backdrop {
        top: 104px !important;
    }
}
@media (max-width: 420px) {
    .topbar {
        min-height: 112px !important;
    }
    .top-actions .user-meta {
        max-width: calc(100vw - 180px);
    }
    .avatar-circle {
        width: 38px !important;
        height: 38px !important;
    }
    .sidebar {
        top: 112px !important;
        max-height: calc(100vh - 112px) !important;
    }
    .sidebar-backdrop {
        top: 112px !important;
    }
}

/* V19 billing tax center */
.mini-stat { border: 1px solid var(--xyoro-border); border-radius: 16px; padding: 14px; background: #fff; height: 100%; display: grid; gap: 4px; }
.mini-stat span { color: var(--xyoro-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mini-stat strong { font-size: 24px; line-height: 1.1; color: var(--xyoro-navy); }
.mini-stat small { color: var(--xyoro-muted); }
.retention-days-input { width: 96px; }
.retention-action-select, .retention-status-select { width: 132px; }
@media (max-width: 767.98px) {
    .retention-days-input, .retention-action-select, .retention-status-select { width: 100%; }
}
.metric-card { background: #fff; border: 1px solid var(--xyoro-border); border-radius: 18px; padding: 16px; min-height: 102px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(15,23,42,.045); }
.metric-card span { display: block; color: var(--xyoro-muted); font-size: 12px; font-weight: 800; }
.metric-card strong { display: block; font-size: 22px; color: var(--xyoro-navy); line-height: 1.1; }
.metric-card small { color: var(--xyoro-muted); font-size: 12px; }
.metric-icon { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: #fff; background: #1767f2; flex: 0 0 auto; }
.metric-icon.green { background: #16a34a; }
.metric-icon.cyan { background: #0891b2; }
.metric-icon.orange { background: #f97316; }
.metric-icon.red { background: #ef4444; }
.metric-icon.purple { background: #7c3aed; }

/* V21 final QA helpers */
.stat-label { color: var(--xyoro-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { color: var(--xyoro-navy); font-size: clamp(22px, 2.2vw, 32px); font-weight: 900; line-height: 1.1; }
.hover-card { transition: transform .18s ease, box-shadow .18s ease; }
.hover-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15,23,42,.10); }

/* V22 governance and observability */
.governance-grid, .recommendation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.governance-tile { min-height: 150px; display: block; }
.governance-inline-form {
    display: grid;
    grid-template-columns: minmax(150px, 1.3fr) 82px auto auto auto;
    gap: 8px;
    align-items: center;
}
.health-score {
    width: 120px;
    height: 9px;
    background: #eef2f6;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 5px;
}
.health-score span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #1767f2);
    border-radius: inherit;
}
.color-dot {
    width: 22px;
    height: 22px;
    display: inline-flex;
    border-radius: 50%;
    border: 1px solid var(--xyoro-border);
    margin-right: 6px;
    vertical-align: middle;
}
.status-healthy { background: #ecfdf3; color: #027a48; }
.status-watch, .status-high { background: #fffaeb; color: #b54708; }
.status-critical { background: #fff1f3; color: #c01048; }
.status-info { background: #eff8ff; color: #175cd3; }
.status-approved { background: #ecfdf3; color: #027a48; }
.status-rejected { background: #fff1f3; color: #c01048; }
.status-beta { background: #f4ebff; color: #6941c6; }
.top-search { margin: 0; }
.top-search .form-control { min-height: 42px; }
@media (max-width: 1199.98px) {
    .governance-grid, .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .governance-inline-form { grid-template-columns: 1fr 76px; }
}
@media (max-width: 767.98px) {
    .governance-grid, .recommendation-grid { grid-template-columns: 1fr; }
    .governance-inline-form { grid-template-columns: 1fr; }
    .governance-inline-form .btn { width: 100%; }
}

/* V27 tenant owner localized dashboard */
.tenant-owner-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 22px; overflow: hidden; }
.tenant-owner-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.tenant-owner-avatar { width: 76px; height: 76px; border-radius: 24px; display: flex; align-items: center; justify-content: center; background: #1767f2; color: #fff; font-size: 30px; font-weight: 900; box-shadow: 0 16px 38px rgba(23,103,242,.22); flex: 0 0 auto; }
.tenant-owner-hero h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); font-weight: 900; letter-spacing: -.04em; color: #071a33; }
.tenant-owner-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tenant-owner-meta > span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--xyoro-border); background: #f8fbff; border-radius: 999px; padding: 7px 11px; color: #52637a; font-size: 12px; font-weight: 700; }
.tenant-owner-meta em { font-style: normal; }
.tenant-owner-score { min-width: 150px; border: 1px solid var(--xyoro-border); background: #fff; border-radius: 18px; padding: 16px; text-align: center; }
.tenant-owner-score span { display: block; color: var(--xyoro-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tenant-owner-score strong { display: block; font-size: 30px; font-weight: 900; letter-spacing: -.04em; color: #175cd3; }
.tenant-owner-score small { color: var(--xyoro-muted); text-transform: capitalize; }
.tenant-owner-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tenant-owner-action { display: flex; flex-direction: column; gap: 4px; min-height: 96px; justify-content: center; border: 1px solid var(--xyoro-border); border-radius: 16px; padding: 16px; text-decoration: none; color: inherit; background: #fff; }
.tenant-owner-action:hover { border-color: rgba(23, 103, 242, .35); box-shadow: 0 12px 28px rgba(23,103,242,.08); color: inherit; }
.tenant-owner-action strong { font-size: 15px; }
.tenant-owner-action span { color: var(--xyoro-muted); font-size: 13px; }
.tenant-owner-detail-grid.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[dir="rtl"] .tenant-owner-hero-main, [dir="rtl"] .stat-card, [dir="rtl"] .ask-card { direction: rtl; }
[dir="rtl"] .side-nav a { flex-direction: row-reverse; }
[dir="rtl"] .main-area { margin-left: 0; margin-right: 306px; }
[dir="rtl"] .sidebar { left: auto; right: 14px; }
@media (max-width: 991.98px) {
    [dir="rtl"] .main-area { margin-right: 0; }
    [dir="rtl"] .sidebar { right: 0; left: auto; border-radius: 22px 0 0 22px; transform: translateX(105%); }
    [dir="rtl"] .app-body.sidebar-open .sidebar { transform: translateX(0); }
}
@media (max-width: 767.98px) {
    .tenant-owner-hero { align-items: flex-start; flex-direction: column; }
    .tenant-owner-hero-main { align-items: flex-start; }
    .tenant-owner-score { width: 100%; }
    .tenant-owner-actions { grid-template-columns: 1fr; }
    .tenant-owner-detail-grid.detail-grid { grid-template-columns: 1fr; }
}

/* V29 Tenant Owner Completion */
.tenant-owner-module-tabs{display:flex;gap:.5rem;overflow-x:auto;padding:.25rem 0 .75rem;scrollbar-width:thin}.tenant-owner-tab{display:flex;align-items:center;gap:.45rem;white-space:nowrap;border:1px solid var(--xyoro-border,#e5e7eb);border-radius:999px;padding:.55rem .85rem;background:#fff;color:#334155;text-decoration:none;font-size:.88rem}.tenant-owner-tab span{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;border-radius:999px;background:#eef2ff;color:#1d4ed8;font-weight:700;font-size:.72rem}.tenant-owner-tab.active,.tenant-owner-tab:hover{background:#12295b;color:#fff;border-color:#12295b}.tenant-owner-tab.active span,.tenant-owner-tab:hover span{background:rgba(255,255,255,.16);color:#fff}.tenant-owner-check{display:flex;align-items:center;justify-content:space-between;gap:1rem;border:1px solid #e5e7eb;border-radius:16px;padding:1rem;background:#fff}.tenant-owner-check input{width:1.1rem;height:1.1rem}.tenant-owner-check span{font-size:.8rem;color:#64748b}.tenant-owner-check.is-done{border-color:#bbf7d0;background:#f0fdf4}.tenant-owner-check.is-done span{color:#166534}@media(max-width:768px){.tenant-owner-module-tabs{padding-bottom:.5rem}.tenant-owner-tab{padding:.48rem .72rem;font-size:.82rem}.tenant-owner-tab span{min-width:24px;height:24px}.tenant-owner-check{align-items:flex-start;flex-direction:column}}

/* V30 Tenant Owner production QA and mobile refinements */
.tenant-owner-module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.tenant-file-input { max-width: 220px; }
.tenant-import-mode { max-width: 150px; }
@media (max-width: 768px) {
    .tenant-owner-module-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: .25rem;
    }
    .tenant-owner-tab {
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
    .tenant-file-input,
    .tenant-import-mode {
        max-width: 100%;
        width: 100%;
    }
    .xyoro-table td,
    .xyoro-table th {
        white-space: nowrap;
    }
}

/* V31 Tenant Owner Runtime Completion */
.tenant-runtime-action-card {
    display: block;
    border: 1px solid var(--xyoro-border, #e5e7eb);
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    min-height: 100%;
}
.tenant-runtime-action-card strong {
    display: block;
    font-size: .92rem;
}
.tenant-runtime-action-card small {
    display: block;
    color: #6b7280;
    margin-top: 2px;
}
@media (max-width: 767px) {
    .tenant-runtime-action-card {
        border-radius: 14px;
        padding: 10px;
    }
    .tenant-owner-module-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .tenant-owner-tab {
        white-space: nowrap;
    }
}

/* V33 School Admin small profile cards */
.mini-card {
    border: 1px solid rgba(7, 26, 51, .08);
    border-radius: 16px;
    padding: 14px 16px;
    background: #fff;
    min-height: 78px;
}
.mini-card span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
}
.mini-card strong {
    color: #071a33;
    font-size: 16px;
    word-break: break-word;
}

/* V34 School Admin Operations Runtime mobile QA */
@media (max-width: 767.98px) {
    .school-admin-runtime-grid,
    .school-admin-action-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: .75rem;
    }
    .panel-card form.row > [class*="col-"] {
        margin-bottom: .35rem;
    }
    .xyoro-table th,
    .xyoro-table td {
        white-space: nowrap;
        font-size: .86rem;
    }
    .page-title-row .btn,
    .dashboard-title-row .btn {
        width: 100%;
    }
}

/* V36 leave management responsive refinements */
.leave-shell .approval-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}
.leave-shell .qa-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.85);
}
.leave-shell .xyoro-table-wrap table {
    min-width: 860px;
}
@media (max-width: 767.98px) {
    .leave-shell .page-title-row {
        gap: 14px;
    }
    .leave-shell .approval-card form {
        width: 100%;
    }
    .leave-shell .approval-card form input[type="text"] {
        min-width: 0;
        flex: 1 1 auto;
    }
    .leave-shell .panel-header {
        align-items: flex-start;
        gap: 8px;
    }
}

/* V37 XYORO role dashboard shell */
.top-context-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.top-context-pill {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 150px;
    height: 52px;
    border: 1px solid var(--xyoro-border);
    border-radius: 8px;
    background: #fff;
    padding: 8px 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}
.top-context-pill.wide {
    min-width: 240px;
}
.top-context-pill span {
    color: #5d6b82;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.top-context-pill strong {
    color: #071a33;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-action-icon,
.top-bell span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f7ff;
    color: #0f3d86;
    font-size: 10px;
    font-weight: 900;
}
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    border-radius: 8px;
    padding: 6px 12px;
    color: #071a33;
}
.top-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--xyoro-border);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}
.top-bell em {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    padding: 0 5px;
    background: #f04438;
    color: #fff;
    border: 2px solid #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
}
.xyoro-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}
.xyoro-dashboard-main {
    min-width: 0;
}
.xyoro-dashboard-rail {
    display: grid;
    gap: 18px;
    min-width: 0;
    position: sticky;
    top: 98px;
}
.xyoro-dashboard .page-title-row {
    margin-bottom: 18px;
}
.xyoro-dashboard .stat-card,
.xyoro-dashboard .panel-card,
.rail-card {
    border-radius: 8px;
    border-color: rgba(15, 42, 84, .09);
    box-shadow: 0 10px 34px rgba(15, 23, 42, .055);
}
.xyoro-dashboard .stat-card {
    min-height: 132px;
    align-items: flex-start;
    padding: 18px;
}
.xyoro-dashboard .stat-card p {
    color: #06142f;
    font-size: 13px;
    font-weight: 800;
}
.xyoro-dashboard .stat-card h3 {
    color: #071a33;
    font-size: 27px;
}
.xyoro-dashboard .stat-card small {
    color: #385273;
    font-weight: 650;
}
.xyoro-dashboard .stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 12px;
}
.xyoro-dashboard .panel-header h2 {
    color: #071a33;
    font-size: 15px;
}
.xyoro-dashboard .xyoro-table thead th {
    background: #f8fafc;
    color: #334155;
    letter-spacing: 0;
    text-transform: none;
}
.dashboard-micro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.dashboard-micro-item {
    min-height: 76px;
    border: 1px solid rgba(15, 42, 84, .09);
    border-radius: 8px;
    background: #fbfdff;
    padding: 12px;
}
.dashboard-micro-item span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
}
.dashboard-micro-item strong {
    display: block;
    color: #071a33;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.rail-card {
    background: #fff;
    padding: 16px;
}
.rail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.rail-card-header h2 {
    margin: 0;
    color: #071a33;
    font-size: 15px;
    font-weight: 900;
}
.rail-card-header a,
.rail-card-header span {
    color: var(--xyoro-blue);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.rail-list {
    display: grid;
    gap: 0;
}
.rail-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid rgba(15, 42, 84, .08);
}
.rail-item:first-child {
    border-top: 0;
    padding-top: 0;
}
.rail-item:last-child {
    padding-bottom: 0;
}
.rail-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef5ff;
    color: #1767f2;
    font-size: 10px;
    font-weight: 900;
}
.rail-dot.success { background: #eafaf1; color: #079455; }
.rail-dot.warning { background: #fff4df; color: #dc6803; }
.rail-dot.danger { background: #fff0f1; color: #d92d20; }
.rail-dot.purple { background: #f3edff; color: #6d28d9; }
.rail-item strong {
    display: block;
    color: #172033;
    font-size: 13px;
    line-height: 1.25;
}
.rail-item small,
.rail-meta {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 2px;
}
.rail-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    padding: 0 8px;
    background: #eff6ff;
    color: #175cd3;
    font-size: 12px;
    font-weight: 900;
}
.rail-count.warning { background: #fff4df; color: #b54708; }
.rail-count.danger { background: #fff0f1; color: #c01048; }
.rail-count.success { background: #ecfdf3; color: #027a48; }
.rail-alert {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    background: #f8fbff;
}
.rail-alert.warning { background: #fff7ed; }
.rail-alert.danger { background: #fff1f3; }
.rail-alert.info { background: #eff8ff; }
.rail-alert strong {
    display: block;
    color: #172033;
    font-size: 13px;
}
.rail-alert small {
    color: #64748b;
    font-size: 11px;
}
[dir="rtl"] .top-bell em {
    right: auto;
    left: -7px;
}
@media (max-width: 1499.98px) {
    .xyoro-dashboard {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 18px;
    }
    .top-context-pill.wide {
        min-width: 200px;
        max-width: 230px;
    }
}
@media (max-width: 1299.98px) {
    .xyoro-dashboard {
        grid-template-columns: 1fr;
    }
    .xyoro-dashboard-rail {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .top-context-pill.wide {
        display: none;
    }
}
@media (max-width: 991.98px) {
    .xyoro-dashboard-rail {
        grid-template-columns: 1fr;
    }
    .top-context-controls {
        flex: 0 0 auto;
    }
    .top-context-pill {
        min-width: 136px;
        height: 46px;
        padding: 7px 10px;
    }
}
@media (max-width: 767.98px) {
    .top-context-controls {
        display: none;
    }
    .lang-pill {
        width: 42px;
        justify-content: center;
        padding: 6px;
        font-size: 0;
    }
    .xyoro-dashboard .stat-card {
        min-height: 112px;
    }
    .rail-card {
        padding: 14px;
    }
}
.trend-up { color: #079455; font-weight: 800; }
.trend-down { color: #c01048; font-weight: 800; }
.dash-flat { display: block; }
.dash-health-bar { width: 100%; height: 6px; border-radius: 999px; background: #eef2f6; margin: 6px 0 4px; overflow: hidden; }
.dash-health-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #15803d); }
.dash-health-bar-fill.warn { background: linear-gradient(90deg, #fb923c, #dc6803); }
.dash-plan-legend { display: grid; gap: 12px; padding: 8px 4px; }
.dash-plan-legend-item { display: flex; align-items: center; gap: 10px; }
.dash-plan-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dash-plan-legend-item strong { display: block; font-size: 13px; color: #172033; }
.dash-plan-legend-item small { color: #64748b; font-size: 12px; }
.dash-kpi-row .stat-card { padding: 16px; gap: 12px; align-items: flex-start; }
.xyoro-dashboard .dash-kpi-row .stat-icon { width: 42px; height: 42px; font-size: 10px; }
.dash-kpi-row .stat-card p { font-size: 12px; margin-bottom: 4px; white-space: nowrap; }
.dash-kpi-row .stat-card h3 { font-size: 21px; }
.dash-kpi-row .stat-card small { font-size: 11px; line-height: 1.4; }
@media (max-width: 575.98px) {
    .dash-kpi-row .stat-card p { white-space: normal; }
}
.dash-health-item { border-left: 3px solid #16a34a; }
.dash-health-item strong { color: #079455; }
.dash-health-item.bad { border-left-color: #dc6803; }
.dash-health-item.bad strong { color: #b54708; }
.dash-quickactions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
}
.dash-qa-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 16px 10px;
    border: 1px solid rgba(15, 42, 84, .09);
    border-radius: 8px;
    text-decoration: none;
    color: #172033;
    font-size: 12.5px;
    font-weight: 700;
    transition: transform .12s ease, box-shadow .12s ease;
}
.dash-qa-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    color: #172033;
}
.dash-qa-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
}

/* V24 module-wise collapsible side nav, native <details>/<summary> (no JS dependency) */
.nav-group-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; user-select: none;
    padding: 10px 12px; border-radius: 12px; color: #b9c9e6; list-style: none;
    border-left: 2px solid transparent; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-group-toggle::-webkit-details-marker { display: none; }
.nav-group-toggle::marker { content: ""; }
.nav-group-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-group-label { flex: 1 1 auto; min-width: 0; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.nav-group-toggle .chevron { flex: 0 0 auto; color: #7d92b8; transition: transform .2s ease; }
.nav-group[open] > .nav-group-toggle .chevron { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-toggle { background: rgba(39,110,255,.16); color: #fff; border-left-color: #4a8dff; }
.nav-group.has-active > .nav-group-toggle .chevron { color: #fff; }
.nav-group-items {
    display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 13px; padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.10);
}
.nav-group-items a { padding: 9px 12px; font-size: 13px; }
.nav-group-items a span { width: 24px; height: 24px; font-size: 9px; }
.side-nav .logout-link { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 6px; }

/* =====================================================================================================
   V38 -- Professional redesign foundation. Additive by design: every rule below re-declares a selector
   that already exists earlier in this file (chrome, cards, badges, page-shell) with a complete set of
   properties, so later-cascade wins cleanly without deleting or fighting any existing module-specific
   CSS (tenant-owner-*, governance-*, gateway-*, rail-*, leave-shell, etc.), all of which are left
   completely untouched. .page-shell (used as a wrapper in 76 view files) had zero rules before this --
   it is a pure addition, not an override, so it carries no regression risk of its own.
   ===================================================================================================== */
:root {
    /* New, richer token layer -- coexists with the original --xyoro-* tokens above; nothing that reads
       --xyoro-* needs to change. */
    --surface: #ffffff;
    --surface-sunken: #f5f7fb;
    --line-soft: #edf1f8;
    --slate: #5b6b85;
    --slate-2: #8792a6;
    --ink: #0b1220;
    --brand-ink: #0a2a63;
    --brand-ink-2: #0d1f3f;
    --success: #157a4a;
    --success-bg: #e6f6ee;
    --warning: #a3620a;
    --warning-bg: #fbf0dd;
    --danger: #b02a2a;
    --danger-bg: #fbe9e9;
    --info: #2f6fd1;
    --info-bg: #eaf1fd;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-1: 0 1px 2px rgba(11,18,32,.05);
    --shadow-2: 0 8px 24px -8px rgba(11,18,32,.12);
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}
/* Deliberate choice: a refined system-font stack, not a webfont. This app has no build step and no
   webfont dependency today (body { font-family: Inter, ... } was already silently falling back to
   system fonts, since Inter was never actually loaded) -- a system stack renders instantly across all
   193 server-rendered pages with zero added network requests and no risk of a broken CDN reference. */
body { font-family: var(--font-ui); color: var(--ink); }
.font-mono, code, .job-code, .id-code { font-family: var(--font-mono); }

/* ---- chrome: sidebar / topbar -------------------------------------------------------------------- */
.sidebar {
    background: linear-gradient(180deg, var(--brand-ink) 0%, var(--brand-ink-2) 100%);
    box-shadow: var(--shadow-2);
}
.side-nav a {
    gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm); color: #c3d2f2; font-weight: 500;
    transition: background .12s ease, color .12s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active, .side-nav a:hover.active { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 2px 0 0 var(--xyoro-blue); }
.side-nav a .nav-icon { flex: 0 0 auto; opacity: .92; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.side-nav a span { opacity: .85; }
.side-nav a .nav-badge { margin-left: auto; flex: 0 0 auto; width: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0; opacity: 1; }
.side-nav a.active .nav-badge { background: #fff; color: #0b53e4; }
.side-nav .nav-section-label { padding: 15px 12px 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; opacity: .45; }
.side-nav .nav-section-label:first-child { padding-top: 4px; }
.side-nav .nav-section-gap { height: 8px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.nav-group-label { font-weight: 700; }
.nav-group-toggle { gap: 11px; }
.side-nav .logout-link { color: #ffb0ac; }
.side-nav .logout-link .nav-icon { opacity: .9; }

.topbar { background: var(--surface); }
.top-search .form-control { border-radius: var(--radius-sm); background: var(--surface-sunken); border-color: var(--xyoro-border); }
.lang-pill { border-radius: var(--radius-sm); font-weight: 700; }
.top-bell, .top-context-pill { border-radius: var(--radius-sm); box-shadow: none; }
.avatar-circle { border-radius: var(--radius-sm); }

/* ---- page-shell: the wrapper used by 76 view files, previously entirely unstyled ------------------ */
.page-shell { display: flex; flex-direction: column; gap: 20px; max-width: 1440px; }
.page-shell .page-title-row { margin-bottom: 0; }
.page-shell .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--xyoro-blue); margin-bottom: 4px; }
.page-shell h1 { font-weight: 750; letter-spacing: -.01em; }

/* ---- cards / stats -------------------------------------------------------------------------------- */
.stat-card, .panel-card {
    background: var(--surface); border: 1px solid var(--xyoro-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}
.stat-card { padding: 18px 18px 16px; }
.stat-card p { color: var(--slate); font-weight: 700; letter-spacing: .01em; }
.stat-card h3 { color: var(--ink); letter-spacing: -.01em; }
.stat-icon { border-radius: var(--radius); box-shadow: none; }
.panel-card { padding: 20px 22px; }
.panel-header { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { font-weight: 700; font-size: 15px; }
.hover-card:hover { box-shadow: var(--shadow-2); }

/* ---- tables ----------------------------------------------------------------------------------------*/
.xyoro-table thead th { background: var(--surface-sunken); color: var(--slate-2); font-weight: 700; }
.xyoro-table tbody tr:hover { background: var(--surface-sunken); }
.xyoro-table-wrap table tbody tr:hover { background: var(--surface-sunken); }

/* ---- status pills: only the shared shape/weight is redeclared -- every individual .status-* color
   rule earlier in this file (25+ variants) is untouched, since those already carry real semantic
   meaning per module and are safe as-is. ------------------------------------------------------------ */
.status-badge {
    border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 11px; font-weight: 700;
    letter-spacing: .01em; display: inline-flex; align-items: center; gap: 5px;
}

/* ---- buttons / forms ---------------------------------------------------------------------------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; }
.btn-primary { border-radius: var(--radius-sm); }
.form-control, .form-select { border-radius: var(--radius-sm); }

@media (max-width: 767.98px) {
    .page-shell { gap: 16px; }
}
