:root {
    --primary-color: #A84C25;
    --primary-hover: #853A1D;
    --secondary-color: #59623C;
    --secondary-hover: #454D2F;
    --accent-color: #C8923D;
    --bg-color: #F8F3EA;
    --card-bg: #FFFFFF;
    --text-main: #0D3152;
    --text-muted: #687385;
    --border-color: #E5DED2;
    
    --prof-primary: #0E416B;
    --prof-hover: #0A3152;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; }

input,
select,
textarea,
button {
    min-width: 0;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    height: auto;
    padding: 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow-y: auto;
}

.login-container {
    display: flex;
    width: 900px;
    min-height: 560px;
    height: auto;
    max-height: calc(100dvh - 2rem);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-left {
    flex: 1;
    padding: 2.4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--prof-primary) 100%);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
}

.login-right h2 { font-size: 2rem; margin-bottom: 1rem; }

.login-brand-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
}

.login-brand-subtle img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    opacity: 0.82;
}

.login-right-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.4rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font-size: 2rem;
}

.login-points {
    display: grid;
    gap: 0.8rem;
    width: 100%;
    margin-top: 2rem;
}

.login-point {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.login-header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-main); }
.login-header p { color: var(--text-muted); margin-bottom: 2rem; }

.login-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.login-form .form-group { margin-bottom: 1.5rem; }
.login-form label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.login-form input,
.login-form textarea,
.login-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.login-form textarea { resize: vertical; }
.login-form input:focus,
.login-form textarea:focus,
.login-form select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(168, 76, 37, 0.18); }

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 3.1rem;
}

.password-toggle {
    position: absolute;
    right: 0.42rem;
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle[aria-pressed="true"] {
    border-color: rgba(168, 76, 37, 0.18);
    background: rgba(168, 76, 37, 0.08);
    color: var(--primary-color);
}

.password-toggle i {
    font-size: 1.25rem;
    line-height: 1;
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.login-submit-btn {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(168, 76, 37, 0.22);
}

.login-submit-btn i {
    font-size: 1.2rem;
}

.login-submit-btn.professor-login-btn {
    background: var(--prof-primary);
    box-shadow: 0 14px 28px rgba(14, 65, 107, 0.24);
}

.login-submit-btn.professor-login-btn:hover {
    background: var(--prof-hover);
}

.login-submit-btn.admin-login-btn {
    background: var(--text-main);
    box-shadow: 0 14px 28px rgba(13, 49, 82, 0.24);
}

.login-submit-btn.admin-login-btn:hover {
    background: #071f35;
}

/* Layout App */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.24s ease, flex-basis 0.24s ease, transform 0.24s ease;
}

.sidebar-header {
    position: relative;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.logo span { color: var(--primary-color); }

.app-brand-subtle {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.55rem;
}

.app-brand-subtle img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex: 0 0 36px;
    border-radius: 6px;
    opacity: 0.72;
}

.app-brand-subtle div {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.app-brand-subtle strong {
    color: var(--text-main);
    font-size: 1rem;
}

.app-brand-subtle span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.role-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}
.aluno-badge { background: #E0E7FF; color: var(--primary-color); }
.prof-badge { background: #DBEAFE; color: var(--prof-primary); }

.sidebar-collapse-btn,
.sidebar-mobile-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: var(--transition);
}

.sidebar-collapse-btn:hover,
.sidebar-mobile-close:hover {
    border-color: #B8CAD8;
    color: var(--prof-primary);
    box-shadow: var(--shadow-sm);
}

.sidebar-mobile-close {
    display: none;
}

.sidebar-nav { flex: 1; padding: 1.5rem 1rem; overflow-y: auto; }
.sidebar-nav ul li { margin-bottom: 0.5rem; }
.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    min-width: 0;
}
.sidebar-nav ul li a:hover, .sidebar-nav ul li.active a {
    background: var(--bg-color);
    color: var(--primary-color);
}
.sidebar-nav ul li a i { font-size: 1.2rem; }

.sidebar-nav .nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prof-sidebar .sidebar-nav ul li.active a { color: var(--prof-primary); }
.prof-sidebar .logo span { color: var(--prof-primary); }

body.prof-sidebar-collapsed .prof-sidebar {
    width: 78px;
    flex-basis: 78px;
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-header {
    justify-content: center;
    padding: 1rem 0.65rem;
}

body.prof-sidebar-collapsed .prof-sidebar .app-brand-subtle div,
body.prof-sidebar-collapsed .prof-sidebar .role-badge,
body.prof-sidebar-collapsed .prof-sidebar .nav-label,
body.prof-sidebar-collapsed .prof-sidebar .user-info .details {
    display: none;
}

body.prof-sidebar-collapsed .prof-sidebar .app-brand-subtle {
    gap: 0;
}

body.prof-sidebar-collapsed .prof-sidebar .app-brand-subtle img {
    width: 34px;
    height: 34px;
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-collapse-btn {
    position: absolute;
    top: 3.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: var(--prof-primary);
    color: white;
    border-color: var(--prof-primary);
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-nav {
    padding: 2.45rem 0.55rem 1rem;
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-nav ul li a {
    justify-content: center;
    gap: 0;
    padding: 0.82rem 0.5rem;
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-nav ul li a i {
    font-size: 1.28rem;
}

body.prof-sidebar-collapsed .prof-sidebar .sidebar-footer {
    padding: 0.9rem 0.65rem;
}

body.prof-sidebar-collapsed .prof-sidebar .user-info {
    justify-content: center;
    gap: 0;
}

.mobile-quick-nav {
    display: none;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.user-info { display: flex; align-items: center; gap: 1rem; }
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 1.2rem;
}
.prof-avatar { background: var(--prof-primary); }
.user-info .details { display: flex; flex-direction: column; }
.user-info .name { font-weight: 600; font-size: 0.9rem; }
.logout-form { margin: 0; }
.user-info .logout { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; transition: var(--transition); background: transparent; padding: 0; font-weight: 500; }
.user-info .logout:hover { color: #EF4444; }

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
    text-align: center;
}

.error-panel {
    max-width: 500px;
    padding: 2rem;
}

.error-panel i {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 6rem;
}

.error-panel h1 {
    margin-bottom: 0;
    color: var(--text-main);
    font-size: 4rem;
}

.error-panel h2 {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.5rem;
}

.error-panel p {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.error-panel .btn-primary {
    display: inline-block;
    width: auto;
    padding: 0.8rem 2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.topbar {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: relative;
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 4px;
}

.aluno-header::after {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
}

.prof-header::after {
    background: linear-gradient(90deg, var(--prof-primary) 0%, #4299E1 50%, var(--prof-hover) 100%);
}

.search-bar {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    width: 300px;
}
.search-bar input { border: none; background: transparent; width: 100%; outline: none; }
.search-bar i { color: var(--text-muted); }

.icon-btn {
    background: transparent;
    font-size: 1.5rem;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
}
.icon-btn:hover { color: var(--text-main); }
.icon-btn .badge {
    position: absolute; top: -5px; right: -5px;
    background: #EF4444; color: white;
    font-size: 0.6rem; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 999px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-user-chip,
.mobile-menu-button,
.mobile-logout-form,
.mobile-menu-backdrop {
    display: none;
}

.mobile-user-chip {
    align-items: center;
    min-width: 0;
    gap: 0.65rem;
}

.mobile-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 1rem;
}

.mobile-brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
    border-radius: 8px;
}

.admin-mobile-avatar {
    background: var(--text-main);
}

.mobile-user-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.mobile-user-meta strong {
    max-width: 42vw;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-user-meta span {
    max-width: 46vw;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-button,
.mobile-logout-button {
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(13, 49, 82, 0.08);
}

.mobile-menu-button {
    gap: 0.28rem;
    min-width: 70px;
    height: 40px;
    padding: 0 0.65rem;
    font-size: 0.78rem;
}

.mobile-menu-button i,
.mobile-logout-button i {
    font-size: 1.15rem;
}

.mobile-logout-form {
    margin: 0;
}

.mobile-logout-button {
    width: 40px;
    height: 40px;
}

.notification-widget {
    position: relative;
}

.notification-trigger {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.notification-trigger[aria-expanded="true"] {
    background: var(--bg-color);
    color: var(--text-main);
}

.notification-popover {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 900;
    width: min(420px, calc(100vw - 2rem));
    max-height: min(620px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    box-shadow: 0 20px 45px rgba(13, 49, 82, 0.16);
}

.notification-popover[hidden] {
    display: none;
}

.notification-popover::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 14px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.notification-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #F8F3EA;
}

.notification-selection-bar[hidden] {
    display: none;
}

.notification-selection-bar span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.notification-selection-bar div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.notification-popover-header strong,
.notification-popover-header span {
    display: block;
}

.notification-popover-header strong {
    color: var(--text-main);
    font-size: 0.98rem;
}

.notification-popover-header span {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.notification-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.notification-read-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    color: var(--text-main);
    font-size: 0.74rem;
    font-weight: 700;
}

.notification-read-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-hover);
}

.notification-read-btn.subtle {
    background: transparent;
    color: var(--text-muted);
}

.notification-ai-summary {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, #F8FBFF 0%, #FDFBF7 100%);
}

.notification-ai-summary[hidden] {
    display: none;
}

.notification-ai-summary-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
}

.notification-ai-summary-title i {
    color: var(--prof-primary);
    font-size: 1rem;
}

.notification-ai-summary-title strong {
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.notification-ai-summary p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.35;
}

.notification-ai-summary small {
    color: var(--text-muted);
    font-size: 0.77rem;
    line-height: 1.35;
}

.notification-ai-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.notification-ai-summary-chips span {
    padding: 0.18rem 0.45rem;
    border: 1px solid #CFE0EE;
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--prof-primary);
    font-size: 0.7rem;
    font-weight: 900;
}

.notification-list {
    overflow-y: auto;
    padding: 0.45rem;
}

.notification-date-group {
    display: grid;
    gap: 0.35rem;
    padding: 0.35rem 0 0.65rem;
}

.notification-date-label {
    padding: 0.25rem 0.55rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.notification-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    align-items: start;
    padding: 0.75rem 0.65rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.notification-widget[data-notification-selection-mode="true"] .notification-item {
    grid-template-columns: 22px 34px minmax(0, 1fr) auto auto;
}

.notification-select-box {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 34px;
}

.notification-select-box input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.notification-widget[data-notification-selection-mode="true"] .notification-select-box {
    display: flex;
}

.notification-item:hover {
    border-color: var(--border-color);
    background: #FDFBF7;
}

.notification-item.is-unread {
    background: #F3F8FC;
}

.notification-item.is-unread:hover {
    background: #EAF2F8;
}

.notification-item.notification-variant-from-professor {
    border-left: 4px solid var(--prof-primary);
    background: #F0F7FF;
}

.notification-item.notification-variant-professor-work {
    border-left: 4px solid var(--accent-color);
    background: #FFFBEB;
}

.notification-item-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--text-main);
    color: white;
    font-size: 1rem;
}

.notification-item-main {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
    text-decoration: none;
}

.notification-item-main em {
    width: fit-content;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #DBEAFE;
    color: var(--prof-primary);
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 900;
}

.notification-item-main strong {
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.3;
}

.notification-item-main small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.notification-item-read {
    min-height: 28px;
    padding: 0.25rem 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--prof-primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.notification-item-read:hover {
    border-color: var(--prof-primary);
    background: #EAF2F8;
}

.notification-empty {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.notification-empty i {
    font-size: 2rem;
    opacity: 0.7;
}

.notification-empty p {
    margin: 0;
    font-size: 0.86rem;
}

.ai-assistant-widget {
    position: fixed;
    right: 1.35rem;
    bottom: 1.35rem;
    z-index: 950;
}

.ai-assistant-trigger {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--text-main);
    color: white;
    box-shadow: 0 18px 40px rgba(13, 49, 82, 0.24);
    font-size: 1.65rem;
    transition: var(--transition);
}

.ai-assistant-trigger:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
}

.ai-assistant-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.8rem);
    width: min(560px, calc(100vw - 2rem));
    height: min(760px, calc(100vh - 6rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: 0 24px 60px rgba(13, 49, 82, 0.2);
}

.ai-assistant-widget.is-ai-expanded .ai-assistant-panel {
    width: min(720px, calc(100vw - 2rem));
    height: min(820px, calc(100vh - 4rem));
}

.ai-assistant-panel[hidden] {
    display: none;
}

.ai-assistant-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #FDFBF7;
}

.ai-assistant-header strong,
.ai-assistant-header span {
    display: block;
}

.ai-assistant-title {
    min-width: 0;
}

.ai-assistant-header strong {
    color: var(--text-main);
    font-size: 0.98rem;
}

.ai-assistant-header span {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.ai-mobile-hint {
    display: none;
}

.ai-assistant-controls {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ai-assistant-control,
.ai-assistant-close {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: transparent;
    font-size: 1.25rem;
    transition: var(--transition);
}

.ai-assistant-control:hover,
.ai-assistant-close:hover {
    background: #F1F5F9;
    color: var(--text-main);
}

.ai-assistant-control[data-ai-reset] {
    display: none;
}

.ai-assistant-messages {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 0;
    overflow-y: auto;
    padding: 1.05rem;
    background: #F8FAFC;
    scrollbar-gutter: stable;
}

.ai-message {
    max-width: 90%;
    padding: 0.85rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
}

.ai-message.user {
    align-self: flex-end;
    border-color: var(--primary-color);
    background: #EFF6FF;
}

.ai-message p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-line;
}

.ai-message-thinking {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-muted);
}

.ai-thinking-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.ai-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}

.ai-thinking-dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--primary-color);
    opacity: 0.35;
    animation: aiThinkingDot 1s ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.ai-thinking-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

.ai-message.is-typing p::after {
    content: "";
    width: 2px;
    height: 1em;
    display: inline-block;
    margin-left: 2px;
    background: var(--primary-color);
    vertical-align: -0.14em;
    animation: aiTypingCaret 0.8s step-end infinite;
}

@keyframes aiThinkingDot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-4px);
        opacity: 0.95;
    }
}

