:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;
    --sidebar: #172033;
    --sidebar-deep: #111827;
    --sidebar-muted: #9da9bc;
    --text: #20283a;
    --muted: #596276;
    --line: #e5e9f2;
    --primary: #4f46e5;
    --primary-dark: #3f37c9;
    --primary-soft: #ecebff;
    --success: #168a61;
    --success-soft: #e8f7f0;
    --warning: #a96808;
    --warning-soft: #fff4d8;
    --danger: #c43d4f;
    --danger-soft: #fff0f2;
    --info: #2868b2;
    --info-soft: #edf5ff;
    --shadow-sm: 0 2px 8px rgba(32, 40, 58, 0.06);
    --shadow: 0 16px 44px rgba(39, 48, 78, 0.11);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --sidebar-width: 268px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

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

a {
    color: var(--primary);
}

svg {
    display: block;
}

.icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.34);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 3000;
    padding: 10px 15px;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.brand--centered {
    justify-content: center;
    width: 100%;
}

.brand--inverse {
    color: #fff;
}

.brand__mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #7069f5, #443bd2);
    box-shadow: 0 9px 22px rgba(79, 70, 229, 0.3);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand__text strong {
    font-size: 18px;
    letter-spacing: 0.02em;
}

.brand__text small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.brand--inverse .brand__text small {
    color: #aeb9cb;
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

.button--primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.button--secondary {
    color: var(--text);
    background: #fff;
    border-color: var(--line);
}

.button--secondary:hover {
    border-color: #cbd1dd;
    box-shadow: var(--shadow-sm);
}

.button--light {
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 10px 24px rgba(32, 22, 125, 0.18);
}

.button--ghost-light {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.34);
}

.button--warning {
    min-height: 36px;
    color: #684100;
    background: #fff;
    border-color: rgba(169, 104, 8, 0.25);
}

.button--small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
}

.button--wide {
    width: 100%;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 20px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 14px;
}

.alert--danger {
    color: #8f2637;
    background: var(--danger-soft);
    border-color: #ffd2d9;
}

.alert--success {
    color: #126846;
    background: var(--success-soft);
    border-color: #c9ebdd;
}

.alert--info {
    color: #21578f;
    background: var(--info-soft);
    border-color: #d1e5ff;
}

.alert--warning {
    color: #76500e;
    background: var(--warning-soft);
    border-color: #f1d998;
}

.alert--action {
    align-items: center;
    justify-content: space-between;
}

/* Login, visually aligned with the P9 card-based entry screen. */
.auth-page {
    background:
        radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.11), transparent 27%),
        radial-gradient(circle at 88% 80%, rgba(58, 181, 150, 0.09), transparent 25%),
        #f3f5fa;
}

.auth-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(37, 46, 75, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(37, 46, 75, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    content: "";
    mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 38px;
    border: 1px solid rgba(225, 229, 239, 0.82);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.auth-card__heading {
    margin: 28px 0 25px;
    text-align: center;
}

.auth-card__heading h1 {
    margin: 8px 0 8px;
    font-size: clamp(24px, 5vw, 29px);
    line-height: 1.16;
    letter-spacing: -0.035em;
}

.auth-card__heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-stack--narrow {
    max-width: 560px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #3b4356;
    font-size: 13px;
    font-weight: 750;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid #dce1eb;
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input::placeholder {
    color: #a1a9b8;
}

.field input:hover {
    border-color: #c7cedb;
}

.field input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}

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

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 50px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.password-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

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

.auth-card__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25a872;
    box-shadow: 0 0 0 4px rgba(37, 168, 114, 0.12);
}

.auth-caption {
    margin: 17px 0 0;
    color: #8a93a5;
    font-size: 12px;
}

.error-card {
    text-align: center;
}

.error-card__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 30px auto 18px;
    border-radius: 50%;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 27px;
    font-weight: 800;
}

.error-card h1 {
    margin: 0 0 10px;
    font-size: 25px;
}

.error-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.error-card small {
    display: block;
    margin-top: 16px;
    color: #929aaa;
}

