:root {
    --primary-light: #0072ce;
    --primary: #00529b;
    --primary-dark: #003366;
    --primary-container: #d7e9ff;
    --on-primary-container: #002f5b;
    --white: #ffffff;
    --surface: #f4f7fb;
    --text: #152236;
    --muted: #718096;
    --border: #e1e8f0;
    --danger: #c9364f;
    --success: #16805b;
    --sidebar-width: 268px;
    --sidebar-collapsed: 86px;
    --shadow: 0 20px 55px rgba(0, 47, 91, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    font-family: 'DM Sans', sans-serif;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--surface);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

svg {
    display: block;
}

/* Login */
.login-body {
    min-height: 100vh;
    background: var(--white);
}

.login-page {
    display: grid;
    grid-template-columns: minmax(380px, 46%) 1fr;
    min-height: 100vh;
}

.login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px;
    color: var(--white);
    background:
        radial-gradient(circle at 15% 12%, rgba(0, 114, 206, 0.8), transparent 32%),
        linear-gradient(145deg, var(--primary-dark) 0%, #003e78 52%, var(--primary) 100%);
}

.login-brand-panel::before,
.login-brand-panel::after {
    position: absolute;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.login-brand-panel::before {
    width: 520px;
    height: 520px;
    top: -270px;
    left: -240px;
}

.login-brand-panel::after {
    width: 430px;
    height: 430px;
    right: -240px;
    bottom: -220px;
}

.brand-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    background: rgba(255, 255, 255, 0.06);
}

.brand-orb-one {
    width: 160px;
    height: 160px;
    top: 14%;
    right: -70px;
}

.brand-orb-two {
    width: 90px;
    height: 90px;
    left: 8%;
    bottom: 16%;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 390px;
    text-align: center;
}

.login-logo {
    width: min(285px, 72%);
    aspect-ratio: 1;
    padding: 10px;
    border-radius: 24px;
    object-fit: contain;
    background: var(--white);
    box-shadow: 0 28px 65px rgba(0, 20, 50, 0.32);
    margin: auto;
}

.login-brand-content p {
    max-width: 340px;
    margin: 28px auto 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.7;
}

.brand-footer {
    position: absolute;
    bottom: 32px;
    left: 0;
    width: 100%;
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    background:
        radial-gradient(circle at 100% 0, var(--primary-container), transparent 28%),
        var(--white);
}

.login-card {
    width: min(100%, 440px);
}

.mobile-brand {
    display: none;
}

.eyebrow {
    display: inline-block;
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.login-heading h1 {
    margin: 10px 0 8px;
    color: var(--primary-dark);
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.login-heading p {
    margin: 0 0 34px;
    color: var(--muted);
    font-size: 15px;
}

.alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

.alert-error {
    color: #98273b;
    border-color: #f2c4cc;
    background: #fff2f4;
}

.alert-success {
    color: #126446;
    border-color: #bce2d2;
    background: #ecfaf4;
}

.login-form {
    display: grid;
    gap: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #344258;
    font-size: 13px;
    font-weight: 600;
}

.input-wrap {
    position: relative;
}

.input-wrap > svg {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 19px;
    height: 19px;
    fill: #8da0b6;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 48px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fbfcfe;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap input::placeholder {
    color: #a4afbf;
}

.input-wrap input:focus {
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 114, 206, 0.1);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 8px;
    color: #8da0b6;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-container);
}

.password-toggle svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    margin-top: 4px;
    color: var(--white);
    border: 0;
    border-radius: 12px;
    background: linear-gradient(105deg, var(--primary), var(--primary-light));
    box-shadow: 0 12px 24px rgba(0, 82, 155, 0.22);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    box-shadow: 0 16px 30px rgba(0, 82, 155, 0.3);
    transform: translateY(-1px);
}

.btn-login svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.login-help {
    margin: 30px 0 0;
    color: #9aa8b8;
    font-size: 12px;
    text-align: center;
}

/* Admin layout */
.admin-body {
    min-height: 100vh;
}

.admin-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    color: var(--white);
    background:
        radial-gradient(circle at 0 0, rgba(0, 114, 206, 0.5), transparent 27%),
        linear-gradient(180deg, #003b70 0%, var(--primary-dark) 100%);
    box-shadow: 8px 0 30px rgba(0, 39, 76, 0.12);
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    background: var(--white);
    padding: 2px;
}

.sidebar-brand-text,
.sidebar-user-info {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 17px;
}

.sidebar-brand-text span {
    color: #86cef9;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 22px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}

.nav-label {
    display: block;
    margin: 0 10px 10px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

.nav-label-space {
    margin-top: 22px;
    padding-top: 4px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 46px;
    margin-bottom: 6px;
    padding: 0 13px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.nav-item svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-item span {
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover:not(.disabled),
.nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

.nav-item.active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -12px;
    width: 3px;
    content: '';
    border-radius: 0 3px 3px 0;
    background: #48b9ff;
}

.nav-item.disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.nav-item small {
    margin-left: auto;
    padding: 3px 6px;
    color: #a9ddff;
    border-radius: 5px;
    background: rgba(0, 114, 206, 0.25);
    font-size: 9px;
    text-transform: uppercase;
}

.nav-group {
    margin-bottom: 6px;
}

.nav-group-toggle {
    width: 100%;
    margin-bottom: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nav-group-chevron {
    margin-left: auto !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 0.75;
    transition: transform 0.2s;
}

.nav-group.open .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 6px 18px;
}

.nav-group.open .nav-submenu {
    display: flex;
}

.nav-subitem {
    display: block;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-subitem:hover,
.nav-subitem.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.08);
}

.user-avatar {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    overflow: hidden;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    place-items: center;
    background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(0, 47, 91, 0.18);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-info strong {
    display: block;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

.logout-icon {
    width: 32px;
    height: 32px;
    padding: 7px;
    color: rgba(255, 255, 255, 0.6);
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.logout-icon:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.logout-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.admin-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    min-height: 82px;
    padding: 12px 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.sidebar-toggle {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-right: 16px;
    padding: 10px;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    place-items: center;
}

.sidebar-toggle:hover {
    border-color: #b8d5ed;
    background: var(--primary-container);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.topbar-title {
    flex: 1;
}

.topbar-title h1 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1.25;
}

.topbar-title span {
    color: var(--muted);
    font-size: 11px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user > div strong,
.topbar-user > div span {
    display: block;
}

.topbar-user > div strong {
    font-size: 12px;
}

.topbar-user > div span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.admin-content {
    flex: 1;
    padding: 28px 30px;
}

.welcome-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    min-height: 190px;
    padding: 36px 40px;
    color: var(--white);
    border-radius: 18px;
    background:
        radial-gradient(circle at 85% 15%, rgba(67, 188, 255, 0.6), transparent 25%),
        linear-gradient(115deg, var(--primary-dark), var(--primary));
    box-shadow: var(--shadow);
}

.welcome-banner::after {
    position: absolute;
    right: -85px;
    bottom: -180px;
    width: 390px;
    height: 390px;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.welcome-banner > div:first-child {
    position: relative;
    z-index: 2;
}

.welcome-banner .eyebrow {
    color: #86cef9;
}

.welcome-banner h2 {
    margin: 9px 0;
    font-size: 27px;
}

.welcome-banner p {
    max-width: 570px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.6;
}

.welcome-mark {
    position: relative;
    z-index: 1;
    margin-right: 35px;
    color: rgba(255, 255, 255, 0.12);
    font-size: 90px;
    font-weight: 700;
    letter-spacing: -0.09em;
}

.empty-dashboard {
    margin-top: 24px;
    padding: 58px 30px;
    border: 1px dashed #cbd9e7;
    border-radius: 16px;
    background: var(--white);
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    color: var(--primary);
    border-radius: 14px;
    background: var(--primary-container);
    place-items: center;
}

.empty-icon svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.empty-dashboard h3 {
    margin: 0 0 7px;
    color: var(--primary-dark);
    font-size: 17px;
}

.empty-dashboard p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* Dashboard reports and analytics */
.dashboard-section {
    margin-top: 26px;
}

.dashboard-section-heading,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-section-heading {
    margin-bottom: 14px;
}

.dashboard-section-heading h3,
.panel-heading h3 {
    margin: 4px 0 0;
    color: var(--primary-dark);
    font-size: 17px;
}

.dashboard-updated {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.analytics-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--white);
    box-shadow: 0 7px 20px rgba(0, 51, 102, 0.05);
}

.analytics-icon {
    display: grid;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    place-items: center;
}

.analytics-icon svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.analytics-card > div {
    min-width: 0;
}

.analytics-card > div > span,
.analytics-card small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-card strong {
    display: block;
    margin: 4px 0 2px;
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.analytics-card.blue .analytics-icon {
    color: #0564b8;
    background: #e7f3ff;
}

.analytics-card.green .analytics-icon {
    color: #16835b;
    background: #e4f8ef;
}

.analytics-card.purple .analytics-icon {
    color: #7153b6;
    background: #f0ebff;
}

.analytics-card.orange .analytics-icon {
    color: #bd6715;
    background: #fff0df;
}

.analytics-card.teal .analytics-icon {
    color: #087d86;
    background: #dff7f7;
}

.static-label {
    display: inline-flex !important;
    width: fit-content;
    padding: 2px 7px;
    color: #7153b6 !important;
    border-radius: 999px;
    background: #f0ebff;
    font-size: 8px !important;
    font-style: normal;
    font-weight: 700 !important;
    text-transform: uppercase;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.dashboard-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 7px 20px rgba(0, 51, 102, 0.05);
}

.panel-heading {
    padding-bottom: 16px;
    border-bottom: 1px solid #edf1f5;
}

.panel-heading a {
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.user-report-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 210px;
    padding: 20px 8px 4px;
}

.report-ring {
    display: grid;
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-light) var(--progress), #e9f0f6 0);
    place-items: center;
}

.report-ring::before {
    width: 104px;
    height: 104px;
    content: '';
    border-radius: 50%;
    background: #fff;
}

.report-ring span {
    position: absolute;
    color: var(--primary-dark);
    font-size: 23px;
    font-weight: 700;
}

.report-legend {
    flex: 1;
}

.report-legend > div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    color: var(--muted);
    border-bottom: 1px solid #edf1f5;
    font-size: 11px;
}

.report-legend > div:last-child {
    border-bottom: 0;
}

.report-legend strong {
    color: var(--primary-dark);
    font-size: 13px;
}

.report-legend small {
    color: #8e72cc;
    font-size: 8px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.active {
    background: var(--primary-light);
}

.legend-dot.inactive {
    background: #c8d4df;
}

.legend-dot.premium {
    background: #8e72cc;
}

.content-report-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 18px;
}

.content-report-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 59px;
    padding: 13px 15px;
    color: var(--muted);
    border: 1px solid #e7edf3;
    border-radius: 11px;
    background: #f9fbfd;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.content-report-list a:hover {
    border-color: #b9d3ea;
    background: #f0f7fd;
}

.content-report-list strong {
    color: var(--primary);
    font-size: 18px;
}

.report-bars {
    display: grid;
    gap: 21px;
    padding-top: 25px;
}

.report-bars > div > span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.report-bars b,
.report-bars em {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
}

.report-bars b {
    color: var(--primary-dark);
    font-weight: 600;
}

.report-bars i {
    display: block;
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: #e9f0f6;
}

.report-bars u {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    text-decoration: none;
}

.recent-user-list {
    padding-top: 8px;
}

.recent-user {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f5;
}

.recent-user:last-child {
    border-bottom: 0;
}

.recent-user-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    color: var(--primary);
    border-radius: 11px;
    background: var(--primary-container);
    font-size: 13px;
    font-weight: 700;
    place-items: center;
}

.recent-user > div {
    min-width: 0;
}

.recent-user strong,
.recent-user > div span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-user strong {
    color: var(--primary-dark);
    font-size: 11px;
}

.recent-user > div span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.mini-status {
    padding: 4px 8px;
    color: #9b4a4a;
    border-radius: 999px;
    background: #fdecec;
    font-size: 8px;
    font-weight: 700;
}

.mini-status.active {
    color: #17704f;
    background: #e5f7ef;
}

.dashboard-empty {
    padding: 35px 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.admin-footer {
    display: flex;
    justify-content: space-between;
    padding: 16px 30px;
    color: #8b9aab;
    border-top: 1px solid var(--border);
    background: var(--white);
    font-size: 10px;
}

.admin-shell.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

.admin-shell.sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed);
}

.admin-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 10px;
}

.admin-shell.sidebar-collapsed .sidebar-brand-text,
.admin-shell.sidebar-collapsed .nav-label,
.admin-shell.sidebar-collapsed .nav-item span,
.admin-shell.sidebar-collapsed .nav-item small,
.admin-shell.sidebar-collapsed .nav-group-chevron,
.admin-shell.sidebar-collapsed .nav-submenu,
.admin-shell.sidebar-collapsed .sidebar-user-info,
.admin-shell.sidebar-collapsed .sidebar-user form {
    display: none;
}

.admin-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0;
}

