/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #2d3748;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    padding: 20px;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding: 0 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary);
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

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

.header-title h1 {
    font-size: 32px;
    margin-bottom: 5px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

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

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

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-2px);
}

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

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

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

.btn-success:hover {
    background: #0ea572;
}

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

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

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

.stat-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.content-grid-equal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border);
}

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

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

/* Table */
.table-container {
    overflow-x: auto;
}

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

thead {
    border-bottom: 1px solid var(--border);
}

th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: var(--bg-tertiary);
}

.saas-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.saas-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.saas-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.saas-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge.premium {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
}

.badge.basic {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 15px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.activity-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.activity-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.activity-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.activity-content h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.activity-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Chart Placeholder */
.chart-placeholder {
    height: 300px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 2px dashed var(--border);
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
}

/* Search Bar */
.search-bar {
    position: relative;
}

.search-bar input {
    padding: 10px 15px 10px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    width: 300px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    transition: width 0.3s;
}

/* Action Menu */
.action-menu {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

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

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid var(--border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: white;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--text-primary);
}

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

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

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

/* SaaS Card */
.saas-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
}

.saas-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.saas-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.saas-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.saas-card-title {
    font-size: 20px;
    margin-bottom: 5px;
}

.saas-card-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.saas-card-stats {
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.saas-card-stat {
    flex: 1;
}

.saas-card-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.saas-card-stat-value {
    font-size: 18px;
    font-weight: 700;
}

/* Notification Item */
.notification-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    border-left: 3px solid var(--accent-primary);
}

.notification-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
}

.notification-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Alert Box */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 32px;
    margin-bottom: 15px;
}

.login-title {
    font-size: 28px;
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .search-bar input {
        width: 100%;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}