/* Authenticated layout */
.mobile-header {
    display: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.08);
}

.sidebar__top {
    display: flex;
    min-height: 89px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar__close {
    display: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 27px;
    line-height: 1;
}

.sidebar__nav {
    flex: 1;
    padding: 21px 15px;
}

.sidebar__label {
    margin: 0 11px 9px;
    color: #75839a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sidebar__label--spaced {
    margin-top: 27px;
}

.nav-link {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    padding: 11px 12px;
    border-radius: 10px;
    color: #c4ccda;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-link .icon {
    width: 20px;
    flex: 0 0 20px;
}

.nav-link span:not(.icon) {
    min-width: 0;
}

.nav-link small {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 20px;
    color: #76849a;
    background: rgba(255, 255, 255, 0.05);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

a.nav-link:hover,
.nav-link.is-active {
    color: #fff;
    background: rgba(111, 104, 242, 0.18);
}

.nav-link.is-active {
    box-shadow: inset 3px 0 0 #817af8;
}

.nav-link.is-disabled {
    cursor: default;
    opacity: 0.64;
}

.sidebar__account {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: center;
    margin: 0 15px 17px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #6f67ef, #3a88d6);
    font-weight: 800;
}

.sidebar__account-copy {
    min-width: 0;
}

.sidebar__account-copy strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__account-copy a {
    color: var(--sidebar-muted);
    font-size: 11px;
    text-decoration: none;
}

.sidebar__account-copy a:hover {
    color: #fff;
}

.logout-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #9da9bc;
    background: transparent;
    cursor: pointer;
}

.logout-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.logout-button .icon {
    width: 19px;
}

.content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.content__inner {
    width: min(100%, 1470px);
    margin: 0 auto;
    padding: 34px 40px 24px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h1 {
    margin: 5px 0 0;
    font-size: clamp(25px, 3.2vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.environment-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #dfe4ed;
    border-radius: 30px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 700;
}

.environment-badge span,
.inline-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #27a875;
    box-shadow: 0 0 0 4px rgba(39, 168, 117, 0.11);
}

.hero-card {
    position: relative;
    display: grid;
    min-height: 262px;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 77% -30%, rgba(255, 255, 255, 0.2), transparent 38%),
        linear-gradient(125deg, #5147dd 0%, #6559e8 46%, #3f79c8 100%);
    box-shadow: 0 20px 50px rgba(70, 62, 187, 0.2);
}

.hero-card__copy {
    position: relative;
    z-index: 2;
    max-width: 760px;
    padding: clamp(29px, 4vw, 46px);
}

.hero-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.hero-card__badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7ff0bf;
    box-shadow: 0 0 0 4px rgba(127, 240, 191, 0.12);
    content: "";
}

.hero-card h2 {
    margin: 17px 0 9px;
    font-size: clamp(27px, 4vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.hero-card p {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.83);
    font-size: 15px;
}

.hero-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.hero-card__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 250px;
}

.hero-card__visual svg {
    position: relative;
    z-index: 2;
    width: min(74%, 210px);
    color: rgba(255, 255, 255, 0.22);
    fill: currentColor;
}

.hero-card__visual .hero-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.78);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
}

.orb--one {
    top: -45px;
    right: 20px;
    width: 190px;
    height: 190px;
}

.orb--two {
    right: -38px;
    bottom: -70px;
    width: 230px;
    height: 230px;
}

.section-block {
    margin-top: 31px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 21px;
    letter-spacing: -0.025em;
}

.muted-text {
    color: var(--muted);
    font-size: 12px;
}

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

.module-card {
    position: relative;
    min-height: 220px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-card--active:hover {
    transform: translateY(-3px);
    border-color: #cbc8ff;
    box-shadow: 0 17px 34px rgba(40, 47, 76, 0.1);
}

.module-card__icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    margin-bottom: 19px;
    border-radius: 12px;
}