.admin-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: minmax(310px, 42%) 1fr;
    }

    .login-brand-panel,
    .login-form-panel {
        padding: 36px;
    }

    .welcome-mark {
        display: none;
    }
}

@media (max-width: 720px) {
    .login-page {
        display: block;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 34px 24px;
    }

    .mobile-brand {
        display: block;
        margin-bottom: 26px;
    }

    .mobile-brand img {
        width: 76px;
        height: 76px;
        object-fit: contain;
        border: 1px solid var(--primary-container);
        border-radius: 16px;
        background: var(--white);
        box-shadow: 0 10px 25px rgba(0, 82, 155, 0.14);
        padding: 4px;
    }

    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .admin-main,
    .admin-shell.sidebar-collapsed .admin-main {
        margin-left: 0;
    }

    .admin-shell.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .admin-shell.sidebar-mobile-open .sidebar-overlay {
        position: fixed;
        z-index: 30;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(0, 32, 61, 0.5);
        backdrop-filter: blur(2px);
    }

    .admin-shell.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    .admin-shell.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding-inline: 20px;
    }

    .admin-shell.sidebar-collapsed .sidebar-brand-text,
    .admin-shell.sidebar-collapsed .nav-label,
    .admin-shell.sidebar-collapsed .nav-item span,
    .admin-shell.sidebar-collapsed .nav-item small,
    .admin-shell.sidebar-collapsed .nav-group-chevron,
    .admin-shell.sidebar-collapsed .sidebar-user-info,
    .admin-shell.sidebar-collapsed .sidebar-user form {
        display: block;
    }

    .admin-shell.sidebar-collapsed .nav-group.open .nav-submenu {
        display: flex;
    }

    .admin-shell.sidebar-collapsed .nav-item,
    .admin-shell.sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
    }

    .topbar {
        min-height: 72px;
        padding: 10px 18px;
    }

    .topbar-user > div {
        display: none;
    }

    .admin-content {
        padding: 20px 18px;
    }

    .welcome-banner {
        min-height: 180px;
        padding: 28px 24px;
    }

    .welcome-banner h2 {
        font-size: 23px;
    }

    .admin-footer {
        padding-inline: 18px;
    }
}

