/**
 * SWAP Tech product pages — Fleet GPS & Access Control.
 * Extends remote-platform-premium.css with telemetry console & report UI.
 */
@import url('remote-platform-premium.css');

.lb-xp-body--gps {
    background: #04060d;
}

.lb-xp-body--access {
    background: #06040c;
}

.lb-xp-body--network {
    background: #080604;
}

/* —— Theme tokens —— */
.lb-st[data-product="gps"] {
    --xp-bg: #04060d;
    --xp-bg-elevated: #0a1020;
    --xp-text: #e8f4ff;
    --xp-muted: rgba(232, 244, 255, 0.52);
    --xp-faint: rgba(56, 189, 248, 0.06);
    --xp-accent: #38bdf8;
    --xp-accent-bright: #7dd3fc;
    --xp-accent-glow: rgba(56, 189, 248, 0.2);
    --xp-line: rgba(125, 211, 252, 0.12);
    --st-console-bg: linear-gradient(145deg, rgba(8, 20, 40, 0.95), rgba(4, 10, 22, 0.98));
    --st-map-accent: #22d3ee;
    --st-chart: #38bdf8;
}

.lb-st[data-product="access"] {
    --xp-bg: #06040c;
    --xp-bg-elevated: #100c1a;
    --xp-text: #f3eefc;
    --xp-muted: rgba(243, 238, 252, 0.52);
    --xp-faint: rgba(167, 139, 250, 0.07);
    --xp-accent: #a78bfa;
    --xp-accent-bright: #c4b5fd;
    --xp-accent-glow: rgba(167, 139, 250, 0.22);
    --xp-line: rgba(196, 181, 253, 0.11);
    --st-console-bg: linear-gradient(145deg, rgba(20, 12, 36, 0.95), rgba(8, 5, 16, 0.98));
    --st-map-accent: #c084fc;
    --st-chart: #a78bfa;
}

.lb-st[data-product="network"] {
    --xp-bg: #080604;
    --xp-bg-elevated: #12100c;
    --xp-text: #faf6f0;
    --xp-muted: rgba(250, 246, 240, 0.52);
    --xp-faint: rgba(251, 191, 36, 0.07);
    --xp-accent: #f59e0b;
    --xp-accent-bright: #fbbf24;
    --xp-accent-glow: rgba(245, 158, 11, 0.2);
    --xp-line: rgba(251, 191, 36, 0.12);
    --st-console-bg: linear-gradient(145deg, rgba(24, 18, 10, 0.96), rgba(10, 8, 5, 0.98));
    --st-map-accent: #fbbf24;
    --st-chart: #f59e0b;
}

.lb-st-ambient__grid {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(var(--xp-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--xp-line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.lb-st-ambient__orb--c {
    width: min(35vw, 320px);
    height: min(35vw, 320px);
    bottom: 8%;
    right: 10%;
    background: color-mix(in srgb, var(--xp-accent) 12%, transparent);
}

/* —— Hero grid —— */
.lb-st-hero__grid {
    align-items: stretch;
}

@media (min-width: 992px) {
    .lb-st-hero__grid .lb-xp-hero__copy {
        padding-bottom: 1rem;
    }
}

/* —— Live console (hero) —— */
.lb-st-console {
    border-radius: 20px;
    border: 1px solid var(--xp-line);
    background: var(--st-console-bg);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 24px 80px rgba(0, 0, 0, 0.45),
        0 0 60px var(--xp-accent-glow);
    overflow: hidden;
    min-height: 280px;
}

.lb-st-console__chrome {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--xp-line);
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--xp-muted);
}

.lb-st-console__dots {
    display: flex;
    gap: 5px;
}

.lb-st-console__dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xp-line);
}

.lb-st-console__dots i:first-child { background: #f87171; opacity: 0.7; }
.lb-st-console__dots i:nth-child(2) { background: #fbbf24; opacity: 0.7; }
.lb-st-console__dots i:nth-child(3) { background: #4ade80; opacity: 0.7; }

.lb-st-console__title {
    flex: 1;
    font-weight: 500;
    color: var(--xp-text);
}

.lb-st-console__live {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--xp-accent-bright);
}

.lb-st-console__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--xp-accent);
    animation: lb-st-pulse 2s ease-in-out infinite;
}

