/* Dashboard Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --header-height: 70px;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 0 0 auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-label {
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-info span {
    font-size: 0.875rem;
    color: var(--sidebar-text);
    word-break: break-all;
}

.btn-link {
    background: none;
    border: none;
    color: var(--sidebar-active);
    cursor: pointer;
    font-size: 0.875rem;
    text-align: left;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.875rem;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    color: var(--text);
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg-alt);
}

.org-name {
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--primary);
    border-radius: 0.375rem;
    background: rgba(59, 130, 246, 0.05);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.dashboard-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.dashboard-card h2,
.dashboard-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
}

.dashboard-card h2 {
    font-size: 1.25rem;
}

.dashboard-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Welcome Card */
.welcome-card {
    grid-column: span 12;
}

.welcome-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

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

.action-icon {
    font-size: 1.25rem;
}

/* Stats Row */
.stats-row {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Products Card */
.products-card {
    grid-column: span 7;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: 0.5rem;
}

.product-status {
    font-size: 0.75rem;
}

.product-status.available {
    color: var(--success);
}

.product-status.pending {
    color: var(--text-light);
}

.product-name {
    flex: 1;
    font-weight: 500;
}

.product-plan {
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-actions .btn-small {
    white-space: nowrap;
}

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

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

.self-serve-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem 0;
}

/* Invite Code Section */
.invite-code-section {
    background: var(--bg-alt);
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.invite-code-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.invite-code-input {
    display: flex;
    gap: 0.5rem;
}

.invite-code-input input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.invite-code-help {
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Live vs Waitlist Products */
.live-product {
    border-left: 3px solid var(--success);
}

.waitlist-product {
    border-left: 3px solid var(--text-light);
    opacity: 0.9;
}

.product-actions .btn-small:disabled {
    background: var(--bg-alt);
    color: var(--text-light);
    border-color: var(--border);
    cursor: not-allowed;
}

.btn-launch {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-launch:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Pricing Modal */
#pricingModal.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#pricingModal.modal.active {
    display: flex !important;
}

#pricingModal .modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    overflow: hidden;
}

#pricingModal .close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background: transparent;
    border: none;
    padding: 0;
}

#pricingModal .close:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.pricing-modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: white;
    border-bottom: 1px solid var(--border);
}

.pricing-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.pricing-modal-body {
    padding: 2rem;
    background: white;
}

.pricing-details {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.price-large {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.price-period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.price-description {
    color: var(--text-light);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.pricing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.pricing-actions button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

/* Empty State */
.empty-state {
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Activity Card */
.activity-card {
    grid-column: span 5;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.activity-time {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}

.activity-text {
    color: var(--text);
}

/* Settings Card */
.settings-card {
    grid-column: span 5;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.setting-value {
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Team Page Styles */
.invite-form {
    margin: 1rem 0;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.form-row input,
.form-row select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.form-row input {
    flex: 1;
    min-width: 200px;
}

.form-row select {
    width: auto;
}

.btn-primary {
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.invite-link-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.invite-link-section p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.team-list-card {
    grid-column: span 6;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-alt);
    border-radius: 0.5rem;
}

.member-avatar {
    font-size: 1.5rem;
}

.member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.member-name {
    font-weight: 500;
    color: var(--text);
}

.member-email {
    font-size: 0.8rem;
    color: var(--text-light);
}

.member-role {
    padding: 0.25rem 0.625rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.member-role.owner {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.member-role.admin {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.member-role.member {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-light);
}

.empty-state {
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header .logo,
    .nav-label,
    .user-info span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }

    .nav-item {
        justify-content: center;
        padding: 1rem;
    }

    .sidebar-footer {
        padding: 1rem;
    }

    .btn-link {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    .products-card,
    .activity-card,
    .settings-card {
        grid-column: span 12;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .sidebar {
        display: none;
    }

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