:root {
    color-scheme: light;
    --ink: #18202a;
    --muted: #627082;
    --line: #dce2e7;
    --panel: #ffffff;
    --soft: #f6f7f8;
    --navy: #152c46;
    --red: #b51f2a;
    --gold: #d8a23a;
    --cocoa: #6d4324;
    --green: #187653;
    --amber: #b7791f;
    --danger: #b42318;
    --blue: #2563a6;
    --shadow: 0 14px 36px rgba(24, 32, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #fffaf1 0, #f7f8fb 260px);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
    scroll-behavior: smooth;
}

a {
    color: var(--red);
    text-decoration: none;
}

button,
select,
input {
    font: inherit;
}

button {
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: var(--red);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 8px 12px;
}

button:hover {
    filter: brightness(0.95);
}

select,
input {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    padding: 8px 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

pre {
    overflow: auto;
    min-height: 120px;
    margin: 0;
    border-radius: 7px;
    background: #101a24;
    color: #eef6f7;
    padding: 14px;
    font-size: 12px;
    line-height: 1.5;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    padding: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    margin-bottom: 28px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    box-shadow: 8px 8px 0 var(--gold);
    font-weight: 900;
}

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

.brand small {
    color: var(--muted);
}

.sidebar-nav-layout {
    display: grid;
    grid-template-columns: minmax(125px, 0.9fr) minmax(165px, 1.1fr);
    gap: 14px;
    align-items: start;
}

.sidebar-nav-guide,
.sidebar-nav-system {
    display: grid;
    gap: 10px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    border-radius: 7px;
    color: var(--navy);
    font-weight: 800;
    padding: 11px 12px;
}

.sidebar-nav-system .sidebar-nav-link {
    border: 1px solid transparent;
    background: #ffffff;
}

.sidebar-nav-system .sidebar-nav-link.active,
.sidebar-nav-system .sidebar-nav-link:hover {
    background: #fff3db;
    color: var(--red);
}

.intro-nav-link {
    border: 1px solid rgba(125, 211, 252, 0.24);
    background: #102a43;
    color: #ffffff;
}

.intro-nav-link.active,
.intro-nav-link:hover {
    border-color: rgba(255, 223, 100, 0.58);
    background: #071d33;
    color: #ffdf64;
}

.sidebar-nav-link.guide-nav-pulse {
    background: #ffdf64;
    color: #5c3b00;
    animation: guidePulse 1.35s ease-in-out infinite;
}

.sidebar-form {
    margin: 0;
}

.reset-demo-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 223, 100, 0.42);
    background: #071d33;
    color: #ffdf64;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.reset-demo-button:hover {
    background: #ffdf64;
    color: #3b2500;
}

.intro-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.intro-profile-photo {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    object-fit: cover;
    box-shadow: 0 16px 34px rgba(5, 17, 31, 0.45);
    margin: 0 0 14px;
}

.intro-copy {
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-top: 4px solid var(--gold);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(21, 44, 70, 0.98) 0, rgba(7, 29, 51, 0.98) 62%, rgba(3, 66, 77, 0.96) 100%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 18px);
    box-shadow: 0 20px 42px rgba(8, 22, 36, 0.2);
    padding: 28px;
}

.intro-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 12px;
}

.intro-meta span {
    border: 1px solid rgba(255, 223, 100, 0.36);
    border-radius: 999px;
    background: rgba(255, 223, 100, 0.12);
    color: #ffdf64;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 10px;
}

.intro-copy h2 {
    max-width: 760px;
    margin-bottom: 16px;
    color: #ffffff;
    font-size: 42px;
}

.intro-copy p {
    max-width: 760px;
    color: rgba(239, 246, 255, 0.86);
    font-size: 18px;
    line-height: 1.55;
}

.intro-copy .eyebrow {
    color: #ffdf64;
}