@keyframes aiTypingCaret {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-thinking-dots span,
    .ai-message.is-typing p::after {
        animation: none;
    }
}

.ai-assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.ai-assistant-actions[hidden] {
    display: none;
}

.ai-suggestion-strip {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.ai-suggestion-strip button {
    min-height: 32px;
    padding: 0.45rem 0.65rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
    color: var(--prof-primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-suggestion-strip button:hover {
    background: #EAF2F8;
    border-color: var(--prof-primary);
}

.ai-material-shell {
    border-top: 1px solid var(--border-color);
    background: #FDFBF7;
}

.ai-material-shell summary {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    list-style: none;
}

.ai-material-shell summary::-webkit-details-marker {
    display: none;
}

.ai-material-shell summary::after {
    content: "+";
    margin-left: auto;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 900;
}

.ai-material-shell[open] summary::after {
    content: "-";
}

.ai-material-form {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: #FDFBF7;
}

.ai-material-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-material-form input[type="file"],
.ai-material-form input[type="text"] {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.55rem;
    background: white;
    font: inherit;
    font-size: 0.82rem;
}

.ai-action-btn {
    min-height: 32px;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-action-btn.primary {
    border-color: var(--text-main);
    background: var(--text-main);
    color: white;
}

.ai-assistant-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 0.55rem;
    padding: 0.85rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.ai-assistant-form textarea {
    min-height: 44px;
    max-height: 96px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    font: inherit;
}

.ai-send-btn {
    width: 42px;
    height: 42px;
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
}

.ai-assistant-widget.is-thinking .ai-send-btn {
    opacity: 0.65;
    pointer-events: none;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Dashboard Home */
.page-header { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: flex-end; }
.page-header h1 { font-size: 1.8rem; color: var(--text-main); }
.page-header p { color: var(--text-muted); }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-weight: 600; font-size: 1.1rem; }
.card-action { font-size: 0.85rem; color: var(--primary-color); font-weight: 500; }

/* Widgets Aluno */
.stats-cards { grid-column: span 12; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem;}
.stat-card {
    background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
}
.stat-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.stat-info h3 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.stat-info p { font-size: 0.85rem; color: var(--text-muted); }

.bg-indigo-light { background: #E0E7FF; color: var(--primary-color); }
.bg-green-light { background: #D1FAE5; color: var(--secondary-color); }
.bg-purple-light { background: #EDE9FE; color: var(--accent-color); }
.bg-orange-light { background: #FEF3C7; color: #D97706; }

.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }
.col-span-12 { grid-column: span 12; }

.performance-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.performance-chart-toolbar h3 {
    margin-bottom: 0.18rem;
    color: var(--text-main);
    font-size: 1rem;
}

.performance-chart-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.performance-chart-nav button {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.performance-chart-nav button.active,
.performance-chart-nav button:hover {
    border-color: var(--prof-primary);
    background: var(--prof-primary);
    color: white;
}

.performance-period-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: -0.35rem 0 1rem;
}

.performance-period-quick button {
    min-height: 34px;
    padding: 0.42rem 0.68rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.performance-period-quick button.active,
.performance-period-quick button:hover {
    border-color: var(--prof-primary);
    background: var(--prof-primary);
    color: white;
}

.performance-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.performance-insight {
    min-height: 74px;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #F8FBFF;
}

.performance-insight strong,
.performance-insight span {
    display: block;
}

.performance-insight strong {
    color: var(--text-main);
    font-size: 1.2rem;
    line-height: 1.15;
}

.performance-insight span {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.performance-insight.is-down strong { color: #B91C1C; }
.performance-insight.is-up strong { color: #047857; }

.chart-explain {
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.chart-frame {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 300px;
    margin-top: 0.35rem;
    overflow: hidden;
}

.chart-frame canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart-frame-bars {
    height: 310px;
}

.chart-frame-students {
    height: 340px;
}

.chart-frame-line {
    height: 320px;
}

.chart-frame-subjects {
    height: 330px;
}

.chart-frame-doughnut {
    height: 300px;
}

.chart-load-message {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.chart-reading-guide {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.chart-reading-guide > span {
    min-height: 68px;
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

.chart-guide-copy {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: normal;
}

.chart-reading-guide i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #EAF3F8;
    color: var(--prof-primary);
    font-size: 1rem;
}

.chart-reading-guide strong {
    display: block;
    color: var(--text-main);
    font-size: 0.8rem;
}

.admin-overview-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-overview-strip > div {
    display: grid;
    gap: 0.15rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.admin-overview-strip strong {
    color: var(--text-main);
    font-size: 1.35rem;
}

.admin-overview-strip span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.role-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.today-command-center {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
}

.today-command-copy h2 {
    margin: 0.18rem 0 0.35rem;
    color: var(--text-main);
    font-size: 1.2rem;
    line-height: 1.2;
}

.today-command-copy p {
    max-width: 520px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.today-command-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.today-command-actions a {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 0.18rem;
    padding: 0.8rem;
    border: 1px solid rgba(184, 202, 216, 0.9);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.today-command-actions a:hover {
    transform: translateY(-2px);
    border-color: var(--prof-primary);
    box-shadow: var(--shadow-md);
}

.today-command-actions i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.18rem;
    border-radius: var(--radius-sm);
    background: #EAF3F8;
    color: var(--prof-primary);
    font-size: 1.1rem;
}

.today-command-actions strong {
    font-size: 0.9rem;
    line-height: 1.15;
}

.today-command-actions span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.role-action-card {
    min-height: 116px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.role-action-card:hover {
    transform: translateY(-2px);
    border-color: #B8CAD8;
    box-shadow: var(--shadow-md);
}

.role-action-card i {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #F1F5E8;
    color: var(--primary-color);
    font-size: 1.35rem;
}

.role-action-card.professor i {
    background: #DBEAFE;
    color: var(--prof-primary);
}

.role-action-card.admin i {
    background: #E2E8F0;
    color: var(--text-main);
}

.role-action-card.warning i {
    background: #FEF3C7;
    color: #B45309;
}

.role-action-card strong {
    display: block;
    margin-bottom: 0.22rem;
    color: var(--text-main);
    font-size: 0.98rem;
}

.role-action-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.teacher-table-wrap {
    width: 100%;
    overflow-x: hidden;
}

.teacher-home-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.clarity-note {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #D6E4EF;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
    color: var(--text-main);
}

.clarity-note i {
    color: var(--prof-primary);
    font-size: 1.35rem;
}

.clarity-note strong {
    display: block;
    font-size: 0.92rem;
}

.clarity-note span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.teacher-ai-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.95rem 1rem;
    border: 1px solid #D6E4EF;
    border-left: 4px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    background: #F7FBFF;
}

.teacher-ai-nudge strong,
.teacher-ai-nudge span {
    display: block;
}

.teacher-ai-nudge strong {
    color: var(--text-main);
    font-size: 0.95rem;
}

.teacher-ai-nudge span {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.teacher-ai-nudge-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.teacher-ai-nudge-actions button {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--prof-primary);
    font-size: 0.8rem;
    font-weight: 800;
}

.teacher-ai-nudge-actions button:hover {
    border-color: var(--prof-primary);
    background: #EAF2F8;
}

.teacher-briefing-panel {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #B8CAD8;
    border-left: 4px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    background: #F7FBFF;
    box-shadow: var(--shadow-sm);
}

.teacher-briefing-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.teacher-briefing-head h2 {
    margin: 0.15rem 0 0;
    color: var(--text-main);
    font-size: 1.15rem;
}

.teacher-briefing-head > i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-size: 1.35rem;
}

.teacher-briefing-summary {
    margin: 0 0 1rem;
    color: var(--text-main);
    white-space: pre-line;
    line-height: 1.55;
}

.teacher-briefing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
}

.teacher-briefing-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 0.75rem;
    min-height: 138px;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.teacher-briefing-item.alta {
    border-color: #F59E0B;
}

.teacher-briefing-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #DBEAFE;
    color: var(--prof-primary);
    font-size: 1.2rem;
}

.teacher-briefing-item.alta .teacher-briefing-icon {
    background: #FEF3C7;
    color: #B45309;
}

.teacher-briefing-item strong,
.teacher-briefing-item p {
    display: block;
}

.teacher-briefing-item strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.teacher-briefing-item p {
    margin: 0.25rem 0 0.7rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.teacher-briefing-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
}

.teacher-briefing-action.is-secondary {
    background: white;
    color: var(--prof-primary);
}

button.teacher-briefing-action {
    cursor: pointer;
}

.copilot-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
    padding: 1.2rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
}

.copilot-hero h2 {
    margin: 0.25rem 0 0.45rem;
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1.2;
}

.copilot-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.copilot-hero-stats,
.copilot-production-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.copilot-hero-stats span,
.copilot-production-grid span {
    min-height: 62px;
    padding: 0.7rem;
    border: 1px solid rgba(26, 95, 122, 0.16);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.copilot-hero-stats strong {
    display: block;
    color: var(--prof-primary);
    font-size: 1.35rem;
    line-height: 1.1;
}

.copilot-production-grid span {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.copilot-action-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.copilot-action-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.75rem;
    min-height: 150px;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.copilot-action-card.alta {
    border-color: #F59E0B;
    background: #FFFBEB;
}

.copilot-action-card.media {
    border-color: #60A5FA;
}

.copilot-action-number {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
}

.copilot-action-card.alta .copilot-action-number {
    background: #B45309;
}

.copilot-action-card strong,
.copilot-week strong,
.copilot-content-head strong {
    color: var(--text-main);
}

.copilot-action-card p,
.copilot-week p,
.copilot-content-map p {
    margin: 0.25rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.copilot-week,
.copilot-content-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.copilot-week article,
.copilot-content-map article {
    min-height: 148px;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
}

.copilot-week article > span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    margin-bottom: 0.45rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: #EEF2FF;
    color: var(--prof-primary);
    font-size: 0.72rem;
    font-weight: 900;
}

.copilot-week button {
    min-height: 32px;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--prof-primary);
    font-size: 0.76rem;
    font-weight: 800;
}

.copilot-meeting-list {
    display: grid;
    gap: 0.55rem;
}

.copilot-meeting-list li {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
    color: var(--text-main);
    font-size: 0.84rem;
}

.copilot-content-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.copilot-content-head a {
    color: var(--prof-primary);
    font-size: 0.74rem;
    font-weight: 900;
}

.copilot-content-map article > span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.copilot-timeline {
    display: grid;
    gap: 0.65rem;
}

.copilot-timeline div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    min-height: 46px;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.copilot-timeline i,
.copilot-production-grid i {
    color: #047857;
    font-size: 1.05rem;
}

.copilot-timeline span,
.copilot-production-grid span {
    overflow-wrap: anywhere;
}

.student-ai-summary {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #B8CAD8;
    border-left: 4px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    background: #F7FBFF;
}

.student-ai-summary.is-alert {
    border-color: #F59E0B;
    border-left-color: #B45309;
    background: #FFFBEB;
}

.student-ai-summary-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-size: 1.35rem;
}

.student-ai-summary.is-alert .student-ai-summary-icon {
    background: #B45309;
}

.student-ai-summary p {
    margin: 0.25rem 0 0.75rem;
    color: var(--text-main);
    line-height: 1.55;
}

.student-ai-summary-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.7rem 0;
}

.student-ai-summary-metrics span {
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid rgba(26, 95, 122, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.student-ai-summary-metrics small {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-ai-summary-metrics strong {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-main);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.student-ai-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 760px) {
    .student-ai-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* List items */
.list-group { display: flex; flex-direction: column; gap: 1rem; }
.list-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    transition: var(--transition);
}
.list-item:hover { border-color: var(--primary-color); box-shadow: var(--shadow-sm); }
.item-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-color); display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 1.2rem; }
.item-content { flex: 1; }
.item-title { font-weight: 600; font-size: 0.95rem; }
.item-desc { font-size: 0.8rem; color: var(--text-muted); }
.item-action .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: var(--radius-sm); background: var(--primary-color); color: white; }

/* Progresso circular / barra */
.progress-wrap { margin-bottom: 1rem; }
.progress-bar { width: 100%; height: 8px; background: var(--bg-color); border-radius: 4px; overflow: hidden; margin-top: 0.5rem; }
.progress-fill { height: 100%; background: var(--secondary-color); border-radius: 4px; }

/* Badges e Status */
.status-badge { padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.status-pendente { background: #FEF3C7; color: #D97706; }
.status-corrigido { background: #D1FAE5; color: #059669; }

/* Mensagens flash */
.flash-messages { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.flash-msg { padding: 1rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; box-shadow: var(--shadow-md); font-weight: 500; }
.alert-danger { background: #FEE2E2; color: #B91C1C; border-left: 4px solid #B91C1C; }
.alert-success { background: #D1FAE5; color: #059669; border-left: 4px solid #059669; }
.alert-warning { background: #FEF3C7; color: #D97706; border-left: 4px solid #D97706; }

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 1rem 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-table td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-action-form {
    margin: 0;
}

.btn-reset-password {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(168, 76, 37, 0.25);
    border-radius: var(--radius-sm);
    background: #FFF7ED;
    color: var(--primary-hover);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn-reset-password:hover {
    background: #FFEDD5;
}

.btn-reset-password.is-secondary {
    border-color: rgba(14, 65, 107, 0.22);
    background: white;
    color: var(--prof-primary);
}

.btn-reset-password.is-secondary:hover {
    background: #EAF3F8;
}

button.is-loading,
.btn-primary.is-loading,
.btn-reset-password.is-loading,
.teacher-briefing-action.is-loading,
.ai-action-btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

button.is-loading::after,
.btn-primary.is-loading::after,
.btn-reset-password.is-loading::after,
.teacher-briefing-action.is-loading::after,
.ai-action-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-radius: 999px;
    color: white;
    animation: uiSpin 0.7s linear infinite;
}

.btn-reset-password.is-loading::after,
.btn-reset-password.is-secondary.is-loading::after,
button.btn-link-compact.is-loading::after {
    color: var(--prof-primary);
}

@keyframes uiSpin {
    to {
        transform: rotate(360deg);
    }
}

.admin-row-actions {
    display: grid;
    gap: 0.55rem;
    min-width: 250px;
}

.admin-list-header {
    align-items: flex-start;
    gap: 1rem;
}

.admin-guidance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #D6E4EF;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
}

.admin-guidance-card strong {
    display: block;
    color: var(--text-main);
    font-size: 0.92rem;
}

.admin-guidance-card p {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.admin-guidance-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.admin-guidance-steps span {
    padding: 0.28rem 0.55rem;
    border: 1px solid #CFE0EE;
    border-radius: 999px;
    background: white;
    color: var(--prof-primary);
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.admin-filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(auto-fit, minmax(150px, auto));
    gap: 0.65rem;
    align-items: center;
    margin: 0 0 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.admin-list-search {
    min-width: min(320px, 100%);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.admin-filter-panel .admin-list-search {
    background: white;
}

.admin-list-search.wide {
    min-width: 0;
}

.compact-filter {
    min-height: 40px;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.82rem !important;
}

.admin-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-filter-presets button {
    min-height: 32px;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: white;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.admin-filter-presets button.active,
.admin-filter-presets button:hover {
    border-color: var(--prof-primary);
    color: var(--prof-primary);
    background: #EAF2F8;
}

.admin-list-search i {
    color: var(--text-muted);
}

.admin-list-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0.86rem;
}

.admin-entity-list {
    display: grid;
    gap: 0.75rem;
}

.admin-entity-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.admin-entity-row:hover {
    border-color: rgba(168, 76, 37, 0.35);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus-visible {
    outline: 3px solid rgba(14, 65, 107, 0.24);
    border-color: var(--prof-primary);
}

.row-arrow-link {
    color: var(--prof-primary);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.compact-person-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-entity-row[hidden] {
    display: none;
}

.admin-entity-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--text-main);
    color: white;
    font-size: 1.25rem;
}

.admin-entity-main {
    min-width: 0;
    display: grid;
    gap: 0.45rem;
}

.admin-entity-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    justify-content: space-between;
}

.admin-entity-title h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.admin-entity-title span,
.admin-entity-main p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.admin-entity-main p {
    margin: 0;
}

.admin-entity-metrics {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 150px;
}

.admin-entity-metrics span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #FDFBF7;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-entity-metrics strong {
    color: var(--text-main);
}

.admin-modal-open {
    overflow: hidden;
}

.admin-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.admin-detail-modal[hidden] {
    display: none;
}

.admin-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.54);
    backdrop-filter: blur(3px);
}

.admin-detail-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(860px, calc(100dvh - 2rem));
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.admin-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.admin-detail-header span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-detail-header h2 {
    margin: 0.1rem 0;
    color: var(--text-main);
    font-size: 1.35rem;
}

.admin-detail-header p {
    margin: 0;
    color: var(--text-muted);
}

.admin-detail-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    color: var(--text-main);
    font-size: 1.25rem;
}

.admin-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-detail-stats > div {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.admin-detail-stats strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    font-size: 1rem;
}

.admin-detail-stats span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-detail-section {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    margin-bottom: 1rem;
}

.admin-detail-section h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.admin-mini-list {
    display: grid;
    gap: 0.55rem;
}

.admin-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.admin-mini-row strong,
.admin-mini-row span {
    display: block;
}

.admin-mini-row span {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.admin-modal-inline-form {
    align-items: stretch;
}

.admin-context-details {
    margin: 0 0 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.admin-context-details summary {
    cursor: pointer;
    padding: 0.75rem 0.9rem;
    color: var(--text-main);
    font-weight: 900;
}

.admin-grouped-map {
    display: grid;
    gap: 0.75rem;
    padding: 0 0.9rem 0.9rem;
}

.admin-grouped-map section {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.admin-grouped-map section > strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.admin-password-box {
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.inline-select-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.inline-select-form .form-select {
    min-width: 160px;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
}

.period-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tag-remove-form {
    display: inline-flex;
    margin: 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 30px;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-sm);
    background: #EAF2F8;
    color: var(--prof-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.tag-pill.removable-tag,
.tag-pill.teacher-tag {
    border: 0;
    cursor: pointer;
}

.tag-pill.teacher-tag {
    background: #EAF2F8;
    color: var(--prof-primary);
}

.tag-pill.neutral {
    background: #F4F1EA;
    color: var(--text-main);
}

.muted-small {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.letter-choice-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.letter-choice-group label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    font-weight: 700;
}

.color-input {
    height: 44px;
    padding: 0.25rem !important;
}

.class-list {
    display: grid;
    gap: 1rem;
}

.class-admin-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) minmax(260px, 0.55fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.class-admin-row[hidden] {
    display: none;
}

.teacher-class-row {
    grid-template-columns: 12px minmax(0, 1fr) 148px;
}

.class-color-dot {
    width: 12px;
    min-height: 100%;
    border-radius: 999px;
}

.class-admin-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.class-admin-title h4 {
    margin: 0;
    color: var(--text-main);
}

.class-admin-title span {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.class-students {
    margin-top: 0.75rem;
}

.teacher-class-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.class-student-details {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.65rem;
}

.class-student-details summary {
    cursor: pointer;
    color: var(--prof-primary);
    font-size: 0.82rem;
    font-weight: 900;
}

.class-teachers {
    margin-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
}

.class-admin-actions {
    display: grid;
    gap: 0.6rem;
    align-content: start;
}

.empty-table-message {
    color: var(--text-muted);
    text-align: center;
}

.form-select,
.activity-form input,
.activity-form textarea,
.activity-form select,
.teacher-edit-form input,
.teacher-edit-form textarea,
.teacher-edit-form select,
.student-submit-form input,
.student-submit-form textarea,
.correction-form input,
.correction-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    transition: var(--transition);
}

.activity-form textarea,
.student-submit-form textarea,
.correction-form textarea {
    resize: vertical;
}

.activity-form input:focus,
.activity-form textarea:focus,
.activity-form select:focus,
.teacher-edit-form input:focus,
.teacher-edit-form textarea:focus,
.teacher-edit-form select:focus,
.student-submit-form input:focus,
.student-submit-form textarea:focus,
.correction-form input:focus,
.correction-form textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--prof-primary);
    box-shadow: 0 0 0 3px rgba(14, 65, 107, 0.12);
}

.activity-builder-grid {
    align-items: start;
}

.activity-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1rem;
}

.activity-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--prof-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.auto-template-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #C8D6E1;
    border-radius: var(--radius-sm);
    background: #F3F8FC;
}

.auto-template-panel strong,
.auto-template-panel span {
    display: block;
}

.auto-template-panel span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.curriculum-lock {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid #C8D6E1;
    border-radius: var(--radius-sm);
    background: #F3F8FC;
    color: var(--prof-primary);
}

.curriculum-lock i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border-radius: 6px;
    background: white;
    color: var(--prof-primary);
    font-size: 1.1rem;
}

.curriculum-lock strong,
.curriculum-lock span {
    display: block;
}

.curriculum-lock span {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.activity-form {
    display: grid;
    gap: 1rem;
}

.activity-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.activity-form .form-group,
.student-submit-form .form-group,
.correction-form .form-group {
    margin-bottom: 0;
}

.activity-form label,
.student-submit-form label,
.correction-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 700;
}

.recipient-box {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.recipient-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.recipient-header span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.recipient-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.recipient-options label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.student-recipient-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    max-height: 260px;
    overflow-y: auto;
}

.student-recipient {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.student-recipient strong,
.student-recipient small {
    display: block;
}

.student-recipient small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.activity-type-list {
    display: grid;
    gap: 0.9rem;
    max-height: 760px;
    overflow-y: auto;
}

.activity-type-category {
    display: grid;
    gap: 0.55rem;
}

.activity-type-category h4 {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.activity-type-category-list {
    display: grid;
    gap: 0.55rem;
}

.activity-type-item {
    display: flex;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.activity-type-item i {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border-radius: 6px;
    background: var(--prof-primary);
    color: white;
}

.activity-type-item strong,
.activity-type-item span {
    display: block;
}

.activity-type-item strong {
    font-size: 0.9rem;
}

.activity-type-item span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.activity-list,
.student-activity-list,
.submission-list {
    display: grid;
    gap: 1rem;
}

.activity-row,
.student-activity-card,
.submission-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.activity-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.activity-row-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #EDF2F7;
    color: var(--prof-primary);
    font-size: 1.25rem;
}

.activity-row-top,
.student-activity-header,
.submission-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.activity-row-top h4,
.student-activity-header h3,
.submission-header h4 {
    margin: 0;
}

.activity-row-main p,
.student-activity-header p,
.submission-header p,
.student-activity-body p,
.submission-answer p,
.delivered-box p,
.activity-criteria p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.activity-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-row-actions {
    display: flex;
    justify-content: flex-end;
}

.student-activity-header {
    align-items: center;
    margin-bottom: 0.8rem;
}

.student-activity-body,
.delivered-box,
.submission-answer,
.activity-criteria {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: #F8F3EA;
}

.activity-timer-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #F0D8A8;
    border-radius: var(--radius-sm);
    background: #FFF8E8;
}

.activity-timer-box p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.activity-timer-box.is-expired {
    border-color: #F4B4B4;
    background: #FFF0F0;
}

.student-submit-form,
.correction-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.correction-form {
    grid-template-columns: 160px minmax(0, 1fr) auto;
    align-items: end;
}

.activity-detail-block {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-detail-block span {
    color: var(--text-muted);
}

.activity-material-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    color: var(--prof-primary);
    font-weight: 700;
}

.auto-question-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.auto-question {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.auto-question strong {
    display: block;
    margin-bottom: 0.75rem;
}

.auto-options {
    display: grid;
    gap: 0.55rem;
}

.auto-options label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
    font-weight: 600;
}

.auto-step-form {
    display: grid;
    gap: 0.9rem;
}

.auto-step-progress {
    width: fit-content;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #EAF2F8;
    color: var(--prof-primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.auto-question[hidden] {
    display: none;
}

.auto-options label.is-correct {
    border-color: var(--secondary-color);
    background: #D1FAE5;
    color: #047857;
}

.auto-options label.is-wrong {
    border-color: #EF4444;
    background: #FEE2E2;
    color: #B91C1C;
}

.auto-question-feedback {
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 800;
}

.auto-question-feedback.correct {
    background: #D1FAE5;
    color: #047857;
}

.auto-question-feedback.wrong {
    background: #FEE2E2;
    color: #B91C1C;
}

.auto-step-actions {
    display: flex;
    justify-content: flex-start;
}

.written-question-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 0.6rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.written-question-list > strong {
    color: var(--text-main);
}

.written-question textarea {
    width: 100%;
}

.chat-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    min-height: calc(100vh - 190px);
}

.chat-rooms,
.chat-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.chat-rooms {
    padding: 1rem;
}

.chat-rooms h3 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.chat-room {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.55rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-weight: 700;
}

.chat-room.active {
    background: #EDF2F7;
}

.chat-room span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto minmax(280px, 1fr) auto;
    overflow: hidden;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    margin: 0;
}

.chat-header p {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    overflow-y: auto;
    background: #F8F3EA;
}

.chat-message {
    max-width: 76%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.chat-message.own {
    align-self: flex-end;
    border-color: #B8CAD8;
    background: #EAF2F8;
}

.chat-message.teacher-message {
    border-left: 4px solid var(--prof-primary);
}

.chat-message.teacher-message.own {
    background: #EAF2F8;
}

.chat-message.student-message {
    border-left: 4px solid var(--primary-color);
}

.chat-message-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
}

.chat-message-top strong {
    color: var(--text-main);
}

.chat-role-badge {
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.chat-role-badge.teacher {
    background: #DBEAFE;
    color: var(--prof-primary);
}

.chat-role-badge.student {
    background: #F8F3EA;
    color: var(--primary-hover);
}

.chat-message-top span {
    color: var(--text-muted);
}

.chat-message-top .chat-role-badge.teacher {
    color: var(--prof-primary);
}

.chat-message-top .chat-role-badge.student {
    color: var(--primary-hover);
}

.chat-message p {
    color: var(--text-main);
    white-space: pre-wrap;
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.chat-form textarea {
    width: 100%;
    resize: vertical;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.progress-bar.compact {
    height: 8px;
    min-width: 120px;
}

.classroom-study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.classroom-study-card,
.resource-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.classroom-study-top {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: stretch;
}

.classroom-study-top .class-color-dot {
    width: 10px;
    min-height: 54px;
}

.classroom-study-top h3,
.resource-card h3 {
    margin: 0;
    color: var(--text-main);
}

.classroom-study-top p,
.resource-card p {
    margin: 0.1rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.classroom-progress {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.classroom-progress div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.classroom-progress strong {
    font-size: 1.25rem;
}

.classroom-progress span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.classroom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.classroom-activity-list {
    display: grid;
    gap: 0.55rem;
}

.classroom-activity-list > strong {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.classroom-activity-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.classroom-activity-item b,
.classroom-activity-item small {
    display: block;
}

.classroom-activity-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.resource-section {
    margin-bottom: 2rem;
}

.resource-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.resource-section h2 span {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.resource-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-left: 4px solid var(--prof-primary);
}

.resource-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.resource-card-header > i {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-size: 1.25rem;
}

.resource-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
}

.teacher-admin-list {
    display: grid;
    gap: 1rem;
}

.teacher-admin-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.teacher-admin-main {
    display: grid;
    gap: 1rem;
}

.teacher-admin-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.teacher-admin-heading h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.05rem;
}

.teacher-admin-heading p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.teacher-edit-form {
    display: grid;
    gap: 0.9rem;
}

.teacher-card-actions,
.teacher-side-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.teacher-assignment-panel {
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.teacher-assignment-panel strong {
    color: var(--text-main);
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.assignment-header span {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.teacher-assign-form {
    align-items: stretch;
}

.teacher-bulk-form {
    display: grid;
    gap: 0.8rem;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.form-label-row label {
    margin: 0;
}

.btn-link-compact {
    border: 0;
    background: transparent;
    color: var(--primary-hover);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.admin-check-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 180px;
}

.admin-check-grid label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 36px;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-check-grid input {
    flex: 0 0 auto;
}

.admin-check-grid span {
    min-width: 0;
}

.admin-sticky-card {
    position: sticky;
    top: 1rem;
}

.admin-map-card {
    margin-top: 1rem;
}

.admin-map-list {
    display: grid;
    gap: 0.75rem;
}

.admin-map-row {
    display: grid;
    gap: 0.5rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.admin-map-row strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.subject-choice-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.subject-choice-group.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.subject-choice-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    margin: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 700;
}

.conteudo-filtros {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.filtro-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.filtro-tab.ativo {
    border-color: var(--prof-primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--prof-primary);
}

.conteudo-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.conteudo-guide span {
    min-height: 72px;
    padding: 0.8rem;
    border: 1px solid #B8CAD8;
    border-radius: var(--radius-sm);
    background: #F7FBFF;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.conteudo-guide strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-size: 0.86rem;
}

.conteudo-titulo-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem;
}

.conteudo-titulo-linha h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.15rem;
}

.conteudo-titulo-linha span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.conteudo-grupo {
    margin-bottom: 1.15rem;
}

.conteudo-unidade {
    margin: 0 0 0.55rem;
    color: var(--text-main);
    font-size: 0.92rem;
}

.conteudo-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.65rem;
}

.conteudo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 54px;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.conteudo-card.inativo {
    background: #F8FAFC;
    opacity: 0.62;
}

.conteudo-nome {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.badge-custom {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.68rem;
    font-weight: 800;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background: #CBD5E1;
    transition: 0.18s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: 0.18s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--prof-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

.conteudo-edit-input {
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--prof-primary);
    border-radius: var(--radius-sm);
    font: inherit;
}

.conteudo-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.32);
}

.modal-box {
    width: min(420px, 100%);
    padding: 1rem;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-lg);
}

.modal-box h3 {
    margin: 0 0 0.8rem;
    color: var(--text-main);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.modal-actions button {
    min-height: 38px;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
}

.modal-actions .btn-primary {
    border-color: var(--prof-primary);
    background: var(--prof-primary);
    color: white;
}

.form-input {
    width: 100%;
    min-height: 42px;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font: inherit;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 0.7rem;
    min-height: 220px;
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-secondary);
    text-align: center;
}

.compact-empty-state {
    min-height: 0;
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.empty-state i {
    color: var(--prof-primary);
    font-size: 2rem;
}

.empty-state h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.2;
}

.empty-state p {
    max-width: 560px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.empty-state button {
    min-height: 38px;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 980px) {
    .admin-guidance-card,
    .admin-list-header,
    .admin-detail-header,
    .admin-entity-title,
    .admin-mini-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-guidance-steps {
        justify-content: flex-start;
    }

    .admin-filter-panel {
        grid-template-columns: 1fr;
    }

    .admin-list-search {
        width: 100%;
    }

    .admin-entity-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .admin-entity-avatar {
        width: 100%;
        height: 38px;
    }

    .admin-entity-metrics {
        justify-content: flex-start;
        min-width: 0;
    }

    .admin-detail-panel {
        width: 100%;
        max-height: calc(100dvh - 1rem);
        padding: 1rem;
    }

    .admin-detail-grid,
    .admin-detail-stats {
        grid-template-columns: 1fr;
    }

    .class-admin-row {
        grid-template-columns: 1fr;
    }

    .teacher-class-row {
        grid-template-columns: 1fr;
    }

    .class-color-dot {
        width: 100%;
        height: 8px;
        min-height: 8px;
    }

    .inline-select-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-select-form .form-select {
        width: 100%;
    }

    .activity-form-grid,
    .student-recipient-list,
    .correction-form,
    .auto-template-panel,
    .chat-layout,
    .chat-form,
    .teacher-admin-card,
    .admin-check-grid,
    .admin-check-grid.compact,
    .subject-choice-group,
    .subject-choice-group.compact {
        grid-template-columns: 1fr;
    }

    .admin-overview-strip {
        grid-template-columns: 1fr;
    }

    .teacher-admin-heading {
        flex-direction: column;
    }

    .activity-row {
        grid-template-columns: 1fr;
    }

    .activity-row-actions {
        justify-content: flex-start;
    }
}

/* Professor specifics */
.prof-stats .stat-icon { background: #DBEAFE; color: var(--prof-primary); }

.em-breve-container {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}
.em-breve-container i { font-size: 4rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.5; }
.em-breve-container h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.em-breve-container p { color: var(--text-muted); }

/* ============================================================
   ARCADE EDUKA - GAME STYLES
   ============================================================ */

/* Game Cards Catalog */
.game-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --game-tone: var(--primary-color);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: block;
    text-decoration: none;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    z-index: -1;
    height: 6px;
    background: var(--game-tone);
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.game-card-type-quiz {
    --game-tone: #A84C25;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF7ED 100%);
}
.game-card-type-matching {
    --game-tone: #0E416B;
    background: linear-gradient(180deg, #FFFFFF 0%, #EFF6FF 100%);
}
.game-card-type-sequence {
    --game-tone: #59623C;
    background: linear-gradient(180deg, #FFFFFF 0%, #F1F5E8 100%);
}
.game-card-type-input {
    --game-tone: #C8923D;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFBEB 100%);
}
.game-card-type-premium_runner,
.game-card-type-premium_defense,
.game-card-type-premium_explorer,
.game-card-type-premium_lab,
.game-card-type-premium_sim,
.game-card-type-premium_dialogue,
.game-card-type-premium_memory,
.game-card-type-premium_builder,
.game-card-type-premium_case {
    --game-tone: #2563EB;
    background:
        radial-gradient(circle at 16% 12%, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}
.game-card-type-premium_defense { --game-tone: #047857; }
.game-card-type-premium_explorer { --game-tone: #0F766E; }
.game-card-type-premium_lab { --game-tone: #7C3AED; }
.game-card-type-premium_sim { --game-tone: #B45309; }
.game-card-type-premium_dialogue { --game-tone: #3B5BA5; }
.game-card-type-premium_memory { --game-tone: #4338CA; }
.game-card-type-premium_builder { --game-tone: #A84C25; }
.game-card-type-premium_case { --game-tone: #334155; }
.game-card-locked {
    opacity: 0.72;
    cursor: not-allowed;
}
.game-card-locked:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}
.game-card-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.game-type-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #FFF7ED;
    color: var(--primary-color);
    font-size: 1.55rem;
    flex-shrink: 0;
}
.game-card-type-matching .game-type-icon { background: #EFF6FF; color: #0E416B; }
.game-card-type-sequence .game-type-icon { background: #F1F5E8; color: #59623C; }
.game-card-type-input .game-type-icon { background: #FFFBEB; color: #A16207; }
.game-card[data-game-type^="premium_"] .game-type-icon {
    background: color-mix(in srgb, var(--game-tone) 12%, white);
    color: var(--game-tone);
}
.game-card-title { font-weight: 600; font-size: 1rem; color: var(--text-main); }
.game-card-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.game-card-footer { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.game-badge {
    font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 10px;
    font-weight: 600; background: #E0E7FF; color: var(--primary-color);
}
.teacher-game-badge {
    background: #DBEAFE;
    color: var(--prof-primary);
}
.premium-game-badge {
    background: #111827;
    color: #FFFFFF;
}
.cooldown-badge {
    background: #FEF3C7;
    color: #A16207;
}
.game-subject-nav a span {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.72rem;
}

/* Player Top Bar */
.game-topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.game-back-btn {
    display: flex; align-items: center; gap: 0.3rem;
    color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
}
.game-back-btn:hover { color: var(--primary-color); }
.game-info-bar { display: flex; gap: 0.5rem; align-items: center; }
.game-timer {
    display: flex; align-items: center; gap: 0.3rem;
    background: var(--card-bg); padding: 0.4rem 1rem;
    border-radius: var(--radius-sm); font-weight: 600;
    box-shadow: var(--shadow-sm); font-size: 0.9rem;
}

/* Game Arena */
.game-arena {
    --arena-tone: var(--primary-color);
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FFFFFF 0%, #FDFBF7 100%);
}

.game-arena-quiz { --arena-tone: #A84C25; background: linear-gradient(135deg, #FFF7ED 0%, #FFFFFF 68%); }
.game-arena-matching { --arena-tone: #0E416B; background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 68%); }
.game-arena-sequence { --arena-tone: #59623C; background: linear-gradient(135deg, #F1F5E8 0%, #FFFFFF 68%); }
.game-arena-input { --arena-tone: #C8923D; background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 68%); }
.game-arena-premium_runner,
.game-arena-premium_defense,
.game-arena-premium_explorer,
.game-arena-premium_lab,
.game-arena-premium_sim,
.game-arena-premium_dialogue,
.game-arena-premium_memory,
.game-arena-premium_builder,
.game-arena-premium_case {
    --arena-tone: #2563EB;
    background:
        radial-gradient(circle at 18% 16%, rgba(37, 99, 235, 0.16), transparent 30%),
        radial-gradient(circle at 82% 10%, rgba(15, 118, 110, 0.12), transparent 26%),
        linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 68%);
}
.game-arena-premium_defense { --arena-tone: #047857; }
.game-arena-premium_explorer { --arena-tone: #0F766E; }
.game-arena-premium_lab { --arena-tone: #7C3AED; }
.game-arena-premium_sim { --arena-tone: #B45309; }
.game-arena-premium_dialogue { --arena-tone: #3B5BA5; }
.game-arena-premium_memory { --arena-tone: #4338CA; }
.game-arena-premium_builder { --arena-tone: #A84C25; }
.game-arena-premium_case { --arena-tone: #334155; }

.game-start-screen {
    border-top: 6px solid var(--arena-tone);
    text-align: center;
    background: var(--card-bg);
    padding: 3rem 4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.game-start-icon { font-size: 4rem; margin-bottom: 1rem; }

.game-start-brief {
    display: grid;
    gap: 0.65rem;
    margin: 0 auto 1.2rem;
    max-width: 620px;
    text-align: left;
}

.game-start-brief div {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--arena-tone);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.game-start-brief strong,
.game-start-brief span {
    display: block;
}

.game-start-brief strong {
    color: var(--text-main);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.game-start-brief span {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

/* Question Card */
.game-question-card {
    border-top: 6px solid var(--arena-tone);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}
.game-progress-top {
    display: flex; align-items: center; margin-bottom: 1.5rem;
    font-size: 0.85rem; color: var(--text-muted); font-weight: 500;
}
.game-q-text { font-size: 1.3rem; margin-bottom: 1.5rem; color: var(--text-main); text-align: center; }

.game-learning-aid {
    display: grid;
    gap: 0.55rem;
    margin: -0.5rem 0 1.25rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.game-mode-pill {
    justify-self: start;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #FDFBF7;
    background: color-mix(in srgb, var(--arena-tone) 14%, white);
    color: var(--arena-tone);
    font-size: 0.74rem;
    font-weight: 900;
}

.learning-aid-row {
    display: grid;
    gap: 0.18rem;
}

.learning-aid-row strong {
    color: var(--text-main);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.learning-aid-row span {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

/* Quiz Options */
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.quiz-opt-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem; background: var(--bg-color); border: 2px solid var(--border-color);
    border-radius: var(--radius-sm); font-weight: 600; font-size: 1rem;
    transition: var(--transition); cursor: pointer; text-align: left;
}
.quiz-opt-btn:hover { border-color: var(--primary-color); background: white; }
.quiz-option-letter {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 900;
}
.quiz-correct { border-color: var(--secondary-color) !important; background: #D1FAE5 !important; color: #059669 !important; }
.quiz-wrong { border-color: #EF4444 !important; background: #FEE2E2 !important; color: #B91C1C !important; }

.quiz-feedback {
    margin-top: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.quiz-feedback.correct {
    background: #D1FAE5;
    color: #047857;
}

.quiz-feedback.wrong {
    background: #FEE2E2;
    color: #B91C1C;
}

.game-feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(17, 24, 39, 0.52);
    backdrop-filter: blur(3px);
}

.game-feedback-card {
    width: min(520px, 100%);
    max-height: calc(100dvh - 2.5rem);
    overflow-y: auto;
    padding: 1.35rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    border-top: 5px solid var(--secondary-color);
}

.game-feedback-modal.is-wrong .game-feedback-card {
    border-top-color: #EF4444;
}

.game-feedback-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #ECFDF5;
    color: #047857;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
}

.game-feedback-modal.is-wrong .game-feedback-status {
    background: #FEF2F2;
    color: #B91C1C;
}

.game-feedback-icon {
    display: inline-flex;
    font-size: 1rem;
}

.game-feedback-card h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    margin-bottom: 0.45rem;
}

.game-feedback-card > p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.game-feedback-explanation {
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.game-feedback-explanation strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.game-feedback-explanation p {
    color: var(--text-main);
    line-height: 1.55;
}

.game-feedback-next {
    width: 100%;
    padding: 0.85rem 1rem;
}

.question-insight-list {
    display: grid;
    gap: 0.75rem;
}

.question-insight-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
}

.question-insight-item strong,
.question-insight-item span {
    display: block;
}

.question-insight-item span {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.question-insight-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.question-insight-stats span {
    margin: 0;
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 700;
}

.quiz-visual {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.quiz-visual-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.quiz-visual-item {
    min-width: 48px;
    height: 48px;
    padding: 0 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.84rem;
    font-weight: 800;
    transition: var(--transition);
}

.quiz-visual-item:hover,
.quiz-visual-item.is-selected {
    border-color: var(--primary-color);
    background: #FFF7ED;
    transform: translateY(-1px);
}

.quiz-visual-counter {
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(168, 76, 37, 0.25);
    border-radius: var(--radius-sm);
    background: #FFF7ED;
    color: var(--primary-hover);
    font-size: 0.82rem;
    font-weight: 800;
}

/* Input Answer */
.input-answer-form { display: flex; gap: 0.8rem; align-items: center; }
.game-input {
    flex: 1; padding: 0.9rem 1rem; font-size: 1.1rem;
    border: 2px solid var(--border-color); border-radius: var(--radius-sm);
    transition: var(--transition);
}
.game-input:focus { border-color: var(--accent-color); outline: none; box-shadow: 0 0 0 3px rgba(214,158,46,0.2); }
.fb-correct { color: #059669; font-weight: 600; margin-top: 1rem; display: inline-block; }
.fb-wrong { color: #B91C1C; font-weight: 500; margin-top: 1rem; display: inline-block; }

/* Matching */
.matching-grid { display: flex; gap: 2rem; justify-content: center; }
.matching-col { display: flex; flex-direction: column; gap: 0.6rem; min-width: 160px; }
.match-item {
    padding: 0.8rem 1.2rem; background: var(--bg-color);
    border: 2px solid var(--border-color); border-radius: var(--radius-sm);
    text-align: center; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.match-item:hover { border-color: var(--primary-color); }
.match-selected { border-color: var(--accent-color) !important; background: #FFFBEB !important; box-shadow: 0 0 0 3px rgba(214,158,46,0.2); }
.match-correct { border-color: var(--secondary-color) !important; background: #D1FAE5 !important; color: #059669 !important; }
.match-wrong { border-color: #EF4444 !important; background: #FEE2E2 !important; }

.match-feedback {
    min-height: 40px;
    margin: 0 auto 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.88rem;
    font-weight: 800;
}

.match-feedback.info {
    background: #EFF6FF;
    color: #1D4ED8;
}

.match-feedback.correct {
    background: #D1FAE5;
    color: #047857;
}

.match-feedback.wrong {
    background: #FEE2E2;
    color: #B91C1C;
}

.match-pair-answer {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #047857;
}

.match-pair-answer-wrong {
    color: #B91C1C;
}

/* Sequence */
.seq-result { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; min-height: 40px; }
.seq-placed {
    padding: 0.5rem 1rem; background: var(--primary-color); color: white;
    border-radius: var(--radius-sm); font-weight: 500;
}
.seq-options { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.seq-btn {
    padding: 0.7rem 1.2rem; background: var(--bg-color);
    border: 2px solid var(--border-color); border-radius: var(--radius-sm);
    font-weight: 500; cursor: pointer; transition: var(--transition);
}
.seq-btn:hover { border-color: var(--primary-color); background: white; }

/* Premium game engine */
.premium-shell {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: clamp(0.9rem, 2vw, 1.35rem);
    border-radius: var(--radius-md);
    background:
        radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--premium-tone) 18%, transparent), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
    border: 1px solid color-mix(in srgb, var(--premium-tone) 22%, var(--border-color));
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    position: relative;
}

.premium-shell::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--premium-tone), var(--premium-accent));
}

.premium-hud {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, 220px) auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.premium-hud strong,
.premium-kicker {
    display: block;
}

.premium-kicker {
    color: var(--premium-tone);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.premium-hud strong {
    color: var(--text-main);
    font-size: 1rem;
}

.premium-meter,
.premium-progress div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #E5E7EB;
}

.premium-meter span,
.premium-progress div span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--premium-tone), var(--premium-accent));
    transition: width 0.28s ease;
}

.premium-combo {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #111827;
    color: white;
    font-size: 0.78rem;
    font-weight: 900;
}

.premium-progress {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.premium-scene {
    min-height: 178px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: clamp(1rem, 2vw, 1.35rem);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--premium-tone) 13%, white), #FFFFFF 70%);
    border: 1px solid color-mix(in srgb, var(--premium-tone) 16%, var(--border-color));
    position: relative;
    overflow: hidden;
}

.premium-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.premium-sparks span {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--premium-accent);
    opacity: 0.26;
    left: calc(18% + var(--i) * 18%);
    top: calc(18% + (var(--i) % 2) * 48%);
    animation: premiumFloat 3.8s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.55s);
}

@keyframes premiumFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.18); }
}

.premium-avatar {
    width: clamp(64px, 13vw, 104px);
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--premium-tone), var(--premium-accent));
    color: white;
    font-size: clamp(2rem, 6vw, 3.2rem);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--premium-tone) 28%, transparent);
    z-index: 1;
}

.premium-scene h2 {
    color: var(--text-main);
    font-size: clamp(1.2rem, 2.4vw, 1.75rem);
    margin-bottom: 0.4rem;
}

.premium-scene p {
    color: var(--text-main);
    line-height: 1.5;
    font-weight: 700;
}

.premium-scene small {
    display: block;
    margin-top: 0.55rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.premium-action-zone {
    margin-top: 0.95rem;
}

.premium-action-title {
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.premium-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.premium-choice {
    min-height: 86px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.25rem 0.65rem;
    align-items: center;
    padding: 0.8rem;
    border: 2px solid color-mix(in srgb, var(--premium-tone) 12%, var(--border-color));
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.premium-choice:hover,
.premium-choice:focus-visible {
    border-color: var(--premium-tone);
    transform: translateY(-2px);
    outline: none;
}

.premium-choice > span:first-child {
    grid-row: 1 / 3;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--premium-tone) 12%, white);
    color: var(--premium-tone);
    font-weight: 900;
}

.premium-choice strong {
    font-size: 0.94rem;
    line-height: 1.25;
}

.premium-choice small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.premium-choice.is-correct {
    border-color: #10B981;
    background: #ECFDF5;
}

.premium-choice.is-wrong {
    border-color: #EF4444;
    background: #FEF2F2;
}

.premium-choice.is-picked {
    border-color: var(--premium-tone);
    background: color-mix(in srgb, var(--premium-tone) 10%, white);
}

.premium-preview,
.premium-assembly {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #F8FAFC;
}

.premium-preview span,
.premium-assembly span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 800;
}

.premium-choice-grid-ordered {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.premium-confirm {
    width: auto;
    margin-top: 0.85rem;
    padding: 0.75rem 1.25rem;
    background: var(--premium-tone);
}

.premium-confirm:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.premium-runner .premium-scene { background-image: linear-gradient(135deg, #EFF6FF, #FFFFFF); }
.premium-defense .premium-scene { background-image: linear-gradient(135deg, #ECFDF5, #FFFFFF); }
.premium-lab .premium-scene { background-image: linear-gradient(135deg, #F5F3FF, #FFFFFF); }
.premium-case .premium-scene { background-image: linear-gradient(135deg, #F1F5F9, #FFFFFF); }

/* Result Screen */
.game-result-screen {
    flex-direction: column; align-items: center; text-align: center;
    background: var(--card-bg); padding: 3rem; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); width: 100%; max-width: 500px; margin: 0 auto;
}
.result-stats {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
    width: 100%; margin-top: 1.5rem;
}
.result-stat {
    background: var(--bg-color); padding: 1rem; border-radius: var(--radius-sm);
    display: flex; flex-direction: column; align-items: center;
}
.result-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.result-value { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }

/* Public landing */
.landing-page {
    min-height: 100vh;
    background: #F8F3EA;
    color: var(--text-main);
}

.landing-hero {
    position: relative;
    min-height: min(700px, calc(100vh - 24px));
    overflow: hidden;
    padding: 1.5rem clamp(1.25rem, 4vw, 4rem) 4rem;
    background:
        linear-gradient(135deg, rgba(248, 243, 234, 0.98) 0%, rgba(248, 243, 234, 0.92) 55%, rgba(232, 221, 204, 0.9) 100%);
}

.landing-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.28) 100%),
        linear-gradient(0deg, rgba(13, 49, 82, 0.08) 0%, rgba(13, 49, 82, 0) 32%);
}

.landing-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.72;
    filter: saturate(0.95);
}

.landing-nav {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.landing-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.landing-logo span { color: var(--primary-color); }

.landing-logo-image {
    display: inline-flex;
    align-items: center;
    height: 52px;
}

.landing-logo-image img {
    display: block;
    width: 96px;
    height: 52px;
    object-fit: contain;
}

.landing-nav nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(45, 55, 72, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.landing-nav nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.landing-nav nav a:hover,
.landing-nav .landing-login-link {
    background: var(--text-main);
    color: white;
}

.landing-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    min-height: 560px;
    padding-top: 3rem;
}

.hero-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.scene-panel {
    position: absolute;
    border: 1px solid rgba(45, 55, 72, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 22px 50px rgba(45, 55, 72, 0.12);
}

.scene-main {
    right: clamp(1.5rem, 9vw, 9rem);
    top: 145px;
    width: min(430px, 34vw);
    min-width: 320px;
    padding: 1.3rem;
}

.scene-topline {
    width: 120px;
    height: 10px;
    margin-bottom: 1.3rem;
    border-radius: 999px;
    background: var(--primary-color);
}

.scene-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.scene-row span {
    width: 60%;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #E9F5EE;
}

.scene-row strong {
    font-size: 2rem;
    color: var(--secondary-color);
}

.scene-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scene-bars span {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: #E4C35A;
}

.scene-student,
.scene-teacher,
.scene-game {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 190px;
    padding: 1rem;
}

.scene-student i,
.scene-teacher i,
.scene-game i {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.3rem;
}

.scene-student strong,
.scene-teacher strong,
.scene-game strong {
    margin-top: 0.3rem;
}

.scene-student span,
.scene-teacher span,
.scene-game span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.scene-student {
    right: clamp(15rem, 38vw, 35rem);
    top: 235px;
}

.scene-student i { background: var(--primary-color); }

.scene-teacher {
    right: clamp(1.5rem, 8vw, 7rem);
    top: 430px;
}

.scene-teacher i { background: var(--prof-primary); }

.scene-game {
    right: clamp(12rem, 25vw, 24rem);
    top: 500px;
}

.scene-game i { background: var(--accent-color); }

.landing-hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.landing-hero-brand {
    display: block;
    width: 260px;
    max-width: 68vw;
    height: auto;
    margin-bottom: 1.2rem;
}

.landing-kicker,
.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(217, 83, 79, 0.12);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
}

.landing-hero h1 {
    margin-top: 1rem;
    font-size: 4.3rem;
    line-height: 0.95;
}

.landing-hero-content p {
    max-width: 620px;
    margin-top: 1.2rem;
    color: #405064;
    font-size: 1.1rem;
}

.landing-institutional-panel {
    padding: 1.4rem;
    border: 1px solid rgba(13, 49, 82, 0.14);
    border-top: 5px solid var(--text-main);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 42px rgba(13, 49, 82, 0.1);
}

.institutional-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.institutional-panel-header span {
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
}

.institutional-panel-header strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.institutional-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.institutional-panel-grid div {
    min-height: 132px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FDFBF7;
}

.institutional-panel-grid i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 0.8rem;
    border-radius: 6px;
    background: var(--text-main);
    color: white;
    font-size: 1.25rem;
}

.institutional-panel-grid strong,
.institutional-panel-grid span {
    display: block;
}

.institutional-panel-grid strong {
    font-size: 0.98rem;
}

.institutional-panel-grid span {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.hero-actions,
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.landing-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.landing-btn-primary {
    background: var(--primary-color);
    color: white;
}

.landing-btn-secondary {
    background: white;
    color: var(--prof-primary);
    border: 1px solid rgba(43, 108, 176, 0.18);
}

.landing-btn-dark {
    background: var(--text-main);
    color: white;
}

.landing-section,
.landing-band,
.landing-cta {
    padding: 4rem clamp(1.25rem, 4vw, 4rem);
}

.landing-section-heading {
    max-width: 760px;
    margin-bottom: 2rem;
}

.landing-section-heading.compact {
    max-width: 820px;
}

.landing-section-heading h2,
.landing-cta h2 {
    margin-top: 0.8rem;
    font-size: 2rem;
    line-height: 1.15;
}

.landing-section-heading p {
    margin-top: 0.7rem;
    color: var(--text-muted);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.role-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem;
    border: 1px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.teacher-panel {
    border-top-color: var(--prof-primary);
}

.role-panel.is-active,
.template-card.is-active,
.route-detail.is-active {
    outline: 3px solid rgba(214, 158, 46, 0.38);
    box-shadow: var(--shadow-md);
}

.role-panel-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.role-panel-header span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.role-panel-header h3 {
    font-size: 1.25rem;
    line-height: 1.2;
}

.role-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.5rem;
}

.student-icon { background: var(--primary-color); }
.teacher-icon { background: var(--prof-primary); }

.feature-list {
    display: grid;
    gap: 0.65rem;
    color: #405064;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.feature-list i {
    margin-top: 0.2rem;
    color: var(--secondary-color);
}

.template-route-link {
    align-self: flex-start;
    color: var(--primary-color);
    font-weight: 700;
}

.professor-link {
    color: var(--prof-primary);
}

.landing-band {
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 150px;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #FDFBF7;
    transition: var(--transition);
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-card i {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: white;
    font-size: 1.35rem;
}

.template-card strong {
    margin-top: 0.5rem;
    font-size: 1.05rem;
}

.template-card span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.teacher-card i { background: var(--prof-primary); }
.games-card i { background: var(--accent-color); }
.admin-card i { background: var(--text-main); }

.route-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.route-detail {
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
}

.route-detail i {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.route-detail h3 {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.route-detail p {
    margin-top: 0.4rem;
    color: var(--text-muted);
}

.landing-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.landing-cta .cta-actions {
    margin-top: 0;
    justify-content: flex-end;
}

.landing-v2 .landing-hero {
    min-height: min(760px, 100vh);
    background:
        linear-gradient(135deg, rgba(247, 251, 255, 0.96) 0%, rgba(248, 243, 234, 0.95) 52%, rgba(232, 221, 204, 0.92) 100%);
}

.landing-v2 .landing-hero::after {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.28) 58%, rgba(14, 65, 107, 0.08) 100%),
        linear-gradient(0deg, rgba(13, 49, 82, 0.08) 0%, rgba(13, 49, 82, 0) 36%);
}

.landing-nav-v2,
.landing-hero-v2 {
    max-width: 1180px;
    margin: 0 auto;
}

.landing-hero-v2 {
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.72fr);
}

.landing-v2 .landing-hero h1 {
    max-width: 760px;
    font-size: clamp(3.25rem, 8vw, 6.1rem);
    line-height: 0.92;
}

.landing-v2 .landing-hero-content p {
    max-width: 680px;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.landing-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.25rem;
}

.landing-trust-row span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(14, 65, 107, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 800;
}

.landing-trust-row i {
    color: var(--prof-primary);
    font-size: 1rem;
}

.landing-command-preview {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid rgba(184, 202, 216, 0.9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 70px rgba(13, 49, 82, 0.16);
    backdrop-filter: blur(16px);
}

.command-preview-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.command-preview-top span {
    color: var(--prof-primary);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.command-preview-top strong {
    color: var(--text-main);
    font-size: 1.15rem;
}

.command-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.command-preview-grid div {
    min-height: 104px;
    display: grid;
    align-content: center;
    gap: 0.22rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
}

.command-preview-grid i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.1rem;
    border-radius: var(--radius-sm);
    background: #EAF3F8;
    color: var(--prof-primary);
    font-size: 1.1rem;
}

.command-preview-grid strong {
    color: var(--text-main);
    font-size: 0.95rem;
}

.command-preview-grid span,
.landing-command-preview p {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.command-preview-chart {
    height: 132px;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(0deg, rgba(14, 65, 107, 0.08) 1px, transparent 1px) 0 0 / 100% 32px,
        white;
}

.command-preview-chart span {
    flex: 1;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, var(--prof-primary), #4299E1);
}

.landing-feature-grid,
.landing-kaio-grid,
.landing-demo-steps,
.landing-security-strip {
    display: grid;
    gap: 1rem;
}

.landing-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-feature-grid article {
    min-height: 220px;
    display: grid;
    align-content: start;
    gap: 0.65rem;
    padding: 1.15rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.landing-feature-grid i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #EAF3F8;
    color: var(--prof-primary);
    font-size: 1.25rem;
}

.landing-feature-grid strong,
.kaio-card strong,
.landing-security-strip strong {
    color: var(--text-main);
    font-size: 1rem;
}

.landing-feature-grid span,
.kaio-card span,
.landing-security-strip span {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.48;
}

.landing-kaio-band {
    background:
        linear-gradient(135deg, rgba(14, 65, 107, 0.08), rgba(200, 146, 61, 0.07)),
        #FFFFFF;
}

.landing-kaio-grid {
    grid-template-columns: minmax(280px, 1.05fr) repeat(3, minmax(0, 0.65fr));
}

.kaio-card {
    min-height: 190px;
    display: grid;
    align-content: start;
    gap: 0.5rem;
    padding: 1.15rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.kaio-card.primary {
    background: var(--prof-primary);
    color: white;
}

.kaio-card.primary i {
    color: var(--accent-color);
    font-size: 1.7rem;
}

.kaio-card.primary h3 {
    color: white;
    font-size: 1.35rem;
    line-height: 1.15;
}

.kaio-card.primary p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

.landing-demo-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1.2rem;
}

.landing-demo-steps span {
    min-height: 118px;
    display: grid;
    align-content: start;
    gap: 0.55rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-size: 0.84rem;
    line-height: 1.35;
    box-shadow: var(--shadow-sm);
}

.landing-demo-steps b {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--prof-primary);
    color: white;
}

.landing-security-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: clamp(2rem, 5vw, 4rem);
    background: #0A3152;
}

.landing-security-strip div {
    min-height: 132px;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
}

.landing-security-strip i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.landing-security-strip strong {
    color: white;
}

.landing-security-strip span {
    color: rgba(255, 255, 255, 0.78);
}

.landing-template-grid-v2 {
    margin-top: 0.8rem;
}

@media (max-width: 1100px) {
    .landing-feature-grid,
    .landing-demo-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-kaio-grid,
    .landing-security-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .landing-hero-v2 {
        grid-template-columns: 1fr;
        min-height: 0;
        padding-top: 1.5rem;
    }

    .landing-v2 .landing-hero h1 {
        font-size: clamp(2.7rem, 15vw, 4.4rem);
    }

    .landing-trust-row span {
        flex: 1 1 180px;
    }

    .landing-command-preview {
        padding: 0.85rem;
    }

    .landing-feature-grid,
    .landing-demo-steps,
    .command-preview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .login-page {
        align-items: flex-start;
        height: auto;
        min-height: 100dvh;
        padding: 1rem;
        overflow-y: auto;
    }

    .login-container {
        width: min(100%, 560px);
        height: auto;
        min-height: 0;
        max-height: none;
        flex-direction: column;
        overflow: hidden;
    }

    .login-left,
    .login-right {
        padding: 1.35rem;
    }

    .login-right {
        align-items: flex-start;
        text-align: left;
    }

    .login-right p {
        max-width: 100% !important;
    }

    .login-header h1 {
        font-size: 1.55rem;
        line-height: 1.15;
    }

    .login-header p {
        margin-bottom: 1.25rem;
    }

    .login-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        margin-bottom: 1.25rem;
    }

    .tab-btn {
        min-height: 44px;
        padding: 0.65rem 0.45rem;
        font-size: 0.82rem;
        line-height: 1.15;
        white-space: normal;
    }

    .login-form .form-group {
        margin-bottom: 1rem;
    }

    .login-points {
        gap: 0.55rem;
        margin-top: 1rem;
    }

    .login-point {
        width: 100%;
        padding: 0.65rem 0.75rem;
    }

    .landing-hero {
        min-height: auto;
    }

    .landing-hero-inner {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 2rem;
    }

    .role-grid,
    .route-detail-grid {
        grid-template-columns: 1fr;
    }

    .role-grid,
    .route-detail-grid {
        display: grid;
    }

    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .landing-cta .cta-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .landing-page {
        overflow-x: hidden;
    }

    .landing-hero {
        padding: 0.85rem 0.85rem 2.25rem;
    }

    .landing-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .landing-logo-image,
    .landing-logo-image img {
        width: 82px;
        height: 44px;
    }

    .landing-nav nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
        gap: 0.4rem;
        padding: 0.35rem;
    }

    .landing-nav nav a {
        justify-content: center;
        min-height: 38px;
        padding: 0.5rem 0.45rem;
        font-size: 0.82rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    .landing-hero-inner {
        gap: 1.15rem;
        padding-top: 1.35rem;
    }

    .landing-hero-brand {
        width: min(210px, 74vw);
        margin-bottom: 0.9rem;
    }

    .landing-kicker,
    .landing-eyebrow {
        width: fit-content;
        max-width: 100%;
        min-height: 26px;
        padding: 0.22rem 0.6rem;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .landing-hero h1 {
        margin-top: 0.75rem;
        font-size: clamp(2.25rem, 12vw, 3rem);
        line-height: 1;
    }

    .landing-hero-content p {
        margin-top: 0.85rem;
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .hero-actions,
    .cta-actions {
        gap: 0.55rem;
        margin-top: 1.15rem;
    }

    .landing-institutional-panel {
        padding: 1rem;
    }

    .institutional-panel-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .institutional-panel-grid div {
        min-height: 0;
        padding: 0.85rem;
    }

    .institutional-panel-grid {
        grid-template-columns: 1fr;
    }

    .landing-btn,
    .hero-actions,
    .cta-actions {
        width: 100%;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    .landing-section,
    .landing-band,
    .landing-cta {
        padding: 2.35rem 1rem;
    }

    .landing-section-heading {
        margin-bottom: 1.2rem;
    }

    .landing-section-heading h2,
    .landing-cta h2 {
        font-size: 1.55rem;
        line-height: 1.18;
    }

    .role-panel,
    .template-card,
    .route-detail {
        padding: 1rem;
    }

    .template-card {
        min-height: 0;
    }

    .landing-cta {
        align-items: stretch;
    }
}

/* Mobile app polish */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.main-content,
.content-wrapper,
.card,
.dashboard-grid,
.stats-cards,
.performance-insights,
.resource-grid,
.classroom-study-grid,
.teacher-admin-card,
.activity-row,
.student-activity-card,
.submission-item,
.chat-panel,
.chat-rooms,
.game-question-card,
.game-start-screen,
.game-result-screen {
    min-width: 0;
}

@media (max-width: 760px) {
    html,
    body {
        overflow-x: hidden;
    }

    .app-layout {
        display: block;
        width: 100%;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.6rem;
        z-index: 820;
        width: auto;
        min-height: 0;
        height: auto;
        max-height: none;
        display: block;
        overflow: hidden;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 16px 44px rgba(13, 49, 82, 0.18);
        backdrop-filter: blur(14px);
    }

    .admin-sidebar {
        border-right: 0 !important;
    }

    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        width: 100%;
        padding: 0.35rem;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav ul {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
        gap: 0.25rem;
        min-width: 0;
    }

    .sidebar-nav ul li {
        margin: 0;
        min-width: 0;
    }

    body:not(.mobile-menu-expanded) .sidebar-nav ul li:nth-child(n+5) {
        display: none;
    }

    .sidebar-nav ul li a {
        height: 54px;
        justify-content: center;
        flex-direction: column;
        gap: 0.18rem;
        padding: 0.32rem 0.2rem;
        border-radius: 10px;
        font-size: 0.59rem;
        font-weight: 800;
        line-height: 1.08;
        text-align: center;
        white-space: normal;
        overflow: hidden;
    }

    .sidebar-nav ul li a i {
        flex: 0 0 auto;
        font-size: 1.18rem;
        line-height: 1;
    }

    .sidebar-nav ul li.active a {
        box-shadow: inset 0 0 0 1px rgba(89, 98, 60, 0.12);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 810;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(15, 23, 42, 0.36);
        backdrop-filter: blur(2px);
    }

    body.mobile-menu-expanded {
        overflow: hidden;
    }

    body.mobile-menu-expanded .mobile-menu-backdrop {
        display: block;
    }

    body.mobile-menu-expanded .sidebar {
        max-height: min(72dvh, 540px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0.35rem;
        border-radius: 18px;
    }

    body.mobile-menu-expanded .sidebar-header,
    body.mobile-menu-expanded .sidebar-footer {
        display: flex;
        flex: 0 0 auto;
    }

    body.mobile-menu-expanded .sidebar-header {
        padding: 0.75rem 0.8rem 0.65rem;
        border-bottom: 1px solid var(--border-color);
    }

    body.mobile-menu-expanded .sidebar-footer {
        padding: 0.7rem 0.8rem;
        border-top: 1px solid var(--border-color);
    }

    body.mobile-menu-expanded .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.55rem;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.mobile-menu-expanded .sidebar-nav ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        gap: 0.45rem;
    }

    body.mobile-menu-expanded .sidebar-nav ul li {
        display: block;
        flex: 1 1 auto;
    }

    body.mobile-menu-expanded .sidebar-nav ul li a {
        min-height: 46px;
        height: auto;
        justify-content: flex-start;
        flex-direction: row;
        gap: 0.55rem;
        padding: 0.68rem 0.75rem;
        font-size: 0.82rem;
        line-height: 1.2;
        text-align: left;
    }

    body.mobile-menu-expanded .sidebar-nav ul li a i {
        font-size: 1.15rem;
    }

    .user-info {
        min-width: 0;
    }

    .user-info .details,
    .user-info .name {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .main-content {
        width: 100%;
        min-height: 0;
        display: block;
    }

    .topbar {
        height: auto;
        min-height: 62px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        padding: 0.62rem 0.78rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
        box-shadow: 0 10px 26px rgba(13, 49, 82, 0.07);
    }

    .mobile-user-chip {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    .mobile-user-meta strong {
        max-width: 36vw;
    }

    .mobile-user-meta span {
        max-width: 38vw;
    }

    .search-bar {
        display: none;
    }

    .topbar-actions {
        flex: 0 0 auto;
        margin-left: auto;
        gap: 0.34rem;
    }

    .mobile-menu-button {
        display: inline-flex;
        width: 40px;
        min-width: 40px;
        padding: 0;
    }

    .mobile-menu-button span {
        display: none;
    }

    .mobile-logout-form {
        display: block;
    }

    .mobile-logout-button {
        display: inline-flex;
    }

    .notification-trigger {
        width: 40px;
        height: 40px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--card-bg);
        box-shadow: 0 8px 22px rgba(13, 49, 82, 0.08);
    }

    .content-wrapper {
        width: 100%;
        padding: 5rem 1rem 7.1rem;
        overflow: visible;
    }

    .admin-detail-modal {
        place-items: stretch;
        padding: 0;
        overflow: hidden;
    }

    .admin-detail-backdrop {
        display: none;
    }

    .admin-detail-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 0.9rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-detail-header {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 0 0 0.85rem;
        margin-bottom: 0.85rem;
        background: var(--card-bg);
    }

    .admin-detail-header h2 {
        font-size: 1.2rem;
        overflow-wrap: anywhere;
    }

    .admin-detail-header p,
    .admin-entity-main p,
    .admin-mini-row span {
        overflow-wrap: anywhere;
    }

    .admin-detail-close {
        align-self: flex-end;
        flex: 0 0 38px;
    }

    .admin-detail-stats {
        gap: 0.55rem;
    }

    .admin-detail-stats > div,
    .admin-detail-section {
        padding: 0.85rem;
    }

    .admin-detail-stats strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    .admin-detail-grid,
    .admin-detail-section .activity-form-grid,
    .admin-detail-section .admin-check-grid,
    .admin-detail-section .admin-check-grid.compact,
    .admin-detail-section .subject-choice-group,
    .admin-detail-section .subject-choice-group.compact {
        grid-template-columns: 1fr !important;
    }

    .admin-entity-row {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
        padding: 0.78rem;
    }

    .admin-entity-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .admin-entity-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: flex-start;
        gap: 0.45rem;
    }

    .admin-entity-metrics span {
        flex: 1 1 auto;
        min-height: 42px;
        padding: 0.42rem;
        justify-content: center;
        text-align: center;
    }

    .admin-entity-row > .btn-reset-password,
    .admin-modal-inline-form,
    .admin-mini-row .tag-remove-form,
    .admin-mini-row .btn-reset-password,
    .admin-detail-panel .btn-reset-password,
    .admin-detail-panel .btn-primary,
    .admin-detail-panel .form-select {
        width: 100%;
    }

    .admin-modal-inline-form,
    .admin-mini-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-check-grid.compact,
    .subject-choice-group.compact {
        max-height: min(42dvh, 320px);
        padding-right: 0;
    }

    .page-header {
        margin-bottom: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .page-header h1 {
        font-size: 1.28rem;
        line-height: 1.15;
    }

    .page-header p {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.82rem;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .dashboard-grid,
    .performance-insights,
    .resource-grid,
    .classroom-study-grid,
    .admin-overview-strip,
    .activity-form-grid,
    .student-recipient-list,
    .correction-form,
    .auto-template-panel,
    .chat-layout,
    .teacher-admin-card,
    .admin-check-grid,
    .admin-check-grid.compact,
    .copilot-hero,
    .copilot-action-list,
    .copilot-week,
    .copilot-content-map,
    .conteudo-guide,
    .subject-choice-group,
    .subject-choice-group.compact,
    .letter-choice-group,
    .template-grid,
    .role-grid,
    .route-detail-grid,
    .institutional-panel-grid {
        grid-template-columns: 1fr !important;
    }

    .stats-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.55rem;
        margin-bottom: 0.75rem;
    }

    .col-span-8,
    .col-span-6,
    .col-span-4,
    .col-span-12,
    .stats-cards {
        grid-column: span 12;
    }

    .performance-chart-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .performance-chart-nav {
        justify-content: stretch;
    }

    .performance-chart-nav button,
    .performance-period-quick button {
        flex: 1 1 130px;
    }

    .card,
    .teacher-admin-card,
    .class-admin-row,
    .activity-row,
    .student-activity-card,
    .submission-item,
    .resource-card,
    .classroom-study-card {
        padding: 1rem;
        border-radius: var(--radius-sm);
    }

    .stat-card {
        gap: 0.55rem;
        min-height: 74px;
        padding: 0.72rem;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 1.05rem;
    }

    .stat-info h3 {
        margin-bottom: 0.05rem;
        font-size: 1.08rem;
    }

    .stat-info p {
        font-size: 0.68rem;
        line-height: 1.15;
    }

    .role-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        margin-bottom: 0.9rem;
    }

    .role-action-card {
        min-height: 0;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 0.55rem;
        padding: 0.72rem;
        border-radius: var(--radius-sm);
    }

    .role-action-card i {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 1rem;
    }

    .role-action-card strong {
        margin-bottom: 0.1rem;
        font-size: 0.8rem;
        line-height: 1.15;
    }

    .role-action-card span {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.68rem;
        line-height: 1.25;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .clarity-note {
        gap: 0.55rem;
        margin-bottom: 0.75rem;
        padding: 0.68rem 0.75rem;
    }

    .clarity-note i {
        font-size: 1.05rem;
    }

    .clarity-note strong {
        font-size: 0.78rem;
    }

    .clarity-note span {
        display: none;
    }

    .card-header,
    .teacher-admin-heading,
    .teacher-card-actions,
    .teacher-side-actions,
    .assignment-header,
    .recipient-header,
    .activity-row-top,
    .student-activity-header,
    .submission-header,
    .class-admin-title,
    .form-label-row,
    .classroom-progress div:first-child {
        align-items: stretch;
        flex-direction: column;
    }

    .activity-subnav,
    .game-subject-nav,
    .classroom-actions,
    .resource-card-footer,
    .activity-meta,
    .tag-list {
        width: 100%;
    }

    .activity-subnav a,
    .game-subject-nav a,
    .classroom-actions a,
    .resource-card-footer a,
    .page-header .btn-reset-password,
    .teacher-card-actions .btn-reset-password,
    .teacher-admin-heading .admin-action-form,
    .teacher-admin-heading .btn-reset-password,
    .teacher-bulk-form .btn-reset-password,
    .login-form .btn-primary,
    .activity-row-actions .btn-reset-password,
    .admin-map-card .tag-pill {
        width: 100%;
    }

    .btn-reset-password,
    .btn-primary,
    .btn-link-compact,
    .tag-pill,
    .game-badge,
    .notification-read-btn,
    .ai-action-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .tag-remove-form,
    .tag-pill {
        width: auto;
    }

    .tag-pill {
        overflow-wrap: anywhere;
        text-align: left;
    }

    .admin-entity-main p,
    .item-desc,
    .activity-row-main p,
    .student-activity-header p,
    .student-activity-body p,
    .classroom-study-top p,
    .resource-card p,
    .game-card-desc {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .list-group {
        gap: 0.55rem;
    }

    .list-item {
        gap: 0.65rem;
        padding: 0.72rem;
    }

    .item-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 1rem;
    }

    .item-title {
        font-size: 0.84rem;
        line-height: 1.2;
    }

    .item-desc {
        font-size: 0.7rem;
    }

    .item-action .btn-sm {
        min-height: 32px;
        padding: 0.35rem 0.52rem;
        font-size: 0.72rem;
    }

    .inline-select-form,
    .period-toolbar,
    .input-answer-form,
    .matching-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-select-form .form-select,
    .inline-select-form .btn-reset-password,
    .period-toolbar .inline-select-form,
    .period-toolbar .btn-reset-password,
    .input-answer-form .btn-primary {
        width: 100% !important;
    }

    .admin-sticky-card {
        position: static;
    }

    .admin-table-wrap {
        overflow: visible;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table tr,
    .admin-table th,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        margin-bottom: 0.85rem;
        padding: 0.85rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        background: white;
    }

    .admin-table td {
        padding: 0.35rem 0;
        border-bottom: 0;
        overflow-wrap: anywhere;
    }

    .admin-row-actions {
        min-width: 0;
    }

    .chat-layout {
        gap: 0.65rem;
        min-height: 0;
    }

    .chat-rooms {
        padding: 0.65rem;
    }

    .chat-rooms h3 {
        margin-bottom: 0.45rem;
        font-size: 0.82rem;
    }

    .chat-room {
        min-height: 34px;
        padding: 0.42rem 0.5rem;
        font-size: 0.8rem;
    }

    .chat-panel {
        grid-template-rows: auto minmax(220px, 40dvh) auto;
    }

    .chat-header {
        padding: 0.65rem 0.75rem;
    }

    .chat-header h3 {
        font-size: 0.96rem;
    }

    .chat-header p {
        display: none;
    }

    .chat-messages {
        gap: 0.5rem;
        padding: 0.65rem;
    }

    .chat-message {
        max-width: 88%;
        padding: 0.56rem 0.62rem;
        border-radius: 10px;
    }

    .chat-message-top {
        gap: 0.25rem 0.45rem;
        margin-bottom: 0.25rem;
        font-size: 0.68rem;
    }

    .chat-role-badge {
        padding: 0.08rem 0.34rem;
        font-size: 0.6rem;
    }

    .chat-message-time {
        width: 100%;
        font-size: 0.64rem;
    }

    .chat-message p {
        font-size: 0.84rem;
        line-height: 1.42;
    }

    .chat-form {
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 0.45rem;
        padding: 0.55rem;
    }

    .chat-form textarea {
        min-height: 42px;
        max-height: 78px;
        resize: none;
        padding: 0.58rem 0.65rem;
        font-size: 0.86rem;
    }

    .chat-form .btn-primary {
        width: 42px !important;
        height: 42px;
        min-width: 42px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-size: 0;
    }

    .chat-form .btn-primary i {
        font-size: 1.15rem;
    }

    .chat-form .btn-primary span {
        display: none;
    }

    .notification-popover {
        position: fixed;
        top: 4.4rem;
        right: 0.65rem;
        bottom: 6.8rem;
        left: 0.65rem;
        z-index: 980;
        width: auto;
        max-height: none;
        border-radius: 18px;
        box-shadow: 0 24px 60px rgba(13, 49, 82, 0.24);
    }

    .notification-popover::before {
        display: none;
    }

    .notification-selection-bar,
    .notification-popover-header {
        align-items: stretch;
        flex-direction: column;
    }

    .notification-header-actions {
        justify-content: stretch;
    }

    .notification-selection-bar div {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .notification-selection-bar .notification-read-btn,
    .notification-popover-header .notification-read-btn {
        flex: 1 1 0;
        min-height: 38px;
    }

    .notification-item {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 0.55rem;
    }

    .notification-widget[data-notification-selection-mode="true"] .notification-item {
        grid-template-columns: 22px 30px minmax(0, 1fr) auto;
    }

    .notification-time {
        grid-column: 2;
        justify-self: start;
    }

    .notification-widget[data-notification-selection-mode="true"] .notification-time {
        grid-column: 3;
    }

    .notification-item-read {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .notification-widget[data-notification-selection-mode="true"] .notification-item-read {
        grid-column: 4;
    }

    .ai-assistant-widget {
        right: 0.6rem;
        bottom: 6.75rem;
        z-index: 970;
    }

    .ai-assistant-trigger {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .ai-assistant-panel {
        position: fixed;
        top: auto;
        right: 0.55rem;
        bottom: 6.35rem;
        left: 0.55rem;
        width: auto;
        height: min(50dvh, 440px);
        max-height: calc(100dvh - 8rem);
        grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
        border-radius: 14px;
    }

    .ai-assistant-widget.is-ai-expanded .ai-assistant-panel {
        width: auto;
        height: calc(100dvh - 11.5rem);
    }

    .ai-assistant-widget.is-ai-positioned .ai-assistant-panel {
        top: var(--ai-panel-top);
        right: auto;
        bottom: auto;
        left: var(--ai-panel-left);
        width: var(--ai-panel-width);
        height: var(--ai-panel-height);
    }

    .ai-assistant-header {
        align-items: center;
        padding: 0.58rem 0.72rem;
        cursor: grab;
        touch-action: none;
        user-select: none;
    }

    .ai-assistant-widget.is-ai-dragging .ai-assistant-header {
        cursor: grabbing;
    }

    .ai-assistant-header strong {
        max-width: 42vw;
        overflow: hidden;
        font-size: 0.86rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ai-assistant-header span {
        display: none;
    }

    .ai-mobile-hint {
        display: block;
        margin-top: 0.12rem;
        color: var(--text-muted);
        font-size: 0.64rem;
        font-weight: 800;
        line-height: 1.1;
    }

    .ai-assistant-controls {
        gap: 0.18rem;
    }

    .ai-assistant-control,
    .ai-assistant-close {
        width: 31px;
        height: 31px;
        border: 1px solid var(--border-color);
        background: white;
        font-size: 1.05rem;
    }

    .ai-assistant-control[data-ai-reset] {
        display: inline-flex;
    }

    .ai-assistant-messages {
        min-height: 0;
        padding: 0.58rem;
        gap: 0.42rem;
    }

    .ai-message {
        padding: 0.52rem 0.62rem;
        border-radius: 9px;
    }

    .ai-message p {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .ai-material-shell summary {
        min-height: 32px;
        padding: 0.42rem 0.65rem;
        font-size: 0.72rem;
    }

    .ai-material-form {
        padding: 0.55rem 0.65rem;
    }

    .ai-suggestion-strip {
        max-height: 5.8rem;
        overflow-y: auto;
        padding: 0.45rem 0.6rem;
        gap: 0.35rem;
    }

    .ai-suggestion-strip button {
        min-height: 30px;
        font-size: 0.7rem;
        padding: 0.35rem 0.48rem;
    }

    .ai-assistant-form {
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 0.4rem;
        padding: 0.5rem;
    }

    .ai-assistant-form textarea {
        min-height: 36px;
        max-height: 60px;
        padding: 0.48rem 0.55rem;
        font-size: 0.78rem;
    }

    .ai-send-btn {
        width: 36px;
        height: 36px;
    }

    .ai-message {
        max-width: 100%;
    }

    .game-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .game-info-bar {
        width: 100%;
        flex-wrap: wrap;
    }

    .game-info-bar .game-badge,
    .game-timer {
        flex: 1 1 auto;
        justify-content: center;
    }

    .game-arena {
        min-height: 0;
        align-items: stretch;
    }

    .game-start-screen,
    .game-question-card,
    .game-result-screen {
        width: 100%;
        padding: 1rem;
    }

    .game-q-text {
        font-size: 1.08rem;
    }

    .quiz-options,
    .result-stats,
    .premium-hud,
    .premium-choice-grid,
    .premium-choice-grid-ordered {
        grid-template-columns: 1fr;
    }

    .premium-shell {
        padding: 0.8rem;
    }

    .premium-scene {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .premium-avatar {
        width: 64px;
        border-radius: 18px;
    }

    .premium-choice {
        min-height: 76px;
    }

    .matching-col {
        width: 100%;
        min-width: 0;
    }

    .seq-btn,
    .match-item,
    .quiz-opt-btn {
        overflow-wrap: anywhere;
    }

    .question-insight-item {
        grid-template-columns: 1fr;
    }

    .question-insight-stats {
        justify-content: flex-start;
    }

    .flash-messages {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
}

@media (min-width: 761px) {
    .professor-layout .mobile-menu-button,
    .professor-layout .sidebar-mobile-close {
        display: none !important;
    }
}

@media (max-width: 760px) {
    html,
    body {
        overflow-x: clip;
    }

    .professor-layout {
        display: block;
        overflow-x: clip;
    }

    .professor-layout .prof-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        z-index: 1050;
        width: min(86vw, 340px);
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-right: 1px solid rgba(184, 202, 216, 0.8);
        border-radius: 0 18px 18px 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 24px 0 60px rgba(13, 49, 82, 0.22);
        transform: translateX(-110%);
        transition: transform 0.24s ease;
        backdrop-filter: blur(16px);
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar {
        width: min(86vw, 340px);
        flex-basis: auto;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .app-brand-subtle div {
        display: flex;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .role-badge {
        display: inline-flex;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .user-info .details {
        display: flex;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .sidebar-nav {
        padding: 0.75rem;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .sidebar-nav ul li a {
        justify-content: flex-start;
        gap: 0.72rem;
        padding: 0.72rem 0.8rem;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .sidebar-nav .nav-label {
        display: inline;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .sidebar-footer {
        padding: 0.85rem 0.9rem;
    }

    body.prof-sidebar-collapsed .professor-layout .prof-sidebar .user-info {
        justify-content: flex-start;
        gap: 1rem;
    }

    body.mobile-menu-expanded .professor-layout .prof-sidebar {
        max-height: 100dvh;
        padding: 0;
        transform: translateX(0);
    }

    .professor-layout .sidebar-header,
    body.mobile-menu-expanded .professor-layout .sidebar-header {
        display: flex;
        flex: 0 0 auto;
        padding: 0.9rem;
        border-bottom: 1px solid var(--border-color);
    }

    .professor-layout .sidebar-footer,
    body.mobile-menu-expanded .professor-layout .sidebar-footer {
        display: flex;
        flex: 0 0 auto;
        padding: 0.85rem 0.9rem;
        border-top: 1px solid var(--border-color);
    }

    .professor-layout .sidebar-collapse-btn {
        display: none;
    }

    .professor-layout .sidebar-mobile-close {
        display: inline-flex;
        margin-left: auto;
    }

    .professor-layout .sidebar-nav,
    body.mobile-menu-expanded .professor-layout .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.75rem;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .professor-layout .sidebar-nav ul,
    body.mobile-menu-expanded .professor-layout .sidebar-nav ul {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
        min-width: 0;
    }

    .professor-layout .sidebar-nav ul li,
    body:not(.mobile-menu-expanded) .professor-layout .sidebar-nav ul li:nth-child(n+5),
    body.mobile-menu-expanded .professor-layout .sidebar-nav ul li {
        display: block;
        margin: 0;
    }

    .professor-layout .sidebar-nav ul li a,
    body.mobile-menu-expanded .professor-layout .sidebar-nav ul li a {
        min-height: 46px;
        height: auto;
        justify-content: flex-start;
        flex-direction: row;
        gap: 0.72rem;
        padding: 0.72rem 0.8rem;
        border-radius: 12px;
        font-size: 0.88rem;
        line-height: 1.2;
        text-align: left;
        white-space: nowrap;
    }

    .professor-layout .sidebar-nav .nav-label {
        display: inline;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .professor-layout .sidebar-nav ul li a i,
    body.mobile-menu-expanded .professor-layout .sidebar-nav ul li a i {
        flex: 0 0 auto;
        font-size: 1.2rem;
    }

    .professor-layout .mobile-menu-backdrop {
        z-index: 1040;
    }

    .professor-layout .topbar {
        z-index: 1000;
    }

    .professor-layout .content-wrapper {
        overflow-x: clip;
        padding-bottom: 7.9rem;
    }

    .today-command-center {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        margin-bottom: 0.9rem;
        padding: 0.8rem;
    }

    .today-command-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .chart-reading-guide {
        grid-template-columns: 1fr;
        margin-top: 0.75rem;
    }

    .chart-frame {
        height: 320px;
        min-height: 320px;
    }

    .chart-frame-bars,
    .chart-frame-students,
    .chart-frame-subjects {
        height: 360px;
        min-height: 360px;
    }

    .chart-frame-line,
    .chart-frame-student-line {
        height: 340px;
        min-height: 340px;
    }

    .chart-frame-doughnut {
        height: 310px;
        min-height: 310px;
    }

    .today-command-actions a {
        min-height: 82px;
        padding: 0.7rem;
    }

    .compact-empty-state {
        margin-bottom: 0.9rem;
    }

    .teacher-table-wrap {
        overflow-x: hidden;
    }

    .teacher-home-table,
    .teacher-home-table thead,
    .teacher-home-table tbody,
    .teacher-home-table tr,
    .teacher-home-table th,
    .teacher-home-table td {
        display: block;
        width: 100% !important;
    }

    .teacher-home-table thead {
        display: none;
    }

    .teacher-home-table tr {
        margin-bottom: 0.65rem;
        padding: 0.75rem;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-sm);
        background: white;
    }

    .teacher-home-table td {
        padding: 0.28rem 0 !important;
        border: 0 !important;
        overflow-wrap: anywhere;
    }

    .conteudo-filtros {
        flex-wrap: wrap;
        overflow-x: hidden;
    }

    .mobile-quick-nav {
        position: fixed;
        right: max(0.6rem, env(safe-area-inset-right));
        bottom: max(0.6rem, env(safe-area-inset-bottom));
        left: max(0.6rem, env(safe-area-inset-left));
        z-index: 960;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.2rem;
        padding: 0.35rem;
        border: 1px solid rgba(184, 202, 216, 0.84);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 18px 48px rgba(13, 49, 82, 0.22);
        backdrop-filter: blur(16px);
    }

    .mobile-quick-nav > a,
    .mobile-quick-plus {
        min-width: 0;
        min-height: 52px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        border-radius: 14px;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.64rem;
        font-weight: 900;
        line-height: 1;
        text-align: center;
        transition: var(--transition);
    }

    .mobile-quick-nav > a i,
    .mobile-quick-plus i {
        font-size: 1.22rem;
        line-height: 1;
    }

    .mobile-quick-nav > a.active,
    .mobile-quick-nav > a:hover,
    .mobile-quick-plus[aria-expanded="true"] {
        background: #EAF3F8;
        color: var(--prof-primary);
    }

    .mobile-quick-plus[aria-expanded="true"] i {
        transform: none;
    }

    .mobile-quick-more-panel {
        position: absolute;
        right: 0;
        bottom: calc(100% + 0.65rem);
        left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.65rem;
        border: 1px solid rgba(184, 202, 216, 0.92);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 20px 52px rgba(13, 49, 82, 0.22);
        backdrop-filter: blur(16px);
    }

    .mobile-quick-more-panel[hidden] {
        display: none !important;
    }

    .mobile-quick-more-panel a {
        min-width: 0;
        min-height: 46px;
        display: flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.62rem 0.7rem;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: #F8FAFC;
        color: var(--text-main);
        font-size: 0.78rem;
        font-weight: 800;
    }

    .mobile-quick-more-panel a i {
        flex: 0 0 auto;
        color: var(--prof-primary);
        font-size: 1.05rem;
    }

    .mobile-quick-more-panel a span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .professor-layout .notification-popover {
        bottom: 7.8rem;
    }

    .professor-layout .ai-assistant-widget {
        bottom: 7.85rem;
    }

    .professor-layout .ai-assistant-panel {
        bottom: 7.45rem;
    }
}

@media (max-width: 420px) {
    .mobile-quick-nav > a span,
    .mobile-quick-plus span {
        font-size: 0.58rem;
    }

    .mobile-quick-more-panel {
        grid-template-columns: 1fr;
    }
}
