:root {
    --bg: #06111f;
    --panel: #0b1d31;
    --panel-soft: #0f263e;
    --panel-deep: #071727;
    --border: rgba(126, 211, 255, 0.14);
    --border-strong: rgba(126, 211, 255, 0.28);
    --text: #f5fbff;
    --muted: #88a2b7;
    --soft: #bed0de;
    --blue: #66d8ff;
    --green: #55dda1;
    --yellow: #f0d45d;
    --orange: #ff9b62;
    --red: #ff657d;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 75% 10%, rgba(41, 140, 196, 0.13), transparent 35%),
        linear-gradient(145deg, #071421, var(--bg));
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 18px;
    background: rgba(4, 14, 25, 0.94);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

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

.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 1.05rem;
}

.brand span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.7rem;
}

.nav-list {
    display: grid;
    gap: 7px;
    margin-top: 34px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 13px;
    text-align: left;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(102, 216, 255, 0.04);
}

.nav-item.active {
    color: var(--text);
    background: rgba(102, 216, 255, 0.08);
    border-color: var(--border-strong);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--blue);
    background: rgba(102, 216, 255, 0.08);
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 13px;
    background: rgba(85, 221, 161, 0.05);
    border: 1px solid rgba(85, 221, 161, 0.12);
    border-radius: 13px;
}

.sidebar-status strong,
.sidebar-status span {
    display: block;
}

.sidebar-status strong {
    font-size: 0.76rem;
}

.sidebar-status span:last-child {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
}

.online-dot {
    width: 9px;
    height: 9px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(85, 221, 161, 0.8);
}

.fleet-link {
    margin-top: 12px;
    color: var(--blue);
    font-size: 0.72rem;
    text-decoration: none;
}

