/*
Theme Name: AMT Portal
Theme URI: https://алмт.рф/
Author: ГАПОУ СО «Алапаевский многопрофильный техникум»
Description: Закрытый внутренний портал педагогов АМТ: рабочие ресурсы, посещаемость, журналы, материалы для кураторов, MAX, «Моя школа» и заявки информационно-ресурсному отделу.
Version: 1.6.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: amt-portal
*/

:root {
    --amt-primary: #135f96;
    --amt-primary-dark: #0d456e;
    --amt-primary-deep: #123d61;
    --amt-ink: #202a33;
    --amt-muted: #68737e;
    --amt-bg: #f3f5f7;
    --amt-card: #ffffff;
    --amt-border: #dce2e7;
    --amt-border-strong: #c9d1d8;
    --amt-success: #287348;
    --amt-warning: #8c6415;
    --amt-danger: #a63d3d;
    --amt-radius-sm: 4px;
    --amt-radius: 7px;
    --amt-radius-lg: 9px;
    --amt-shadow-sm: 0 1px 3px rgba(22, 42, 57, .06);
    --amt-shadow: 0 4px 14px rgba(22, 42, 57, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: auto; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--amt-bg);
    color: var(--amt-ink);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.52;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--amt-primary); }
a:hover { color: var(--amt-primary-dark); }
.amt-main { flex: 1 0 auto; }
.amt-container { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.text-secondary { color: var(--amt-muted) !important; }

/* Keep the internal portal deliberately snappy: no decorative motion. */
:root { scroll-behavior: auto !important; }
.amt-navbar .collapsing { transition: none !important; }
.amt-main a,
.amt-main button,
.amt-login-page button,
.amt-header a,
.amt-header button { transition: none !important; }

/* Header */
.amt-header {
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--amt-border);
    box-shadow: 0 1px 5px rgba(22, 42, 57, .05);
}
.amt-header-top {
    min-height: 31px;
    display: flex;
    align-items: center;
    background: var(--amt-primary-deep);
    color: rgba(255,255,255,.86);
    font-size: .76rem;
}
.amt-header-top .amt-container { min-height: 31px; }
.amt-navbar { background: #fff; min-height: 68px; }
.amt-navbar .navbar-brand { margin-right: 28px; min-width: 0; }
.amt-logo, .amt-logo-wrap img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain;
}
.amt-logo-wrap a { display: block; }
.amt-brand-text { display: flex; flex-direction: column; color: var(--amt-ink); line-height: 1.15; min-width: 0; }
.amt-brand-text strong { font-size: .98rem; font-weight: 700; }
.amt-brand-text small { margin-top: 4px; color: #7c8791; font-size: .72rem; font-weight: 400; }
.amt-navbar .navbar-nav { gap: 0; }
.amt-navbar .nav-link {
    position: relative;
    color: #495560 !important;
    padding: .65rem .68rem !important;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 4px;
}
.amt-navbar .nav-link:hover,
.amt-navbar .nav-link:focus { color: var(--amt-primary-dark) !important; background: #f2f5f7; }
.amt-navbar .nav-link.active { color: var(--amt-primary-dark) !important; background: #eef3f7; }
.amt-navbar .dropdown-menu {
    padding: 5px;
    border: 1px solid var(--amt-border);
    border-radius: 6px;
    box-shadow: var(--amt-shadow);
}
.amt-navbar .dropdown-item { border-radius: 3px; padding: .58rem .66rem; font-size: .9rem; }
.amt-navbar .dropdown-item:hover { background: #eef3f7; color: var(--amt-primary-dark); }
.amt-user-menu .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #34414c;
    background: #fff;
    border: 1px solid var(--amt-border-strong);
    border-radius: 5px;
    padding: .4rem .65rem;
    white-space: nowrap;
}
.amt-user-menu .btn:hover { background: #f6f8f9; border-color: #b9c4cd; }
.amt-user-menu .dashicons { font-size: 18px; width: 18px; height: 18px; color: #586775; }
.amt-navbar .navbar-toggler { border-color: var(--amt-border-strong); border-radius: 5px; padding: .42rem .58rem; }

/* Typography */
.amt-eyebrow {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .7rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--amt-primary);
}
.amt-page-subtitle { color: var(--amt-muted); max-width: 820px; }

/* Dashboard welcome */
.amt-welcome {
    min-height: 150px;
    background: #fff;
    border: 1px solid var(--amt-border);
    border-left: 4px solid var(--amt-primary-deep);
    border-radius: var(--amt-radius-lg);
    padding: 28px 30px;
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: center;
    box-shadow: var(--amt-shadow-sm);
}
.amt-welcome-main h1 {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -.015em;
}
.amt-welcome-main p:last-child { color: var(--amt-muted); }
.amt-welcome-stat {
    width: 150px;
    min-height: 88px;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 14px 16px;
    color: var(--amt-ink);
    background: #f5f7f8;
    border: 1px solid var(--amt-border);
    border-radius: 6px;
    text-decoration: none;
}
.amt-welcome-stat:hover { color: var(--amt-ink); background: #f0f4f6; border-color: var(--amt-border-strong); }
.amt-stat-label { grid-column: 1 / -1; color: #5d6872; font-size: .8rem; font-weight: 600; }
.amt-welcome-stat strong { font-size: 1.65rem; line-height: 1; font-weight: 700; color: var(--amt-primary-dark); }
.amt-stat-caption { align-self: end; color: #7b858e; font-size: .75rem; }

.amt-dashboard-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 13px; }
.amt-dashboard-title h2 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.amt-dashboard-title p { margin: 3px 0 0; color: var(--amt-muted); font-size: .88rem; }

/* Main dashboard sections: campuses + curator */
.amt-primary-card,
.amt-campus-card {
    position: relative;
    min-height: 188px;
    height: 100%;
    display: flex;
    gap: 18px;
    padding: 23px 52px 22px 22px;
    background: #fff;
    color: var(--amt-ink);
    text-decoration: none;
    border: 1px solid var(--amt-border);
    border-top: 3px solid var(--amt-primary-deep);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
}
.amt-primary-card:hover,
.amt-campus-card:hover { color: var(--amt-ink); border-color: #c6d0d8; border-top-color: var(--amt-primary); box-shadow: var(--amt-shadow); }
.amt-primary-icon,
.amt-campus-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--amt-primary-dark);
    background: #eef3f7;
    border: 1px solid #dce5eb;
    border-radius: 5px;
}
.amt-primary-icon .dashicons,
.amt-campus-icon .dashicons { width: 23px; height: 23px; font-size: 23px; }
.amt-primary-content,
.amt-campus-content { min-width: 0; display: flex; flex-direction: column; }
.amt-primary-meta,
.amt-campus-meta { margin-bottom: 4px; color: #7b858e; font-size: .76rem; }
.amt-primary-card h2,
.amt-campus-card h2 { margin: 0 0 7px; font-size: 1.18rem; font-weight: 700; }
.amt-primary-card p,
.amt-campus-card p { margin: 0 0 14px; color: var(--amt-muted); font-size: .9rem; }
.amt-inline-link { margin-top: auto; color: var(--amt-primary); font-size: .86rem; font-weight: 600; }
.amt-count {
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 4px;
    background: #f3f5f7;
    border: 1px solid #e2e6ea;
    color: #6a7580;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .76rem;
    font-weight: 700;
}
.amt-primary-card > .amt-count,
.amt-campus-card > .amt-count { position: absolute; top: 20px; right: 18px; }

.amt-primary-card { min-height: 218px; }
.amt-primary-card--curator { border-top-color: #2f6d54; }
.amt-primary-card--curator:hover { border-top-color: #245a45; }
.amt-primary-card--curator .amt-primary-icon {
    color: #285f49;
    background: #eef5f1;
    border-color: #d9e7df;
}
.amt-primary-card--curator .amt-inline-link { color: #285f49; }

/* Compact service rows */
.amt-service-card {
    min-height: 98px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 17px 18px;
    background: #fff;
    color: var(--amt-ink);
    text-decoration: none;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
}
.amt-service-card:hover { color: var(--amt-ink); border-color: #bdc9d2; background: #fcfdfe; }
.amt-service-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--amt-primary-dark);
}
.amt-service-icon .dashicons { width: 23px; height: 23px; font-size: 23px; }
.amt-service-text { min-width: 0; display: flex; flex-direction: column; }
.amt-service-text strong { margin-bottom: 3px; font-size: .98rem; font-weight: 700; }
.amt-service-text small { color: var(--amt-muted); font-size: .82rem; line-height: 1.35; }
.amt-service-side { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.amt-service-arrow { color: #7c8791; font-size: 1.12rem; }

/* Legacy classes kept for compatibility with templates */
.amt-dashboard-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    background: #fff;
    color: var(--amt-ink);
    text-decoration: none;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
}
.amt-card-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.amt-card-icon, .amt-mini-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: #eef3f7;
    color: var(--amt-primary-dark);
    border: 1px solid #dce5eb;
}
.amt-card-icon .dashicons { font-size: 24px; width: 24px; height: 24px; }
.amt-card-icon-lg { width: 56px; height: 56px; }
.amt-card-icon-lg .dashicons { font-size: 28px; width: 28px; height: 28px; }
.amt-mini-icon { width: 40px; height: 40px; }
.amt-mini-icon .dashicons { font-size: 21px; width: 21px; height: 21px; }
.amt-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.amt-card-body h2 { font-weight: 700; }
.amt-card-body p { color: var(--amt-muted); margin: 0 0 16px; font-size: .9rem; }
.amt-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.amt-card-link { font-size: .86rem; font-weight: 600; color: var(--amt-primary); }
.amt-card-arrow { color: #71808c; }

/* Section pages */
.breadcrumb { font-size: .84rem; }
.breadcrumb a { color: #6f7a84; text-decoration: none; }
.breadcrumb a:hover { color: var(--amt-primary); }
.breadcrumb-item.active { color: #9aa2aa; }
.amt-section-head {
    display: flex;
    gap: 18px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--amt-border);
    border-left: 4px solid var(--amt-primary);
    border-radius: var(--amt-radius);
    padding: 22px 24px;
    box-shadow: var(--amt-shadow-sm);
}
.amt-section-head h1 { font-size: clamp(1.55rem, 3vw, 2.05rem); font-weight: 700; letter-spacing: -.015em; }
.amt-section-head p:last-child { color: var(--amt-muted); max-width: 900px; }

.amt-resource-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
}
.amt-resource-panel-head {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 20px;
    background: #f8fafb;
    border-bottom: 1px solid var(--amt-border);
}
.amt-resource-panel-head h2 { margin: 0 0 3px; font-size: 1rem; font-weight: 700; }
.amt-resource-panel-head p { margin: 0; color: var(--amt-muted); font-size: .82rem; }
.amt-resource-total {
    min-width: 34px;
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--amt-primary-dark);
    border: 1px solid #d5dde3;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 700;
}
.amt-resource-list { display: flex; flex-direction: column; }
.amt-resource-row {
    position: relative;
    min-height: 104px;
    display: grid;
    grid-template-columns: 34px 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: #fff;
    border-top: 1px solid #e7ebee;
}
.amt-resource-row:first-child { border-top: 0; }
.amt-resource-row:hover { background: #fbfcfd; }
.amt-resource-row.is-pending { background: #fafbfc; }
.amt-resource-number {
    align-self: start;
    padding-top: 10px;
    color: #a1aab2;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.amt-resource-row-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--amt-primary-dark);
    background: #f0f4f7;
    border: 1px solid #dce4e9;
    border-radius: 5px;
}
.amt-resource-row-icon .dashicons { width: 20px; height: 20px; font-size: 20px; }
.amt-resource-row-content { min-width: 0; padding-right: 16px; }
.amt-resource-row-content h3 {
    margin: 0 0 5px;
    color: var(--amt-ink);
    font-size: .98rem;
    line-height: 1.35;
    font-weight: 700;
}
.amt-resource-row-content p {
    max-width: 930px;
    margin: 0;
    color: var(--amt-muted);
    font-size: .85rem;
    line-height: 1.45;
}
.amt-resource-host {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: #7b858e;
    font-size: .74rem;
    overflow-wrap: anywhere;
}
.amt-resource-host .dashicons { width: 14px; height: 14px; font-size: 14px; }
.amt-resource-row-action { min-width: 122px; display: flex; justify-content: flex-end; }
.amt-resource-open {
    min-width: 116px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-left: 17px;
    padding-right: 17px;
}
.amt-resource-pending {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    color: #7b858e;
    background: #f3f5f6;
    border: 1px solid #dfe4e7;
    border-radius: 4px;
    font-size: .75rem;
    white-space: nowrap;
}

/* Tickets */
.amt-ticket-card {
    background: #fff;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    padding: 22px;
    box-shadow: var(--amt-shadow-sm);
}
.amt-sticky-card { position: sticky; top: 118px; }
.amt-ticket-list { display: flex; flex-direction: column; margin: 0; }
.amt-ticket-row {
    margin: 0;
    padding: 15px 5px;
    border-top: 1px solid #e8ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--amt-ink);
    text-decoration: none;
}
.amt-ticket-row:first-child { border-top: 0; }
.amt-ticket-row:hover { color: var(--amt-ink); background: #fafbfc; }
.amt-arrow { font-size: 1.1rem; color: #71808c; }
.amt-ticket-dl dt { color: var(--amt-muted); font-weight: 600; }
.amt-ticket-dl dd { font-weight: 500; }
.amt-preline { white-space: pre-line; }
.amt-ticket-response {
    background: #f4f8f5;
    border: 1px solid #d4e4d9;
    border-left: 4px solid var(--amt-success);
    border-radius: var(--amt-radius);
    padding: 21px;
    display: flex;
    gap: 15px;
}
.amt-response-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; color: var(--amt-success); background: #fff; border: 1px solid #d5e2d9; border-radius: 4px; }
.amt-response-icon .dashicons { font-size: 22px; width: 22px; height: 22px; }
.amt-timeline { position: relative; }
.amt-timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 11px; padding-bottom: 20px; }
.amt-timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 13px; left: 4px; bottom: -2px; width: 1px; background: #dce2e7; }
.amt-timeline-dot { margin-top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--amt-primary); z-index: 1; }

.badge { font-weight: 600; border-radius: 4px; padding: .42em .58em; }
.badge.bg-primary, .badge.text-bg-primary { background-color: #e9f1f7 !important; color: #155f93 !important; }
.badge.bg-info, .badge.text-bg-info { background-color: #eaf3f4 !important; color: #326d74 !important; }
.badge.bg-warning, .badge.text-bg-warning { background-color: #f8f0de !important; color: #876216 !important; }
.badge.bg-success, .badge.text-bg-success { background-color: #e8f2eb !important; color: #2b7048 !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background-color: #edf0f2 !important; color: #5e6871 !important; }
.badge.bg-danger { background-color: #f6e9e9 !important; color: #963f3f !important; }
.badge.text-bg-dark { background: #e7eaed !important; color: #37424c !important; }

/* Support, empty and legacy */
.amt-support-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--amt-border);
    border-left: 4px solid #647786;
    border-radius: var(--amt-radius);
    padding: 18px 20px;
    box-shadow: var(--amt-shadow-sm);
}
.amt-support-mark { color: #526675; }
.amt-support-panel .dashicons { font-size: 25px; width: 25px; height: 25px; }
.amt-empty-state { padding: 40px 24px; text-align: center; background: #fff; border: 1px dashed #c9d2d9; border-radius: var(--amt-radius); color: var(--amt-muted); }
.amt-empty-state .dashicons { display: block; margin: 0 auto 10px; font-size: 36px; width: 36px; height: 36px; color: #7b929f; }
.amt-empty-state h1, .amt-empty-state h2, .amt-empty-state h3 { color: var(--amt-ink); }
.amt-legacy-area { background: #fff; border: 1px solid var(--amt-border); border-radius: var(--amt-radius); padding: 20px; box-shadow: var(--amt-shadow-sm); }
.amt-legacy-widget + .amt-legacy-widget { margin-top: 20px; }
.amt-legacy-widget ul { margin: 0; padding-left: 1.2rem; }
.amt-legacy-widget a { overflow-wrap: anywhere; }

/* Forms and buttons */
.form-label { color: #3d4954; font-size: .88rem; font-weight: 600; }
.form-control, .form-select {
    min-height: 44px;
    border-color: #cfd7de;
    border-radius: 5px;
    background-color: #fff;
    color: var(--amt-ink);
    padding: .58rem .72rem;
}
textarea.form-control { min-height: auto; }
.form-control:hover, .form-select:hover { border-color: #bdc8d1; }
.form-control:focus, .form-select:focus { border-color: #6e9fc2; box-shadow: 0 0 0 .16rem rgba(19,95,150,.10); }
.form-text { color: #818b94; }
.btn {
    border-radius: 5px;
    font-weight: 600;
    padding: .52rem .82rem;
}
.btn-primary { background-color: var(--amt-primary); border-color: var(--amt-primary); }
.btn-primary:hover { background-color: var(--amt-primary-dark); border-color: var(--amt-primary-dark); }
.btn-outline-primary { color: var(--amt-primary); border-color: #8eafc6; }
.btn-outline-primary:hover { background: var(--amt-primary); border-color: var(--amt-primary); }
.btn-lg { min-height: 48px; font-size: .96rem; }
.alert { border: 1px solid transparent; border-radius: 5px; }
.alert-danger { background: #fbefef; border-color: #ebcccc; color: #8a3f3f; }
.page-link { color: var(--amt-primary); border-color: var(--amt-border); }
.page-item.active .page-link { background-color: var(--amt-primary); border-color: var(--amt-primary); }

/* Login */
.amt-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #edf1f4;
}
.amt-login-shell {
    width: min(930px, 100%);
    min-height: 500px;
    display: grid;
    grid-template-columns: .88fr 1.12fr;
    background: #fff;
    border: 1px solid #d6dde3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(24, 47, 64, .10);
}
.amt-login-brand {
    padding: 40px 36px;
    color: #fff;
    background: var(--amt-primary-deep);
    display: flex;
    flex-direction: column;
}
.amt-login-brand-head { display: flex; align-items: center; gap: 13px; }
.amt-login-brand-head > div { display: flex; flex-direction: column; line-height: 1.25; }
.amt-login-brand-head strong { font-size: .9rem; }
.amt-login-brand-head span { margin-top: 3px; color: rgba(255,255,255,.68); font-size: .7rem; }
.amt-login-logo { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 4px; padding: 5px; }
.amt-login-brand-body { margin: auto 0; padding: 46px 0 36px; }
.amt-login-brand .amt-eyebrow { color: #afcadc; }
.amt-login-brand h1 { margin: 0 0 14px; font-size: 2.15rem; font-weight: 700; line-height: 1.1; }
.amt-login-brand-body > p:last-child { margin: 0; max-width: 390px; color: rgba(255,255,255,.78); font-size: .94rem; }
.amt-login-access-note { margin: 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.61); font-size: .73rem; }
.amt-login-card { padding: 54px 50px; align-self: center; }
.amt-login-card h2 { font-weight: 700; }
.amt-login-form .form-control { min-height: 49px; }
.amt-login-help { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.amt-login-help a { color: #5f6f7b; text-decoration: none; font-size: .88rem; }
.amt-login-help a:hover { color: var(--amt-primary); }
.amt-login-help span { color: #9199a0; font-size: .76rem; }

/* Footer */
.amt-footer { background: #fff; border-top: 1px solid var(--amt-border); color: #7a858e; font-size: .82rem; }

/* Responsive */
@media (max-width: 1199.98px) {
    .amt-navbar { min-height: 64px; }
    .amt-navbar .navbar-collapse { margin-top: 10px; padding: 10px; background: #fff; border-top: 1px solid var(--amt-border); }
    .amt-navbar .nav-link { padding: .62rem .72rem !important; }
    .amt-user-menu { margin-top: 7px; }
    .amt-user-menu .btn { width: 100%; justify-content: center; }
    .amt-sticky-card { position: static; }
}

@media (max-width: 991.98px) {
    .amt-login-shell { grid-template-columns: 1fr; min-height: 0; }
    .amt-login-brand { padding: 28px 32px; }
    .amt-login-brand-body { padding: 32px 0 22px; }
    .amt-login-card { padding: 38px 32px 42px; }
}

@media (max-width: 767.98px) {
    .amt-container { padding-left: 16px; padding-right: 16px; }
    .amt-header-top { font-size: .7rem; }
    .amt-brand-text small { display: none; }
    .amt-brand-text strong { font-size: .9rem; }
    .amt-welcome { min-height: 0; padding: 22px; align-items: flex-start; flex-direction: column; }
    .amt-welcome-stat { width: 100%; min-height: 70px; grid-template-columns: 1fr auto auto; grid-template-rows: auto; }
    .amt-stat-label { grid-column: auto; }
    .amt-primary-card,
.amt-campus-card { min-height: 0; padding: 20px 48px 20px 19px; }
    .amt-service-card { min-height: 88px; }
    .amt-section-head { padding: 20px; align-items: flex-start; }
    .amt-card-icon-lg { width: 50px; height: 50px; }
    .amt-support-panel { align-items: flex-start; flex-wrap: wrap; }
    .amt-support-panel .btn { width: 100%; }
    .amt-login-page { padding: 14px; align-items: start; }
    .amt-login-shell { border-radius: 6px; }
    .amt-login-brand { padding: 25px 23px; }
    .amt-login-brand-body { padding: 28px 0 20px; }
    .amt-login-brand h1 { font-size: 1.8rem; }
    .amt-login-card { padding: 31px 24px 34px; }
    .amt-ticket-card { padding: 19px; }
}

@media (max-width: 767.98px) {
    .amt-resource-panel-head { padding: 15px 16px; }
    .amt-resource-row {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 12px;
        padding: 17px 16px;
    }
    .amt-resource-number { display: none; }
    .amt-resource-row-icon { width: 38px; height: 38px; align-self: start; }
    .amt-resource-row-content { padding-right: 0; }
    .amt-resource-row-action { grid-column: 2; width: 100%; min-width: 0; justify-content: stretch; }
    .amt-resource-open { width: 100%; }
    .amt-resource-pending { width: 100%; justify-content: center; }
}

@media (max-width: 575.98px) {
    .amt-logo, .amt-logo-wrap img { width: 37px !important; height: 37px !important; }
    .amt-navbar .navbar-brand { margin-right: 8px; }
    .amt-brand-text strong { max-width: 180px; white-space: normal; }
    .amt-welcome-main h1 { font-size: 1.62rem; }
    .amt-primary-card,
.amt-campus-card { gap: 13px; }
    .amt-primary-icon,
.amt-campus-icon { width: 39px; height: 39px; }
    .amt-primary-icon .dashicons,
.amt-campus-icon .dashicons { font-size: 20px; width: 20px; height: 20px; }
    .amt-primary-card h2,
.amt-campus-card h2 { font-size: 1.07rem; }
    .amt-service-card { align-items: flex-start; gap: 10px; }
    .amt-service-side { flex-direction: column; gap: 4px; }
    .amt-service-text small { font-size: .78rem; }
    .amt-section-head { gap: 13px; }
    .amt-section-head h1 { font-size: 1.45rem; }
    .amt-ticket-row { align-items: flex-start; }
    .amt-login-brand-head span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Curator section */
.amt-curator-list {
    display: grid;
    gap: 14px;
}

.amt-curator-item {
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    overflow: hidden;
}

.amt-curator-item-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px;
}

.amt-curator-item-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f9fb;
    color: #174f8a;
}

.amt-curator-item-icon .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.amt-curator-item h2 {
    margin: 0 0 7px;
    font-size: 1.08rem;
    font-weight: 600;
    color: #20262e;
}

.amt-curator-item p {
    margin: 0 0 14px;
    color: #5f6873;
    line-height: 1.55;
}

.amt-curator-documents {
    border-top: 1px solid #e5e9ee;
    background: #fafbfc;
    padding: 15px 24px 18px 82px;
}

.amt-curator-documents-title {
    margin-bottom: 8px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #727b86;
}

.amt-curator-document-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.amt-curator-document {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    margin-left: -10px;
    border-radius: 4px;
    color: #174f8a;
    text-decoration: none;
}

.amt-curator-document:hover {
    background: #eef3f8;
    color: #103e6f;
}

.amt-curator-document .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #687583;
}

.amt-curator-document-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amt-curator-document small {
    color: #7a838e;
    font-size: .7rem;
    font-weight: 700;
}

.amt-editor-shortcut {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border: 1px solid #dce3ea;
    border-radius: 6px;
    background: #f7f9fb;
    font-size: .9rem;
    color: #59636e;
}

.amt-editor-shortcut a {
    margin-left: auto;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .amt-curator-item-main {
        padding: 18px;
    }

    .amt-curator-documents {
        padding: 14px 18px 16px;
    }

    .amt-editor-shortcut {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .amt-editor-shortcut a {
        width: 100%;
        margin-left: 0;
    }
}

/* MAX section */
.amt-service-card--max {
    border-left: 3px solid #666782;
    background: #fff;
}
.amt-service-card--max .amt-service-icon {
    color: #565872;
}

.amt-max-section-head {
    border-left-color: #62647d;
}
.amt-max-head-icon {
    color: #565872;
    background: #f1f1f6;
    border-color: #dddde7;
}
.amt-max-block {
    background: #fff;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
    overflow: hidden;
}
.amt-max-block-head {
    min-height: 78px;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fafbfc;
    border-bottom: 1px solid var(--amt-border);
}
.amt-max-block-head h2 {
    margin: 0 0 3px;
    font-size: 1.05rem;
    font-weight: 700;
}
.amt-max-block-head p {
    margin: 0;
    color: var(--amt-muted);
    font-size: .84rem;
}
.amt-max-chat-list,
.amt-max-article-list {
    display: flex;
    flex-direction: column;
}
.amt-max-chat-row {
    min-height: 104px;
    display: grid;
    grid-template-columns: 36px 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 17px 20px;
    border-top: 1px solid #e8ecef;
}
.amt-max-chat-row:first-child { border-top: 0; }
.amt-max-chat-row:hover { background: #fbfcfd; }
.amt-max-chat-number {
    color: #9aa2a9;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}
.amt-max-chat-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #565872;
    background: #f1f1f6;
    border: 1px solid #e0e0e8;
    border-radius: 5px;
}
.amt-max-chat-icon .dashicons {
    width: 21px;
    height: 21px;
    font-size: 21px;
}
.amt-max-chat-content { min-width: 0; }
.amt-max-chat-content h3 {
    margin: 0 0 3px;
    font-size: .98rem;
    font-weight: 700;
}
.amt-max-chat-content p {
    margin: 0 0 7px;
    color: var(--amt-muted);
    font-size: .83rem;
    line-height: 1.4;
}
.amt-max-chat-url {
    max-width: 680px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7b858e;
    font-size: .75rem;
    white-space: nowrap;
    overflow: hidden;
}
.amt-max-chat-url .dashicons {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    font-size: 14px;
}
.amt-max-chat-url span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
.amt-max-chat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.amt-copy-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.amt-copy-link .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}
.amt-copy-link.is-copied {
    color: var(--amt-success);
    border-color: #88aa94;
    background: #f4f8f5;
}

.amt-max-article {
    margin: 0;
    background: #fff;
    border-top: 1px solid #e8ecef;
}
.amt-max-article:first-child { border-top: 0; }
.amt-max-article > summary {
    min-height: 88px;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}
.amt-max-article > summary::-webkit-details-marker { display: none; }
.amt-max-article > summary:hover { background: #fbfcfd; }
.amt-max-article-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--amt-primary-dark);
    background: #eef3f7;
    border: 1px solid #dce5eb;
    border-radius: 5px;
}
.amt-max-article-icon .dashicons {
    width: 21px;
    height: 21px;
    font-size: 21px;
}
.amt-max-article-summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.amt-max-article-summary strong {
    color: var(--amt-ink);
    font-size: .98rem;
    font-weight: 700;
}
.amt-max-article-summary small {
    color: var(--amt-muted);
    font-size: .82rem;
    line-height: 1.4;
}
.amt-max-article-date {
    color: #8a939b;
    font-size: .74rem;
    white-space: nowrap;
}
.amt-max-article-toggle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #66737e;
    border: 1px solid #d6dde2;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
}
.amt-max-article[open] .amt-max-article-toggle::before { content: "−"; }
.amt-max-article[open] .amt-max-article-toggle { font-size: 0; }
.amt-max-article[open] .amt-max-article-toggle::before { font-size: 1rem; }
.amt-max-article[open] > summary { background: #fafbfc; }
.amt-max-article-body {
    padding: 4px 76px 24px;
    color: #34414b;
    border-top: 1px solid #eef1f3;
}
.amt-max-article-body > :first-child { margin-top: 18px; }
.amt-max-article-body > :last-child { margin-bottom: 0; }
.amt-max-article-body img { max-width: 100%; height: auto; }
.amt-max-article-body table { width: 100%; max-width: 100%; }
.amt-max-empty { border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 991.98px) {
    .amt-max-chat-row {
        grid-template-columns: 34px 40px minmax(0, 1fr);
    }
    .amt-max-chat-actions {
        grid-column: 3;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .amt-max-block-head { padding: 15px 16px; }
    .amt-max-chat-row {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 15px 16px;
    }
    .amt-max-chat-number { display: none; }
    .amt-max-chat-icon { align-self: start; }
    .amt-max-chat-actions {
        grid-column: 2;
        width: 100%;
    }
    .amt-max-chat-actions .btn {
        flex: 1 1 170px;
    }
    .amt-max-article > summary {
        grid-template-columns: 40px minmax(0, 1fr) 24px;
        padding: 15px 16px;
    }
    .amt-max-article-date { display: none; }
    .amt-max-article-body { padding: 2px 16px 20px 70px; }
}

@media (max-width: 575.98px) {
    .amt-max-chat-row { grid-template-columns: 1fr; }
    .amt-max-chat-icon { display: none; }
    .amt-max-chat-actions { grid-column: 1; }
    .amt-max-chat-actions .btn { width: 100%; flex-basis: 100%; }
    .amt-max-article > summary { grid-template-columns: minmax(0, 1fr) 24px; gap: 10px; }
    .amt-max-article-icon { display: none; }
    .amt-max-article-body { padding: 2px 16px 20px; }
}

/* «Моя школа» */
.amt-service-card--school {
    border-left: 3px solid var(--amt-primary);
    background: #fff;
}
.amt-service-card--school .amt-service-icon {
    color: var(--amt-primary-dark);
}
.amt-school-section-head {
    border-left-color: var(--amt-primary);
}
.amt-school-head-icon,
.amt-school-link-icon,
.amt-school-article-icon {
    color: var(--amt-primary-dark);
    background: #eef3f7;
    border-color: #dce5eb;
}


/* Restricted journal: understated and consistent with the staff portal */
.amt-bullying-heading { border-left: 4px solid #64758a; }
.amt-bullying-form-card,
.amt-bullying-help {
    background: #fff;
    border: 1px solid var(--amt-border);
    border-radius: var(--amt-radius);
    box-shadow: var(--amt-shadow-sm);
}
.amt-bullying-form-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--amt-border); }
.amt-bullying-form-head h2 { font-weight: 700; }
.amt-bullying-form-head p { color: var(--amt-muted); font-size: .88rem; }
.amt-bullying-form { padding: 24px 26px 28px; }
.amt-bullying-form .form-label { font-weight: 600; }
.amt-bullying-form .form-control { border-radius: 5px; }
.amt-bullying-form textarea { resize: vertical; }
.amt-bullying-help { padding: 24px; }
.amt-bullying-help h2 { font-weight: 700; margin: 0 0 12px; }
.amt-bullying-help p,
.amt-bullying-help li { color: var(--amt-muted); font-size: .9rem; }
.amt-bullying-help ol { padding-left: 21px; margin: 16px 0; }
.amt-bullying-help li { margin-bottom: 11px; }
.amt-bullying-confidential { display: flex; gap: 10px; align-items: flex-start; color: #586777; font-size: .86rem; }
.amt-bullying-confidential .dashicons { color: #48607a; flex: 0 0 auto; }
.amt-bullying-confirmation { border-radius: 5px; }
@media (max-width: 575.98px) {
    .amt-bullying-form, .amt-bullying-form-head, .amt-bullying-help { padding: 18px; }
    .amt-bullying-form .btn[type="submit"] { width: 100%; }
}