@keyframes lb-st-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.lb-st-console__body {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
}

.lb-st-console__body--fleet {
    grid-template-columns: 1fr auto;
}

.lb-st-console__body--access {
    grid-template-columns: 1fr auto;
    align-items: start;
}

.lb-st-console__body--network {
    grid-template-columns: 1fr auto;
    align-items: stretch;
}

@media (max-width: 520px) {
    .lb-st-console__body--fleet,
    .lb-st-console__body--access,
    .lb-st-console__body--network {
        grid-template-columns: 1fr;
    }
}

/* Fleet map mock */
.lb-st-map {
    position: relative;
    min-height: 180px;
    border-radius: 12px;
    border: 1px solid var(--xp-line);
    background:
        radial-gradient(ellipse 80% 70% at 60% 40%, color-mix(in srgb, var(--st-map-accent) 15%, transparent), transparent),
        #060a14;
    overflow: hidden;
}

.lb-st-map__grid {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image:
        linear-gradient(var(--xp-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--xp-line) 1px, transparent 1px);
    background-size: 20px 20px;
}

.lb-st-map__route {
    position: absolute;
    top: 35%;
    left: 12%;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--st-map-accent), transparent);
    transform: rotate(-8deg);
    opacity: 0.6;
}

.lb-st-map__route::after {
    content: '';
    position: absolute;
    right: 0;
    top: -30px;
    width: 55%;
    height: 2px;
    background: linear-gradient(90deg, var(--st-map-accent), transparent);
    transform: rotate(42deg);
    opacity: 0.45;
}

.lb-st-map__pin {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--st-map-accent);
    box-shadow: 0 0 12px var(--st-map-accent);
    animation: lb-st-pin 3s ease-in-out infinite;
}

.lb-st-map__pin--a { top: 28%; left: 22%; animation-delay: 0s; }
.lb-st-map__pin--b { top: 42%; left: 58%; animation-delay: 0.8s; }
.lb-st-map__pin--c { top: 62%; left: 38%; animation-delay: 1.6s; }

@keyframes lb-st-pin {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.75; }
}

.lb-st-map__label {
    position: absolute;
    bottom: 0.65rem;
    left: 0.75rem;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--xp-muted);
}

.lb-st-console__side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 110px;
}

.lb-st-gauge,
.lb-st-attendance-ring {
    position: relative;
    width: 100px;
    text-align: center;
}

.lb-st-gauge__svg,
.lb-st-attendance-ring svg {
    width: 100%;
    height: auto;
    transform: rotate(-90deg);
}

.lb-st-gauge__track {
    fill: none;
    stroke: var(--xp-faint);
    stroke-width: 6;
}

.lb-st-gauge__fill {
    fill: none;
    stroke: var(--xp-accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 214;
    stroke-dashoffset: calc(214 - (214 * var(--st-gauge, 0) / 100));
    transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 6px var(--xp-accent-glow));
}

.lb-st-gauge__value {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--xp-accent-bright);
}

.lb-st-gauge__label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.62rem;
    line-height: 1.35;
    color: var(--xp-muted);
}

.lb-st-mini-stats {
    display: grid;
    gap: 0.5rem;
}

.lb-st-mini-stat {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--xp-line);
    background: var(--xp-faint);
    text-align: center;
}

.lb-st-mini-stat__val {
    display: block;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--xp-text);
}

.lb-st-mini-stat__lbl {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--xp-muted);
}

/* Access doors mock */
.lb-st-doors {
    display: grid;
    gap: 0.45rem;
}

.lb-st-door {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--xp-line);
    font-size: 0.72rem;
}

.lb-st-door--secured {
    background: color-mix(in srgb, var(--xp-accent) 6%, transparent);
}

