/* SaaS Platform - Modern CSS */

:root {
    --primary-purple: #6366f1;
    --primary-blue: #3b82f6;
    --primary-green: #10b981;
    --primary-orange: #f59e0b;

    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-dark: #111827;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo .accent {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--border-color);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.chevron {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Welcome Section */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.welcome-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.welcome-content p {
    color: var(--text-secondary);
}

.quick-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-primary);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-purple);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-primary);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.gradient-purple .stat-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.gradient-blue .stat-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.gradient-green .stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-orange .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.stat-change svg {
    width: 12px;
    height: 12px;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.stat-change.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel.large {
    grid-column: span 2;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.panel-body {
    padding: 1.5rem;
}

.select-sm {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    cursor: pointer;
}

.badge-pro {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Chart */
.chart-placeholder {
    height: 250px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bar {
    flex: 1;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}

.bar:hover {
    opacity: 0.8;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Plan Info */
.plan-price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.currency {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.amount {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
}

.period {
    font-size: 1rem;
    color: var(--text-secondary);
    align-self: flex-end;
    margin-bottom: 0.5rem;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.feature-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-green);
    flex-shrink: 0;
}

/* API Keys */
.api-key-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.key-info {
    flex: 1;
}

.key-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

code {
    font-family: 'Monaco', 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary-purple);
}

.key-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.activity-icon.purple {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.activity-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.activity-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.activity-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.link-sm {
    color: var(--primary-purple);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.link-sm:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .panel.large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}