.start-demo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 20px;
    border-radius: 8px;
    background: #ffdf64;
    color: #3b2500;
    font-size: 18px;
    font-weight: 900;
    padding: 0 24px;
    animation: guidePulse 1.35s ease-in-out infinite;
}

.intro-stack {
    display: grid;
    gap: 12px;
}

.intro-stack article,
.intro-grid .panel {
    border-top: 4px solid #0a9c96;
}

.intro-stack article {
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 8px;
    background: linear-gradient(180deg, #102a43 0, #071d33 100%);
    box-shadow: 0 16px 34px rgba(8, 22, 36, 0.16);
    padding: 18px;
}

.intro-stack strong,
.intro-stack span {
    display: block;
}

.intro-stack strong {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 18px;
}

.intro-stack span {
    color: rgba(239, 246, 255, 0.78);
    line-height: 1.45;
}

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

.intro-list {
    margin: 0;
    padding-left: 20px;
    color: rgba(239, 246, 255, 0.78);
}

.intro-list li {
    margin: 8px 0;
}

.intro-grid .panel {
    border-color: rgba(125, 211, 252, 0.22);
    border-top-color: #0a9c96;
    background: linear-gradient(180deg, #102a43 0, #071d33 100%);
    box-shadow: 0 16px 34px rgba(8, 22, 36, 0.16);
}

.intro-grid .panel h2 {
    color: #ffffff;
}

.intro-grid .panel p,
.intro-grid .panel li {
    color: rgba(239, 246, 255, 0.78);
}

.main-content {
    width: min(100%, 1280px);
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0;
}

h1 {
    font-size: 34px;
}

h2 {
    font-size: 18px;
}

.role-badge {
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    padding: 9px 13px;
}

.toast-message {
    margin-bottom: 18px;
    border-left: 4px solid var(--green);
    border-radius: 7px;
    background: #eefaf4;
    color: var(--green);
    padding: 13px 15px;
    animation: slideIn 240ms ease-out;
}

.app-guide {
    margin-bottom: 22px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-top: 5px solid #0a9c96;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #102a43 0, #071d33 56%, #042f3b 100%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 16px);
    box-shadow: 0 18px 42px rgba(8, 22, 36, 0.2);
}

.app-guide summary {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1fr) auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
}

.app-guide summary::-webkit-details-marker {
    display: none;
}

.guide-title-row {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.guide-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #ffdf64;
    object-fit: cover;
}

.guide-summary-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
}

.guide-mode-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(255, 223, 100, 0.58);
    border-radius: 999px;
    background: rgba(255, 223, 100, 0.14);
    color: #ffdf64;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .guide-title-row {
        justify-content: flex-start;
    }

    .guide-avatar {
        width: 34px;
        height: 34px;
    }
}

.guide-summary-title::after {
    content: "Show";
    display: inline-flex;
    margin-left: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffdf64;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    vertical-align: middle;
}

.app-guide[open] .guide-summary-title::after {
    content: "Hide";
}

.guide-summary-flow {
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow: auto;
    scrollbar-width: none;
}

.guide-summary-flow::-webkit-scrollbar {
    display: none;
}

.guide-summary-flow span {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(239, 246, 255, 0.82);
    font-size: 12px;
    font-weight: 900;
    padding: 6px 9px;
}

.guide-summary-flow span.done {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.12);
    color: rgba(203, 213, 225, 0.84);
}

.guide-summary-flow span.current {
    border-color: #e0aa20;
    background: #ffdf64;
    color: #5c3b00;
    animation: softPulse 1.7s ease-in-out infinite;
}

.guide-summary-flow span.next {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(203, 213, 225, 0.78);
}

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

.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 18px;
    border-top: 4px solid var(--gold);
}

.metric-card.danger {
    border-top-color: var(--red);
}

.metric-card span,
.metric-card small {
    display: block;
    color: var(--muted);
}

.metric-card strong {
    display: block;
    margin: 10px 0 4px;
    color: var(--navy);
    font-size: 32px;
}

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

