/* ============================================
   Brand Foundation — Coworking Space Theme
   Primary: #E67E22 (warm orange)
   Accent:  #F39C12 (golden amber)
   ============================================ */

/* -- Base Reset & Typography -- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #FAF8F5;
    color: #1A1A2E;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
}

/* -- Custom Utilities -- */
.gradient-text {
    background: linear-gradient(135deg, #E67E22, #F39C12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-shadow {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, .05);
}

.card-shadow:hover {
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, .1);
}

/* Material Symbols — explicit font-family needed to resist Tailwind preflight reset */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* -- Scrollbar -- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f0eb;
}

::-webkit-scrollbar-thumb {
    background: #d4c5b5;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8a898;
}

/* -- Animations -- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .6;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in-up {
    animation: fadeInUp .6s ease-out forwards;
}

.animate-fade-in-up-delay-1 {
    animation-delay: .1s;
    opacity: 0;
}

.animate-fade-in-up-delay-2 {
    animation-delay: .2s;
    opacity: 0;
}

.animate-fade-in-up-delay-3 {
    animation-delay: .3s;
    opacity: 0;
}

.animate-fade-in-up-delay-4 {
    animation-delay: .4s;
    opacity: 0;
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

/* -- Stat Card -- */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #ede5db;
    transition: all .2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(230, 126, 34, .1);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.2;
    font-family: 'Space Grotesk', sans-serif;
}

.stat-card .stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 4px;
}

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

/* -- Table -- */
.proto-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.proto-table thead th {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    color: #6B7280;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 2px solid #ede5db;
    white-space: nowrap;
}

.proto-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f0eb;
    font-size: 14px;
    vertical-align: middle;
}

.proto-table tbody tr:hover {
    background: #faf6f1;
}

.proto-table tbody tr {
    transition: background .15s ease;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .proto-table {
    min-width: 700px;
}

/* -- Tabs -- */
.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #ede5db;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color .2s;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #E67E22;
    background: #fef6ee;
}

.tab-btn.active {
    color: #E67E22;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #E67E22;
    border-radius: 1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp .3s ease-out;
}

/* -- Sub-tabs (horizontal brand detail tabs) -- */
.sub-tab-nav {
    display: flex;
    gap: 2px;
    background: #f5f0eb;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.sub-tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s;
    white-space: nowrap;
}

.sub-tab-btn:hover {
    color: #1A1A2E;
    background: rgba(255, 255, 255, .5);
}

.sub-tab-btn.active {
    color: #E67E22;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* -- Document Tabs (scrollable) -- */
.doc-tab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #ede5db;
    scrollbar-width: none;
}

.doc-tab-nav::-webkit-scrollbar {
    display: none;
}

.doc-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    border: 1px solid #ede5db;
    background: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-tab-btn:hover {
    border-color: #E67E22;
    color: #E67E22;
}

.doc-tab-btn.active {
    background: #E67E22;
    color: white;
    border-color: #E67E22;
}

/* -- Toggle Switch -- */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d4c5b5;
    border-radius: 24px;
    transition: .3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: #E67E22;
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* -- Badge Colors -- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.badge-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-unpaid {
    background: #fef3c7;
    color: #92400e;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-coming-soon {
    background: #f3f0ff;
    color: #6d28d9;
}

/* -- Modal -- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
    animation: fadeInUp .3s ease-out;
}

/* -- Progress Bar -- */
.progress-bar {
    height: 8px;
    background: #ede5db;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #E67E22, #F39C12);
    border-radius: 4px;
    transition: width .5s ease;
}

/* -- Form styles -- */
.form-group {
    margin-bottom: 20px;
}

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

.form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ede5db;
    border-radius: 12px;
    font-size: 14px;
    color: #1A1A2E;
    outline: none;
    transition: all .2s;
    background: white;
}

.form-input:focus {
    border-color: #E67E22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, .1);
}

.form-input::placeholder {
    color: #9ca3af;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 126, 34, .3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(230, 126, 34, .4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #ede5db;
}