.workspace {
    min-width: 0;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 30px;
    background: rgba(7, 21, 36, 0.72);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.page-kicker,
.card-label {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.workspace-header h1 {
    margin: 5px 0 0;
    font-size: 1.45rem;
}

.header-meta {
    display: flex;
    gap: 18px;
    margin-top: 8px;
}

.header-meta span,
.header-meta strong {
    display: block;
}

.header-meta span {
    color: var(--muted);
    font-size: 0.68rem;
}

.header-meta strong {
    margin-top: 3px;
    color: var(--soft);
    font-size: 0.74rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.language-select span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.language-select select {
    padding: 8px 10px;
    color: var(--text);
    background: var(--panel-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.status-pill,
.simple-badge,
.coming-soon {
    padding: 7px 10px;
    color: var(--green);
    background: rgba(85, 221, 161, 0.08);
    border: 1px solid rgba(85, 221, 161, 0.18);
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.content {
    padding: 24px 30px 40px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

.section-title h2 {
    margin: 5px 0 0;
    font-size: 1.35rem;
}

.card {
    background:
        linear-gradient(145deg, rgba(13, 36, 59, 0.96), rgba(7, 21, 36, 0.94));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.overview-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) 1.45fr;
    gap: 14px;
}

.hero-health {
    min-height: 330px;
    padding: 28px;
}

.health-value {
    display: flex;
    align-items: flex-end;
    margin-top: 32px;
}

.health-value strong {
    font-size: 5rem;
    line-height: 0.85;
}

.health-value span {
    margin-left: 5px;
    color: var(--muted);
    font-size: 1.2rem;
}

.health-label {
    display: inline-flex;
    margin-top: 22px;
    padding: 8px 11px;
    color: var(--green);
    background: rgba(85, 221, 161, 0.07);
    border: 1px solid rgba(85, 221, 161, 0.16);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.hero-health p {
    margin: 20px 0 0;
    color: var(--soft);
    line-height: 1.65;
}

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

.summary-card {
    min-height: 158px;
    padding: 21px;
}

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

.summary-card span {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.summary-card strong {
    margin-top: 16px;
    font-size: 1.12rem;
    line-height: 1.45;
}

.summary-card small {
    margin-top: 10px;
    color: var(--muted);
}

.simple-report {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 14px;
    padding: 24px;
}

.simple-report h3 {
    margin: 8px 0 0;
    font-size: 1.08rem;
}

.simple-report p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--soft);
    line-height: 1.6;
}

.primary-button,
.small-button {
    padding: 9px 12px;
    color: var(--text);
    background: rgba(102, 216, 255, 0.08);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

.primary-button:hover,
.small-button:hover,
.small-button.active {
    background: rgba(102, 216, 255, 0.16);
}

.analysis-layout {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 14px;
}

.analysis-main,
.subsystem-card {
    padding: 23px;
}

.analysis-main h3 {
    margin: 14px 0 0;
    font-size: 1.25rem;
    line-height: 1.5;
}

.analysis-main p {
    margin: 18px 0 0;
    color: var(--soft);
    line-height: 1.6;
}

.analysis-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    margin-top: 22px;
    padding: 15px;
    background: rgba(102, 216, 255, 0.045);
    border-radius: 13px;
}

.analysis-row span,
.analysis-row strong {
    display: block;
}

.analysis-row span {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.analysis-row strong {
    margin-top: 5px;
}

.subsystem-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.subsystem-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 11px;
}

.findings-header {
    display: flex;
    justify-content: space-between;
    margin: 20px 2px 10px;
}

.findings-header h3 {
    margin: 0;
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.finding-card {
    padding: 17px;
}

.finding-head {
    display: flex;
    justify-content: space-between;
}

.finding-severity {
    color: var(--green);
    font-size: 0.66rem;
    font-weight: 800;
}

.finding-card h4 {
    margin: 15px 0 8px;
    font-size: 0.83rem;
}

.finding-card p {
    margin: 0;
    color: var(--soft);
    font-size: 0.74rem;
    line-height: 1.5;
}

.finding-card small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
}

.metrics-grid,
.profile-grid,
.history-summary,
.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric-card,
.profile-card,
.history-summary article,
.maintenance-card {
    padding: 18px;
}

.metric-card span,
.metric-card strong,
.metric-card small,
.profile-card span,
.profile-card strong,
.history-summary span,
.history-summary strong {
    display: block;
}

.metric-card span,
.profile-card span,
.history-summary span {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.metric-card strong,
.profile-card strong,
.history-summary strong {
    margin-top: 13px;
    font-size: 1.45rem;
}

.metric-card small {
    margin-top: 4px;
    color: var(--muted);
}

.chart-actions {
    display: flex;
    gap: 7px;
}

.chart-card {
    margin-top: 14px;
    padding: 20px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-header h3,
.chart-card h3,
.timeline-card h3 {
    margin: 0;
    font-size: 1rem;
}

.chart-container {
    height: 370px;
    margin-top: 14px;
}

.profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding: 18px;
}

.timeline-card {
    margin-top: 14px;
    padding: 20px;
}

.timeline {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 150px 100px 1fr;
    gap: 15px;
    align-items: center;
    padding: 13px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 11px;
}

.timeline-item time,
.timeline-item span {
    color: var(--muted);
    font-size: 0.72rem;
}

.timeline-item strong {
    font-size: 0.78rem;
}

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

.maintenance-card p {
    color: var(--soft);
    line-height: 1.55;
}

.coming-soon {
    display: inline-flex;
    color: var(--blue);
    background: rgba(102, 216, 255, 0.07);
    border-color: var(--border-strong);
}

@media (max-width: 1100px) {
    .overview-layout,
    .analysis-layout {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 820px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 20px;
    }

    .sidebar-status,
    .fleet-link {
        display: none;
    }

    .workspace-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .content,
    .workspace-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-cards,
    .metrics-grid,
    .profile-grid,
    .history-summary,
    .maintenance-grid,
    .findings-grid {
        grid-template-columns: 1fr;
    }

    .simple-report,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}


#findings-count {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    color: var(--blue);
    background: rgba(102, 216, 255, 0.08);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}


/* Sentinel V5.2 — Alarms + Users */

.status-dot-inline {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(85, 221, 161, 0.7);
}

.alarm-state-ok {
    display: inline-flex;
    align-items: center;
}

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

.alarm-stat {
    padding: 18px;
}

.alarm-stat span,
.alarm-stat strong,
.alarm-stat small {
    display: block;
}

.alarm-stat span {
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.alarm-stat strong {
    margin-top: 12px;
    font-size: 1.75rem;
}

.alarm-stat small {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.45;
}

.alarms-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr;
    gap: 14px;
    margin-top: 14px;
}

.alarm-empty,
.escalation-card,
.alarm-table-card,
.users-intro,
.user-list-card {
    padding: 22px;
}

.alarm-empty {
    display: flex;
    align-items: center;
    gap: 18px;
}

.alarm-empty-icon {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    color: var(--green);
    background: rgba(85, 221, 161, 0.08);
    border: 1px solid rgba(85, 221, 161, 0.18);
    border-radius: 50%;
    font-size: 1.45rem;
    font-weight: 900;
}

.alarm-empty h3,
.escalation-card h3,
.users-intro h3 {
    margin: 8px 0 0;
}

.alarm-empty p,
.users-intro p {
    margin: 9px 0 0;
    color: var(--soft);
    line-height: 1.55;
}

.escalation-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 9px;
    align-items: center;
    margin-top: 18px;
}

.escalation-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 12px;
    background: rgba(102, 216, 255, 0.04);
    border: 1px solid rgba(102, 216, 255, 0.08);
    border-radius: 12px;
}

.escalation-step > span {
    display: grid;
    place-items: center;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    color: var(--blue);
    background: rgba(102, 216, 255, 0.08);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 900;
}

.escalation-step strong,
.escalation-step small {
    display: block;
}

.escalation-step strong {
    font-size: 0.76rem;
}

.escalation-step small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.66rem;
}

.escalation-arrow {
    color: var(--blue);
    font-weight: 900;
}

.foundation-note {
    display: grid;
    gap: 5px;
    margin-top: 15px;
    padding: 12px;
    color: var(--soft);
    background: rgba(85, 221, 161, 0.04);
    border: 1px solid rgba(85, 221, 161, 0.10);
    border-radius: 11px;
    font-size: 0.72rem;
    line-height: 1.45;
}

.foundation-note strong {
    color: var(--green);
}

.alarm-table-card,
.user-list-card {
    margin-top: 14px;
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.table-card-header h3 {
    margin: 6px 0 0;
    font-size: 1rem;
}

.empty-table-state {
    display: grid;
    place-items: center;
    min-height: 120px;
    margin-top: 15px;
    padding: 20px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.018);
    border: 1px dashed rgba(126, 211, 255, 0.13);
    border-radius: 13px;
    text-align: center;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.users-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.users-intro > div:first-child {
    max-width: 760px;
}

.users-status {
    min-width: 180px;
    padding: 15px;
    background: rgba(102, 216, 255, 0.04);
    border: 1px solid rgba(102, 216, 255, 0.09);
    border-radius: 12px;
}

.users-status span,
.users-status strong {
    display: block;
}

.users-status span {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.users-status strong {
    margin-top: 7px;
    color: var(--blue);
    font-size: 0.82rem;
}

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

.role-card {
    padding: 18px;
}

.role-admin {
    border-color: rgba(102, 216, 255, 0.28);
}

.role-header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.role-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--blue);
    background: rgba(102, 216, 255, 0.08);
    border-radius: 10px;
    font-weight: 900;
}

.role-header strong,
.role-header small {
    display: block;
}

.role-header small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
}

.role-card ul {
    display: grid;
    gap: 9px;
    margin: 17px 0 0;
    padding: 0;
    list-style: none;
}

.role-card li {
    position: relative;
    padding-left: 15px;
    color: var(--soft);
    font-size: 0.72rem;
    line-height: 1.45;
}

.role-card li::before {
    position: absolute;
    left: 0;
    color: var(--green);
    content: "•";
}

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

    .alarms-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .alarms-summary,
    .role-grid {
        grid-template-columns: 1fr;
    }

    .escalation-flow {
        grid-template-columns: 1fr;
    }

    .escalation-arrow {
        transform: rotate(90deg);
        text-align: center;
    }

    .users-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .users-status {
        width: 100%;
    }
}
