* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.nav {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav a {
    text-decoration: none;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav a:hover, .nav a.active {
    background: #667eea;
    color: white;
}

.content {
    padding: 3rem 0;
}

.doc-content {
    background: white;
    border-radius: 10px;
    padding: 3rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.doc-content h2 {
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.doc-content h2:first-child {
    margin-top: 0;
}

.doc-content h3 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.doc-content h4 {
    color: #555;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.doc-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.doc-content li {
    margin: 0.5rem 0;
}

.doc-content ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.doc-content p {
    margin: 1rem 0;
}

.callout {
    border-left: 4px solid;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.callout-info {
    background: #e8f4fd;
    border-color: #2196F3;
}

.callout-warning {
    background: #fff4e6;
    border-color: #ff9800;
}

.callout-success {
    background: #e8f5e9;
    border-color: #4caf50;
}

.callout-danger {
    background: #ffebee;
    border-color: #f44336;
}

.diagram {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.diagram h3 {
    margin-top: 1rem;
    color: #667eea;
}

.diagram h3:first-child {
    margin-top: 0;
}

.system-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 2px solid #dee2e6;
}

.system-card h3 {
    margin-top: 0;
    color: #667eea;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.integration {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    border-left: 4px solid #667eea;
}

.decision-table {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.decision-table h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.decision-table p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

table.scenario-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

table.scenario-table th,
table.scenario-table td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
}

table.scenario-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

table.scenario-table tr:nth-child(even) {
    background: #f8f9fa;
}

.flow-diagram {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.flow-steps {
    counter-reset: step-counter;
    list-style: none;
    margin-left: 0;
}

.flow-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin: 1rem 0;
    padding-bottom: 1.5rem;
    border-left: 3px solid #667eea;
}

.flow-steps li:last-child {
    border-left: none;
}

.flow-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: -1.2rem;
    top: 0;
    background: #667eea;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-list {
    list-style: none;
    margin-left: 0;
}

.step-list li {
    margin: 1rem 0;
    padding-left: 2.5rem;
    position: relative;
}

.step-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-size: 1.5rem;
    font-weight: bold;
}

.checklist {
    list-style: none;
    margin-left: 0;
}

.checklist li {
    padding-left: 2rem;
    position: relative;
    margin: 0.75rem 0;
}

.checklist li::before {
    content: "□";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    color: #667eea;
}

.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.ref-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #dee2e6;
}

.ref-card h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 1rem;
}

.ref-card strong {
    color: #667eea;
}

.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer a {
    color: white;
    text-decoration: underline;
}

code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 0.25rem;
}

.badge-happy {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-exception {
    background: #ffebee;
    color: #c62828;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}
