* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
    background-color: #f8fafc; color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px;
}
.container { width: 100%; max-width: 1120px; margin: 0 auto; }
a { color: #5857ff; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.top-wrap { display: flex; justify-content: flex-end; margin: -8px 0 12px; }
.top-links { display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    width: 100%; max-width: 380px; }
.top-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 20px;
    font-size: 13px; font-weight: 700; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.top-link::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%;
    background: var(--top-dot, #94a3b8); }
.top-link:hover { transform: translateY(-1px); }
.top-link--school { background: linear-gradient(135deg, #fffaea 0%, #fceecb 100%);
    border-color: #f5e0a4; color: #8a6100; --top-dot: #efb52a; }
.top-link--managers { background: linear-gradient(135deg, #f4faec 0%, #e3f1d2 100%);
    border-color: #cfe6b4; color: #3d7719; --top-dot: #6aa62f; }
.top-link--api { background: linear-gradient(135deg, #fdf2f0 0%, #f9dcd8 100%);
    border-color: #f3c8c1; color: #a8281f; --top-dot: #d13a2f; }

.svc-rail { position: relative; margin-bottom: 22px; padding: 8px 8px 14px;
    border: 1px solid #d8d6ff; border-radius: 16px;
    background: linear-gradient(160deg, #f7f7ff 0%, #ededfb 100%);
    box-shadow: 0 8px 24px rgba(88, 87, 255, .08); }
.svc-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
    overflow: hidden; transition: max-height .32s ease; }
.svc-toggle { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%); z-index: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px;
    padding: 0 14px 0 15px; border: 1px solid #c5c3ff; border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #eeefff 100%); color: #4b48d9;
    font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
    cursor: pointer; box-shadow: 0 4px 14px rgba(88, 87, 255, .22), inset 0 1px 0 #fff;
    transition: transform .18s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.svc-toggle:hover { transform: translate(-50%, calc(50% - 2px)); border-color: #5857ff; color: #5857ff;
    box-shadow: 0 8px 22px rgba(88, 87, 255, .32), inset 0 1px 0 #fff; }
.svc-toggle:focus-visible { outline: 2px solid #5857ff; outline-offset: 3px; }
.svc-toggle-arrow { flex: none; transition: transform .32s ease; }
.svc-toggle[aria-expanded="true"] .svc-toggle-arrow { transform: rotate(180deg); }
.svc-tile { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; text-align: left;
    text-decoration: none; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.03); transition: border-color .15s ease, box-shadow .15s ease; }
.svc-tile:hover { border-color: #5857ff; box-shadow: 0 4px 16px rgba(88,87,255,.12); }
.svc-tile.active { background: #eeefff; border-color: #5857ff; }
.svc-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 10px; background: #f1f5f9; color: #5857ff; }
.svc-tile.active .svc-icon { background: #5857ff; color: #fff; }
.svc-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.svc-name { display: flex; align-items: flex-start; gap: 4px; font-size: 13px; font-weight: 700;
    color: #0f172a; line-height: 1.25; }
.svc-tile.active .svc-name { color: #5857ff; }
.svc-title { min-width: 0; }
.svc-sub { font-size: 11.5px; color: #64748b; line-height: 1.3; }
.svc-api { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 8.5px;
    font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #047857; background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0; border-radius: 999px; padding: 0 5px; }
.svc-api::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #10b981; flex: none; }

.app-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 11px; background: #5857ff; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .03em; }
.brand-text { display: flex; flex-direction: column; }
.brand-text b { font-size: 15px; color: #0f172a; }
.brand-text small { font-size: 11.5px; color: #64748b; }
.app-user { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline-flex; }

.app-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.app-tab { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
    border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: all .15s ease; }
.app-tab:hover { border-color: #5857ff; color: #5857ff; }
.app-tab.active { background: #5857ff; border-color: #5857ff; color: #fff; box-shadow: 0 4px 14px rgba(88,87,255,.28); }

.account-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px;
    padding: 10px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.account-bar__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.account-bar__select { min-width: 240px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; font-family: inherit; background: #fff; color: #0f172a; }
.account-bar__select:focus { border-color: #5857ff; outline: none; box-shadow: 0 0 0 3px rgba(88,87,255,.12); }

.hero { text-align: center; margin-bottom: 20px; }
.header-badge { display: inline-block; padding: 4px 14px; background: #eeefff; color: #5857ff;
    font-size: 13px; font-weight: 600; border-radius: 20px; margin-bottom: 12px; }
.title { font-size: 28px; font-weight: 700; margin-bottom: 10px; color: #0f172a;
    letter-spacing: -.02em; line-height: 1.25; }
.subtitle { font-size: 14px; color: #64748b; line-height: 1.55; max-width: 760px; margin: 0 auto; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 10px;
    flex-wrap: wrap; margin-top: 16px; }
.hero-actions--left { justify-content: flex-start; margin-top: 12px; }

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04); text-align: left; overflow: hidden; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.card-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.card-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
    border-radius: 7px; background: #eeefff; color: #5857ff; font-size: 11.5px; font-weight: 800; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px 20px; }
.card-body > * + * { margin-top: 12px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 4px; }
.feature-text { font-size: 13.5px; color: #475569; line-height: 1.55; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #475569; }
.plan-list li { position: relative; padding-left: 18px; line-height: 1.45; }
.plan-list li::before { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px;
    border-radius: 50%; background: #c5c3ff; }
.steps { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; font-size: 13.5px;
    color: #475569; line-height: 1.5; }
.steps b { color: #0f172a; }

.stats-grid { display: grid; gap: 10px; margin-bottom: 16px; }
.stats-grid--three { grid-template-columns: repeat(3, 1fr); }
.stats-grid--four { grid-template-columns: repeat(4, 1fr); }
.stat-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 10px;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.stat-value { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 3px; }
.stat-label { font-size: 12px; color: #64748b; }

.search-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background-color: #5857ff; color: #fff; border: none; padding: 11px 20px; border-radius: 10px;
    font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
    text-decoration: none; transition: background-color .2s ease, transform .1s ease; }
.search-btn:hover { background-color: #4342e6; }
.search-btn:active { transform: scale(.98); }
.search-btn:disabled { background-color: #cbd5e1; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0;
    background: #fff; color: #64748b; border-radius: 9px; padding: 6px 10px; font-size: 12.5px;
    font-family: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: all .15s ease; }
.icon-btn:hover { border-color: #5857ff; color: #5857ff; background: #f8fafc; }
.icon-btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn.danger:hover { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.icon-btn--lg { padding: 11px 18px; font-size: 14px; border-radius: 10px; color: #475569; }
.sync-btn { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; }
.sync-btn:hover { background: #15803d; border-color: #15803d; color: #fff; }
.link-btn { background: none; border: none; color: #5857ff; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; padding: 0; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions--lg { margin-top: 14px; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    background: #f1f5f9; color: #475569; white-space: nowrap; }
.badge--queued { background: #eeefff; color: #5857ff; }
.badge--running { background: #e0f2fe; color: #0369a1; }
.badge--waiting { background: #fff7ed; color: #b45309; }
.badge--paused { background: #f3e8ff; color: #7e22ce; }
.badge--muted { background: #f1f5f9; color: #64748b; }
.badge--done { background: #dcfce7; color: #15803d; }
.badge--error { background: #fee2e2; color: #b91c1c; }

.hint { font-size: 12px; color: #64748b; line-height: 1.5; }
.ok-text { color: #15803d; }
.err-text { color: #b91c1c; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; border: 1px solid transparent; }
.alert--error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert--info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.task-screenshot { margin: 14px 0; display: grid; gap: 8px; }
.task-screenshot img { display: block; width: 100%; max-width: 900px; height: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.empty { text-align: center; padding: 26px 16px; color: #94a3b8; font-size: 14px; }
.empty b { color: #475569; }
.empty .link-btn { margin-left: 4px; }


.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; text-align: left;
    vertical-align: top; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b;
    background: #f8fafc; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfbff; }
.table code { font-size: 12.5px; background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.cell-wrap { white-space: normal; min-width: 160px; }
.cell-actions { text-align: right; white-space: nowrap; }
.table td:last-child .row-actions { flex-wrap: nowrap; }
.row-link { font-weight: 600; color: #0f172a; text-decoration: none; }
.row-link:hover { color: #5857ff; text-decoration: underline; }
.row-muted td { opacity: .62; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-size: 12.5px; font-weight: 600; color: #475569; }
.field input, .field textarea, .field select, .select {
    width: 100%; padding: 10px 13px; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; font-family: inherit; color: #0f172a; background: #fff; }
.field textarea { resize: vertical; min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .select:focus {
    border-color: #5857ff; outline: none; box-shadow: 0 0 0 3px rgba(88,87,255,.12); }
.field--full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.check-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #334155; }
.check-row input { width: 16px; height: 16px; accent-color: #5857ff; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1 1 240px; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; font-family: inherit; background: #fff; }
.search-input:focus { border-color: #5857ff; outline: none; box-shadow: 0 0 0 3px rgba(88,87,255,.12); }
.filter-bar .select { flex: 0 0 180px; }

.date-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.date-chip { position: relative; display: block; cursor: pointer; }
.date-chip input { position: absolute; opacity: 0; pointer-events: none; }
.date-chip__box { display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 7px 6px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
    font-size: 12.5px; color: #475569; transition: all .15s ease; text-align: center; }
.date-chip__box b { font-size: 13px; color: #0f172a; }
.date-chip__box small { font-size: 10.5px; color: #94a3b8; }
.date-chip:hover .date-chip__box { border-color: #c5c3ff; }
.date-chip input:checked + .date-chip__box { border-color: #5857ff; background: #eeefff;
    box-shadow: 0 2px 10px rgba(88,87,255,.16); }
.date-chip input:checked + .date-chip__box b { color: #4342e6; }
.date-chip input:focus-visible + .date-chip__box { outline: 2px solid #5857ff; outline-offset: 2px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.detail-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: #94a3b8; margin-bottom: 2px; }
.detail-grid b { color: #0f172a; font-weight: 600; }

.log-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.log-item { display: grid; grid-template-columns: 128px 70px minmax(0, 1fr); gap: 10px;
    align-items: baseline; padding: 8px 10px; border: 1px solid #f1f5f9; border-radius: 9px;
    background: #fbfbfd; font-size: 13px; }
.log-time { color: #94a3b8; font-size: 12px; }
.log-level { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: #64748b; }
.log-message { color: #334155; line-height: 1.45; word-break: break-word; }
.log-item--success { border-color: #bbf7d0; background: #f0fdf4; }
.log-item--success .log-level { color: #15803d; }
.log-item--warning { border-color: #fde68a; background: #fffbeb; }
.log-item--warning .log-level { color: #b45309; }


.login-step { margin-top: 16px; padding: 16px; border: 1px solid #dcdbff; border-radius: 12px;
    background: #f7f7ff; }
.login-step__title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.login-status { display: flex; align-items: center; gap: 8px; margin-top: 12px;
    padding: 9px 12px; border: 1px solid #bae6fd; border-radius: 10px;
    background: #f0f9ff; font-size: 13px; color: #075985; }
.login-status.is-error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.login-status.is-error .login-status__spinner { display: none; }
.login-status__spinner { flex: none; width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: wb-spin .8s linear infinite; }
@keyframes wb-spin { to { transform: rotate(360deg); } }
.login-code { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.login-code__input { width: 150px; padding: 11px 14px; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 18px; letter-spacing: .35em; font-family: ui-monospace, Menlo, Consolas, monospace;
    text-align: center; background: #fff; color: #0f172a; }
.login-code__input:focus { border-color: #5857ff; outline: none;
    box-shadow: 0 0 0 3px rgba(88,87,255,.12); }

.account-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.auth-wrap { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 460px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .field input { padding: 11px 14px; }
.auth-submit { width: 100%; margin-top: 2px; }

.footer { margin-top: 34px; font-size: 13px; color: #64748b; display: flex; flex-direction: column;
    gap: 10px; align-items: center; text-align: center; }
.footer a { color: #64748b; text-decoration: none; transition: color .15s ease; }
.footer a:hover { color: #5857ff; text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.footer-highlight { font-weight: 600; color: #5857ff !important; }
.dot { color: #cbd5e1; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
    background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
    opacity: 0; pointer-events: none; transition: all .25s ease; max-width: min(92vw, 560px); z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #991b1b; }

@media (max-width: 980px) {
    .features { grid-template-columns: 1fr 1fr; }
    .stats-grid--four { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
    .top-links { flex: 0 0 190px; }
}

@media (min-width: 1420px) {
    .top-wrap { margin: 0; height: 0; }
    .top-links { position: fixed; top: 24px; right: 16px; z-index: 40;
        width: calc(50% - 588px); max-width: 520px; }
}

@media (max-width: 860px) {
    .svc-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .features { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { padding: 16px 10px; }
    .top-wrap { margin: 0 0 10px; }
    .top-links { gap: 4px; max-width: none; }
    .top-link { height: 28px; padding: 0 11px; font-size: 12px; }
    .svc-rail { padding: 7px 7px 12px; border-radius: 14px; margin-bottom: 18px; }
    .svc-toggle { height: 28px; padding: 0 12px 0 13px; font-size: 12px; }
    .svc-tile { flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px; text-align: center; }
    .svc-icon { width: 30px; height: 30px; }
    .svc-name { font-size: 12.5px; justify-content: center; }
    .svc-name .svc-api { margin-left: 0; }
    .svc-sub { display: none; }
    .title { font-size: 23px; }
    .subtitle { font-size: 13.5px; }
    .card-body { padding: 14px; }
    .card-head { padding: 12px 14px; }
    .stats-grid--three, .stats-grid--four { grid-template-columns: repeat(2, 1fr); }
    .date-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
    .filter-bar .select { flex: 1 1 120px; }
    .log-item { grid-template-columns: 1fr; gap: 3px; }
    .table th, .table td { padding: 8px; font-size: 12.5px; }
    .app-head { flex-wrap: wrap; }
    .account-bar__select { min-width: 0; width: 100%; }
}