.lb-st-door--open {
    border-color: color-mix(in srgb, #fbbf24 40%, var(--xp-line));
    background: rgba(251, 191, 36, 0.06);
}

.lb-st-door__icon {
    color: var(--xp-accent);
    width: 1.25rem;
    text-align: center;
}

.lb-st-door--open .lb-st-door__icon {
    color: #fbbf24;
}

.lb-st-door__name {
    color: var(--xp-text);
    font-weight: 500;
}

.lb-st-door__count {
    color: var(--xp-muted);
    font-size: 0.62rem;
}

.lb-st-attendance-ring {
    padding-top: 0.5rem;
}

/* Network topology mock */
.lb-st-topology {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    min-height: 180px;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--xp-line);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.lb-st-topology::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 49%, var(--xp-line) 49%, var(--xp-line) 51%, transparent 51%) 0 35% / 100% 1px no-repeat,
        linear-gradient(90deg, transparent 49%, var(--xp-line) 49%, var(--xp-line) 51%, transparent 51%) 0 68% / 100% 1px no-repeat;
    opacity: 0.35;
    pointer-events: none;
}

.lb-st-topology__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.55rem 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--xp-line);
    background: var(--xp-faint);
    font-size: 0.62rem;
    text-align: center;
    color: var(--xp-muted);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.lb-st-topology__node i {
    font-size: 0.95rem;
    color: var(--xp-accent);
}

.lb-st-topology__node--ok {
    animation: lb-st-node-pulse 3s ease-in-out infinite;
}

.lb-st-topology__node--wan { grid-column: 1; grid-row: 1; }
.lb-st-topology__node--fw { grid-column: 2; grid-row: 1; }
.lb-st-topology__node--core { grid-column: 3; grid-row: 1; }
.lb-st-topology__node--poe { grid-column: 1; grid-row: 2; }
.lb-st-topology__node--srv { grid-column: 2; grid-row: 2; }
.lb-st-topology__node--nvr { grid-column: 3; grid-row: 2; }

@keyframes lb-st-node-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--xp-accent-glow); }
    50% { box-shadow: 0 0 16px 2px var(--xp-accent-glow); }
}

.lb-st-poe {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--xp-line);
    background: var(--xp-faint);
    text-align: center;
}

.lb-st-poe__label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--xp-muted);
    margin-bottom: 0.25rem;
}

.lb-st-poe__value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--xp-text);
    margin-bottom: 0.45rem;
}

.lb-st-poe__bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.lb-st-poe__fill {
    display: block;
    height: 100%;
    width: var(--st-poe, 50%);
    border-radius: 3px;
    background: linear-gradient(90deg, var(--xp-accent), var(--xp-accent-bright));
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Line chart */
.lb-st-linechart {
    padding: 1.25rem 1.1rem 1rem;
    min-height: 200px;
}

.lb-st-linechart__svg {
    width: 100%;
    height: 120px;
    display: block;
}

.lb-st-linechart__line {
    fill: none;
    stroke: var(--xp-accent-bright);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 6px var(--xp-accent-glow));
}

.lb-st-linechart__area {
    fill: var(--xp-accent-glow);
    stroke: none;
}

.lb-st-linechart--animated .lb-st-linechart__line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: lb-st-line-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes lb-st-line-draw {
    to { stroke-dashoffset: 0; }
}

.lb-st-linechart__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.6rem;
    color: var(--xp-muted);
}

/* —— Analytics strip —— */
.lb-st-analytics {
    padding: 0 0 clamp(2rem, 4vw, 3rem);
    margin-top: -0.5rem;
}

.lb-st-analytics__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

@media (max-width: 900px) {
    .lb-st-analytics__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.lb-st-metric {
    padding: 1.1rem 1.15rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--xp-line);
    background: linear-gradient(160deg, var(--xp-faint), transparent 70%);
    overflow: hidden;
}

.lb-st-metric__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.lb-st-metric__value {
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
    font-weight: 600;
    color: var(--xp-text);
    letter-spacing: -0.02em;
}

.lb-st-metric__delta {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--xp-accent);
}

.lb-st-metric__label {
    display: block;
    font-size: 0.78rem;
    color: var(--xp-muted);
    margin-bottom: 0.65rem;
}

.lb-st-metric__spark {
    width: 100%;
    height: 32px;
    display: block;
}