.module-card__icon--blue { color: #3478c5; background: #eaf3ff; }
.module-card__icon--violet { color: #7456c9; background: #f1edff; }
.module-card__icon--green { color: #20875f; background: #e9f7f1; }
.module-card__icon--orange { color: #bd6d19; background: #fff2e2; }

.tag {
    position: absolute;
    top: 21px;
    right: 18px;
    padding: 4px 7px;
    border-radius: 30px;
    color: #596276;
    background: #f1f3f7;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tag--ready {
    color: #157651;
    background: var(--success-soft);
}

.module-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

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

.card-link {
    display: inline-flex;
    gap: 6px;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.card-link::after {
    position: absolute;
    inset: 0;
    content: "";
}

.status-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    margin-top: 18px;
    padding: 18px 21px;
    border: 1px solid #dbe9e3;
    border-radius: var(--radius);
    background: linear-gradient(90deg, #f5fbf8, #fff);
}

.status-card__icon {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    border-radius: 50%;
    color: var(--success);
    background: var(--success-soft);
}

.status-card__icon .icon {
    stroke-width: 2.4;
}

.status-card h2 {
    margin: 0 0 3px;
    font-size: 15px;
}

.status-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 30px;
    color: #167651;
    background: var(--success-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.test-panel {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 27px;
    background: linear-gradient(120deg, #fff, #f7f6ff);
}

.test-panel__icon {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    place-items: center;
    border-radius: 17px;
    color: var(--primary);
    background: var(--primary-soft);
}

.test-panel__icon .icon {
    width: 30px;
    height: 30px;
}

.test-panel h2 {
    margin: 4px 0 5px;
    font-size: 22px;
}

.test-panel p {
    margin: 0;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 17px;
    margin-top: 17px;
}

.detail-grid .panel {
    padding: 24px;
}

.panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.panel__heading h2 {
    margin: 0;
    font-size: 17px;
}

.check-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.check-list li:first-child {
    border-top: 0;
}

.check-icon {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    border-radius: 50%;
    color: var(--success);
    background: var(--success-soft);
    font-weight: 800;
}

.check-list strong,
.check-list small {
    display: block;
}

.check-list strong {
    font-size: 13px;
}

.check-list small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.definition-list {
    margin: 0;
}

.definition-list > div {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.definition-list > div:first-child {
    border-top: 0;
}

.definition-list dt {
    color: var(--muted);
    font-size: 12px;
}

.definition-list dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.inline-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.page-actions {
    margin-top: 18px;
}

.form-panel {
    max-width: 820px;
    padding: clamp(24px, 4vw, 38px);
}

.form-panel__intro {
    max-width: 620px;
    margin-bottom: 25px;
}

.form-panel__intro h2 {
    margin: 5px 0 8px;
    font-size: 24px;
}

.form-panel__intro p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.empty-state {
    padding: 50px 25px;
    text-align: center;
}

.empty-state__code {
    color: var(--primary);
    font-size: 56px;
    font-weight: 850;
    letter-spacing: -0.06em;
}

.empty-state h2 {
    margin: 2px 0 6px;
}

.empty-state p {
    margin: 0 0 22px;
    color: var(--muted);
}

.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding: 18px 3px 0;
    border-top: 1px solid var(--line);
    color: #596276;
    font-size: 11px;
}

.sidebar-backdrop {
    display: none;
}

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

    .hero-card {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 959px) {
    .app-page {
        padding-top: 66px;
    }

    .mobile-header {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 900;
        display: flex;
        height: 66px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 17px;
        color: #fff;
        background: var(--sidebar);
        box-shadow: 0 5px 20px rgba(15, 23, 42, 0.12);
    }

    .mobile-header .brand__mark {
        width: 37px;
        height: 37px;
        border-radius: 11px;
        font-size: 18px;
    }

    .mobile-menu-button {
        display: grid;
        width: 42px;
        height: 42px;
        place-content: center;
        gap: 5px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-menu-button span:not(.sr-only) {
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }

    .sidebar {
        width: min(86vw, 300px);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }

    .sidebar__close {
        display: inline-grid;
        place-items: center;
        cursor: pointer;
    }

    .menu-open {
        overflow: hidden;
    }

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 950;
        display: block;
        visibility: hidden;
        background: rgba(11, 17, 30, 0.54);
        opacity: 0;
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .menu-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .content {
        margin-left: 0;
    }

    .content__inner {
        padding: 25px 22px 20px;
    }

    .hero-card {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

@media (max-width: 720px) {
    .content__inner {
        padding: 22px 15px 18px;
    }

    .page-header {
        align-items: flex-start;
    }

    .environment-badge {
        display: none;
    }

    .alert--action {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-card {
        display: block;
        min-height: 0;
    }

    .hero-card__copy {
        padding: 29px 24px 31px;
    }

    .hero-card__visual {
        display: none;
    }

    .hero-card__actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .module-card {
        min-height: 0;
    }

    .status-card {
        grid-template-columns: 43px minmax(0, 1fr);
    }

    .status-card .status-pill {
        display: none;
    }

    .test-panel {
        align-items: flex-start;
        padding: 22px;
    }

    .test-panel__icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 13px;
    }

    .test-panel__icon .icon {
        width: 24px;
        height: 24px;
    }

    .definition-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .definition-list dd {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .auth-shell {
        justify-content: flex-start;
        padding: 22px 13px;
    }

    .auth-card {
        padding: 29px 21px;
        border-radius: 18px;
    }

    .auth-card__heading {
        margin-top: 24px;
    }

    .mobile-header .brand__text small {
        display: none;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .test-panel {
        display: block;
    }

    .test-panel__icon {
        margin-bottom: 17px;
    }

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

    .page-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.toolbar__summary {
    margin: 0 0 3px;
    font-size: 15px;
}

.toolbar p {
    margin-top: 0;
}

.filter-panel,
.data-panel,
.detail-card,
.coverage-panel,
.report-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.filter-panel {
    margin-bottom: 18px;
    padding: 18px;
}

.filter-panel--compact {
    padding: 15px 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) repeat(5, minmax(135px, 1fr));
    gap: 12px;
}

.field > span {
    color: #3b4356;
    font-size: 12px;
    font-weight: 750;
}

.field select,
.field input[type="search"],
.field input[type="date"] {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid #dce1eb;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.field select:focus,
.field input[type="search"]:focus,
.field input[type="date"]:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}

.filter-actions,
.date-filter {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.date-filter {
    margin-top: 0;
}

.date-filter .field {
    width: min(100%, 210px);
}

.privacy-note {
    max-width: 520px;
    color: var(--muted);
    font-size: 11px;
}

.data-panel {
    overflow: hidden;
}

.data-panel__header,
.detail-card__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.data-panel__header h2,
.detail-card__header h2,
.report-card h2 {
    margin: 3px 0 0;
    font-size: 18px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.data-table td small,
.request-link + small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.request-link {
    font-weight: 800;
    text-decoration: none;
}

.private-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status-chip,
.integration-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 30px;
    color: #465069;
    background: #eef1f6;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.status-chip--new { color: #8a5700; background: var(--warning-soft); }
.status-chip--won { color: #157651; background: var(--success-soft); }
.status-chip--qualified { color: #2868b2; background: var(--info-soft); }
.status-chip--processed_legacy { color: #5c4aaa; background: #f0edff; }
.integration-chip { color: #2868b2; background: var(--info-soft); }

.empty-state {
    padding: 46px 20px;
    text-align: center;
}

.empty-state--compact {
    padding: 24px 8px;
}

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

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    color: var(--muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.metric-grid--dashboard {
    margin-top: 22px;
}

.metric-card {
    display: grid;
    gap: 5px;
    min-height: 132px;
    align-content: center;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
    font-size: 11px;
}

.metric-card strong {
    color: var(--text);
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -0.04em;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    margin: -9px 0 15px;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumbs a {
    text-decoration: none;
}

.request-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 22px 24px;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(125deg, #5147dd, #3f79c8);
    box-shadow: 0 15px 35px rgba(70, 62, 187, 0.18);
}

.request-summary .status-chip {
    margin-bottom: 9px;
}

.request-summary h2,
.request-summary p {
    margin: 0;
}

.request-summary p {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
}

.request-summary__ids {
    display: grid;
    gap: 5px;
    justify-items: end;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

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

.detail-card {
    margin-bottom: 15px;
    overflow: hidden;
}

.detail-columns .detail-card {
    margin-bottom: 0;
}

.record-list {
    margin: 0;
    padding: 8px 20px;
}

.record-list > div {
    display: grid;
    grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr);
    gap: 15px;
    padding: 11px 0;
    border-bottom: 1px solid #edf0f5;
}

.record-list > div:last-child {
    border-bottom: 0;
}

.record-list dt {
    color: var(--muted);
    font-size: 11px;
}

.record-list dd {
    margin: 0;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.privacy-box {
    margin: 6px 20px 20px;
    padding: 12px 14px;
    border: 1px solid #dae7f7;
    border-radius: 10px;
    color: #3b587b;
    background: #f4f8fd;
    font-size: 11px;
}

.contact-list,
.conversion-list,
.timeline,
.rank-list {
    margin: 0;
    padding: 14px 20px;
    list-style: none;
}

.contact-list li,
.conversion-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #edf0f5;
}

.contact-list li:last-child,
.conversion-list li:last-child {
    border-bottom: 0;
}

.contact-list span,
.contact-list small,
.conversion-list small {
    color: var(--muted);
    font-size: 10px;
}

.conversion-list li {
    display: block;
}

.conversion-list li > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.timeline {
    padding-top: 20px;
    padding-bottom: 20px;
}

.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 18px;
}

.timeline li:not(:last-child)::before {
    position: absolute;
    top: 12px;
    bottom: -2px;
    left: 5px;
    width: 2px;
    background: #e2e6f0;
    content: "";
}

.timeline__marker {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-top: 3px;
    border: 3px solid #dcd8ff;
    border-radius: 50%;
    background: var(--primary);
}

.timeline strong,
.timeline p,
.timeline time {
    font-size: 12px;
}

.timeline p {
    margin: 4px 0;
    color: var(--muted);
}

.timeline time {
    color: var(--muted);
    font-size: 11px;
}

.coverage-panel {
    margin: 18px 0;
    padding: 20px;
}

.coverage-panel .section-heading {
    margin-bottom: 18px;
}

.coverage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
}

.coverage-row > div,
.rank-list li > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    font-size: 12px;
}

progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: #eceff5;
}

progress::-webkit-progress-bar { background: #eceff5; }
progress::-webkit-progress-value { border-radius: 10px; background: linear-gradient(90deg, #6559e8, #3f79c8); }
progress::-moz-progress-bar { border-radius: 10px; background: linear-gradient(90deg, #6559e8, #3f79c8); }

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.report-card {
    padding: 20px;
}

.report-card h2 {
    margin-top: 0;
}

.rank-list {
    padding: 10px 0 0;
}

.rank-list li {
    margin-top: 13px;
}

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

    .field--wide {
        grid-column: span 2;
    }
}

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

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

    .detail-columns .detail-card {
        margin-bottom: 0;
    }
}

@media (max-width: 720px) {
    .toolbar,
    .request-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-grid,
    .coverage-grid {
        grid-template-columns: 1fr;
    }

    .field--wide {
        grid-column: auto;
    }

    .filter-actions,
    .date-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .date-filter .field {
        width: 100%;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        padding: 9px 15px;
        border-bottom: 1px solid var(--line);
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
        gap: 12px;
        padding: 7px 0;
        border: 0;
        text-align: right;
    }

    .data-table td::before {
        color: var(--muted);
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-align: left;
        text-transform: uppercase;
        content: attr(data-label);
    }

    .data-table td small {
        text-align: right;
    }

    .request-summary__ids {
        justify-items: start;
    }

    .record-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .record-list dd {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .data-panel__header,
    .detail-card__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination {
        justify-content: space-between;
    }
}

@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;
    }
}