.btn-secondary:hover {
    background: #faf6f1;
    border-color: #d4c5b5;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: #6B7280;
}

.btn-ghost:hover {
    background: #f5f0eb;
    color: #1A1A2E;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
}

/* -- Alert Banner -- */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: #fef6ee;
    color: #E67E22;
    border: 1px solid #fde4c8;
}

/* -- Pagination -- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination .page-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    border: none;
    background: none;
    cursor: pointer;
    transition: all .15s;
}

.pagination .page-btn:hover {
    background: #f5f0eb;
}

.pagination .page-btn.active {
    background: #E67E22;
    color: white;
}

/* -- Blur Preview Overlay -- */
.preview-blur-overlay {
    position: relative;
    overflow: hidden;
}

.preview-blur-overlay .blur-content {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.preview-blur-overlay .unlock-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    padding: 32px;
    background: rgba(255, 255, 255, .95);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}

/* -- Share Code Display -- */
.share-code-display {
    font-family: 'Space Grotesk', monospace;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 12px;
    color: #E67E22;
    text-align: center;
    padding: 24px 32px;
    background: #fef6ee;
    border-radius: 16px;
    border: 2px dashed #fde4c8;
}

/* -- Skeleton Loading -- */
.skeleton {
    background: linear-gradient(90deg, #f5f0eb 25%, #ede5db 50%, #f5f0eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* -- Breadcrumb -- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: #6B7280;
    text-decoration: none;
    transition: color .2s;
}

.breadcrumb a:hover {
    color: #E67E22;
}

.breadcrumb .separator {
    color: #d1d5db;
}

.breadcrumb .current {
    color: #1A1A2E;
    font-weight: 600;
}

/* -- Markdown Content -- */
.markdown-body {
    font-size: 15px;
    line-height: 1.75;
    color: #374151;
}

.markdown-body h1 {
    font-size: 28px;
    margin: 32px 0 16px;
    color: #1A1A2E;
}

.markdown-body h2 {
    font-size: 22px;
    margin: 28px 0 12px;
    color: #1A1A2E;
}

.markdown-body h3 {
    font-size: 18px;
    margin: 24px 0 8px;
    color: #1A1A2E;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    margin: 0 0 16px 24px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body strong {
    color: #1A1A2E;
    font-weight: 700;
}

.markdown-body blockquote {
    border-left: 4px solid #E67E22;
    padding: 12px 16px;
    background: #fef6ee;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.markdown-body code {
    background: #f5f0eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

.markdown-body pre {
    background: #2C2C2C;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* -- Split Editor -- */
.editor-pane {
    display: flex;
    gap: 0;
    border: 1px solid #ede5db;
    border-radius: 16px;
    overflow: hidden;
}

.editor-pane .editor-left {
    flex: 1;
    border-right: 1px solid #ede5db;
}

.editor-pane .editor-right {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #faf8f5;
}

.editor-pane textarea {
    width: 100%;
    height: 100%;
    min-height: 500px;
    padding: 24px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1A1A2E;
    background: white;
}

/* -- CTA Card -- */
.cta-card {
    background: linear-gradient(135deg, #E67E22, #F39C12);
    border-radius: 20px;
    padding: 32px;
    color: white;
    text-align: center;
}

.cta-card h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 12px;
}

.cta-card p {
    opacity: .9;
    margin-bottom: 24px;
}

.cta-card .btn {
    background: white;
    color: #E67E22;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.cta-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

/* -- Brand Card (Grid) -- */
.brand-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #ede5db;
    transition: all .2s ease;
    cursor: pointer;
}

.brand-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(230, 126, 34, .1);
    border-color: #E67E22;
}

.brand-card .brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef6ee, #fde4c8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #E67E22;
    margin-bottom: 16px;
}

/* -- Step Indicator -- */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
}

.step-item.active {
    color: #E67E22;
}

.step-item.completed {
    color: #22c55e;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #f5f0eb;
    color: #9ca3af;
    font-size: 14px;
}

