/*
 * Giáo Viên Việt: hệ giao diện "Xanh tin cậy".
 * Token (biến --gv-*) và component dùng chung cho các trang của giáo viên. Mọi class có tiền tố gv- để không đụng
 * CSS cũ còn nằm trong từng trang. Màu từng thẻ (ảnh bìa ứng dụng, sản phẩm) đặt bằng biến --gv-tone trên thẻ.
 */
:root {
    --gv-font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --gv-bg: #F5F7FB;
    --gv-surface: #FFFFFF;
    --gv-surface-2: #F0F3F8;
    --gv-title: #0F2A5A;
    --gv-text: #1A2233;
    --gv-text-2: #52607A;
    --gv-text-3: #8792A8;
    --gv-line: #E4E9F1;
    --gv-line-strong: #D2D9E5;

    --gv-primary: #1F5FD6;
    --gv-primary-hover: #1A50B6;
    --gv-primary-soft: #E8F0FE;
    --gv-primary-ring: rgba(31, 95, 214, .18);
    --gv-accent: #F08C1A;
    --gv-accent-hover: #DB7A0B;
    --gv-success: #15924A;
    --gv-success-hover: #117A3D;
    --gv-success-soft: #E6F6EC;
    --gv-warning: #B45309;
    --gv-warning-soft: #FEF3D7;
    --gv-danger: #DC2F2F;
    --gv-danger-soft: #FDEDED;
    --gv-star: #F5B301;

    --gv-tone-amber: #E3A008;
    --gv-tone-teal: #12919A;
    --gv-tone-honey: #F08C1A;
    --gv-tone-violet: #7A5AF0;
    --gv-tone-slate: #7B8798;
    --gv-tone-blue: #2F6FE4;
    --gv-tone-rose: #E0507A;
    --gv-tone-green: #22A06B;

    --gv-r-sm: 10px;
    --gv-r-md: 14px;
    --gv-r-lg: 18px;
    --gv-r-xl: 22px;
    --gv-r-btn: 10px;

    --gv-shadow-sm: 0 1px 2px rgba(15, 42, 90, .05), 0 1px 1px rgba(15, 42, 90, .03);
    --gv-shadow-md: 0 12px 28px -12px rgba(15, 42, 90, .22), 0 2px 6px rgba(15, 42, 90, .05);
    --gv-shadow-lg: 0 24px 48px -20px rgba(15, 42, 90, .28);

    --gv-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Nền trang ---------- */
.gv-body {
    margin: 0;
    font-family: var(--gv-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--gv-text);
    background: var(--gv-bg);
    -webkit-font-smoothing: antialiased;
}
.gv-body :focus-visible { outline: 2px solid var(--gv-primary); outline-offset: 2px; }
.gv-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gv-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Nút ---------- */
.gv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: var(--gv-r-btn); border: 1px solid transparent;
    font: 600 14px/1 var(--gv-font); white-space: nowrap; text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.gv-btn:active { transform: translateY(1px); }
.gv-btn:disabled, .gv-btn.is-disabled { opacity: .55; pointer-events: none; }
.gv-btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.gv-btn--lg { height: 48px; font-size: 15px; }
.gv-btn--block { width: 100%; }
.gv-btn--primary { background: var(--gv-primary); color: #fff; box-shadow: 0 1px 2px rgba(31, 95, 214, .3); }
.gv-btn--primary:hover { background: var(--gv-primary-hover); color: #fff; }
.gv-btn--accent { background: var(--gv-accent); color: #fff; box-shadow: 0 1px 2px rgba(240, 140, 26, .35); }
.gv-btn--accent:hover { background: var(--gv-accent-hover); color: #fff; }
.gv-btn--success { background: var(--gv-success); color: #fff; }
.gv-btn--success:hover { background: var(--gv-success-hover); color: #fff; }
.gv-btn--secondary { background: var(--gv-surface); border-color: var(--gv-line-strong); color: var(--gv-text); }
.gv-btn--secondary:hover { border-color: var(--gv-primary); color: var(--gv-primary); }
.gv-btn--soft { background: var(--gv-success-soft); border-color: #B9E3C9; color: var(--gv-success); }
.gv-btn--soft:hover { background: #D8F0E1; color: var(--gv-success-hover); }
.gv-btn--ghost { background: transparent; color: var(--gv-text-2); }
.gv-btn--ghost:hover { background: var(--gv-surface-2); color: var(--gv-text); }
.gv-btn--danger { background: var(--gv-danger-soft); color: var(--gv-danger); }
.gv-btn--danger:hover { background: #FADADA; }

.gv-icon-btn {
    position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: var(--gv-r-btn); background: transparent; color: var(--gv-text-2); cursor: pointer; text-decoration: none;
}
.gv-icon-btn:hover { background: var(--gv-surface-2); color: var(--gv-text); }
.gv-icon-btn[hidden] { display: none; }
.gv-icon-btn--sm { width: 32px; height: 32px; color: var(--gv-text-3); }
.gv-count {
    position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--gv-danger); color: #fff; border: 2px solid var(--gv-surface);
    font: 700 11px/14px var(--gv-font); text-align: center;
}

/* ---------- Nhãn ---------- */
.gv-badge {
    display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px;
    font: 600 12px/1 var(--gv-font); white-space: nowrap; vertical-align: middle;
}
.gv-badge--free { background: var(--gv-success-soft); color: var(--gv-success); }
.gv-badge--trial { background: var(--gv-primary-soft); color: var(--gv-primary); }
.gv-badge--premium { background: var(--gv-warning-soft); color: var(--gv-warning); }
.gv-badge--danger { background: var(--gv-danger-soft); color: var(--gv-danger); }
.gv-badge--muted { background: var(--gv-surface-2); color: var(--gv-text-3); }
.gv-badge--hot { background: var(--gv-danger); color: #fff; }
.gv-badge--success { background: var(--gv-success); color: #fff; }

/* ---------- Header website (trang ứng dụng, cửa hàng, tài khoản) ---------- */
.gv-head { position: sticky; top: 0; z-index: 100; background: var(--gv-surface); border-bottom: 1px solid var(--gv-line); }
.gv-head__in { display: flex; align-items: center; gap: 20px; height: 68px; }
.gv-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.gv-logo__mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: linear-gradient(140deg, #3A86F5, #1F5FD6); color: #fff; box-shadow: 0 4px 10px -4px rgba(31, 95, 214, .6);
}
.gv-logo__mark--lg { width: 56px; height: 56px; border-radius: 16px; }
.gv-logo__text { display: flex; flex-direction: column; line-height: 1.2; }
.gv-logo__text b { font-size: 17px; font-weight: 700; color: var(--gv-title); letter-spacing: -.01em; }
.gv-logo__text small { font-size: 12px; color: var(--gv-text-3); }
.gv-nav { display: flex; gap: 2px; margin-left: 8px; }
.gv-nav a {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--gv-r-btn);
    font-size: 14px; font-weight: 500; color: var(--gv-text-2); text-decoration: none; white-space: nowrap;
}
.gv-nav a:hover { background: var(--gv-surface-2); color: var(--gv-text); }
.gv-nav a[aria-current] { background: var(--gv-primary-soft); color: var(--gv-primary); }
.gv-head__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.gv-admin-link {
    display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--gv-r-btn);
    font-size: 13.5px; font-weight: 600; color: var(--gv-danger); background: var(--gv-danger-soft); text-decoration: none;
}
.gv-account { position: relative; }
.gv-account__btn {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 999px;
    border: 1px solid var(--gv-line); background: var(--gv-surface); color: var(--gv-text); font: 500 14px var(--gv-font); cursor: pointer;
}
.gv-account__btn:hover { background: var(--gv-surface-2); }
.gv-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--gv-primary-soft); color: var(--gv-primary); font-weight: 700; font-size: 13px; text-transform: uppercase;
}
.gv-account__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; z-index: 110;
    background: var(--gv-surface); border: 1px solid var(--gv-line); border-radius: var(--gv-r-md); box-shadow: var(--gv-shadow-lg);
}
.gv-menu[hidden] { display: none; }
.gv-menu__head { padding: 10px 12px 8px; border-bottom: 1px solid var(--gv-line); margin-bottom: 4px; }
.gv-menu__head b { display: block; font-size: 14px; color: var(--gv-title); }
.gv-menu__head small { font-size: 12.5px; color: var(--gv-text-3); word-break: break-all; }
.gv-menu a, .gv-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: var(--gv-r-sm);
    background: transparent; font: 500 14px var(--gv-font); color: var(--gv-text); text-decoration: none; text-align: left; cursor: pointer;
}
.gv-menu a:hover, .gv-menu button:hover { background: var(--gv-surface-2); }
.gv-menu .is-danger { color: var(--gv-danger); }
.gv-menu-btn { display: none; }

/* Menu trên điện thoại */
.gv-drawer { position: fixed; inset: 0; z-index: 200; }
.gv-drawer[hidden] { display: none; }
.gv-drawer__backdrop { position: absolute; inset: 0; background: rgba(15, 42, 90, .35); }
.gv-drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); padding: 16px; overflow-y: auto;
    background: var(--gv-surface); box-shadow: var(--gv-shadow-lg); display: flex; flex-direction: column; gap: 4px;
}
.gv-drawer__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gv-drawer__user { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: var(--gv-r-md); background: var(--gv-surface-2); }
.gv-drawer__user b { display: block; color: var(--gv-title); }
.gv-drawer__user small { color: var(--gv-text-3); font-size: 12.5px; word-break: break-all; }
.gv-drawer a, .gv-drawer form button {
    display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border: 0; border-radius: var(--gv-r-sm);
    background: transparent; font: 500 15px var(--gv-font); color: var(--gv-text); text-decoration: none; width: 100%; text-align: left; cursor: pointer;
}
.gv-drawer a:hover, .gv-drawer form button:hover { background: var(--gv-surface-2); }
.gv-drawer a[aria-current] { background: var(--gv-primary-soft); color: var(--gv-primary); }
.gv-drawer .is-danger { color: var(--gv-danger); }
.gv-drawer hr { border: 0; border-top: 1px solid var(--gv-line); margin: 8px 0; }

/* ---------- Khối trang ---------- */
.gv-page { padding-top: 36px; padding-bottom: 72px; }
.gv-page-head { margin-bottom: 24px; }
.gv-page-head .gv-page-head__hello { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--gv-primary); }
.gv-page-head h1 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; color: var(--gv-title); }
.gv-page-head p { margin: 6px 0 0; color: var(--gv-text-2); font-size: 16px; }
.gv-section-head { margin-bottom: 18px; }
.gv-section-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--gv-title); }
.gv-section-head p { margin: 2px 0 0; font-size: 14px; color: var(--gv-text-2); }

