/* Onboarding */
.onboarding-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.onboarding-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1e3a8a;
}
.onboarding-hint {
    margin: 0 0 16px;
    color: #1d4ed8;
    font-size: 14px;
}
.onboarding-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.6);
    color: #64748b;
}
.onboarding-step.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
}
.onboarding-step.done {
    background: #dcfce7;
    color: #166534;
}
.onboarding-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
}
.onboarding-step.active .onboarding-num {
    background: rgba(255, 255, 255, 0.25);
}

/* Owner Dashboard */
:root {
    --sidebar: #141416;
    --radius: var(--radius-md);
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--surface);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

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

.sidebar {
    width: 260px;
    max-width: min(260px, 88vw);
    background: var(--sidebar);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 101;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.sidebar-close-btn {
    display: none;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #444;
    border-radius: var(--radius);
    background: #2d2d2d;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-close-btn:active {
    transform: scale(0.95);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.nav-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.nav-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.nav-logout-wrap {
    flex-shrink: 0;
    border-top: 1px solid #333;
    background: var(--sidebar);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.28);
}

.nav-item-logout {
    border-left-color: transparent !important;
    min-height: 44px;
}

.nav-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: #333;
    color: white;
    border-left-color: var(--primary);
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid #333;
    background: var(--sidebar);
    position: relative;
    z-index: 2;
}

.sidebar-footer .nav-item {
    border-left-color: transparent;
    min-height: 44px;
}

.main {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    min-width: 0;
}

.topbar {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
}

.content {
    padding: 32px;
    max-width: 100%;
    overflow-x: hidden;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface-alt);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    color: var(--accent);
}

.card {
    background: var(--surface-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    max-width: 100%;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
    overflow-x: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-alt);
}

.table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--surface-alt);
}

.status {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.pending { background: rgba(255, 214, 10, 0.15); color: var(--warning); }
.status.paid { background: rgba(48, 209, 88, 0.15); color: var(--accent); }
.status.shipped { background: rgba(10, 132, 255, 0.15); color: var(--primary); }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-selector-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-selector-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.shop-selector {
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.section-divider {
    margin: 32px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.success-message {
    background: rgba(48, 209, 88, 0.12);
    color: var(--accent);
    border: 1px solid rgba(48, 209, 88, 0.3);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: none;
}

.error-message {
    background: rgba(255, 69, 58, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 69, 58, 0.3);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }

    body.sidebar-open .mobile-menu-btn {
        display: none;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .nav-main {
        overscroll-behavior: contain;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 12px 16px 12px 64px;
    }

    .page-title {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .grid-2,
    .theme-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 16px;
    }

    .card-header,
    .card-body {
        padding: 16px;
    }

    .stat-value {
        font-size: 26px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select,
    .btn {
        font-size: 16px;
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