.step-item.active .step-dot {
    background: #E67E22;
    color: white;
}

.step-item.completed .step-dot {
    background: #22c55e;
    color: white;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #ede5db;
    margin: 0 8px;
}

.step-line.completed {
    background: #22c55e;
}

/* -- Question Set Choice -- */
.choice-card {
    background: white;
    border: 2px solid #ede5db;
    border-radius: 16px;
    padding: 32px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.choice-card:hover {
    border-color: #E67E22;
    background: #fef6ee;
}

.choice-card.selected {
    border-color: #E67E22;
    background: #fef6ee;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, .15);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 260px;
    background: #2C2C2C;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 50;
    transition: all .3s ease;
}

.sidebar .logo-section {
    padding: 24px;
    border-bottom: 1px solid #3d3d3d;
}

.sidebar .logo-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #E67E22, #F39C12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(230, 126, 34, .3);
}

.sidebar .logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #E67E22;
}

.sidebar .logo-subtitle {
    font-size: 10px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .1em;
    display: block;
    margin-top: -2px;
}

.sidebar nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.sidebar .section-label {
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6B7280;
}

.sidebar .nav-divider {
    height: 1px;
    background: #3d3d3d;
    margin: 8px 16px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #a3a3a3;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar .nav-link:hover {
    background: #3d3d3d;
    color: #e5e5e5;
}

.sidebar .nav-link.active {
    background: rgba(230, 126, 34, .15);
    color: #F39C12;
    border-left: 3px solid #E67E22;
    margin-left: -3px;
}

.sidebar .nav-link .material-symbols-outlined {
    font-size: 20px;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link.disabled {
    color: #525252;
    cursor: not-allowed;
}

.sidebar .nav-link.disabled:hover {
    background: none;
}

.sidebar .nav-link .lock-icon {
    margin-left: auto;
    font-size: 14px;
    color: #525252;
}

.sidebar .sub-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 48px;
    font-size: 13px;
    color: #737373;
    text-decoration: none;
    border-radius: 8px;
    transition: all .2s;
}

.sidebar .sub-link:hover {
    color: #e5e5e5;
    background: #3d3d3d;
}

.sidebar .sub-link.active {
    color: #F39C12;
}

/* Sidebar Accordion */
.sidebar-group .sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.sidebar-group.open .sidebar-submenu {
    max-height: 500px;
}

.sidebar-group .chevron {
    transition: transform .3s ease;
    font-size: 18px;
    margin-left: auto;
}

.sidebar-group.open .chevron {
    transform: rotate(90deg);
}

/* Sidebar Bottom */
.sidebar .sidebar-bottom {
    padding: 16px;
    border-top: 1px solid #3d3d3d;
    margin-top: auto;
}

.sidebar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.sidebar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(230, 126, 34, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E67E22;
    font-weight: 700;
    font-size: 14px;
}

.sidebar .user-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
}

.sidebar .user-email {
    font-size: 11px;
    color: #737373;
}

/* -- Mobile Overlay -- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 40;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   MAIN CONTENT & HEADER
   ============================================ */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
    overflow-x: hidden;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(250, 248, 245, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #ede5db;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: between;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 800;
    color: #1A1A2E;
}

.page-header .subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #ede5db;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all .2s;
}

.hamburger-btn:hover {
    background: #f5f0eb;
    color: #E67E22;
}

.main-padding {
    padding: 32px;
}