/* Video management */
.video-table {
    min-width: 950px;
}

.video-form-card {
    max-width: 900px;
}

.video-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
}

.video-name-cell strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-name-cell > span:last-child {
    min-width: 0;
}

.video-name-cell small {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-file-icon {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: var(--primary);
    border-radius: 9px;
    background: var(--primary-container);
    place-items: center;
}

.video-file-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.badge-paid {
    color: #7a4210;
    background: #fff1dc;
}

.badge-info {
    color: var(--primary-dark);
    background: var(--primary-container);
}

.video-play-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.video-player {
    height: auto;
    min-height: 320px;
    max-height: 62vh;
    border-radius: 12px;
}

.video-play-description {
    margin: 5px 0 14px;
    color: var(--muted);
    line-height: 1.6;
}

.icon-btn.play {
    color: #126446;
    border-color: #bce2d2;
    background: #ecfaf4;
}

.icon-btn.play:hover {
    background: #dff6eb;
}

.access-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
}

.access-type-card {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
    cursor: pointer;
}

.access-type-card:has(input:checked) {
    border-color: var(--primary-light);
    background: #eef7ff;
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.09);
}

.access-type-card input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.access-type-card span,
.access-type-card strong,
.access-type-card small {
    display: block;
}

.access-type-card strong {
    color: var(--primary-dark);
    font-size: 14px;
}

