/**
 * ==========================================================
 * ABSENSIKU v1.0
 * Base Application Styles
 * File : assets/css/app.css
 * ==========================================================
 */

:root {
    --font-sans:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --color-background: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;

    --color-text: #111827;
    --color-text-soft: #64748b;
    --color-border: #e5e7eb;

    --color-primary: #111827;
    --color-primary-soft: #eef2ff;

    --color-success: #15803d;
    --color-success-soft: #f0fdf4;

    --color-danger: #b91c1c;
    --color-danger-soft: #fef2f2;

    --color-warning: #a16207;
    --color-warning-soft: #fffbeb;

    --color-info: #1d4ed8;
    --color-info-soft: #eff6ff;

    --sidebar-width: 272px;
    --navbar-height: 72px;

    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 18px;

    --shadow-small:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow-medium:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --transition:
        180ms ease;
}

/*
|--------------------------------------------------------------------------
| Reset
|--------------------------------------------------------------------------
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Application Shell
|--------------------------------------------------------------------------
*/

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

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 32px;
}

.page-container {
    width: min(100%, 1440px);
    margin: 0 auto;
}

/*
|--------------------------------------------------------------------------
| Sidebar
|--------------------------------------------------------------------------
*/

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--color-primary);
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    min-height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand__link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand__mark,
.guest-brand__mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #ffffff;
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 800;
}

.sidebar-brand__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand__text strong {
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.sidebar-brand__text small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.73rem;
}

.sidebar-navigation {
    flex: 1;
    overflow-y: auto;
    padding: 24px 14px;
}

.sidebar-navigation__title {
    display: block;
    margin: 0 10px 10px;
    color: rgba(255, 255, 255, 0.44);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-menu {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    list-style: none;
}

.sidebar-menu__link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition:
        background var(--transition),
        color var(--transition);
}

.sidebar-menu__link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-menu__link.is-active {
    background: #ffffff;
    color: var(--color-primary);
}

.sidebar-menu__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 800;
}

.sidebar-menu__link.is-active .sidebar-menu__icon {
    background: var(--color-primary-soft);
}

.sidebar-menu__label {
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user__identity {
    min-width: 0;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.sidebar-user__identity strong,
.sidebar-user__identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user__identity strong {
    font-size: 0.84rem;
}

.sidebar-user__identity span {
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.73rem;
}

.sidebar-logout {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.08);
}

/*
|--------------------------------------------------------------------------
| Navbar
|--------------------------------------------------------------------------
*/

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(18px);
}

.app-navbar__left,
.app-navbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}

.sidebar-toggle {
    display: none;
    align-content: center;
    gap: 4px;
}

.sidebar-toggle span {
    width: 17px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: var(--color-text);
}

.navbar-context {
    display: flex;
    flex-direction: column;
}

.navbar-context__label {
    color: var(--color-text-soft);
    font-size: 0.83rem;
    font-weight: 600;
}

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

.navbar-user__avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 800;
}

.navbar-user__identity {
    display: flex;
    flex-direction: column;
}

.navbar-user__identity strong {
    font-size: 0.84rem;
}

.navbar-user__identity small {
    color: var(--color-text-soft);
    font-size: 0.72rem;
    text-transform: capitalize;
}

/*
|--------------------------------------------------------------------------
| Page
|--------------------------------------------------------------------------
*/

