/* OnePlatform ERP - User Guide Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width: 280px;
    --header-height: 64px;
    --primary: #2563eb;
    --primary-dark: #3b82f6;
}

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

body {
    font-family: 'Inter', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.6;
}

.dark body, body.dark {
    background-color: #111827;
    color: #f3f4f6;
}

/* Sidebar */
.docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e3a5f 0%, #1e293b 100%);
    color: #e2e8f0;
    overflow-y: auto;
    z-index: 40;
    transition: transform 0.3s ease;
}

.dark .docs-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

.docs-sidebar .logo-section {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-sidebar .logo-section .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

.docs-sidebar .logo-section h1 {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.docs-sidebar .logo-section span {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}

.docs-sidebar nav {
    padding: 16px 0;
}

.docs-sidebar .nav-section {
    padding: 0 16px;
    margin-bottom: 8px;
}

.docs-sidebar .nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 8px 12px 4px;
}

.docs-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    margin-bottom: 2px;
}

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

.docs-sidebar .nav-link.active {
    background: rgba(59,130,246,0.2);
    color: #60a5fa;
    font-weight: 500;
    border-left: 3px solid #3b82f6;
    margin-left: -3px;
}

.docs-sidebar .nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Main Content */
.docs-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.docs-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 30;
}

.dark .docs-header {
    background: #1f2937;
    border-color: #374151;
}

.docs-content {
    padding: 32px;
    max-width: 1200px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.dark .breadcrumbs { color: #9ca3af; }

.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.dark .breadcrumbs a { color: #60a5fa; }

.breadcrumbs a:hover { text-decoration: underline; }

.breadcrumbs .separator { color: #d1d5db; }

/* Page Title */
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.dark .page-title { color: #f3f4f6; }

.page-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
}

.dark .page-subtitle { color: #9ca3af; }

/* Section */
.guide-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.dark .section-title {
    color: #f3f4f6;
    border-color: #374151;
}

/* Mockup Frame */
.mockup-frame {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0 24px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dark .mockup-frame {
    border-color: #374151;
    background: #1f2937;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mockup-header {
    background: #f3f4f6;
    padding: 8px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.dark .mockup-header {
    background: #111827;
    border-color: #374151;
    color: #9ca3af;
}

.mockup-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.mockup-header .dot.red { background: #ef4444; }
.mockup-header .dot.yellow { background: #f59e0b; }
.mockup-header .dot.green { background: #22c55e; }

.mockup-body {
    padding: 24px;
}

/* Step Guide */
.step-list {
    counter-reset: step;
}

.step-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
}

.step-item::before {
    counter-increment: step;
    content: counter(step);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-item .step-content {
    flex: 1;
    padding-top: 4px;
}

.step-item .step-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.dark .step-item .step-content h4 { color: #f3f4f6; }

.step-item .step-content p {
    font-size: 14px;
    color: #6b7280;
}

.dark .step-item .step-content p { color: #9ca3af; }

/* Info Box */
.info-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-box.tip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.dark .info-box.tip {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.3);
    color: #93c5fd;
}

.info-box.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.dark .info-box.warning {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
    color: #fcd34d;
}

.info-box.important {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.dark .info-box.important {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.dark .feature-card {
    background: #1f2937;
    border-color: #374151;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.dark .feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.feature-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.dark .feature-card h3 { color: #f3f4f6; }

.feature-card p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.dark .feature-card p { color: #9ca3af; }

/* Flow Diagram */
.flow-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.flow-step .step-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.flow-step .step-label {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: #374151;
}

.dark .flow-step .step-label { color: #d1d5db; }

.flow-arrow {
    font-size: 20px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }

.dark .badge-blue { background: rgba(59,130,246,0.2); color: #93c5fd; }
.dark .badge-green { background: rgba(34,197,94,0.2); color: #86efac; }
.dark .badge-yellow { background: rgba(234,179,8,0.2); color: #fde047; }
.dark .badge-red { background: rgba(239,68,68,0.2); color: #fca5a5; }
.dark .badge-gray { background: rgba(107,114,128,0.2); color: #d1d5db; }
.dark .badge-purple { background: rgba(168,85,247,0.2); color: #d8b4fe; }
.dark .badge-indigo { background: rgba(99,102,241,0.2); color: #a5b4fc; }

/* Mock Table */
.mock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mock-table thead th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .mock-table thead th {
    background: #111827;
    border-color: #374151;
    color: #9ca3af;
}

.mock-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.dark .mock-table tbody td {
    border-color: #1f2937;
    color: #d1d5db;
}

.mock-table tbody tr:hover {
    background: #f9fafb;
}

.dark .mock-table tbody tr:hover {
    background: #111827;
}

/* Mock Form */
.mock-form-group {
    margin-bottom: 16px;
}

.mock-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.dark .mock-form-group label { color: #d1d5db; }

.mock-input, .mock-select, .mock-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #374151;
}

.dark .mock-input, .dark .mock-select, .dark .mock-textarea {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.mock-textarea { min-height: 80px; resize: vertical; }

.mock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: default;
    border: none;
    text-decoration: none;
}

.mock-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.mock-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.dark .mock-btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

.mock-btn-danger {
    background: #ef4444;
    color: white;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dark .stat-card {
    background: #1f2937;
    border-color: #374151;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.dark .stat-card .stat-value { color: #f3f4f6; }

.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
}

.dark .stat-card .stat-label { color: #9ca3af; }

/* Field Description Table */
.field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 12px 0;
}

.field-table th, .field-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.dark .field-table th, .dark .field-table td {
    border-color: #374151;
}

.field-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .field-table th {
    background: #111827;
    color: #9ca3af;
}

.field-table td { color: #4b5563; }
.dark .field-table td { color: #d1d5db; }

.field-required {
    color: #ef4444;
    font-weight: 600;
}

/* Mobile Responsive */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    width: 40px;
    height: 40px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-main {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .docs-content {
        padding: 24px 16px;
    }

    .flow-steps {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Dark mode toggle button */
.dark-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s;
}

.dark .dark-toggle {
    border-color: #374151;
    background: #374151;
    color: #fbbf24;
}

.dark-toggle:hover {
    background: #f3f4f6;
}

.dark .dark-toggle:hover {
    background: #4b5563;
}

/* Print */
@media print {
    .docs-sidebar, .docs-header, .mobile-toggle { display: none !important; }
    .docs-main { margin-left: 0 !important; }
}