/* -- Theme Toggle -- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #ede5db;
    background: transparent;
    cursor: pointer;
    transition: all .2s;
    color: #6B7280;
}

.theme-toggle:hover {
    background: #f5f0eb;
    color: #E67E22;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: inline;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed !important;
        z-index: 50 !important;
    }

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

    .main-content {
        margin-left: 0 !important;
    }

    .hamburger-btn {
        display: flex !important;
    }
}

@media (min-width: 1024px) {
    .hamburger-btn {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 639px) {
    .stat-card .stat-value {
        font-size: 24px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
    }

    .page-header {
        padding: 12px 16px !important;
    }

    .page-header h1 {
        font-size: 16px !important;
    }

    .main-padding {
        padding: 16px !important;
    }

    .modal-box {
        padding: 20px;
        border-radius: 16px;
    }

    .form-row {
        flex-direction: column !important;
    }

    .form-row>* {
        width: 100% !important;
    }

    .proto-table thead th {
        padding: 10px 12px;
        font-size: 10px;
    }

    .proto-table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .editor-pane {
        flex-direction: column;
    }

    .editor-pane .editor-left {
        border-right: none;
        border-bottom: 1px solid #ede5db;
    }

    .share-code-display {
        font-size: 32px;
        letter-spacing: 8px;
    }
}

@media (max-width: 767px) {
    .filter-bar {
        flex-direction: column !important;
    }

    .filter-bar>* {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ============================================
   MOBILE BOTTOM NAV + FAB
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: white;
    border-top: 1px solid #ede5db;
    box-shadow: 0 -4px 20px -2px rgba(0, 0, 0, .06);
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-bottom-nav .nav-item-mobile {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 6px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    transition: color .2s;
    position: relative;
}

.mobile-bottom-nav .nav-item-mobile:hover,
.mobile-bottom-nav .nav-item-mobile.active {
    color: #E67E22;
}

.mobile-bottom-nav .nav-item-mobile.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #E67E22;
    border-radius: 0 0 2px 2px;
}

.mobile-bottom-nav .nav-item-mobile .material-symbols-outlined {
    font-size: 22px;
    margin-bottom: 2px;
}

.mobile-bottom-nav .fab-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav .fab-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E67E22, #D35400);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(230, 126, 34, .4);
    margin-top: -20px;
    transition: all .2s;
    text-decoration: none;
}

.mobile-bottom-nav .fab-btn:hover {
    transform: scale(1.08);
}

.mobile-bottom-nav .fab-btn .material-symbols-outlined {
    font-size: 26px;
    font-variation-settings: 'FILL' 1, 'wght' 600;
}

.mobile-bottom-nav .fab-label {
    font-size: 10px;
    font-weight: 700;
    color: #E67E22;
    margin-top: -2px;
}

@media (max-width: 1023px) {
    .mobile-bottom-nav {
        display: block;
    }

    .main-content {
        padding-bottom: 72px !important;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] body {
    background: #141414;
    color: #e5e5e5;
}

[data-theme="dark"] .theme-toggle {
    border-color: #3d3d3d;
    color: #a3a3a3;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #2C2C2C;
    color: #F39C12;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: inline;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .sidebar {
    background: #1a1a1a;
}

[data-theme="dark"] .sidebar .logo-section,
[data-theme="dark"] .sidebar .sidebar-bottom {
    border-color: #2a2a2a;
}

[data-theme="dark"] .sidebar .nav-divider {
    background: #2a2a2a;
}

[data-theme="dark"] .page-header {
    background: rgba(20, 20, 20, .92) !important;
    border-color: #2a2a2a !important;
}

[data-theme="dark"] .page-header h1 {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .hamburger-btn {
    border-color: #3d3d3d !important;
    color: #a3a3a3 !important;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .brand-card,
[data-theme="dark"] .choice-card {
    background: #1f1f1f !important;
    border-color: #2a2a2a !important;
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .brand-card:hover {
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, .3);
}

[data-theme="dark"] .stat-card .stat-value {
    color: #f5f5f5;
}

[data-theme="dark"] .stat-card .stat-label {
    color: #737373;
}

[data-theme="dark"] .proto-table thead th {
    color: #a3a3a3;
    border-color: #2a2a2a;
}

[data-theme="dark"] .proto-table tbody td {
    border-color: #1f1f1f;
    color: #d4d4d4;
}

[data-theme="dark"] .proto-table tbody tr:hover {
    background: #2a2a2a !important;
}

[data-theme="dark"] .form-input {
    background: #141414;
    border-color: #2a2a2a;
    color: #e5e5e5;
}

[data-theme="dark"] .form-input:focus {
    border-color: #E67E22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, .2);
}

[data-theme="dark"] .form-input::placeholder {
    color: #525252;
}

[data-theme="dark"] .form-label {
    color: #d4d4d4;
}

[data-theme="dark"] select,
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea {
    background: #141414 !important;
    border-color: #2a2a2a !important;
    color: #e5e5e5 !important;
}

[data-theme="dark"] .tab-nav,
[data-theme="dark"] .doc-tab-nav {
    border-color: #2a2a2a;
}

[data-theme="dark"] .tab-btn {
    color: #737373;
}

[data-theme="dark"] .tab-btn:hover {
    color: #F39C12;
    background: #1a1a1a;
}

[data-theme="dark"] .tab-btn.active {
    color: #F39C12;
}

[data-theme="dark"] .tab-btn.active::after {
    background: #F39C12;
}

[data-theme="dark"] .sub-tab-nav {
    background: #1a1a1a;
}

[data-theme="dark"] .sub-tab-btn {
    color: #737373;
}

[data-theme="dark"] .sub-tab-btn:hover {
    color: #e5e5e5;
    background: rgba(255, 255, 255, .05);
}

[data-theme="dark"] .sub-tab-btn.active {
    color: #F39C12;
    background: #2a2a2a;
}

[data-theme="dark"] .doc-tab-btn {
    background: #1f1f1f;
    border-color: #2a2a2a;
    color: #a3a3a3;
}

[data-theme="dark"] .doc-tab-btn:hover {
    border-color: #E67E22;
    color: #E67E22;
}

[data-theme="dark"] .doc-tab-btn.active {
    background: #E67E22;
    color: white;
    border-color: #E67E22;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, .6);
}

[data-theme="dark"] .modal-box {
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
}

[data-theme="dark"] .progress-bar {
    background: #2a2a2a;
}

[data-theme="dark"] .breadcrumb a {
    color: #737373;
}

[data-theme="dark"] .breadcrumb .current {
    color: #e5e5e5;
}

[data-theme="dark"] .breadcrumb .separator {
    color: #525252;
}

[data-theme="dark"] .alert-info {
    background: rgba(230, 126, 34, .1);
    color: #F39C12;
    border-color: rgba(230, 126, 34, .2);
}

[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, .1);
    color: #4ade80;
    border-color: rgba(34, 197, 94, .2);
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, .1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .2);
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, .1);
    color: #f87171;
    border-color: rgba(239, 68, 68, .2);
}

[data-theme="dark"] .badge-paid {
    background: rgba(34, 197, 94, .15);
    color: #4ade80;
}

[data-theme="dark"] .badge-unpaid {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
}

[data-theme="dark"] .badge-failed {
    background: rgba(239, 68, 68, .15);
    color: #f87171;
}

[data-theme="dark"] .editor-pane {
    border-color: #2a2a2a;
}

[data-theme="dark"] .editor-pane .editor-left {
    border-color: #2a2a2a;
}

[data-theme="dark"] .editor-pane .editor-right {
    background: #1a1a1a;
}

[data-theme="dark"] .editor-pane textarea {
    background: #141414;
    color: #e5e5e5;
}

[data-theme="dark"] .share-code-display {
    background: rgba(230, 126, 34, .1);
    border-color: rgba(230, 126, 34, .2);
}

[data-theme="dark"] .unlock-cta {
    background: rgba(31, 31, 31, .95);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 50%, #1f1f1f 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .mobile-bottom-nav {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

[data-theme="dark"] .mobile-bottom-nav .nav-item-mobile {
    color: #525252;
}

[data-theme="dark"] .mobile-bottom-nav .nav-item-mobile:hover,
[data-theme="dark"] .mobile-bottom-nav .nav-item-mobile.active {
    color: #F39C12;
}

[data-theme="dark"] .mobile-bottom-nav .nav-item-mobile.active::before {
    background: #F39C12;
}

[data-theme="dark"] .markdown-body {
    color: #d4d4d4;
}

[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2,
[data-theme="dark"] .markdown-body h3 {
    color: #f5f5f5;
}

[data-theme="dark"] .markdown-body blockquote {
    background: rgba(230, 126, 34, .1);
}

[data-theme="dark"] .markdown-body code {
    background: #2a2a2a;
}

[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-slate-100 {
    border-color: #2a2a2a !important;
}

[data-theme="dark"] .text-slate-900 {
    color: #f5f5f5 !important;
}

[data-theme="dark"] .text-slate-700 {
    color: #d4d4d4 !important;
}

[data-theme="dark"] .text-slate-600 {
    color: #a3a3a3 !important;
}

[data-theme="dark"] .text-slate-500 {
    color: #737373 !important;
}

[data-theme="dark"] .text-slate-400 {
    color: #525252 !important;
}

[data-theme="dark"] .bg-slate-50 {
    background: #141414 !important;
}

/* -- Scrollbar Dark -- */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3d3d3d;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #525252;
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -- Document Tab Buttons -- */
.doc-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    background: #f5f0eb;
    border: 1px solid #ede5db;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.doc-tab-btn:hover:not(:disabled) {
    background: #fef6ee;
    color: #E67E22;
    border-color: #E67E22;
}

