:root {
    --bg-dark: #0f1115;
    --bg-sidebar: #161b22;
    --bg-card: #1c2128;
    --bg-hover: #2d333b;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-purple: #bc8cff;
    --accent-green: #3fb950;
    --border-color: #30363d;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: white;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

/* Sidebar Section Title */
.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 24px;
    margin-bottom: 8px;
    padding-left: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-speed);
    font-size: 14px;
    font-weight: 500;
}

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

.nav-item.active {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Sidebar Product List Items */
.product-list .nav-item {
    padding-left: 16px;
}

.badge {
    margin-left: auto;
    background-color: var(--accent-color);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}



/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.cta-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0 24px;
    height: 40px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-speed);
}

.cta-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple {
    background-color: rgba(188, 140, 255, 0.1);
    color: var(--accent-purple);
}

.stat-icon.blue {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
}

.stat-icon.green {
    background-color: rgba(63, 185, 80, 0.1);
    color: var(--accent-green);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info .trend {
    font-size: 12px;
    font-weight: 500;
}

.trend.up {
    color: var(--accent-green);
}

.trend.down {
    color: #f85149;
}

/* Projects Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.filter-tabs {
    display: flex;
    background-color: rgba(30, 41, 59, 0.5);
    /* Semi-transparent slate */
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.tab {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active,
.tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.tab.active {
    background-color: rgba(88, 166, 255, 0.2);
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    /* Increased height for better proportions */
    gap: 24px;
}

.bento-item {
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Hover Effects */
.bento-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 20px rgba(88, 166, 255, 0.2);
    /* Glow effect */
    z-index: 10;
}

/* Gradient Themes - Premium & Sophisticated */
/* Adding noise texture via data URI for premium feel (optional simple version) */

.theme-purple {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%),
        radial-gradient(circle at 10% 10%, rgba(139, 92, 246, 0.6), transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(79, 70, 229, 0.4), transparent 50%);
}

.theme-purple:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.5);
}

.theme-blue {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%),
        radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.5), transparent 60%),
        radial-gradient(circle at 80% 100%, rgba(14, 165, 233, 0.4), transparent 60%);
}

.theme-blue:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(56, 189, 248, 0.4);
    border-color: rgba(56, 189, 248, 0.5);
}

.theme-dark {
    background: linear-gradient(135deg, rgba(24, 24, 27, 0.95) 0%, rgba(39, 39, 42, 0.95) 100%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15), transparent 70%);
}

.theme-dark:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-ocean {
    background: linear-gradient(135deg, rgba(12, 74, 110, 0.9) 0%, rgba(7, 89, 133, 0.9) 100%),
        radial-gradient(circle at 0% 100%, rgba(6, 182, 212, 0.5), transparent 60%),
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.4), transparent 60%);
}

.theme-ocean:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(6, 182, 212, 0.4);
    border-color: rgba(6, 182, 212, 0.5);
}

.theme-sunset {
    background: linear-gradient(135deg, rgba(76, 5, 25, 0.9) 0%, rgba(136, 19, 55, 0.9) 100%),
        radial-gradient(circle at 10% 90%, rgba(244, 63, 94, 0.5), transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(251, 113, 133, 0.4), transparent 50%);
}

.theme-sunset:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(244, 63, 94, 0.4);
    border-color: rgba(244, 63, 94, 0.5);
}

/* Card background: image with fallback when load fails */
.bento-bg-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    /* Important for zoom effect */
    border-radius: 24px;
}

.bento-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s ease;
}

.bento-item:hover .bento-bg-img {
    transform: scale(1.1);
    /* Smooth zoom on hover */
}

.bento-bg-fallback {
    display: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.85)), linear-gradient(135deg, #2b2b2b, #1a1a1a);
}

.bento-item .item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 28px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.6) 50%, transparent);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bento-item.clean {
    background-color: rgba(30, 41, 59, 0.6);
    /* Slightly more opaque for clean cards */
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-content-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    /* Fully rounded pills */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
    width: fit-content;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.bento-item:hover .tag {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.bento-item h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.bento-item p {
    font-size: 14px;
    color: rgba(240, 246, 252, 0.8);
    line-height: 1.5;
    font-weight: 400;
}

.icon-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-primary);
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}

.bento-item:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Edit Button Styles */
.edit-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
}

.edit-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: rotate(15deg);
}

.bento-item:hover .edit-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Grid Spanning classes */
/* Maintained logic, adjusted for visual balance if needed */
.large {
    grid-column: span 2;
    grid-row: span 2;
}

.medium {
    grid-column: span 1;
    grid-row: span 1;
}

.small {
    grid-column: span 1;
    grid-row: span 1;
}

.wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-sidebar);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-primary);
    text-decoration: none;
}

.modal h2 {
    margin-bottom: 24px;
    font-size: 22px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-color);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}

.submit-btn:hover {
    filter: brightness(1.1);
}

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

    .large {
        grid-column: span 2;
    }

    .wide {
        grid-column: span 3;
    }
}

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

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .large,
    .wide {
        grid-column: span 2;
    }
}

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

    .main-content {
        margin-left: 0;
        padding: 24px;
    }
}

/* Admin Mode & Delete Button */
/* Admin mode logic removed as per request */

.delete-btn {
    background-color: transparent;
    color: #f85149;
    /* GitHub danger red */
    border: 1px solid #30363d;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}

.delete-btn:hover {
    background-color: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
}

/* Search Bar Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container input {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    /* Pill shape */
    padding: 10px 16px 10px 40px;
    /* Left padding for icon */
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    width: 240px;
    transition: var(--transition-speed);
}

.search-container input:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-hover);
    width: 280px;
    /* Slight expansion on focus */
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}