@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&amp;display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.95);

    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --secondary: #d946ef;
    --secondary-glow: rgba(217, 70, 239, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --border: rgba(0, 0, 0, 0.06);
    --glass-blur: blur(20px);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
}

/* Base Glass Effect */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.08);
}

.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    transition: var(--transition);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 10px;
}

.brand-icon img {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.brand-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    border-radius: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.nav-link .material-symbols-outlined {
    font-size: 22px;
    color: currentColor;
    transition: var(--transition);
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
    border-radius: 14px;
}

.nav-item:hover::before,
.nav-item.active::before {
    opacity: 1;
}

.nav-item:hover .nav-link,
.nav-item.active .nav-link {
    color: var(--text-main);
}

.nav-item.active .nav-link .material-symbols-outlined {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary-glow);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* User Profile Widget */
.user-widget {
    margin-top: auto;
    padding: 15px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.user-widget:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
}

.greeting h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.greeting h1 span {
    color: var(--primary);
}

.greeting p {
    color: var(--text-muted);
    font-size: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
}

.search-bar input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px 12px 45px;
    color: var(--text-main);
    font-family: 'Outfit';
    font-size: 15px;
    width: 300px;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    width: 350px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    fill: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.icon-button {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    color: var(--text-muted);
}

.icon-button .material-symbols-outlined {
    font-size: 20px;
    color: currentColor;
    transition: var(--transition);
}

.icon-button:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    color: var(--text-main);
}

.indicator {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--secondary-glow);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.stat-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.15);
}

.stat-icon.primary svg {
    fill: var(--primary);
}

.stat-icon.secondary {
    background: rgba(236, 72, 153, 0.15);
}

.stat-icon.secondary svg {
    fill: var(--secondary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.15);
}

.stat-icon.success svg {
    fill: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.15);
}

.stat-icon.warning svg {
    fill: var(--warning);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.stat-trend.up {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-trend.down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.stat-trend svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.stat-info {
    margin-top: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Charts & Dashboard Body */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

.chart-card {
    padding: 25px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.chart-placeholder {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding-top: 30px;
    padding-bottom: 10px;
    position: relative;
}

/* Fake Chart Bars for pure CSS visual */
.bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    height: 100%;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, var(--primary), rgba(99, 102, 241, 0.3));
    border-radius: 6px 6px 0 0;
    position: relative;
    box-shadow: 0 -5px 15px rgba(99, 102, 241, 0.2);
    transition: var(--transition);
    cursor: pointer;
    animation: growUp 1s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    transform-origin: bottom;
}

.bar:hover {
    background: linear-gradient(to top, var(--secondary), var(--primary));
    box-shadow: 0 -5px 20px rgba(236, 72, 153, 0.4);
}

.bar-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Activity List */
.activity-card {
    padding: 25px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.upload {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.activity-icon.sale {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.activity-icon.message {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.activity-icon.alert {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-main);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Data Table */
.data-table-card {
    padding: 25px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr {
    transition: var(--transition);
}

.data-table tr:hover:not(thead tr) {
    background: rgba(0, 0, 0, 0.015);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-user img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.table-user span {
    font-weight: 500;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.canceled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--text-main);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--text-main);
}

/* Animations */
@keyframes growUp {
    from {
        height: 0;
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
    }

    .mobile-toggle {
        display: block;
    }

    .search-bar input {
        width: 200px;
    }

    .search-bar input:focus {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .greeting h1 {
        font-size: 24px;
    }

    .main-content {
        padding: 20px;
    }
}

@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        display: none;
    }

    .top-header {
        flex-wrap: wrap;
        gap: 15px;
    }
}