:root {
    --bg-app: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-sidebar: #94a3b8;
    --border-color: #e2e8f0;
    --primary: #3b82f6;

    --font-sans: 'Inter', system-ui, sans-serif;

    --sidebar-width: 260px;
    --header-height: 70px;

    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 8px;

    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 14px;
    overflow-x: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Main Content Adjustments */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.current-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 6px 12px;
    gap: 8px;
    width: 280px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
}

.search-box i {
    color: #94a3b8;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: var(--radius-md);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f8fafc;
    color: var(--primary);
    border-color: #cbd5e1;
}

.modern-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 15px;
    cursor: pointer;
    font-size: 1.1rem;
}

.modern-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Quick Stats */
.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
}

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

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

.stat-info .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

/* Colors Utility */
.bg-blue-soft {
    background: #eff6ff;
}

.text-blue {
    color: #3b82f6;
}

.bg-green-soft {
    background: #f0fdf4;
}

.text-green {
    color: #22c55e;
}

.bg-purple-soft {
    background: #faf5ff;
}

.text-purple {
    color: #a855f7;
}

.text-emerald {
    color: #10b981;
}

.text-indigo {
    color: #6366f1;
}

.text-red {
    color: #ef4444;
}

.text-slate {
    color: #64748b;
}

.text-amber {
    color: #f59e0b;
}

/* Modules Grid */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #334155;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    /* Featured card spans 2 columns */
}

/* Module Cards */
.module-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.card-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.card-body h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.card-body p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* Featured Card (Production Manager) */
.module-card.featured {
    grid-column: span 2;
    background: #1e293b;
    /* Fallback */
    border: none;
    padding: 0;
    color: white;
    justify-content: flex-end;
    /* Align content bottom */
    min-height: 200px;
    /* Taller */
}

.card-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, #3b82f6 0%, #0f172a 60%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.big-icon {
    font-size: 80px;
    position: absolute;
    right: -10px;
    top: -10px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.overlay-text {
    position: relative;
    z-index: 10;
}

.overlay-text h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.overlay-text p {
    color: #cbd5e1;
    font-size: 14px;
    max-width: 80%;
    margin: 0;
}

.card-footer {
    position: absolute;
    bottom: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
    z-index: 10;
}

/* Responsive */
@media (max-width: 1024px) {
    .module-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 15px;
    }

    .topbar {
        padding: 10px 15px;
    }

    .stats-row {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        display: none;
    }

    .stat-card {
        width: 100%;
        flex: none;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .module-card {
        padding: 20px;
    }

    .welcome-text h1 {
        font-size: 20px;
    }
}