.access-type-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.video-upload-box {
    position: relative;
    display: grid;
    overflow: hidden;
    width: min(100%, 680px);
    min-height: 320px;
    color: var(--muted);
    border: 1.5px dashed #aac8e2;
    border-radius: 14px;
    background: #f7fbff;
    cursor: pointer;
    place-items: center;
    transition: border-color 0.2s, background 0.2s;
}

.video-upload-box:hover {
    border-color: var(--primary-light);
    background: #eef7ff;
}

.video-upload-box > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.video-preview {
    width: 100%;
    height: 320px;
    background: #00172c;
    object-fit: contain;
}

.video-upload-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 25px;
    text-align: center;
}

.video-upload-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    fill: var(--primary);
}

.video-upload-placeholder strong {
    color: var(--primary-dark);
    font-size: 14px;
}

.video-upload-placeholder small,
.selected-video-name {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.selected-video-name {
    display: block;
    max-width: 680px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

@media (max-width: 620px) {
    .access-type-options {
        grid-template-columns: 1fr;
    }

    .video-upload-box {
        min-height: 220px;
    }

    .video-preview {
        height: 220px;
    }
}

/* Registered app users */
.app-users-table {
    min-width: 880px;
}

.cell-user-copy {
    min-width: 0;
}

.cell-user-copy strong,
.cell-user-copy span {
    display: block;
}

.cell-user-copy span {
    max-width: 220px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-photo {
    object-fit: cover;
    object-position: center;
}

.status-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 82px;
    min-height: 30px;
    padding: 0 10px;
    color: #6b7c90;
    border: 1px solid #d9e1e9;
    border-radius: 999px;
    background: #f3f6f8;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.status-switch-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #98a6b5;
    box-shadow: 0 0 0 3px rgba(152, 166, 181, 0.14);
}

.status-switch.active {
    color: #126446;
    border-color: #bce2d2;
    background: #ecfaf4;
}

.status-switch.active .status-switch-dot {
    background: #1ba672;
    box-shadow: 0 0 0 3px rgba(27, 166, 114, 0.14);
}

.detail-page-actions {
    margin-bottom: 18px;
}

.user-detail-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 12px 35px rgba(0, 47, 91, 0.06);
}

.user-detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 32px;
    color: var(--white);
    background:
        radial-gradient(circle at 90% 0, rgba(67, 188, 255, 0.55), transparent 25%),
        linear-gradient(115deg, var(--primary-dark), var(--primary));
}

