:root {
    --portal-bg: #f4f7fa;
    --portal-surface: #ffffff;
    --portal-ink: #0D1323;
    --portal-muted: #607086;
    --portal-line: #dbe5ef;
    --portal-primary: #006D7A;
    --portal-primary-dark: #0D1323;
    --portal-accent: #00C4A7;
    --portal-danger: #dc2626;
    --portal-warning: #d97706;
    --portal-shadow: 0 18px 50px rgba(22, 32, 51, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Poppins", "Segoe UI", Arial, sans-serif;
    background: var(--portal-bg);
    color: var(--portal-ink);
}

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

button, a { transition: 0.18s ease; }

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

.hidden { display: none !important; }

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    padding: 14px clamp(20px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(13, 19, 35, 0.94);
    border-bottom: 1px solid rgba(230, 232, 235, 0.12);
    backdrop-filter: blur(14px);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.portal-brand.compact { padding: 10px 0 22px; }

.portal-brand img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.portal-brand strong { display: block; font-size: 22px; letter-spacing: 0; color: #ffffff; }
.portal-brand small { color: #88c8cb; font-size: 12px; }

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #155eef, #10b981);
    box-shadow: 0 10px 28px rgba(21,94,239,0.25);
}

.portal-topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.portal-topbar nav a,
.portal-topbar nav button {
    border: 0;
    background: transparent;
    color: #c7d5e3;
    cursor: pointer;
    padding: 9px 10px;
    border-radius: 8px;
}

.portal-topbar nav a:hover,
.portal-topbar nav button:hover { background: rgba(0,196,167,0.12); color: #ffffff; }

.admin-link {
    border: 1px solid rgba(0,196,167,0.38) !important;
    color: #ffffff !important;
}

.hero {
    min-height: calc(100vh - 72px);
    padding: clamp(44px, 7vw, 86px) clamp(20px, 5vw, 72px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: clamp(28px, 6vw, 72px);
    align-items: center;
    background:
        radial-gradient(circle at 82% 18%, rgba(0, 196, 167, 0.23), transparent 36%),
        linear-gradient(135deg, #0D1323 0%, #10213a 58%, #006D7A 140%);
    color: #ffffff;
}

.hero-product-logo {
    display: block;
    width: min(360px, 80vw);
    max-height: 132px;
    object-fit: contain;
    object-position: left center;
    margin: 12px 0 14px;
    filter: drop-shadow(0 18px 38px rgba(0,0,0,0.28));
}

.hero-copy p {
    max-width: 680px;
    font-size: 21px;
    line-height: 1.55;
    color: #dbe7f1;
}

.eyebrow,
.section-title span {
    display: inline-flex;
    color: var(--portal-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.hero-actions,
.modal-actions,
.ticket-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.primary,
.secondary,
.ghost,
.danger {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    min-height: 42px;
    padding: 10px 16px;
    font-weight: 700;
}

.primary { background: var(--portal-primary); color: #fff; }
.primary:hover { background: var(--portal-primary-dark); }
.secondary { background: #eaf1ff; color: var(--portal-primary); }
.ghost { background: transparent; color: var(--portal-primary); }
.danger { background: #fee2e2; color: var(--portal-danger); }
.primary:disabled,
.secondary:disabled { opacity: 0.48; cursor: not-allowed; }

.hero-panel {
    min-height: 420px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(230, 232, 235, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 20% 10%, rgba(0,196,167,0.14), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(0,109,122,0.2), transparent 24%),
        rgba(13, 19, 35, 0.62);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.hero-brand-card {
    width: 100%;
    grid-column: 1 / -1;
    border-radius: 8px;
    border: 1px solid rgba(230, 232, 235, 0.12);
    display: block;
}

.metric {
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: 18px;
    border: 1px solid rgba(230, 232, 235, 0.14);
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.metric span { color: #8fded6; }
.metric strong { margin-top: 8px; font-size: 20px; }

.section {
    padding: 68px clamp(20px, 5vw, 72px);
}

.muted-section { background: #eef3fa; }

.section-title {
    max-width: 760px;
    margin-bottom: 26px;
}

.section-title h2,
.contact-band h2 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 46px);
    letter-spacing: 0;
}

.feature-grid,
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.feature-grid article,
.plan-card,
.download-card,
.customer-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(22,32,51,0.06);
}

.feature-grid h3,
.plan-card h3,
.customer-card h3 {
    margin: 0 0 10px;
}

.feature-grid p,
.plan-card p,
.download-card p,
.contact-band p {
    color: var(--portal-muted);
    line-height: 1.55;
}

.plan-price {
    font-size: 28px;
    color: var(--portal-primary);
    font-weight: 800;
    margin: 18px 0 12px;
}

.download-list {
    display: grid;
    gap: 12px;
}

.download-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

.simulator-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 20px;
    align-items: stretch;
    background: var(--portal-surface);
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(22,32,51,0.06);
}

.simulator-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.simulator-controls label,
.portal-form label {
    display: grid;
    gap: 7px;
    color: var(--portal-muted);
    font-weight: 700;
}

.simulator-controls input,
.simulator-controls select {
    min-height: 42px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--portal-ink);
    background: #fff;
}

.simulator-controls label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fbff;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 12px;
}

.simulator-result,
.proposal-values {
    display: grid;
    align-content: center;
    gap: 8px;
    background: #f8fbff;
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    padding: 18px;
}

.simulator-result span,
.proposal-values span,
.proposal-values small {
    color: var(--portal-muted);
}

.simulator-result strong,
.proposal-values strong {
    font-size: 30px;
    color: var(--portal-primary);
}

.proposal-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 18px;
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eef4ff;
    color: var(--portal-primary);
    font-size: 12px;
    font-weight: 700;
}

.contact-band {
    margin: 40px clamp(20px, 5vw, 72px) 70px;
    padding: 34px;
    border-radius: 18px;
    background: #172033;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.contact-band p { color: #c9d4e5; max-width: 700px; }

.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15,23,42,0.52);
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-card {
    width: min(640px, 100%);
    max-height: min(720px, 90vh);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--portal-line);
    box-shadow: var(--portal-shadow);
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    border: 0;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.portal-form {
    display: grid;
    gap: 12px;
}

.portal-form label {
    display: grid;
    gap: 7px;
    color: var(--portal-muted);
    font-weight: 600;
}

.portal-form input,
.portal-form textarea,
.portal-form select {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--portal-ink);
    background: #fff;
}

.portal-form textarea { min-height: 110px; resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.customer-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px 1fr;
    background: var(--portal-bg);
}

.customer-sidebar {
    background: #0d1b2e;
    border-right: 1px solid #20324a;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 100vh;
    overflow: auto;
}

.customer-sidebar .portal-brand.compact {
    padding: 4px 8px 18px;
    border-bottom: 1px solid #263a55;
}

.customer-sidebar .portal-brand strong { font-size: 18px; }
.customer-sidebar .portal-brand small { color: #7ddbd1; }

.customer-sidebar button {
    border: 1px solid transparent;
    background: transparent;
    color: #dbe7f4;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.customer-sidebar button:hover {
    background: #162b44;
    border-color: #294660;
    color: #fff;
}

.customer-sidebar button.active {
    background: #007b88;
    color: #fff;
    border-color: #1ba6aa;
    box-shadow: inset 3px 0 0 #5eead4;
}

.customer-menu-group {
    display: grid;
    gap: 5px;
}

.customer-menu-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #77e1d6 !important;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid #263a55 !important;
    border-radius: 0 !important;
    padding: 9px 7px !important;
}

.customer-menu-heading:hover { background: transparent !important; }

.menu-chevron {
    transition: transform 0.18s ease;
    font-size: 11px;
}

.customer-menu-group:not(.open) .menu-chevron { transform: rotate(-90deg); }
.customer-menu-group:not(.open) .customer-submenu { display: none; }

.customer-submenu {
    display: grid;
    gap: 3px;
}

.customer-submenu button {
    width: 100%;
    min-height: 38px;
    font-size: 14px;
}

#portalLogout {
    margin-top: auto;
    border-color: #314863;
    color: #ffb4b4;
}

.customer-main { min-width: 0; overflow-x: hidden; }

.customer-header {
    min-height: 76px;
    background: #fff;
    border-bottom: 1px solid var(--portal-line);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.customer-header h2 { margin: 0; }
.customer-header span { color: var(--portal-muted); }

.customer-header-actions,
.portal-live-state {
    display: flex;
    align-items: center;
}

.customer-header-actions { gap: 18px; }

.portal-environment-picker {
    display: grid;
    gap: 4px;
    min-width: 210px;
}

.portal-environment-picker > span {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-environment-picker select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #b8c9da;
    border-radius: 7px;
    padding: 7px 34px 7px 10px;
    background: #f8fafc;
    color: var(--portal-ink);
    font-weight: 800;
}

.portal-environment-picker select:focus {
    outline: 2px solid rgba(0, 109, 122, 0.2);
    border-color: var(--portal-primary);
}

.environment-loading {
    min-height: 180px;
    display: grid;
    place-content: center;
    text-align: center;
}

.portal-live-state {
    gap: 9px;
    padding-right: 18px;
    border-right: 1px solid var(--portal-line);
}

.portal-live-state div { display: grid; gap: 2px; }
.portal-live-state strong { font-size: 12px; color: #087f5b; }
.portal-live-state small { font-size: 11px; color: var(--portal-muted); }

.live-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
}

#customerContent {
    padding: 24px;
    display: grid;
    gap: 18px;
}

.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.customer-card strong {
    display: block;
    font-size: 26px;
    color: var(--portal-primary);
    margin-top: 8px;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    overflow: hidden;
}

.portal-table th,
.portal-table td {
    padding: 13px;
    border-bottom: 1px solid var(--portal-line);
    text-align: left;
    vertical-align: top;
}

.portal-table th {
    color: var(--portal-muted);
    background: #f8fafc;
    font-size: 13px;
}

.portal-table-wrap {
    overflow-x: auto;
}

.portal-table td strong {
    display: block;
    margin: 0 0 3px;
    color: var(--portal-ink);
    font-size: 14px;
}

.portal-table td small {
    display: block;
    color: var(--portal-muted);
}

.portal-identity-delivery {
    border-color: #5eead4;
    background: #f0fdfa;
}

.portal-identity-delivery label {
    display: grid;
    gap: 7px;
    color: var(--portal-muted);
    font-weight: 700;
}

.portal-identity-delivery input {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--portal-ink);
    background: #fff;
}

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
}

.stale-notice {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.notice.error {
    background: #fef2f2;
    color: var(--portal-danger);
    border-color: #fecaca;
}

.portal-invite-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0 14px;
}
.portal-invite-heading h2 { margin: 2px 0 0; }
.portal-invite-heading small { color: #087b83; font-weight: 800; }
.portal-invite-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #0c7880;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}
.portal-password-policy {
    padding: 10px 12px;
    border-left: 3px solid #0c7880;
    background: #eef8f8;
    color: #3d5560;
    font-size: 13px;
}
.portal-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #dce7ed;
}
.portal-invite-success { text-align: center; padding: 18px 8px 8px; }
.portal-invite-success > span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #e3f8ed;
    color: #08763f;
    font-weight: 800;
}

.tag.is-danger { background: #fee2e2; color: #991b1b; }
.tag.is-warning { background: #fef3c7; color: #92400e; }
.tag.is-ok { background: #dcfce7; color: #166534; }
.tag.is-muted { background: #eef4ff; color: var(--portal-primary); }

.ops-command-hero {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) minmax(180px, 240px);
    gap: 18px;
    align-items: stretch;
    padding: 22px;
    border-radius: 8px;
    background: #07545c;
    color: #fff;
    box-shadow: 0 18px 48px rgba(13, 19, 35, 0.16);
}

.ops-command-hero.is-danger { background: #8f1f29; }
.ops-command-hero.is-warning { background: #8a5108; }

.hero-score,
.hero-mission,
.hero-pulse {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    padding: 18px;
    background: rgba(255,255,255,0.07);
}

.hero-score span,
.hero-mission span,
.hero-pulse span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #99f6e4;
}

.hero-score strong {
    display: block;
    margin: 12px 0;
    font-size: 64px;
    line-height: 1;
}

.hero-score small { font-size: 22px; color: #ccfbf1; }
.hero-score p,
.hero-mission p,
.hero-pulse small { color: #e6fffb; }
.hero-mission h3 { margin: 10px 0; font-size: 26px; }
.hero-pulse strong { display: block; margin-top: 16px; font-size: 42px; }
.ops-command-hero[class*="dashboard-mode-"] .hero-pulse strong { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }

.observability-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
}

.observability-tabs button {
    border: 1px solid transparent;
    border-radius: 7px;
    background: #f5f8fb;
    color: #334155;
    padding: 9px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 800;
}

.observability-tabs button.active {
    background: var(--portal-primary);
    color: #fff;
    border-color: var(--portal-primary);
}

.portal-refresh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #ffffff;
}

.portal-refresh-bar strong {
    display: block;
    font-size: 14px;
}

.portal-refresh-bar span,
.portal-refresh-bar label {
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-refresh-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.portal-refresh-bar select {
    min-width: 92px;
    padding: 8px 10px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--portal-ink);
    font-weight: 800;
}

.ops-kpi-grid.executive {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

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

.command-card {
    min-height: 220px;
}

.command-card.wide {
    grid-column: span 2;
}

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

.portal-canonical-dashboard.incident {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
}

.portal-priority-incident {
    grid-row: span 2;
    align-self: start;
    border-left: 5px solid var(--portal-danger);
}

.portal-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--portal-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.portal-root-cause,
.portal-next-action {
    margin-top: 14px;
    padding: 14px;
    border-left: 4px solid var(--portal-warning);
    background: #fffbeb;
}

.portal-next-action {
    border-left-color: var(--portal-primary);
    background: #ecfeff;
}

.portal-root-cause small,
.portal-root-cause strong,
.portal-root-cause span,
.portal-next-action small,
.portal-next-action strong,
.portal-next-action span {
    display: block;
}

.portal-root-cause strong,
.portal-next-action strong { margin: 5px 0; }
.portal-root-cause span,
.portal-next-action span { color: var(--portal-muted); font-size: 12px; }

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

.portal-impact-grid > div {
    min-width: 0;
    padding: 10px;
    background: #f5f8fb;
}

.portal-impact-grid span,
.portal-impact-grid strong { display: block; }
.portal-impact-grid span { color: var(--portal-muted); font-size: 11px; }
.portal-impact-grid strong { margin-top: 5px; overflow-wrap: anywhere; }

.portal-canonical-intro {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-left: 5px solid var(--portal-primary);
}

.portal-canonical-intro p { max-width: 720px; }
.portal-canonical-list > div {
    position: relative;
    margin-top: 8px;
    padding: 10px;
    border-left: 3px solid var(--portal-primary);
    background: #f8fafc;
}
.portal-canonical-list strong,
.portal-canonical-list small { display: block; }
.portal-canonical-list small { margin-top: 3px; color: var(--portal-muted); }
.portal-canonical-list b { position: absolute; top: 10px; right: 10px; color: var(--portal-primary); }
.portal-quality-card { border-top: 4px solid #64748b; }
.portal-copilot-card { border-top: 4px solid #0ea5e9; }
.portal-timeline-card { max-height: 430px; overflow: hidden; }
.portal-timeline-scroll {
    max-height: 340px;
    margin-top: 12px;
    padding-right: 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.portal-timeline-scroll:focus-visible { outline: 3px solid rgba(14, 165, 233, .25); outline-offset: 3px; }
.portal-timeline-scroll::-webkit-scrollbar { width: 9px; }
.portal-timeline-scroll::-webkit-scrollbar-track { background: #eef2f7; }
.portal-timeline-scroll::-webkit-scrollbar-thumb { border: 2px solid #eef2f7; border-radius: 8px; background: #94a3b8; }

.alert-card-list,
.mini-stack {
    display: grid;
    gap: 10px;
}

.alert-card-list article,
.mini-stack div {
    border: 1px solid var(--portal-line);
    border-left: 4px solid var(--portal-primary);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.alert-card-list article.is-danger { border-left-color: var(--portal-danger); background: #fff7f7; }
.alert-card-list article.is-warning { border-left-color: var(--portal-warning); background: #fffbeb; }
.alert-card-list span,
.mini-stack span {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
}

.alert-card-list strong,
.mini-stack strong {
    display: block;
    margin: 4px 0;
    color: var(--portal-ink);
    font-size: 14px;
}

.alert-card-list small {
    color: var(--portal-muted);
}

.status-source {
    display: block;
    margin-top: 5px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
}

.ops-hero {
    background: linear-gradient(135deg, #083344, #0f766e);
    color: #fff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 12px 32px rgba(13, 19, 35, 0.14);
}

.ops-hero.is-danger { background: linear-gradient(135deg, #4c0519, #b91c1c); }
.ops-hero.is-warning { background: linear-gradient(135deg, #78350f, #b45309); }
.ops-hero span { display: block; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; color: #a7f3d0; }
.ops-hero strong { display: block; margin: 10px 0; font-size: 56px; line-height: 1; }
.ops-hero strong small { font-size: 22px; color: #d9fff8; }
.ops-hero p { margin: 0; color: #e8fffb; }

.ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.ops-kpi {
    min-height: 104px;
    border: 1px solid var(--portal-line);
    border-left: 4px solid var(--portal-primary);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    display: grid;
    align-content: center;
    gap: 7px;
}

.ops-kpi span,
.ops-kpi small {
    color: var(--portal-muted);
    font-size: 12px;
}

.ops-kpi strong {
    color: var(--portal-ink);
    font-size: 28px;
    line-height: 1.15;
}

.ops-kpi.is-danger { border-left-color: var(--portal-danger); background: #fff7f7; }
.ops-kpi.is-warning { border-left-color: var(--portal-warning); background: #fffbeb; }
.ops-kpi.is-ok { border-left-color: #16a34a; background: #f0fdf4; }
.ops-kpi.is-muted { border-left-color: #94a3b8; background: #f8fafc; }

.ops-two-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.ops-toolbar,
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.ops-toolbar {
    justify-content: flex-start;
}

.ops-toolbar button,
.compact-btn {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 13px;
}

.table-scroll {
    width: 100%;
    overflow: auto;
}

.ops-table td code {
    font-size: 12px;
}

.priority-list,
.timeline-list {
    display: grid;
    gap: 10px;
}

.priority-list article,
.timeline-list article {
    border-left: 4px solid var(--portal-primary);
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.priority-list article.critico { border-left-color: var(--portal-danger); background: #fff7f7; }
.priority-list article.aviso { border-left-color: var(--portal-warning); background: #fffbeb; }
.priority-list strong,
.timeline-list strong { display: block; color: var(--portal-ink); font-size: 15px; }
.priority-list span,
.timeline-list span { display: block; margin-top: 4px; color: var(--portal-muted); }

.ops-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.action-card {
    text-align: left;
    cursor: pointer;
}

.action-card span {
    display: block;
    margin-top: 6px;
    color: var(--portal-muted);
}

.copilot-card textarea {
    min-height: 130px;
}

.copilot-answer {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.report-json {
    max-height: 320px;
    overflow: auto;
    background: #0f172a;
    color: #d1fae5;
    border-radius: 8px;
    padding: 14px;
    white-space: pre-wrap;
}

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

.erp-health-strip article {
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--portal-line);
    border-top: 4px solid var(--portal-primary);
    border-radius: 8px;
    background: #fff;
}

.erp-health-strip article.is-danger { border-top-color: var(--portal-danger); background: #fff7f7; }
.erp-health-strip article.is-warning { border-top-color: var(--portal-warning); background: #fffbeb; }
.erp-health-strip article.is-ok { border-top-color: #16a34a; background: #f0fdf4; }
.erp-health-strip article > span { color: var(--portal-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.erp-health-strip article > strong { display: block; margin: 8px 0; font-size: 30px; }
.erp-health-strip article > strong small { font-size: 14px; color: var(--portal-muted); }
.erp-health-strip article p { display: flex; align-items: center; gap: 8px; margin: 0; }
.erp-health-strip article p small { color: var(--portal-muted); }

.incident-ledger { display: grid; gap: 10px; }
.incident-ledger article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 18px;
    padding: 13px 14px;
    border: 1px solid var(--portal-line);
    border-left: 4px solid var(--portal-primary);
    border-radius: 8px;
    background: #f8fafc;
}
.incident-ledger article.is-danger { border-left-color: var(--portal-danger); background: #fff7f7; }
.incident-ledger article.is-warning { border-left-color: var(--portal-warning); background: #fffbeb; }
.incident-ledger article span, .incident-ledger article small { color: var(--portal-muted); font-size: 12px; }
.incident-ledger article strong { display: block; margin-top: 3px; }
.incident-ledger article p { margin: 0; }
.incident-ledger article > small { grid-column: 1 / -1; }

.topology-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.section-subtitle { margin-top: 22px; }
.evidence-excerpt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 1350px) {
    .ops-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-kpi-grid.executive { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
    .portal-topbar { align-items: flex-start; flex-direction: column; }
    .portal-topbar nav { width: 100%; }
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero-panel { min-height: 300px; }
    .download-card,
    .contact-band { grid-template-columns: 1fr; display: grid; }
    .customer-app { grid-template-columns: 1fr; }
    .customer-sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        grid-template-columns: minmax(0, 1fr) auto;
        display: grid;
        gap: 7px 10px;
        padding: 9px 10px;
        border-right: 0;
        border-bottom: 1px solid #20324a;
        max-height: none;
        overflow: visible;
    }
    .customer-sidebar .portal-brand.compact {
        min-width: 0;
        padding: 2px 4px 7px;
        border-bottom: 0;
    }
    .customer-sidebar .portal-brand img { width: 34px; height: 34px; }
    .customer-sidebar .portal-brand strong { font-size: 15px; }
    .customer-sidebar .portal-brand small { font-size: 10px; }
    .customer-menu-group { grid-column: 1 / -1; min-width: 0; gap: 2px; }
    .customer-menu-heading { min-height: 28px; padding: 4px 7px !important; }
    .customer-menu-group:not(.open) .customer-submenu,
    .customer-submenu {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        padding: 2px 0 5px;
        scrollbar-width: none;
    }
    .customer-submenu::-webkit-scrollbar { display: none; }
    .customer-submenu button {
        width: auto;
        min-width: max-content;
        min-height: 32px;
        padding: 6px 9px;
        font-size: 12px;
        white-space: nowrap;
    }
    #portalLogout {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        margin: 0;
        min-height: 32px;
        padding: 6px 9px;
    }
    .customer-main { width: 100%; max-width: 100vw; min-width: 0; }
    .customer-header { align-items: flex-start; gap: 12px; flex-direction: column; height: auto; }
    .customer-header-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; }
    .portal-live-state { min-width: 0; padding-right: 0; border-right: 0; }
    .portal-live-state div { min-width: 0; }
    .portal-live-state small { overflow-wrap: anywhere; }
    .portal-environment-picker { min-width: min(100%, 260px); }
    #customerContent { width: 100%; min-width: 0; padding: 14px; }
    #customerContent > * { width: 100%; max-width: 100%; min-width: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .ops-command-hero,
    .ops-dashboard-grid,
    .ops-kpi-grid.executive,
    .erp-health-strip,
    .topology-summary,
    .portal-canonical-dashboard,
    .portal-canonical-dashboard.incident,
    .portal-impact-grid { grid-template-columns: 1fr; }
    .portal-priority-incident { grid-row: auto; }
    .portal-canonical-intro { align-items: flex-start; flex-direction: column; }
    .portal-timeline-card { max-height: 390px; }
    .portal-timeline-scroll { max-height: 300px; }
    .command-card.wide { grid-column: auto; }
    .hero-score, .hero-mission, .hero-pulse { min-width: 0; }
    .hero-mission .ops-toolbar { display: grid; grid-template-columns: 1fr; }
    .hero-mission .ops-toolbar button { width: 100%; }
    .ops-hero,
    .ops-two-cols { grid-template-columns: 1fr; display: grid; }
    .ops-hero strong { font-size: 42px; }
}
.consent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px 0}.consent-grid label{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #d7e2ec;background:#f7fafc}.consent-grid input{width:auto}@media(max-width:720px){.consent-grid{grid-template-columns:1fr}}

/* PROResolver Web uses the same visual hierarchy and functional map as Complete. */
.product-web-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    color: #0f172a;
}

.proresolver-web-runtime {
    display: none;
    width: 100%;
    height: 100vh;
    border: 0;
    background: #f4f7fa;
}

.product-web-shell.runtime-active {
    display: block;
    overflow: hidden;
}

.product-web-shell.runtime-active .proresolver-web-runtime {
    display: block;
}

.product-web-shell.runtime-active > .customer-sidebar,
.product-web-shell.runtime-active > .customer-main,
.product-web-shell.runtime-active > .product-web-copilot {
    display: none !important;
}

.product-sidebar {
    padding: 0;
    gap: 0;
    background: #0b2030;
    border-right: 1px solid #274154;
}

.product-brand {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 24px 18px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

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

.product-brand strong {
    color: #fff;
    font-size: 20px;
    line-height: 1.1;
}

.product-brand strong span {
    display: inline-block;
    margin-left: 4px;
    padding: 3px 7px;
    color: #99f6e4;
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 999px;
    font-size: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.product-brand small {
    color: #5eead4;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.product-navigation {
    display: grid;
    gap: 5px;
    padding: 18px 12px;
}

.product-section-label {
    margin-top: 12px;
    padding: 7px 9px 4px;
    color: #38bdf8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.product-operation-nav {
    display: grid;
    gap: 5px;
}

.product-nav-item,
.product-submenu > button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-nav-item::before,
.product-submenu > button::before {
    content: attr(data-nav-icon);
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 7px;
    background: rgba(20, 184, 166, 0.13);
    color: #5eead4;
    font-size: 10px;
    font-weight: 900;
}

.product-nav-item {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
    font-weight: 800;
}

.product-menu-block {
    gap: 3px;
}

.product-menu-toggle {
    min-height: 44px;
    font-size: 14px;
    text-transform: none;
    border: 1px solid rgba(71, 115, 140, 0.34) !important;
    border-radius: 9px !important;
    padding: 8px 10px !important;
}

.product-menu-toggle > span:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
}

.nav-mark {
    display: grid;
    min-width: 28px;
    height: 28px;
    padding: 0 4px;
    place-items: center;
    border-radius: 7px;
    background: rgba(20, 184, 166, 0.17);
    color: #5eead4;
    font-size: 10px;
}

.product-submenu {
    gap: 2px;
    padding: 4px 0 6px 7px;
}

.product-submenu > button {
    min-height: 37px;
    padding: 7px 9px;
    font-size: 13px;
    font-weight: 700;
}

.product-subgroup-label {
    margin: 7px 8px 3px 36px;
    padding-bottom: 4px;
    color: #2dd4bf;
    border-bottom: 1px solid rgba(45, 212, 191, 0.2);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-user-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: auto 12px 8px;
    padding: 10px;
    color: #fff;
    border: 1px solid #29465c;
    border-radius: 10px;
    background: #102a3d;
}

.product-user-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: #0f8f8d;
    color: #fff !important;
    font-weight: 900;
}

.product-user-card div {
    min-width: 0;
}

.product-user-card strong,
.product-user-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-user-card small {
    margin-top: 2px;
    color: #8bb8c7;
    font-size: 11px;
}

.product-logout {
    margin: 0 12px 15px !important;
}

.product-web-shell .customer-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 86px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.product-web-shell #customerContent {
    width: min(100%, 1680px);
    margin: 0 auto;
}

.product-page-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 3px solid #0f9f93;
}

.product-page-intro h3 {
    margin: 4px 0 8px;
    font-size: 22px;
}

.product-page-intro p {
    max-width: 900px;
    margin: 0;
}

.product-empty-state {
    min-height: 300px;
    display: grid;
    place-content: center;
    justify-items: start;
}

.product-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.product-table-filter {
    width: min(430px, 100%);
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #b8c9da;
    border-radius: 8px;
}

.product-ops-toolbar {
    margin-top: 12px;
}

.product-web-copilot {
    position: fixed;
    right: 22px;
    bottom: 18px;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    background: #078b8d;
    color: #fff;
    box-shadow: 0 12px 30px rgba(6, 95, 103, 0.28);
    font-weight: 900;
    cursor: pointer;
}

.product-web-copilot span {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-size: 11px;
}

#portalCopilotPergunta {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #b8c9da;
    border-radius: 9px;
    resize: vertical;
}

.product-menu-block[hidden],
.product-operation-nav[hidden] {
    display: none !important;
}

@media (max-width: 880px) {
    .product-web-shell {
        grid-template-columns: 1fr;
    }

    .product-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 8px 10px;
        max-height: 54vh;
        overflow-y: auto;
    }

    .product-brand {
        justify-items: start;
        padding: 5px 8px 9px;
        border-bottom: 0;
    }

    .product-brand img { width: 120px; }
    .product-brand strong,
    .product-brand small { display: none; }
    .product-navigation { grid-column: 1 / -1; padding: 4px 0; }
    .product-operation-nav { display: grid; }
    .product-section-label { margin-top: 6px; }
    .product-user-card { display: none; }
    .product-logout { grid-column: 2; grid-row: 1; margin: 4px 0 !important; }
    .product-submenu { display: grid; overflow: visible; }
    .product-submenu > button { width: 100%; min-width: 0; white-space: normal; }
    .product-page-intro { align-items: flex-start; flex-direction: column; }
    .product-web-copilot { right: 12px; bottom: 12px; padding: 9px 13px; }
}