.manufacturing-card-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

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

.guide-grid {
    counter-reset: guide;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-guide .guide-grid {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 12px 14px 14px;
}

.guide-grid li {
    position: relative;
    min-height: 108px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 12px 12px 12px 48px;
}

.guide-grid li.done {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.1);
}

.guide-grid li.current {
    border-color: #e0aa20;
    background: linear-gradient(180deg, #fff4c2 0, #ffdf64 100%);
    box-shadow: inset 0 0 0 1px rgba(224, 170, 32, 0.26), 0 14px 28px rgba(224, 170, 32, 0.2);
}

.guide-grid li.next {
    background: rgba(255, 255, 255, 0.05);
}

.system-work-area {
    border: 1px solid #ccd7e2;
    border-top: 5px solid var(--navy);
    border-radius: 8px;
    background:
        linear-gradient(180deg, #f7fafc 0, #ffffff 190px),
        #ffffff;
    padding: 18px;
    box-shadow: var(--shadow);
}

.system-work-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: -2px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.system-work-header span {
    color: var(--navy);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.system-work-header small {
    max-width: 560px;
    color: var(--muted);
    text-align: right;
}

.guide-grid li::before {
    counter-increment: guide;
    content: counter(guide);
    position: absolute;
    left: 12px;
    top: 12px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.guide-grid li.done::before {
    background: #9aa6b2;
}

.guide-grid li.current::before {
    background: #e0aa20;
    color: #332200;
    animation: softPulse 1.7s ease-in-out infinite;
}

.guide-grid li.next::before {
    background: #d9e0e7;
    color: var(--muted);
}

.guide-grid strong,
.guide-grid span,
.guide-grid small {
    display: block;
}

.guide-grid strong {
    margin-bottom: 5px;
    color: rgba(239, 246, 255, 0.9);
}

.guide-grid span {
    color: rgba(239, 246, 255, 0.84);
    line-height: 1.35;
}

.guide-grid small {
    margin-top: 6px;
    color: rgba(203, 213, 225, 0.78);
    line-height: 1.35;
}

.guide-grid em {
    display: block;
    margin-top: 7px;
    color: rgba(239, 246, 255, 0.9);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.35;
}

.guide-grid li.current strong,
.guide-grid li.current span,
.guide-grid li.current em {
    color: #152c46;
}

.guide-grid li.current small {
    color: #627082;
}

.guide-card-status {
    display: inline-flex;
    width: fit-content;
    margin: 0 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
}

.guide-card-status.done {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(203, 213, 225, 0.86);
}

.guide-card-status.current {
    background: #fff4c2;
    color: #7a4d00;
}

.guide-card-status.next {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(203, 213, 225, 0.86);
}

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

.scroll-target {
    scroll-margin-top: 24px;
}

.highlight-row {
    animation: rowHighlight 2.6s ease-out 1;
}

.target-flash {
    animation: panelFlash 1.8s ease-out 1;
}

.guide-focus-card {
    border-color: #e0aa20;
    box-shadow: 0 0 0 5px rgba(224, 170, 32, 0.16), var(--shadow);
    animation: focusGlow 1.45s ease-in-out infinite;
}

.guide-action,
.guide-action-link {
    animation: guidePulse 1.35s ease-in-out infinite;
}

.guide-action-link {
    display: inline-flex;
    border-radius: 999px;
    background: #ffdf64;
    color: #5c3b00;
    font-weight: 900;
    padding: 7px 12px;
}

.panel-note,
.muted,
small {
    color: var(--muted);
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 9px;
}

.status.sent,
.status.senttoerp,
.status.completed,
.status.closed,
.status.resolved {
    background: #e8f7ef;
    color: var(--green);
}

.status.pending,
.status.retry,
.status.inprogress,
.status.queuedtoerp,
.status.waitingvendor {
    background: #fff4d8;
    color: var(--amber);
}

.status.failed,
.status.open {
    background: #fff0ef;
    color: var(--danger);
}

.status.draft,
.status.planned {
    background: #edf4ff;
    color: var(--blue);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions-cell {
    min-width: 270px;
}

.danger-button {
    background: var(--danger);
}

.success-button {
    margin-top: 8px;
    background: var(--green);
}

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

.form-grid button {
    grid-column: 1 / -1;
}

.ticket-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.support-table {
    table-layout: fixed;
}

.support-table th,
.support-table td {
    overflow-wrap: anywhere;
}

.support-ticket-cell {
    width: 22%;
}

.support-vendor-cell {
    width: 12%;
}

.support-status-cell {
    width: 13%;
}

.support-reference-cell {
    width: 16%;
}

.support-action-cell {
    width: 37%;
}

.support-ticket-summary {
    display: block;
    margin-top: 4px;
    line-height: 1.45;
}

.support-action-cell form,
.support-action-cell input,
.support-action-cell button {
    max-width: 100%;
}

.support-action-cell .ticket-form {
    width: 100%;
    min-width: 0;
}

.support-action-cell input {
    min-width: 0;
}

.table-frame {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: visible;
    background: #fff;
}

.data-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.data-table th,
.data-table td {
    overflow-wrap: anywhere;
    white-space: normal;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.data-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

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

.payload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.error-text {
    color: var(--danger);
    font-weight: 800;
}

.empty {
    color: var(--muted);
}

.event-list,
.reference-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-list li {
    display: grid;
    gap: 5px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.flow-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.flow-step {
    position: relative;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 900;
    padding: 8px 12px;
}

.flow-step.active {
    background: var(--red);
    color: #fff;
    animation: softPulse 1.7s ease-in-out infinite;
}

.flow-strip--steps {
    counter-reset: step;
}

.flow-strip--steps .flow-step {
    border-radius: 999px;
    position: relative;
    padding-left: 12px;
}

.flow-strip--steps .flow-step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin-right: 6px;
    background: rgba(24, 32, 42, 0.14);
    color: var(--navy);
    font-size: 11px;
    font-weight: 900;
}

.flow-strip--steps .flow-step.active::before {
    background: #fff;
    color: var(--red);
}

.pulse-row {
    animation: rowPulse 1.8s ease-in-out infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softPulse {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(181, 31, 42, 0);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(181, 31, 42, 0.14);
    }
}

@keyframes rowPulse {
    0%,
    100% {
        background: #fff;
    }
    50% {
        background: #fff9ea;
    }
}

@keyframes rowHighlight {
    0% {
        background: #ffe88a;
        box-shadow: inset 4px 0 0 #e0aa20;
    }
    100% {
        background: transparent;
        box-shadow: inset 0 0 0 transparent;
    }
}

@keyframes panelFlash {
    0% {
        border-color: #e0aa20;
        box-shadow: 0 0 0 5px rgba(224, 170, 32, 0.2), var(--shadow);
    }
    100% {
        border-color: var(--line);
        box-shadow: var(--shadow);
    }
}

@keyframes focusGlow {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(224, 170, 32, 0.08), var(--shadow);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(224, 170, 32, 0.22), var(--shadow);
    }
}

@keyframes guidePulse {
    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 0 0 rgba(224, 170, 32, 0);
    }
    50% {
        transform: translateY(-1px);
        box-shadow: 0 0 0 5px rgba(224, 170, 32, 0.22);
    }
}

@media (max-width: 980px) {
    .intro-profile-photo {
        display: block;
        justify-self: stretch;
        width: 100%;
        height: auto;
        max-height: 250px;
        border-radius: 12px;
        margin-bottom: 8px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

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

    .intro-hero,
    .intro-grid,
    .metric-grid,
    .grid-two,
    .payload-grid,
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 18px;
    }

    .app-guide summary {
        grid-template-columns: 1fr;
    }
}