.gv-card { background: var(--gv-surface); border: 1px solid var(--gv-line); border-radius: var(--gv-r-lg); box-shadow: var(--gv-shadow-sm); }

/* Chữ chỉ cho trình đọc màn hình */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.gv-notice {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 14px; border-radius: var(--gv-r-md);
    background: var(--gv-surface); border: 1px solid var(--gv-line); box-shadow: var(--gv-shadow-sm);
}
.gv-notice__icon { width: 40px; height: 40px; border-radius: var(--gv-r-sm); display: grid; place-items: center; flex: none; background: var(--gv-warning-soft); color: var(--gv-warning); }
.gv-notice p { flex: 1; margin: 0; font-size: 14px; color: var(--gv-text-2); }
.gv-notice p strong { color: var(--gv-text); }
.gv-notice p a { color: var(--gv-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.gv-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--gv-r-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.gv-alert[hidden] { display: none; }
.gv-alert .gv-icon { margin-top: 1px; }
.gv-alert--success { background: var(--gv-success-soft); border-color: #BFE6CD; color: #12643A; }
.gv-alert--error { background: var(--gv-danger-soft); border-color: #F6C9C9; color: #A82020; }

/* ---------- Ô nhập ---------- */
.gv-field { margin-bottom: 16px; }
.gv-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--gv-title); }
.gv-label .req { color: var(--gv-danger); }
.gv-input {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 14px; border-radius: var(--gv-r-btn);
    border: 1px solid #DDE3EC; background: #F7F9FC; color: var(--gv-text-3); transition: border-color .15s, box-shadow .15s, background .15s;
}
.gv-input input, .gv-input select {
    flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: var(--gv-text); font: 15px var(--gv-font);
}
.gv-input input::placeholder { color: var(--gv-text-3); }
.gv-input input:focus-visible, .gv-input select:focus-visible, .gv-search input:focus-visible { outline: none; }
.gv-input:focus-within { border-color: var(--gv-primary); background: #fff; box-shadow: 0 0 0 3px var(--gv-primary-ring); }
.gv-input.is-invalid { border-color: var(--gv-danger); }
.gv-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gv-text-2); cursor: pointer; }
.gv-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--gv-primary); }
.gv-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 13px; color: var(--gv-text-3); }
.gv-divider::before, .gv-divider::after { content: ''; flex: 1; height: 1px; background: #DDE3EC; }

.gv-select, .gv-search {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; border-radius: var(--gv-r-btn);
    border: 1px solid var(--gv-line-strong); background: var(--gv-surface); color: var(--gv-text-2); font: 14px var(--gv-font);
}
.gv-select { padding: 0 34px 0 14px; appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352607A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
.gv-select:hover { border-color: var(--gv-primary); }
.gv-search { flex: 1 1 220px; padding: 0 12px; color: var(--gv-text-3); }
.gv-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--gv-text); font: 14px var(--gv-font); }
.gv-search:focus-within, .gv-select:focus { border-color: var(--gv-primary); box-shadow: 0 0 0 3px var(--gv-primary-ring); outline: 0; }

