/*
 * Ober interface tokens
 * ---------------------
 * These values implement the decisions recorded in docs/interface-design.md.
 * Update the documentation in the same change when their meaning changes.
 */
:root {
    /* Brand and semantic colors */
    --primary: #6c4cf1;      /* Primary actions and active navigation */
    --primary-dark: #4c2ec8; /* Primary text on light backgrounds */
    --primary-soft: #eeeaff; /* Subtle branded backgrounds */
    --ink: #20223b;          /* Main text */
    --muted: #71758d;        /* Secondary text */
    --line: #e9eaf2;         /* Borders and separators */
    --surface: #fff;         /* Cards and navigation surfaces */
    --background: #f6f7fb;   /* Application canvas */
    --success: #24ad7b;      /* Verified positive states only */

    /* Structural tokens */
    --sidebar-width: 268px;
    --radius-lg: 22px;
    --shadow: 0 12px 36px rgba(32, 34, 59, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 15px 'Manrope', sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.skip-link {
    position: fixed; z-index: 100; top: 12px; left: 12px;
    padding: 10px 16px; border-radius: 10px; background: var(--ink); color: white;
    transform: translateY(-150%); transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed; z-index: 30; inset: 0 auto 0 0;
    display: flex; width: var(--sidebar-width); flex-direction: column;
    border-right: 1px solid var(--line); background: var(--surface); padding: 28px 20px 22px;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 34px; }
.brand-mark {
    position: relative; display: grid; width: 35px; height: 35px; place-items: center;
    overflow: hidden; border-radius: 11px; background: linear-gradient(145deg, #886cff, #5d3de0);
    box-shadow: 0 8px 18px rgba(108, 76, 241, .24);
}
.brand-mark::before, .brand-mark span {
    content: ''; position: absolute; border: 2px solid rgba(255, 255, 255, .9); border-radius: 50%;
}
.brand-mark::before { width: 17px; height: 17px; }
.brand-mark span { width: 5px; height: 5px; border: 0; background: white; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: -.8px; }
.sidebar__nav { flex: 1; }
.nav-heading {
    margin: 0 12px 10px; color: #a3a6b5; font-size: 10px; font-weight: 800;
    letter-spacing: 1.3px; text-transform: uppercase;
}
.nav-heading--spaced { margin-top: 30px; }
.nav-item {
    display: flex; min-height: 47px; align-items: center; gap: 13px; margin: 3px 0; padding: 0 13px;
    border-radius: 12px; color: #656980; font-size: 13px; font-weight: 600; transition: 160ms ease;
}
.nav-item:hover { background: #f7f6ff; color: var(--primary); }
.nav-item.is-active {
    background: var(--primary); color: white; box-shadow: 0 8px 20px rgba(108, 76, 241, .22);
}
.nav-count {
    min-width: 22px; margin-left: auto; padding: 3px 6px; border-radius: 7px;
    background: #efedfa; color: var(--primary); font-size: 10px; text-align: center;
}
.nav-item.is-active .nav-count { background: rgba(255, 255, 255, .2); color: white; }
.sidebar__footer { border-top: 1px solid var(--line); padding-top: 20px; }
.sidebar-help { display: flex; align-items: center; gap: 11px; padding: 4px 6px 18px; }
.sidebar-help__icon {
    display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center;
    border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 800;
}
.sidebar-help strong, .sidebar-help span { display: block; }
.sidebar-help strong { font-size: 12px; }
.sidebar-help div span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.environment-badge {
    display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 600;
}
.environment-badge i, .status-pill i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--success);
    box-shadow: 0 0 0 3px rgba(36, 173, 123, .12);
}

.app-main { min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky; z-index: 20; top: 0; display: flex; height: 86px; align-items: center;
    justify-content: space-between; border-bottom: 1px solid rgba(233, 234, 242, .85);
    background: rgba(255, 255, 255, .88); padding: 0 38px; backdrop-filter: blur(16px);
}
.topbar__leading, .topbar__actions, .profile-button { display: flex; align-items: center; }
.topbar__eyebrow, .topbar__title { margin: 0; }
.topbar__eyebrow {
    margin-bottom: 2px; color: #a0a3b2; font-size: 10px; font-weight: 800;
    letter-spacing: 1.1px; text-transform: uppercase;
}
.topbar__title { font-size: 17px; font-weight: 800; }
.topbar__actions { gap: 16px; }
.icon-button, .profile-button { border: 0; background: transparent; cursor: pointer; }
.icon-button {
    position: relative; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px;
}
.icon-button:hover { background: #f3f2f8; }
.topbar__menu { display: none; margin-right: 10px; }
.notification-button span {
    position: absolute; top: 8px; right: 8px; width: 7px; height: 7px;
    border: 2px solid white; border-radius: 50%; background: #ff5e7a;
}
.topbar__divider { width: 1px; height: 30px; background: var(--line); }
.profile-button { gap: 10px; padding: 4px; text-align: left; }
.avatar {
    display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px;
    background: linear-gradient(145deg, #dcd4ff, #ece8ff); color: var(--primary-dark); font-size: 11px; font-weight: 800;
}
.profile-button__copy strong, .profile-button__copy small { display: block; }
.profile-button__copy strong { font-size: 12px; }
.profile-button__copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.page-content { width: min(1440px, 100%); margin: 0 auto; padding: 34px 38px 48px; }

.welcome-panel {
    position: relative; display: grid; min-height: 310px;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: center;
    overflow: hidden; border-radius: 26px;
    background: linear-gradient(125deg, #25133f 0%, #4b2388 53%, #7651ea 100%);
    box-shadow: 0 18px 45px rgba(65, 32, 119, .16);
}
.welcome-panel::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 65% 0%, rgba(255,255,255,.13), transparent 34%);
}
.welcome-panel__copy { position: relative; z-index: 2; padding: 46px 0 46px 52px; color: white; }
.eyebrow-badge {
    display: inline-flex; padding: 7px 11px; border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 999px; background: rgba(255, 255, 255, .1); color: #e8e0ff;
    font-size: 9px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase;
}
.welcome-panel h1 {
    margin: 17px 0 13px; font-size: clamp(35px, 4vw, 52px); line-height: 1.05; letter-spacing: -2.4px;
}
.welcome-panel h1 span { color: #beaaff; }
.welcome-panel__copy p {
    max-width: 520px; margin: 0 0 25px; color: rgba(255, 255, 255, .72); font-size: 13px; line-height: 1.75;
}
.primary-button, .secondary-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0;
    border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.primary-button {
    min-height: 42px; padding: 0 17px; background: white; color: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(24, 12, 52, .2);
}
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.welcome-visual { position: relative; min-height: 310px; }
.visual-core {
    position: absolute; z-index: 3; top: 50%; left: 50%; display: grid; width: 106px; height: 106px;
    place-items: center; border: 1px solid rgba(255, 255, 255, .32); border-radius: 31px;
    background: linear-gradient(145deg, rgba(255,255,255,.28), rgba(255,255,255,.1));
    box-shadow: inset 0 1px rgba(255,255,255,.4), 0 28px 60px rgba(25,10,70,.3);
    transform: translate(-50%, -50%) rotate(-8deg); backdrop-filter: blur(8px);
}
.visual-core span {
    width: 34px; height: 34px; border: 7px solid white; border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, .45);
}
.visual-orbit {
    position: absolute; top: 50%; left: 50%; border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%; transform: translate(-50%, -50%);
}
.visual-orbit--one { width: 235px; height: 235px; }
.visual-orbit--two { width: 355px; height: 355px; }
.visual-node {
    position: absolute; z-index: 4; width: 14px; height: 14px; border: 3px solid rgba(255,255,255,.5);
    border-radius: 50%; background: white; box-shadow: 0 0 20px rgba(255,255,255,.45);
}
.visual-node--one { top: 20%; left: 30%; }
.visual-node--two { right: 20%; bottom: 27%; width: 10px; height: 10px; }
.visual-node--three { bottom: 15%; left: 27%; width: 8px; height: 8px; }

.metrics-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px;
}
.metric-card {
    display: flex; min-width: 0; align-items: center; gap: 16px; border: 1px solid var(--line);
    border-radius: 17px; background: var(--surface); padding: 19px; box-shadow: 0 5px 20px rgba(32, 34, 59, .025);
}
.metric-card__icon {
    display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 14px;
}
.metric-card__icon--purple { background: #eeeaff; color: var(--primary); }
.metric-card__icon--blue { background: #e5f4ff; color: #2581c4; }
.metric-card__icon--green { background: #e4f8f0; color: #18966a; }
.metric-card__copy span, .metric-card__copy strong, .metric-card__copy small { display: block; }
.metric-card__copy span {
    margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.metric-card__copy strong {
    overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap;
}
.metric-card__copy small {
    overflow: hidden; margin-top: 2px; color: #a1a4b3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap;
}

.section-block { padding-top: 38px; scroll-margin-top: 90px; }
.section-heading, .card-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading h2, .card-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.5px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.section-heading__kicker {
    color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: 1.15px; text-transform: uppercase;
}
.secondary-button {
    min-height: 38px; border: 1px solid var(--line); background: white; padding: 0 14px; color: #5e6174;
}
.integrations-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px;
}
.integration-card, .surface-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.integration-card {
    position: relative;
    display: flex; min-width: 0; min-height: 220px; flex-direction: column;
    border-radius: 18px; padding: 19px; transition: transform 180ms ease, box-shadow 180ms ease;
}
.integration-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(32, 34, 59, .09); }
.integration-card--linked:focus-within { outline: 3px solid rgba(108, 76, 241, .32); outline-offset: 3px; }
.integration-card--linked .card-link::after { content: ''; position: absolute; inset: 0; }
.integration-card__header, .integration-card__footer { display: flex; align-items: center; justify-content: space-between; }
.integration-logo {
    display: grid; width: 45px; height: 45px; place-items: center; border-radius: 13px; font-size: 10px; font-weight: 800;
}
.integration-logo--orange { background: #fff0e9; color: #e96b32; }
.integration-logo--blue { background: #e4f4ff; color: #147ec0; }
.integration-logo--navy { background: #e8edff; color: #3854aa; }
.integration-logo--pink { background: #ffe9f1; color: #d94c7b; }
.status-pill, .soft-badge {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 8px; font-weight: 700;
}
.status-pill { background: #edfaf5; padding: 6px 9px; color: #188461; }
.status-pill i { width: 5px; height: 5px; box-shadow: none; }
.status-pill--neutral { background: #f2f1f7; color: #656980; }
.status-pill--neutral i { background: #8b8ea0; }
.integration-card__content { flex: 1; padding-top: 20px; }
.integration-card h3, .empty-state h3 { margin: 0; font-size: 14px; }
.integration-card p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.integration-card__footer {
    border-top: 1px solid var(--line); padding-top: 13px; color: #a1a4b3;
    font-size: 9px; font-weight: 700; text-transform: uppercase;
}
.card-link {
    display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent;
    color: var(--primary); cursor: pointer; font-size: 9px; font-weight: 800; text-transform: none;
}

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px;
}
.page-header h1 { margin: 5px 0 7px; font-size: 30px; letter-spacing: -1px; }
.page-header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.log-card { padding: 0; overflow: hidden; }
.log-card > .card-heading { padding: 23px; }
.log-list { margin: 0; border-top: 1px solid var(--line); padding: 0; list-style: none; }
.log-list__item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px;
    border-bottom: 1px solid var(--line); padding: 16px 23px;
}
.log-list__item:last-child { border-bottom: 0; }
.log-status {
    display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px;
}
.log-status--success { background: #e4f8f0; color: var(--success); }
.log-status--error { background: #fff0f2; color: #b42f49; }
.log-status--unknown { background: #f2f1f7; color: var(--muted); }
.log-list__content { min-width: 0; }
.log-list__title { display: flex; align-items: center; gap: 9px; }
.log-list__title strong { font-size: 12px; }
.log-result { border-radius: 999px; padding: 4px 7px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.log-result--success { background: #edfaf5; color: #188461; }
.log-result--error { background: #fff0f2; color: #a52d43; }
.log-result--unknown { background: #f2f1f7; color: #656980; }
.log-result--neutral { background: #f2f1f7; color: #656980; }
.log-result--running { background: #fff6df; color: #8a6300; }
.log-list__content p { margin: 5px 0; color: #4b4e63; font-size: 10px; }
.log-list__meta {
    display: block; overflow: hidden; color: #a1a4b3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap;
}
.log-list__link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 10px; font-weight: 800; }
.log-list-loader {
    display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 12px;
    border-top: 1px solid var(--line); padding: 12px 23px; color: var(--muted); font-size: 10px;
}
.log-list-loader:empty { display: none; }
.log-list-loader .secondary-button { padding: 8px 12px; }
.log-visualizer__help { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.event-flow { margin: 28px -23px 0; overflow-x: auto; padding: 6px 23px 18px; scrollbar-color: #cbc7dc transparent; }
.event-flow__track { display: flex; min-width: max-content; align-items: center; margin: 0; padding: 0; list-style: none; }
.event-flow__step { position: relative; display: flex; align-items: center; }
.event-flow__step:not(:last-child)::after { content: ''; width: 38px; height: 2px; background: #dedbea; }
.event-node {
    display: flex; width: 128px; height: 128px; flex: 0 0 auto; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px; border: 2px solid #d9d7e3; border-radius: 50%; background: var(--surface);
    padding: 15px; color: var(--ink); cursor: pointer; text-align: center; transition: transform 160ms ease, box-shadow 160ms ease;
}
.event-node:hover, .event-node.is-selected { transform: translateY(-3px); box-shadow: 0 13px 28px rgba(32, 34, 59, .12); }
.event-node--success { border-color: #88d8bb; background: #f4fcf9; }
.event-node--error { border-color: #efaeb9; background: #fff7f8; }
.event-node--neutral, .event-node--unknown { border-color: #c9c5d9; background: #faf9fc; }
.event-node--running { border-color: #ebca74; background: #fffbef; }
.event-node__category {
    max-width: 96px; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 800;
    letter-spacing: .8px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.event-node strong { display: -webkit-box; overflow: hidden; font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.event-node__status { display: inline-flex; align-items: center; gap: 5px; font-size: 8px; font-weight: 800; }
.event-node__status i { width: 6px; height: 6px; border-radius: 50%; background: #8b8ea0; }
.event-node--success .event-node__status { color: #188461; }
.event-node--success .event-node__status i { background: var(--success); }
.event-node--error .event-node__status { color: #a52d43; }
.event-node--error .event-node__status i { background: #c33d56; }
.event-node--running .event-node__status { color: #8a6300; }
.event-node--running .event-node__status i { background: #d69a00; }
.event-panels { margin-top: 7px; }
.event-panel { border: 1px solid var(--line); border-radius: 16px; background: #fbfbfd; padding: 18px; }
.event-panel[hidden] { display: none; }
.event-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.event-panel__header span:first-child { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.event-panel__header h3 { margin: 3px 0 0; font-size: 14px; }
.event-panel__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-data { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.event-data h4 { margin: 0; border-bottom: 1px solid var(--line); padding: 10px 13px; color: var(--primary-dark); font-size: 9px; letter-spacing: .6px; text-transform: uppercase; }
.event-data pre {
    min-height: 170px; max-height: 360px; margin: 0; overflow: auto; padding: 14px;
    color: #3b3d53; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre;
}
.event-data p { min-height: 170px; margin: 0; padding: 18px 14px; color: var(--muted); font-size: 10px; }
.raw-log { margin-top: 18px; }
.raw-log summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.raw-log summary::-webkit-details-marker { display: none; }
.raw-log summary strong { display: block; margin-top: 4px; font-size: 13px; }
.raw-log__action { color: var(--primary); font-size: 10px; font-weight: 800; }
.raw-log[open] .raw-log__action { font-size: 0; }
.raw-log[open] .raw-log__action::after { content: 'Masquer'; font-size: 10px; }
.log-detail__content {
    max-height: calc(100vh - 250px); margin: 20px 0 0; overflow: auto; border-radius: 14px;
    background: #20223b; padding: 22px; color: #f5f3ff; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre; tab-size: 2;
}
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    clip-path: inset(50%); white-space: nowrap;
}

.dashboard-grid {
    display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; padding-top: 22px;
}
.surface-card { border-radius: var(--radius-lg); padding: 23px; scroll-margin-top: 100px; }
.card-heading { align-items: center; }
.soft-badge { background: var(--primary-soft); padding: 7px 10px; color: var(--primary); }
.empty-state {
    display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 15px;
    margin-top: 18px; border: 1px dashed #ddddeb; border-radius: 15px; background: #fbfbfd; padding: 25px;
}
.empty-state__icon {
    display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center;
    border-radius: 15px; background: var(--primary-soft); color: var(--primary);
}
.empty-state p {
    max-width: 430px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6;
}
.system-card__check {
    display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px;
    background: #e4f8f0; color: var(--success);
}
.system-list { display: grid; gap: 13px; margin: 20px 0 0; padding: 0; list-style: none; }
.system-list li { display: flex; align-items: center; gap: 11px; }
.system-list__icon {
    display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center;
    border-radius: 10px; background: #f2f1f7; color: #71758d;
}
.system-list strong, .system-list span { display: block; }
.system-list strong { font-size: 10px; }
.system-list div span { margin-top: 3px; color: #a1a4b3; font-size: 9px; }

.sidebar-backdrop {
    position: fixed; z-index: 25; inset: 0; border: 0; background: rgba(25, 20, 45, .45); backdrop-filter: blur(2px);
}
.sidebar-backdrop[hidden] { display: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(108, 76, 241, .32); outline-offset: 3px; }

.sidebar-logout {
    width: 100%; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); padding: 10px 12px; color: #656980; cursor: pointer;
    font-size: 11px; font-weight: 700; text-align: left;
}
.sidebar-logout:hover { border-color: #d6d1f6; color: var(--primary-dark); }

.auth-page { min-height: 100vh; background: #f3f1fa; }
.auth-shell {
    display: grid; width: min(1040px, calc(100% - 40px)); min-height: 650px;
    grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr); margin: 5vh auto;
    overflow: hidden; border: 1px solid rgba(108, 76, 241, .1); border-radius: 26px;
    background: var(--surface); box-shadow: 0 24px 70px rgba(43, 30, 88, .13);
}
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 52px 64px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 45px; }
.auth-eyebrow { margin: 0 0 9px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.auth-panel h1 { margin: 0; font-size: clamp(31px, 4vw, 42px); letter-spacing: -1.6px; }
.auth-intro { margin: 13px 0 28px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-form { display: grid; gap: 17px; }
.field-group { display: grid; gap: 7px; }
.field-group label { color: #4b4e63; font-size: 11px; font-weight: 700; }
.field-group input {
    width: 100%; min-height: 46px; border: 1px solid #dfe0e9; border-radius: 11px;
    background: #fcfcfe; padding: 0 14px; color: var(--ink); outline: none;
}
.field-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 76, 241, .12); }
.auth-submit, .passkey-button, .profile-primary-button {
    display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px;
    border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 800;
}
.auth-submit, .profile-primary-button { border: 0; background: var(--primary); color: white; box-shadow: 0 9px 20px rgba(108, 76, 241, .22); }
.auth-submit:hover, .profile-primary-button:hover { background: var(--primary-dark); }
.passkey-button { width: 100%; border: 1px solid #dcd9ee; background: white; color: var(--primary-dark); }
.passkey-button:hover { background: var(--primary-soft); }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 21px 0; color: #a0a3b2; font-size: 10px; text-transform: uppercase; }
.auth-separator::before, .auth-separator::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.form-alert { margin: 0 0 20px; border-radius: 11px; padding: 12px 14px; font-size: 11px; line-height: 1.5; }
.form-alert--error { border: 1px solid #f4c9d0; background: #fff3f5; color: #a52d43; }
.form-alert--success { border: 1px solid #bde7d7; background: #effaf6; color: #167353; }
.form-status { min-height: 17px; margin: 0; color: #a52d43; font-size: 10px; line-height: 1.5; }
.auth-visual { position: relative; overflow: hidden; background: linear-gradient(140deg, #24113c, #533098 55%, #8062ef); }
.auth-visual::before, .auth-visual::after { content: ''; position: absolute; border: 1px solid rgba(255, 255, 255, .13); border-radius: 50%; }
.auth-visual::before { width: 470px; height: 470px; top: -80px; left: -80px; }
.auth-visual::after { width: 290px; height: 290px; right: -80px; bottom: -55px; }
.auth-visual__content { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; color: white; text-align: center; }
.auth-visual__icon {
    display: grid; width: 92px; height: 92px; place-items: center; margin: 0 auto 25px;
    border: 1px solid rgba(255,255,255,.3); border-radius: 28px; background: rgba(255,255,255,.15);
    box-shadow: 0 24px 55px rgba(18, 5, 48, .3); font-size: 38px; font-weight: 800; backdrop-filter: blur(8px);
}
.auth-visual__content p { margin: 0; color: rgba(255,255,255,.82); font-size: 19px; font-weight: 700; line-height: 1.5; }

.profile-header { margin-bottom: 24px; }
.profile-header h1 { margin: 5px 0 7px; font-size: 30px; letter-spacing: -1px; }
.profile-header p, .security-card__intro { color: var(--muted); font-size: 11px; line-height: 1.7; }
.profile-header p { margin: 0; }
.security-card { max-width: 850px; }
.security-card__intro { max-width: 650px; margin: 16px 0 0; }
.passkey-empty { display: flex; align-items: center; gap: 15px; margin-top: 22px; border: 1px dashed #ddddeb; border-radius: 15px; background: #fbfbfd; padding: 22px; }
.passkey-empty strong, .passkey-empty p { display: block; }
.passkey-empty strong { font-size: 12px; }
.passkey-empty p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.passkey-list { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.passkey-list li { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.passkey-list__icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.passkey-list__copy { min-width: 0; flex: 1; }
.passkey-list__copy strong, .passkey-list__copy span { display: block; }
.passkey-list__copy strong { font-size: 11px; }
.passkey-list__copy span { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.danger-link { border: 0; background: transparent; color: #b42f49; cursor: pointer; font-size: 10px; font-weight: 700; }
.passkey-enroll { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.profile-primary-button { min-height: 42px; padding: 0 17px; }
.passkey-enroll .form-status { flex: 1; }

@media (max-width: 1120px) {
    .integrations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-panel { grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 220ms ease; }
    .sidebar.is-open { transform: translateX(0); }
    .has-open-sidebar { overflow: hidden; }
    .app-main { margin-left: 0; }
    .topbar__menu { display: grid; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
}

@media (max-width: 700px) {
    .topbar { height: 72px; padding: 0 20px; }
    .profile-button__copy, .profile-button > svg, .topbar__divider { display: none; }
    .page-content { padding: 22px 18px 36px; }
    .welcome-panel { min-height: 420px; grid-template-columns: 1fr; }
    .welcome-panel__copy { padding: 34px 28px 5px; }
    .welcome-panel h1 { letter-spacing: -1.7px; }
    .welcome-visual { min-height: 175px; }
    .visual-core { width: 75px; height: 75px; border-radius: 23px; }
    .visual-orbit--one { width: 170px; height: 170px; }
    .visual-orbit--two { width: 260px; height: 260px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; gap: 18px; }
    .secondary-button { white-space: nowrap; }
    .integrations-grid { grid-template-columns: 1fr; }
    .integration-card { min-height: 205px; }
    .page-header { align-items: stretch; flex-direction: column; }
    .page-header .secondary-button { align-self: flex-start; }
    .log-list__item { grid-template-columns: auto minmax(0, 1fr); padding: 15px 17px; }
    .log-list__link { grid-column: 2; justify-self: start; }
    .event-panel__columns { grid-template-columns: 1fr; }
    .event-data pre, .event-data p { min-height: 130px; }
    .auth-shell { width: min(100% - 24px, 540px); min-height: 0; margin: 12px auto; }
    .auth-panel { padding: 36px 28px; }
    .auth-brand { margin-bottom: 32px; }
    .passkey-list li { align-items: flex-start; flex-wrap: wrap; }
    .passkey-list li form { width: 100%; padding-left: 51px; }
    .danger-link { padding: 5px 0; }
}

@media (max-width: 440px) {
    .section-heading { flex-direction: column; }
    .secondary-button { width: 100%; }
    .page-header .secondary-button { align-self: stretch; }
    .event-node { width: 110px; height: 110px; }
    .event-flow__step:not(:last-child)::after { width: 24px; }
    .empty-state { align-items: flex-start; flex-direction: column; }
    .passkey-enroll { align-items: stretch; flex-direction: column; }
    .profile-primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