.user-detail-avatar {
    display: grid;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    color: var(--primary-dark);
    border: 3px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    place-items: center;
    background: var(--primary-container);
    box-shadow: 0 8px 25px rgba(0, 20, 50, 0.24);
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
}

.user-detail-header h2 {
    margin: 0;
    font-size: 23px;
}

.user-detail-header p {
    margin: 4px 0 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.user-detail-header .badge-success {
    color: #d5fff0;
    background: rgba(31, 192, 132, 0.24);
}

.user-detail-header .badge-muted {
    color: #e2e8ef;
    background: rgba(255, 255, 255, 0.14);
}

.detail-section {
    padding: 30px 32px 34px;
}

.detail-section-title {
    margin-bottom: 24px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.detail-section-title h3 {
    margin: 0 0 4px;
    color: var(--primary-dark);
    font-size: 17px;
}

.detail-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

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

.detail-item {
    min-width: 0;
}

.detail-item > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-item > strong {
    display: block;
    overflow-wrap: anywhere;
    color: #26364b;
    font-size: 14px;
    font-weight: 600;
}

.detail-item-full {
    grid-column: 1 / -1;
}

.course-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.course-tags span {
    padding: 7px 11px;
    color: var(--on-primary-container);
    border: 1px solid #bad8f3;
    border-radius: 8px;
    background: var(--primary-container);
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 620px) {
    .user-detail-header,
    .detail-section {
        padding: 24px 20px;
    }

    .user-detail-avatar {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        font-size: 22px;
    }

    .user-detail-header h2 {
        font-size: 19px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .detail-item-full {
        grid-column: auto;
    }
}

/* Categories */
.hidden {
    display: none !important;
}

.category-table {
    min-width: 900px;
}

.topic-table {
    min-width: 980px;
}

.badge-primary {
    color: var(--on-primary-container);
    background: var(--primary-container);
}

.category-thumb {
    display: block;
    width: 58px;
    height: 46px;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.table-description {
    display: block;
    max-width: 360px;
    color: #596b80;
    line-height: 1.5;
}

.admin-form .form-group-full {
    grid-column: 1 / -1;
}

.admin-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 13px 14px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
    resize: vertical;
}

.admin-form .form-select {
    width: 100%;
    height: 46px;
    padding: 0 38px 0 14px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
}

.admin-form textarea:focus,
.admin-form .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.12);
}

.image-upload-box {
    position: relative;
    display: grid;
    overflow: hidden;
    width: min(100%, 420px);
    min-height: 230px;
    color: var(--muted);
    border: 1.5px dashed #aac8e2;
    border-radius: 14px;
    background: #f7fbff;
    cursor: pointer;
    place-items: center;
    transition: border-color 0.2s, background 0.2s;
}

.image-upload-box:hover {
    border-color: var(--primary-light);
    background: #eef7ff;
}

.image-upload-box > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.image-preview {
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: center;
}

.image-upload-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 25px;
    text-align: center;
}

.image-upload-placeholder svg {
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    fill: var(--primary);
}

.image-upload-placeholder strong {
    color: var(--primary-dark);
    font-size: 14px;
}

.image-upload-placeholder small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

@media (max-width: 720px) {
    .image-upload-box {
        width: 100%;
        min-height: 200px;
    }

    .image-preview {
        height: 200px;
    }
}

