/* Serenity FMS - SCX PunchOut Integration Demo */
:root {
    --serenity-primary: #2c5282;
    --serenity-secondary: #4a5568;
    --serenity-accent: #38a169;
    --serenity-light: #f7fafc;
    --serenity-dark: #1a202c;
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--serenity-light);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--serenity-dark);
    min-height: 100vh;
    width: 250px;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h5 {
    color: white;
    margin: 0;
    font-weight: 700;
}

.sidebar-brand small {
    color: #a0aec0;
    font-size: 0.75rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: #a0aec0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.sidebar-nav .nav-link.active {
    border-left: 3px solid var(--serenity-accent);
}

/* Main content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

/* Top header */
.top-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

/* Cards */
.case-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.case-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.case-card .card-header {
    background: var(--serenity-light);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #c6f6d5;
    color: #276749;
}

.status-badge.pending {
    background: #fefcbf;
    color: #975a16;
}

.status-badge.completed {
    background: #e2e8f0;
    color: #4a5568;
}

/* Protocol badges */
.protocol-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.protocol-badge.protocol-rest {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
}

.protocol-badge.protocol-cxml {
    background: #faf5ff;
    color: #6b46c1;
    border: 1px solid #e9d8fd;
}

.protocol-badge.protocol-oci {
    background: #fffaf0;
    color: #c05621;
    border: 1px solid #feebc8;
}

/* Protocol buttons */
.btn-cxml {
    background: #6b46c1;
    border-color: #6b46c1;
    color: white;
}
.btn-cxml:hover {
    background: #553c9a;
    border-color: #553c9a;
    color: white;
}

.btn-oci {
    background: #c05621;
    border-color: #c05621;
    color: white;
}
.btn-oci:hover {
    background: #9c4221;
    border-color: #9c4221;
    color: white;
}

/* SCX Integration Callouts */
.scx-callout {
    position: relative;
    border: 2px dashed #e53e3e;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    background: #fff5f5;
}

.scx-callout::before {
    content: 'SCX Integration';
    position: absolute;
    top: -12px;
    left: 16px;
    background: #e53e3e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scx-callout-info {
    position: relative;
    border: 2px dashed #d69e2e;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    background: #fffaf0;
}

.scx-callout-info::before {
    content: 'How It Works';
    position: absolute;
    top: -12px;
    left: 16px;
    background: #d69e2e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scx-callout-code {
    position: relative;
    background: #1a202c;
    border: 2px solid #4a5568;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    color: #e2e8f0;
}

.scx-callout-code::before {
    content: 'API Request';
    position: absolute;
    top: -12px;
    left: 16px;
    background: #4a5568;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scx-callout-code pre {
    margin: 0;
    color: #68d391;
    font-size: 0.85rem;
}

/* Order button highlight */
.btn-order-products {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
}

.btn-order-products:hover {
    background: linear-gradient(135deg, #c53030, #9b2c2c);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

.btn-order-products:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Product grid in returned cart */
.returned-product {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.returned-product:last-child {
    border-bottom: none;
}

.returned-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #f7fafc;
}

.product-image-thumb {
    width: 60px;
    height: 60px;
    background: #f7fafc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Floating demo banner */
.demo-banner {
    position: fixed;
    bottom: 0;
    left: 250px;
    right: 0;
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 1000;
    font-size: 0.85rem;
}

.demo-banner a {
    color: #fc8181;
    font-weight: 600;
}

.demo-banner code {
    background: none;
    font-size: 0.8rem;
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.step-indicator .step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-indicator .step.active {
    background: var(--serenity-accent);
    color: white;
}

.step-indicator .step.completed {
    background: var(--serenity-primary);
    color: white;
}

.step-indicator .step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
}

.step-indicator .step-line.completed {
    background: var(--serenity-primary);
}

/* PunchOut flow steps (horizontal in case detail) */
.punchout-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    background: var(--serenity-light);
    border-radius: 8px;
    padding: 1rem;
}

.punchout-step {
    flex: 1;
    text-align: center;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.punchout-step.active {
    opacity: 1;
}

.punchout-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.punchout-step.active .punchout-step-num {
    background: var(--serenity-primary);
    color: white;
}

.punchout-step-label {
    font-weight: 600;
    font-size: 0.85rem;
}

.punchout-step-desc {
    font-size: 0.75rem;
    color: #718096;
}

.punchout-step-line {
    width: 60px;
    height: 2px;
    background: #e2e8f0;
    margin-top: 18px;
    flex-shrink: 0;
}

.punchout-step-line.active {
    background: var(--serenity-primary);
}

/* API Log Panel */
.api-log-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1050;
    transition: all 0.2s;
}

.api-log-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.api-log-toggle.active {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

.api-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1060;
}

.api-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 650px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 1070;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.api-panel-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.api-log-entry {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.api-log-entry.alt {
    background: #f7fafc;
}

.api-log-pre {
    background: #1a202c;
    color: #68d391;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow: auto;
}

/* API Log Page cards */
.api-log-card {
    transition: border-color 0.2s;
}
.api-log-card:hover {
    border-color: var(--serenity-primary);
}

/* Settings page */
.settings-protocol-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Flow Guide Timeline */
.flow-timeline {
    position: relative;
    padding-left: 2rem;
}

.flow-timeline::before {
    content: '';
    position: absolute;
    left: 1.15rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e2e8f0;
    border-radius: 2px;
}

.flow-step {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.flow-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--serenity-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    z-index: 1;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--serenity-primary);
}

.flow-step-content {
    flex: 1;
    min-width: 0;
}

/* Validation styles */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni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