.doc-tab-btn.active {
    background: #E67E22;
    color: #fff;
    border-color: #E67E22;
}

.doc-tab-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* -- Markdown Body -- */
.markdown-body {
    font-size: 15px;
    line-height: 1.75;
    color: #374151;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    overflow-x: hidden;
}

.markdown-body h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #1A1A2E;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ede5db;
}

.markdown-body h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1A1A2E;
    margin: 32px 0 12px;
}

.markdown-body h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1A1A2E;
    margin: 24px 0 8px;
}

.markdown-body p {
    margin: 0 0 16px;
}

.markdown-body ul,
.markdown-body ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body strong {
    font-weight: 700;
    color: #1A1A2E;
}

.markdown-body em {
    font-style: italic;
    color: #E67E22;
}

.markdown-body blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    border-left: 4px solid #E67E22;
    background: #fef6ee;
    border-radius: 0 12px 12px 0;
    color: #92400e;
    font-style: italic;
}

.markdown-body code {
    background: #f5f0eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #E67E22;
}

.markdown-body pre {
    background: #1A1A2E;
    color: #e5e5e5;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid #ede5db;
    margin: 24px 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.markdown-body th,
.markdown-body td {
    padding: 10px 14px;
    border: 1px solid #ede5db;
    text-align: left;
    font-size: 14px;
}

.markdown-body th {
    background: #f5f0eb;
    font-weight: 700;
    color: #1A1A2E;
}

.markdown-body a {
    color: #E67E22;
    text-decoration: underline;
}

/* -- Dark mode docs -- */
[data-theme="dark"] .doc-tab-btn {
    background: #2a2a2a;
    border-color: #3d3d3d;
    color: #a3a3a3;
}

[data-theme="dark"] .doc-tab-btn:hover:not(:disabled) {
    background: #3d3d3d;
}

[data-theme="dark"] .doc-tab-btn.active {
    background: #E67E22;
    color: #fff;
}

[data-theme="dark"] .markdown-body {
    color: #d4d4d4;
}

[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2,
[data-theme="dark"] .markdown-body h3,
[data-theme="dark"] .markdown-body strong {
    color: #e5e5e5;
}

[data-theme="dark"] .markdown-body blockquote {
    background: #2a1f0d;
    border-left-color: #E67E22;
    color: #fbbf24;
}

[data-theme="dark"] .markdown-body code {
    background: #2a2a2a;
}

[data-theme="dark"] .markdown-body th {
    background: #2a2a2a;
    color: #e5e5e5;
}

[data-theme="dark"] .markdown-body td {
    border-color: #3d3d3d;
}