@media (max-width: 420px) {
    .login-heading h1 {
        font-size: 32px;
    }

    .topbar-title span {
        display: none;
    }

    .admin-footer span:last-child {
        display: none;
    }
}

/* Shared alerts in admin pages */
.admin-content .alert {
    margin-bottom: 18px;
}

/* Page toolbar / filters */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.search-wrap {
    position: relative;
    min-width: min(100%, 260px);
    flex: 1;
    max-width: 320px;
}

.search-wrap svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    fill: #8da0b6;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    outline: none;
}

.search-wrap input:focus,
.filter-select:focus,
.admin-form input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.12);
}

.filter-select {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-primary {
    color: var(--white);
    background: linear-gradient(105deg, var(--primary), var(--primary-light));
    box-shadow: 0 8px 18px rgba(0, 82, 155, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 10px 22px rgba(0, 82, 155, 0.28);
}

.btn-secondary {
    color: var(--primary);
    border-color: #b8d5ed;
    background: var(--primary-container);
}

.btn-secondary:hover {
    background: #c9e2ff;
}

.btn-ghost {
    color: var(--muted);
    border-color: var(--border);
    background: var(--white);
}

.btn-ghost:hover {
    color: var(--primary-dark);
    border-color: #b8d5ed;
}

/* Data table */
.table-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 47, 91, 0.05);
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}

.data-table th {
    color: #6b7c90;
    background: #f7fafc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.reorder-hint {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #5c6f86;
    font-size: 13px;
}

.reorder-hint.is-saved {
    color: #126446;
}

.reorder-hint.is-error {
    color: #b42318;
}

.drag-col,
.drag-cell {
    width: 44px;
    padding-right: 0 !important;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8aa0b8;
    cursor: grab;
    touch-action: none;
}

.drag-handle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.drag-handle:hover {
    background: #eef4fb;
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

.data-table tbody tr.is-dragging {
    opacity: 0.55;
    background: #eef5fc;
    pointer-events: none;
}

.text-right {
    text-align: right !important;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar.sm {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    color: #126446;
    background: #ecfaf4;
}

.badge-muted {
    color: #6b7c90;
    background: #eef2f6;
}

.action-btns {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.icon-btn {
    display: grid;
    width: 34px;
    height: 34px;
    color: var(--primary);
    border: 1px solid #d7e4f0;
    border-radius: 8px;
    background: #f5f9fd;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--primary-container);
}

.icon-btn.danger {
    color: var(--danger);
    border-color: #f2c4cc;
    background: #fff5f7;
}

.icon-btn.danger:hover {
    background: #ffe8ec;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.empty-row {
    padding: 0 !important;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 16px;
}

.empty-state p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}

.table-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.table-footer-pagination {
    margin-left: auto;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    display: grid;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-container);
}

.page-btn.active {
    color: var(--white);
    border-color: var(--primary);
    background: var(--primary);
}

.page-btn.disabled {
    color: #a8b4c2;
    cursor: default;
    opacity: 0.7;
}

/* Forms */
.form-card {
    max-width: 760px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 47, 91, 0.05);
}

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

.admin-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form .form-group:last-child {
    grid-column: 1 / -1;
}

.admin-form label {
    color: #344258;
    font-size: 13px;
    font-weight: 600;
}

.admin-form label small {
    margin-left: 6px;
    color: var(--muted);
    font-weight: 500;
}

.admin-form input[type='text'],
.admin-form input[type='email'],
.admin-form input[type='tel'],
.admin-form input[type='password'],
.admin-form input[type='number'],
.admin-form input[type='datetime-local'] {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
    color: var(--text);
    outline: none;
}

.number-field-box {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 220px;
    height: 46px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.number-field-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.12);
}

.number-field-box input[type='number'] {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
}

.number-field-box input[type='number']:focus {
    border: 0;
    box-shadow: none;
}

.number-field-box input[type='number']::-webkit-outer-spin-button,
.number-field-box input[type='number']::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.number-field-unit {
    display: grid;
    min-width: 58px;
    padding: 0 12px;
    color: var(--primary);
    border-left: 1px solid var(--border);
    background: #eef5fb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    place-items: center;
    text-transform: lowercase;
}

.admin-password-wrap {
    position: relative;
}

.admin-password-wrap input {
    width: 100%;
    padding-right: 50px !important;
}

.admin-password-wrap .password-toggle {
    right: 6px;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 500 !important;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.module-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 4px;
}