.lb-st-metric__spark-line {
    fill: none;
    stroke: var(--xp-accent);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    opacity: 0.85;
}

.lb-st-metric__spark-area {
    fill: var(--xp-accent-glow);
    stroke: none;
}

/* —— Report deck —— */
.lb-st-report {
    padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.lb-st-report__lead {
    max-width: 42rem;
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--xp-muted);
}

.lb-st-report__deck {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .lb-st-report__deck {
        grid-template-columns: 1fr;
    }
}

.lb-st-report__chart-panel,
.lb-st-report__log-panel {
    border-radius: 16px;
    border: 1px solid var(--xp-line);
    background: var(--xp-bg-elevated);
    overflow: hidden;
}

.lb-st-report__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--xp-line);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--xp-muted);
}

.lb-st-report__tag,
.lb-st-report__sync {
    color: var(--xp-accent);
    font-size: 0.65rem;
}

.lb-st-report__sync i {
    margin-right: 0.25rem;
    animation: lb-st-spin 8s linear infinite;
}

@keyframes lb-st-spin {
    to { transform: rotate(360deg); }
}

/* Bar chart */
.lb-st-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 1.25rem 1.1rem 1rem;
    min-height: 200px;
}

.lb-st-bars__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    height: 160px;
    justify-content: flex-end;
}

.lb-st-bars__bar {
    width: 100%;
    max-width: 36px;
    height: 0;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--xp-accent-bright), var(--st-chart));
    box-shadow: 0 0 20px var(--xp-accent-glow);
    transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.lb-st-bars.is-animated .lb-st-bars__bar {
    height: var(--st-bar-h, 50%);
}

.lb-st-bars__lbl {
    font-size: 0.6rem;
    color: var(--xp-muted);
    letter-spacing: 0.05em;
}

/* Event log table */
.lb-st-log {
    font-size: 0.72rem;
    max-height: 280px;
    overflow: auto;
}

.lb-st-log__head,
.lb-st-log__row {
    display: grid;
    grid-template-columns: 3.5rem 5.5rem 1fr 4rem;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    align-items: center;
}

@media (max-width: 600px) {
    .lb-st-log__head,
    .lb-st-log__row {
        grid-template-columns: 3rem 1fr 3.5rem;
    }

    .lb-st-log__head span:nth-child(2),
    .lb-st-log__row span:nth-child(2) {
        display: none;
    }
}

.lb-st-log__head {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.35);
    color: var(--xp-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.6rem;
    border-bottom: 1px solid var(--xp-line);
}

.lb-st-log__row {
    border-bottom: 1px solid var(--xp-faint);
    color: var(--xp-text);
    transition: background 0.2s;
}

.lb-st-log__row:hover {
    background: var(--xp-faint);
}

.lb-st-log__row span:last-child {
    text-align: right;
}

.lb-st-log__badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lb-st-log__row--ok .lb-st-log__badge {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.lb-st-log__row--info .lb-st-log__badge {
    background: color-mix(in srgb, var(--xp-accent) 15%, transparent);
    color: var(--xp-accent-bright);
}

.lb-st-log__row--warn .lb-st-log__badge {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.lb-st-log__row--alert .lb-st-log__badge {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

/* —— Stack cards —— */
.lb-st-stack {
    padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.lb-st-stack__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.lb-st-stack__card {
    padding: 1.15rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--xp-line);
    background: linear-gradient(135deg, var(--xp-faint), transparent);
    transition: border-color 0.3s, transform 0.3s;
}

.lb-st-stack__card:hover {
    border-color: color-mix(in srgb, var(--xp-accent) 35%, var(--xp-line));
    transform: translateY(-3px);
}

.lb-st-stack__card h3 {
    margin: 0 0 0.4rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--xp-accent-bright);
}

.lb-st-stack__card p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--xp-muted);
}

/* Mobile hero */
@media (max-width: 991px) {
    .lb-st-console {
        margin-top: 1.5rem;
    }
}

@media (max-width: 767px) {
    .lb-st-console__chrome {
        flex-wrap: wrap;
    }

    .lb-st-console__title {
        order: 3;
        width: 100%;
        margin-top: 0.25rem;
    }
}