.gv-segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--gv-r-btn); background: var(--gv-surface-2); flex-wrap: wrap; }
.gv-segmented a, .gv-segmented button {
    display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent;
    font: 500 14px var(--gv-font); color: var(--gv-text-2); text-decoration: none; cursor: pointer;
}
.gv-segmented a:hover, .gv-segmented button:hover { color: var(--gv-text); }
.gv-segmented .is-active { background: var(--gv-surface); color: var(--gv-text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

/* ---------- Ảnh bìa có màu theo thẻ ---------- */
.gv-cover {
    position: relative; display: grid; place-items: center; overflow: hidden;
    background: color-mix(in srgb, var(--gv-tone, var(--gv-tone-blue)) 13%, #fff);
}
.gv-cover::before {
    content: ''; position: absolute; inset: 0; opacity: .5;
    background-image: radial-gradient(color-mix(in srgb, var(--gv-tone, var(--gv-tone-blue)) 45%, transparent) 1.2px, transparent 1.3px);
    background-size: 16px 16px;
}
.gv-cover__art {
    position: relative; display: grid; place-items: center; border-radius: 22px; background: #fff;
    color: var(--gv-tone, var(--gv-tone-blue));
    box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--gv-tone, var(--gv-tone-blue)) 60%, transparent),
                0 0 0 1px color-mix(in srgb, var(--gv-tone, var(--gv-tone-blue)) 14%, transparent);
}
.gv-cover__art .gv-icon { stroke-width: 1.6; }
.gv-cover__art img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ---------- Chân trang, nút góp ý ---------- */
.gv-foot { border-top: 1px solid var(--gv-line); padding: 24px 0; text-align: center; font-size: 13.5px; color: var(--gv-text-3); background: var(--gv-surface); }
.gv-foot a { color: var(--gv-primary); font-weight: 600; text-decoration: none; }
.gv-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px;
    border: 0; border-radius: 999px; background: #FFC93C; color: #3A2A00; font: 700 14px var(--gv-font); text-decoration: none; cursor: pointer;
    box-shadow: var(--gv-shadow-lg);
}
.gv-fab:hover { background: #FFC023; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .gv-nav a span { display: none; }
    .gv-nav a { padding: 0 10px; }
}
@media (max-width: 900px) {
    .gv-account__name, .gv-admin-link span, .gv-logo__text small { display: none; }
}
@media (max-width: 720px) {
    .gv-container { padding: 0 16px; }
    .gv-head__in { gap: 8px; height: 60px; }
    .gv-nav, .gv-account, .gv-admin-link { display: none; }
    .gv-menu-btn { display: inline-grid; }
    .gv-logo__text b { font-size: 16px; }
    .gv-page { padding-top: 24px; }
    .gv-page-head h1 { font-size: 28px; }
    .gv-notice { flex-wrap: wrap; }
    .gv-notice > .gv-btn { width: 100%; }
    .gv-fab span { display: none; }
    .gv-fab { width: 52px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .gv-body *, .gv-body *::before, .gv-body *::after { transition: none !important; animation: none !important; }
}