.module-checkbox-grid .checkbox-label {
    margin-top: 0;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .page-toolbar {
        align-items: stretch;
    }

    .filter-bar {
        width: 100%;
    }

    .search-wrap {
        max-width: none;
        min-width: 0;
    }

    .page-toolbar .btn-primary {
        width: 100%;
    }

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

    .form-card {
        padding: 20px;
    }

    .table-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .table-footer-pagination {
        margin-left: auto;
    }
}

/* Study materials */
.study-material-table {
    min-width: 980px;
}

.study-material-form-card {
    max-width: 900px;
}

.material-file-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Job alert banners */
.job-alert-table {
    min-width: 1050px;
}

.job-alert-form-card {
    max-width: 900px;
}

.job-alert-thumb {
    width: 120px;
    height: 62px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f4f8fc;
    object-fit: cover;
}

.job-alert-upload-box {
    width: min(100%, 720px);
    min-height: 260px;
}

.job-alert-preview {
    width: 100%;
    height: 260px;
    object-fit: contain;
}

.section-label {
    margin-bottom: 0;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 700;
}

.form-file {
    display: block;
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

/* Test management */
.test-table {
    min-width: 1050px;
}

.import-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 230px;
    padding: 28px 22px;
    border: 1.5px dashed #aac8e2;
    border-radius: 16px;
    background: linear-gradient(180deg, #f3f9ff 0%, #f8fbfe 100%);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.import-dropzone:hover,
.import-dropzone.is-dragover {
    border-color: var(--primary-light);
    background: #eef6ff;
    box-shadow: 0 12px 28px rgba(0, 82, 155, 0.08);
}

.import-dropzone.has-file {
    min-height: 0;
    padding: 16px;
    border-style: solid;
    border-color: #c5ddf3;
    background: #fff;
    cursor: default;
}

.import-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.import-dropzone-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.import-dropzone-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 82, 155, 0.1);
    place-items: center;
}

.import-dropzone-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--primary);
}

.import-dropzone-empty strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.import-dropzone-empty small {
    color: var(--muted);
    font-size: 13px;
}