.page-header {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.page-title {
    margin: 0;
    font-size: clamp(1.65rem, 2vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.page-subtitle {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--color-text-soft);
    font-size: 0.93rem;
}

.page-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-content {
    min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Card
|--------------------------------------------------------------------------
*/

.card {
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.card__title {
    margin: 0;
    font-size: 1rem;
}

.card__description {
    margin: 6px 0 0;
    color: var(--color-text-soft);
    font-size: 0.86rem;
}

/*
|--------------------------------------------------------------------------
| Flash
|--------------------------------------------------------------------------
*/

.flash-stack {
    margin-bottom: 22px;
    display: grid;
    gap: 10px;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid;
    border-radius: var(--radius-medium);
}

.flash-message--success {
    border-color: #bbf7d0;
    background: var(--color-success-soft);
    color: var(--color-success);
}

.flash-message--error {
    border-color: #fecaca;
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.flash-message--warning {
    border-color: #fde68a;
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.flash-message--info {
    border-color: #bfdbfe;
    background: var(--color-info-soft);
    color: var(--color-info);
}

.flash-message__title {
    display: block;
    margin-bottom: 2px;
    font-size: 0.84rem;
}

.flash-message__text {
    margin: 0;
    font-size: 0.82rem;
}

.flash-message__close {
    border: 0;
    background: transparent;
    color: currentColor;
    font-size: 1.25rem;
    line-height: 1;
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.app-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.app-footer__content {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 32px;
    color: var(--color-text-soft);
    font-size: 0.76rem;
}

/*
|--------------------------------------------------------------------------
| Guest Layout
|--------------------------------------------------------------------------
*/

.layout-guest {
    background:
        radial-gradient(
            circle at top left,
            rgba(99, 102, 241, 0.08),
            transparent 36%
        ),
        var(--color-background);
}

.guest-layout {
    width: min(100% - 32px, 460px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 0 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.guest-layout__brand {
    margin-bottom: 28px;
}

.guest-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.guest-brand__content {
    display: flex;
    flex-direction: column;
}

.guest-brand__content strong {
    letter-spacing: 0.04em;
}

.guest-brand__content small {
    color: var(--color-text-soft);
    font-size: 0.72rem;
}

.guest-layout__content {
    width: 100%;
}

.guest-footer {
    margin-top: 24px;
    color: var(--color-text-soft);
    font-size: 0.74rem;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Overlay
|--------------------------------------------------------------------------
*/

.app-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-grid;
    }

    .app-content {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .app-navbar {
        min-height: 64px;
        padding: 10px 16px;
    }

    .app-content {
        padding: 20px 16px;
    }

    .navbar-user__identity {
        display: none;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .page-actions {
        width: 100%;
    }

    .app-footer__content {
        padding: 14px 16px;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        text-align: center;
    }

    .guest-layout {
        padding-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/*
|--------------------------------------------------------------------------
| Core Integration Test
|--------------------------------------------------------------------------
*/

.test-dashboard-grid {
    display: grid;
    gap: 22px;
}

.test-login-card {
    padding: 30px;
}

.test-heading {
    margin-bottom: 26px;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-info);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.test-title,
.test-welcome-title {
    margin: 14px 0 0;
    color: var(--color-text);
    letter-spacing: -0.035em;
}

.test-title {
    font-size: 1.7rem;
}

.test-welcome-title {
    font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.test-description {
    margin: 8px 0 0;
    color: var(--color-text-soft);
    font-size: 0.88rem;
}

.test-account-list {
    display: grid;
    gap: 10px;
}

.test-account {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: var(--color-surface);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.test-account:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.test-account__avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 0.73rem;
    font-weight: 800;
}

.test-account__content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.test-account__content strong {
    font-size: 0.84rem;
}

.test-account__content small {
    color: var(--color-text-soft);
    font-size: 0.72rem;
}

.test-account__action {
    color: var(--color-info);
    font-size: 0.76rem;
    font-weight: 700;
}

.test-warning {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid #fde68a;
    border-radius: var(--radius-medium);
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.test-warning strong {
    display: block;
    font-size: 0.78rem;
}

.test-warning p {
    margin: 4px 0 0;
    font-size: 0.75rem;
}

.test-welcome-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.test-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.test-status--success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.test-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

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

.test-stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-stat-card__label {
    color: var(--color-text-soft);
    font-size: 0.73rem;
    font-weight: 600;
}

.test-stat-card__value {
    overflow: hidden;
    font-size: 1.15rem;
    text-overflow: ellipsis;
    text-transform: capitalize;
    white-space: nowrap;
}

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

.test-section-heading {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.test-detail-list {
    margin: 0;
    display: grid;
}

.test-detail {
    padding: 11px 0;
    display: grid;
    grid-template-columns: minmax(100px, 0.65fr) minmax(0, 1.35fr);
    gap: 18px;
    border-bottom: 1px solid var(--color-border);
}

.test-detail:last-child {
    border-bottom: 0;
}

.test-detail dt {
    color: var(--color-text-soft);
    font-size: 0.76rem;
}

.test-detail dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    font-weight: 600;
}

.test-code {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.72rem !important;
}

.test-check-list {
    display: grid;
}

.test-check {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--color-border);
}

.test-check:last-child {
    border-bottom: 0;
}

.test-check span {
    color: var(--color-text-soft);
    font-size: 0.78rem;
}

.test-check strong {
    font-size: 0.7rem;
}

.test-check--passed {
    color: var(--color-success);
}

.test-check--failed {
    color: var(--color-danger);
}

.test-permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.test-permission {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    background: var(--color-surface-soft);
    color: var(--color-text-soft);
    font-size: 0.7rem;
    font-weight: 600;
}

.test-empty {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 0.8rem;
}

.test-action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.test-button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 700;
    transition:
        background var(--transition),
        border-color var(--transition);
}

.test-button--secondary {
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.test-button--secondary:hover {
    background: var(--color-surface-soft);
}

.test-button--danger {
    border-color: #fecaca;
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.test-button--danger:hover {
    background: #fee2e2;
}

.test-session-output {
    max-height: 420px;
    margin: 0;
    padding: 18px;
    overflow: auto;
    border-radius: var(--radius-medium);
    background: #0f172a;
    color: #dbeafe;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.74rem;
    line-height: 1.7;
}

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

    .test-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .test-login-card,
    .test-welcome-card {
        padding: 20px;
    }

    .test-welcome-card {
        flex-direction: column;
    }

    .test-stat-grid {
        grid-template-columns: 1fr;
    }

    .test-account__action {
        display: none;
    }

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

    .test-action-list,
    .test-button {
        width: 100%;
    }
}

/*
|--------------------------------------------------------------------------
| Core Integration Test Report
|--------------------------------------------------------------------------
*/

.core-test-page .guest-layout {
    width: min(100% - 32px, 960px);
    padding-top: 32px;
    padding-bottom: 32px;
}

.core-test-report {
    padding: 30px;
}

.core-test-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.core-test-score {
    min-width: 170px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.core-test-score strong {
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.core-test-score span {
    margin-top: 8px;
    color: var(--color-text-soft);
    font-size: 0.74rem;
}

.core-test-summary {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.core-test-summary__item {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: var(--color-surface-soft);
}

.core-test-summary__item span {
    color: var(--color-text-soft);
    font-size: 0.72rem;
}

.core-test-summary__item strong {
    font-size: 1.1rem;
}

.core-test-passed {
    color: var(--color-success);
}

.core-test-failed {
    color: var(--color-danger);
}

.core-test-groups {
    margin-top: 26px;
    display: grid;
    gap: 16px;
}

.core-test-group {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
}

.core-test-group__header {
    min-height: 52px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--color-surface-soft);
    border-bottom: 1px solid var(--color-border);
}

.core-test-group__header h2 {
    margin: 0;
    font-size: 0.88rem;
}

.core-test-group__header span {
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-weight: 700;
}

.core-test-list {
    display: grid;
}

.core-test-item {
    min-height: 58px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
}

.core-test-item:last-child {
    border-bottom: 0;
}

.core-test-item__status {
    min-width: 46px;
    display: inline-flex;
    justify-content: center;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.core-test-item__status.is-passed {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.core-test-item__status.is-failed {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.core-test-item__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.core-test-item__content strong {
    font-size: 0.78rem;
}

.core-test-item__content small {
    margin-top: 3px;
    color: var(--color-text-soft);
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

.core-test-footer {
    margin-top: 26px;
}

.core-test-ready,
.core-test-warning {
    padding: 18px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-medium);
}

.core-test-ready {
    border: 1px solid #bbf7d0;
    background: var(--color-success-soft);
    color: var(--color-success);
}

.core-test-warning {
    border: 1px solid #fecaca;
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.core-test-ready strong,
.core-test-warning strong {
    font-size: 0.82rem;
}

.core-test-ready span,
.core-test-warning span {
    margin-top: 3px;
    font-size: 0.74rem;
}

@media (max-width: 700px) {
    .core-test-header {
        flex-direction: column;
    }

    .core-test-score {
        align-items: flex-start;
    }

    .core-test-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 440px) {
    .core-test-report {
        padding: 20px;
    }

    .core-test-summary {
        grid-template-columns: 1fr;
    }
}



/* ==========================================================
   MASTER USER — REFERENCE UI
   ========================================================== */

.master-user-page {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-bottom: 36px;
}

.master-user-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 30px;
    border: 1px solid var(--color-border, #dfe5ee);
    border-radius: 22px;
    background:
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.master-user-hero__content {
    min-width: 0;
}

.master-user-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.master-user-hero h1,
.master-user-panel h2 {
    color: #0f172a;
    letter-spacing: -0.04em;
}

.master-user-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.04;
}

.master-user-hero p {
    max-width: 720px;
    margin: 14px 0 0;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.7;
}

.master-user-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.master-user-button:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.master-user-button--primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.master-user-button--primary:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

.master-user-button--secondary {
    background: #ffffff;
}

.master-user-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.045);
}

.master-user-summary__card {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 24px;
    border-right: 1px solid #e5e7eb;
}

.master-user-summary__card:last-child {
    border-right: 0;
}

.master-user-summary__card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #2563eb;
    content: '';
}

.master-user-summary__card--success::before {
    background: #059669;
}

.master-user-summary__card--muted::before {
    background: #64748b;
}

.master-user-summary__card--danger::before {
    background: #dc2626;
}

.master-user-summary__card span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.master-user-summary__card strong {
    color: #0f172a;
    font-size: 2rem;
    line-height: 1;
}

.master-user-summary__card small {
    color: #94a3b8;
    font-size: 0.72rem;
}

.master-user-panel {
    padding: 26px;
    border: 1px solid #dfe5ee;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.04);
}

.master-user-panel--filter {
    padding-bottom: 24px;
}

.master-user-panel__heading,
.master-user-list-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.master-user-panel h2 {
    margin: 0;
    font-size: 1.25rem;
}

.master-user-list-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.84rem;
}

.master-user-filter-state {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
}

.master-user-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 190px 190px auto;
    gap: 12px;
    align-items: end;
}

.master-user-field {
    display: grid;
    gap: 7px;
}

.master-user-field label {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 750;
}

.master-user-field input,
.master-user-field select,
.master-user-per-page select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.master-user-field input:focus,
.master-user-field select:focus,
.master-user-per-page select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.master-user-filter__actions {
    display: flex;
    gap: 8px;
}

.master-user-per-page {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #64748b;
    font-size: 0.78rem;
}

.master-user-per-page select {
    width: 82px;
    min-height: 38px;
}

.master-user-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.master-user-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.master-user-table th,
.master-user-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.master-user-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.master-user-table tbody tr {
    transition: background 140ms ease;
}

.master-user-table tbody tr:hover {
    background: #fbfdff;
}

.master-user-table__actions-column,
.master-user-table__actions-cell {
    width: 180px;
    text-align: right !important;
}

.master-user-identity {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.master-user-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.92rem;
    font-weight: 850;
}

.master-user-identity > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.master-user-identity strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.master-user-identity small {
    overflow: hidden;
    color: #64748b;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.master-user-role {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 750;
}

.master-user-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}

.master-user-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.master-user-badge--active {
    background: #ecfdf5;
    color: #047857;
}

.master-user-badge--inactive {
    background: #f1f5f9;
    color: #475569;
}

.master-user-badge--blocked {
    background: #fef2f2;
    color: #b91c1c;
}

.master-user-last-login {
    color: #475569;
    font-size: 0.78rem;
}

.master-user-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.master-user-row-actions form {
    margin: 0;
}

.master-user-row-actions a,
.master-user-row-actions button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: #ffffff;
    color: #2563eb;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.master-user-row-actions button {
    color: #dc2626;
}

.master-user-row-actions a:hover,
.master-user-row-actions button:hover {
    background: #f8fafc;
}

.master-user-empty {
    display: grid;
    min-height: 280px;
    place-items: center;
    align-content: center;
    padding: 34px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    text-align: center;
}

.master-user-empty > span {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 16px;
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 850;
}

.master-user-empty h3 {
    margin: 0;
    color: #0f172a;
}

.master-user-empty p {
    max-width: 460px;
    margin: 8px 0 18px;
    line-height: 1.6;
}

.master-user-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.master-user-pagination a,
.master-user-pagination span {
    font-size: 0.78rem;
}

.master-user-pagination a {
    color: #2563eb;
    font-weight: 750;
    text-decoration: none;
}

.master-user-pagination a.is-disabled {
    color: #94a3b8;
    pointer-events: none;
}

.master-user-pagination span {
    color: #64748b;
}

@media (max-width: 1100px) {
    .master-user-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-user-summary__card:nth-child(2) {
        border-right: 0;
    }

    .master-user-summary__card:nth-child(-n + 2) {
        border-bottom: 1px solid #e5e7eb;
    }

    .master-user-filter {
        grid-template-columns: 1fr 1fr;
    }

    .master-user-field--search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .master-user-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .master-user-hero .master-user-button {
        width: 100%;
    }

    .master-user-panel__heading,
    .master-user-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .master-user-per-page {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 560px) {
    .master-user-page {
        gap: 18px;
    }

    .master-user-hero,
    .master-user-panel {
        padding: 20px;
        border-radius: 16px;
    }

    .master-user-summary {
        grid-template-columns: 1fr;
    }

    .master-user-summary__card,
    .master-user-summary__card:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

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

    .master-user-filter {
        grid-template-columns: 1fr;
    }

    .master-user-field--search {
        grid-column: auto;
    }

    .master-user-filter__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .master-user-pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
}
