/* ==========================================================================
   Vendor Dashboard — complete dashboard styles.
   Loaded only on vendor dashboard pages.
   ========================================================================== */

/* --- Dashboard topbar --- */

.dash-topbar-inner {
    max-width: 100%;
    padding: 0 28px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    gap: 18px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* --- Dashboard header --- */

.dash-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-header-inner {
    padding: 0 28px;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-url-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
    max-width: 320px;
    overflow: hidden;
}

.store-url-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-url-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--grad-hero);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--grad-hero);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn-add:hover {
    opacity: 0.9;
    color: #fff;
}

/* --- Dashboard layout --- */

.dash-body {
    display: flex;
    min-height: calc(100vh - 108px);
}

/* --- Sidebar nav --- */

.dash-sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 20px;
    margin: 20px 0 8px;
}

.nav-section-label:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-right: 3px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--secondary);
    background: #f5f3ff;
}

.nav-item.active {
    color: var(--secondary);
    background: #f0eeff;
    border-right-color: var(--secondary);
}

.nav-item .icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
}

.nav-item .badge-count {
    margin-left: auto;
    background: var(--secondary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.nav-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 20px;
}

/* --- Main content --- */

.dash-main {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

/* --- Welcome banner --- */

.welcome-banner {
    background: var(--grad-hero);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.welcome-text h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.welcome-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    text-decoration: none;
}

.welcome-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* --- Dashboard CTA / rotating tip card --- */

.dash-cta-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    background: var(--grad-hero);
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-cta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #fff;
}

.dash-cta-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    font-size: 20px;
    flex-shrink: 0;
}

.dash-cta-body {
    flex: 1;
}

.dash-cta-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-bottom: 2px;
}

.dash-cta-title {
    font-size: 15px;
    font-weight: 700;
}

.dash-cta-arrow {
    font-size: 18px;
    opacity: 0.9;
    flex-shrink: 0;
}

/* --- Stats row --- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.stat-icon {
    float: right;
    font-size: 24px;
    margin-top: -4px;
}

/* --- Dashboard card --- */

.dash-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    margin-bottom: 16px;
}

.dash-card-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.dash-card-header a {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 700;
}

/* --- Builds table --- */

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

.builds-table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.builds-table td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
}

.builds-table tr:last-child td {
    border-bottom: none;
}

.builds-table tr:hover td {
    background: #fafbff;
}

.build-thumb-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.build-mini-thumb {
    width: 44px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.build-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.build-name {
    font-weight: 700;
    color: var(--dark);
    font-size: 14px;
}

/* --- Status pills --- */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-live { background: #dcfce7; color: #16a34a; }
.status-pending { background: #fef9c3; color: #a16207; }
.status-draft { background: var(--light); color: var(--muted); }

/* --- Action buttons --- */

.action-btns {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    transition: all 0.15s;
    text-decoration: none;
}

.action-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

button.action-btn {
    font-family: inherit;
    line-height: 1.4;
}

.action-btn--danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.action-btn--danger:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.action-btns form {
    display: inline;
    margin: 0;
}

/* --- Form styles (add/edit build) --- */

.page-title-bar {
    margin-bottom: 24px;
}

.page-title-bar h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-card h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-group {
    margin-bottom: 18px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 7px;
}

.field-hint {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 7px;
    display: block;
}

.field-required {
    color: #ef4444;
}

.field-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    font-family: 'Outfit', sans-serif;
    background: var(--white);
}

.field-input:focus {
    border-color: var(--primary);
}

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

.field-select {
    cursor: pointer;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* --- Platform radio group --- */

.platform-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.platform-opt {
    position: relative;
}

.platform-opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.platform-opt label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}

.platform-opt input:checked + label {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #f0eeff;
}

/* --- Legal confirm --- */

.legal-confirm {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.legal-confirm input {
    margin-top: 3px;
    accent-color: var(--secondary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.legal-confirm label {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.legal-confirm label a {
    color: var(--secondary);
    font-weight: 600;
}

/* --- Sidebar cards --- */

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.status-card,
.pricing-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}

.status-card h3,
.pricing-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.status-row:last-of-type {
    border-bottom: none;
    margin-bottom: 14px;
}

.status-row label {
    color: var(--muted);
    font-weight: 500;
}

.status-row .val {
    font-weight: 700;
    color: var(--dark);
}

.btn-publish-full {
    width: 100%;
    background: var(--grad-hero);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

/* --- Pricing card --- */

.price-input-wrap {
    position: relative;
}

.price-input-wrap .currency {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
}

.price-input-wrap input {
    width: 100%;
    padding: 10px 14px 10px 30px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.price-guide {
    margin-top: 12px;
}

.price-guide-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
}

.price-tier {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 0;
}

.commission-note {
    margin-top: 14px;
    padding: 12px;
    background: #f0eeff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--secondary);
    font-weight: 600;
}

/* --- Responsive --- */

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

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-header-inner {
        padding: 0 16px;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .dash-header-inner .logo {
        font-size: 16px;
    }

    .dash-header-inner .logo small {
        display: none;
    }

    .header-right {
        gap: 8px;
    }

    .store-url-chip {
        display: none;
    }

    .user-chip .user-name {
        display: none;
    }

    .btn-add {
        padding: 8px 14px;
        font-size: 13px;
    }

    .dash-topbar-inner {
        padding: 0 16px;
        font-size: 13px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .dash-sidebar {
        display: none;
    }

    .dash-main {
        padding: 20px 16px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* ==========================================================================
   Creator Storefront — public /creator/{slug}/ page
   ========================================================================== */

.store-header {
    background: var(--grad-hero);
    padding: 48px 0;
}

.store-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.store-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
    flex-shrink: 0;
}

.store-name {
    color: var(--white) !important;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.store-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.store-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.store-bio {
    color: rgba(255, 255, 255, 0.85);
    margin-top: 16px;
    max-width: 700px;
    font-size: 15px;
    line-height: 1.6;
}

.store-builds {
    padding: 28px 0 60px;
}

@media (max-width: 640px) {
    .store-header {
        padding: 32px 0;
    }

    .store-header-inner {
        flex-direction: column;
        text-align: center;
    }

    .store-meta {
        justify-content: center;
    }

    .store-bio {
        text-align: center;
    }
}