.import-file-types {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.import-file-types span,
.import-file-mark {
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.import-dropzone-file {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.import-file-mark {
    display: grid;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-container);
    place-items: center;
}

.import-file-meta {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.import-file-meta strong,
.import-file-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-file-meta strong {
    color: var(--text);
    font-size: 14px;
}

.import-file-meta small {
    color: var(--muted);
    font-size: 12px;
}

.import-file-remove {
    border: 0;
    border-radius: 10px;
    background: #fdecef;
    color: var(--danger);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
}

.import-file-remove:hover {
    background: #f8d5dc;
}

.import-guide {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.import-guide h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.import-guide ul {
    margin: 0;
    padding-left: 18px;
    color: #526277;
    line-height: 1.7;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.test-form-card {
    max-width: 980px;
}

.test-questions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.test-questions-header .badge {
    margin-right: 6px;
}

.test-questions-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.attached-question-list {
    display: grid;
    gap: 12px;
}

.pool-question-list {
    display: grid;
    gap: 12px;
    max-height: calc((72px + 12px) * 5 - 12px);
    overflow-y: auto;
    padding-right: 6px;
    overscroll-behavior: contain;
}

.pool-question-list::-webkit-scrollbar {
    width: 6px;
}

.pool-question-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c5d4e4;
}

.attached-question,
.pool-question-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fbfd;
}

.pool-question-item {
    min-height: 72px;
    box-sizing: border-box;
}

.attached-question-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.attached-question p {
    margin: 0 0 10px;
    color: var(--primary-dark);
    font-size: 13px;
    line-height: 1.5;
}

.answer-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.answer-preview {
    padding: 4px 8px;
    color: var(--muted);
    border-radius: 999px;
    background: #eef3f8;
    font-size: 10px;
    font-weight: 600;
}

.answer-preview.correct {
    color: #17704f;
    background: #e5f7ef;
}

.pool-question-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.pool-question-item input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.pool-question-item strong,
.pool-question-item small {
    display: block;
}

.pool-question-item strong {
    color: var(--primary-dark);
    font-size: 12px;
}

.pool-question-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.pool-search-bar {
    margin-bottom: 14px;
    flex: none;
}

.pool-search-bar .search-wrap {
    max-width: none;
}

.daily-intro {
    flex: 1 1 100%;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.daily-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
}

.daily-flow-arrow {
    display: grid;
    place-items: center;
    color: #9db0c3;
    font-size: 22px;
    font-weight: 700;
}

.daily-flow-card {
    display: flex;
    flex-direction: column;
    min-height: 168px;
    padding: 18px 18px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 8px 22px rgba(0, 51, 102, 0.05);
}

.daily-flow-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.daily-flow-label {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.daily-flow-top small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.daily-flow-card p {
    margin: 0;
    color: var(--primary-dark);
    font-size: 14px;
    line-height: 1.55;
}

.daily-flow-empty {
    color: var(--muted) !important;
}

.daily-flow-card.is-past {
    background: #f7f9fb;
}

.daily-flow-card.is-past .daily-flow-label {
    color: #5d6f82;
    background: #e8eef4;
}

.daily-flow-card.is-today {
    border-color: #b7e4cf;
    background: linear-gradient(180deg, #f3fbf7 0%, #ffffff 48%);
    box-shadow: 0 10px 28px rgba(22, 131, 91, 0.12);
}

.daily-flow-card.is-today .daily-flow-label {
    color: #126446;
    background: #ecfaf4;
}

.daily-flow-card.is-next .daily-flow-label {
    color: #0564b8;
    background: #e7f3ff;
}

.daily-later-card {
    padding: 22px 24px 18px;
}

.daily-later-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.daily-later-head h3 {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 18px;
}

.daily-later-head p {
    margin: 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.daily-later-list {
    display: grid;
    gap: 10px;
}

.daily-later-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e7edf3;
    border-radius: 12px;
    background: #f9fbfd;
}

.daily-later-day {
    display: inline-flex;
    justify-content: center;
    min-width: 84px;
    padding: 6px 10px;
    color: #0564b8;
    border-radius: 999px;
    background: #e7f3ff;
    font-size: 11px;
    font-weight: 800;
}

.daily-later-item p {
    margin: 0;
    color: var(--primary-dark);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .daily-flow {
        grid-template-columns: 1fr;
    }

    .daily-flow-arrow {
        transform: rotate(90deg);
        min-height: 18px;
    }

    .daily-later-head {
        flex-direction: column;
    }

    .daily-later-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.answer-list {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

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

.answer-correct {
    white-space: nowrap;
}

.solution-editor {
    min-height: 180px;
    background: #fff;
    border-radius: 0 0 10px 10px;
}

.solution-editor .ql-editor {
    min-height: 160px;
    font-family: inherit;
}

.ql-toolbar.ql-snow {
    border-color: var(--border);
    border-radius: 10px 10px 0 0;
}

.ql-container.ql-snow {
    border-color: var(--border);
}

@media (max-width: 900px) {
    .test-questions-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1180px) {
    .analytics-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .analytics-cards,
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-panel {
        padding: 18px;
    }
}

@media (max-width: 620px) {
    .analytics-cards,
    .dashboard-grid,
    .content-report-list {
        grid-template-columns: 1fr;
    }

    .dashboard-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-card {
        padding: 15px;
    }

    .user-report-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .report-ring {
        margin: 0 auto;
    }
}

/* Public legal pages */
.public-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.public-header {
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 4px 20px rgba(0, 47, 91, 0.15);
}

.public-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

.public-brand img {
    height: 40px;
    width: auto;
}

.public-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.public-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.legal-page {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px 48px;
}

.legal-page-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--primary-container);
}

.legal-page-header h1 {
    margin: 0 0 16px;
    font-size: 1.75rem;
    color: var(--primary-dark);
    line-height: 1.3;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-meta p {
    margin: 0;
}

.legal-intro {
    margin-bottom: 32px;
    line-height: 1.7;
}

.legal-intro p:last-child {
    margin-bottom: 0;
}

.legal-section {
    margin-bottom: 32px;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    margin: 0 0 14px;
    font-size: 1.25rem;
    color: var(--primary);
}

.legal-section h3 {
    margin: 20px 0 10px;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.legal-section p {
    margin: 0 0 12px;
    line-height: 1.7;
}

.legal-section ul {
    margin: 0 0 14px;
    padding-left: 24px;
    line-height: 1.7;
}

.legal-section li {
    margin-bottom: 6px;
}

.legal-section a {
    color: var(--primary-light);
    text-decoration: none;
}

.course-section {
    margin-top: 18px;
}

.course-section[hidden] {
    display: none;
}

.course-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.course-section-head h3 {
    margin: 4px 0 0;
}

.legal-section a:hover {
    text-decoration: underline;
}

.legal-contact {
    background: var(--primary-container);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 16px 0;
}

.legal-contact p {
    margin: 0 0 8px;
}

.legal-contact p:last-child {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .legal-page {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .legal-page-header h1 {
        font-size: 1.4rem;
    }

    .public-main {
        padding: 20px 16px 32px;
    }
}

