/* ======================================
   🎨 WMS & MRP - D-inventy Premium Theme
   Clean Light Modern Design
   ====================================== */

:root {
    /* Brand Colors */
    --primary: #5d5fef;
    --primary-light: rgba(93, 95, 239, 0.1);
    --primary-hover: #4a4cd9;

    /* Neutral Palette */
    --bg-body: #f8f9fd;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;

    --text-main: #1a1d1f;
    --text-secondary: #6f767e;
    --text-muted: #9a9fa5;

    /* Semantic Colors */
    --success: #1eb886;
    --warning: #ff9f21;
    --danger: #ff4d4f;
    --info: #2196f3;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #5d5fef 0%, #818cf8 100%);
    --gradient-success: linear-gradient(135deg, #1eb886 0%, #4ae3b5 100%);
    --gradient-warning: linear-gradient(135deg, #ff9f21 0%, #ffc670 100%);

    /* Borders & Spacing */
    --border-color: #f1f3f7;
    --shadow-sm: 0px 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0px 8px 16px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0px 16px 32px rgba(0, 0, 0, 0.08);

    --sidebar-width: 250px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Prompt', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - D-inventy Style */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 80px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 2.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.logo-area i {
    color: var(--primary);
    font-size: 1.5rem;
}

.sidebar.collapsed .logo-area span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span {
    display: none;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.5rem 0.75rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.main-content.collapsed-mode {
    margin-left: 80px;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.search-fake {
    background: #f4f6f9;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.header-icon-btn:hover {
    color: var(--primary);
}

.header-icon-btn .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

/* Responsive spans */
.col-12 {
    grid-column: span 12;
}

.col-8 {
    grid-column: span 8;
}

.col-6 {
    grid-column: span 6;
}

.col-4 {
    grid-column: span 4;
}

.col-3 {
    grid-column: span 3;
}

@media (max-width: 1200px) {
    .col-3 {
        grid-column: span 4;
    }
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(12, 1fr);
    }

    .col-3 {
        grid-column: span 6;
    }

    .col-4 {
        grid-column: span 6;
    }

    .col-6 {
        grid-column: span 12;
    }

    .col-8 {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .col-3,
    .col-4,
    .col-6,
    .col-8,
    .col-12 {
        grid-column: span 1;
    }
}

/* Cards - D-inventy Style */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #f4f6f9;
}

.stat-info .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

.trend-up {
    background: #e6fff1;
    color: var(--success);
}

.trend-down {
    background: #fff1f0;
    color: var(--danger);
}

/* Table Section */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #fafbfc;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: #e6fff1;
    color: var(--success);
}

.badge-warning {
    background: #fff7e6;
    color: var(--warning);
}

.badge-danger {
    background: #fff1f0;
    color: var(--danger);
}

.badge-info {
    background: #e6f7ff;
    color: var(--info);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Chart Mockups */
.chart-container {
    height: 300px;
    position: relative;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card[style*="span 12"] {
        grid-column: span 2 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 0 1rem;
    }

    .search-fake {
        display: none;
    }
}