/* style.css */

/* --- CSS Variables & Design Tokens --- */
:root {
    /* Main Theme Colors */
    --primary-color: #0284C7;
    /* Modern Sky Blue */
    --primary-light: #E0F2FE;
    --primary-dark: #0369A1;
    --secondary-blue: #3B82F6;

    --secondary-color: #64748B;

    /* Semantic Colors for Statuses */
    --success-color: #10B981;
    --success-light: #D1FAE5;

    --danger-color: #EF4444;
    --danger-light: #FEE2E2;

    --warning-color: #F59E0B;
    --warning-light: #FEF3C7;

    /* Backgrounds & Surfaces */
    --bg-body: #F4F7FA;
    /* Very light cool gray */
    --surface-card: #FFFFFF;
    --surface-sidebar: #FFFFFF;

    /* Typography */
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* Borders & Shadows */
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 8px 24px -12px rgba(0, 0, 0, 0.08);
    /* Soft premium shadow */

    /* Layout Tokens */
    --sidebar-width: 280px;
    --topbar-height: 80px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;

    /* Animation Speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* --- Base Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- App Layout (No Sidebar — Full Dashboard) --- */
/* ═══════ APP CONTAINER & SIDEBAR ═══════ */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
}

.app-sidebar {
    width: 280px;
    background-color: #FFFFFF;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 32px 24px;
}

.sidebar-brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

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

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #FFFFFF;
    color: var(--text-main);
    box-shadow: 0 0 0 2px var(--border-color);
    font-weight: 600;
}

.sidebar-footer {
    padding: 24px 12px;
    border-top: 1px solid var(--border-color);
}

.logout-item:hover {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

/* ═══════ MAIN WRAPPER ═══════ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: transparent;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

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

.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.content-area {
    padding: 0 40px 40px 40px;
}

/* ═══════ KPI CARDS MOCKUP STYLE ═══════ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    transition: all var(--transition-fast);
}

.kpi-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.kpi-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.kpi-value-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.kpi-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.kpi-unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
}

.kpi-icon {
    font-size: 28px;
    color: var(--text-main);
    opacity: 0.8;
}

/* ═══════ DASHBOARD CONTENT ═══════ */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

.chart-card-full {
    background: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
}

.bento-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.bento-card {
    background: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
}

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

.bento-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}




/* ═══════ FEATURE NAVIGATION CARDS ═══════ */
.feature-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.feature-card-blue::before {
    background: #0284C7;
}

.feature-card-green::before {
    background: #10B981;
}

.feature-card-purple::before {
    background: #8B5CF6;
}

.feature-card-orange::before {
    background: #F59E0B;
}

.feature-card-teal::before {
    background: #06B6D4;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    border-color: transparent;
}

.feature-card-blue:hover {
    border-color: #0284C7;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15);
}

.feature-card-green:hover {
    border-color: #10B981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.feature-card-purple:hover {
    border-color: #8B5CF6;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.feature-card-orange:hover {
    border-color: #F59E0B;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.feature-card-teal:hover {
    border-color: #06B6D4;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.feature-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.feature-card-blue .feature-card-icon {
    background: #E0F2FE;
    color: #0284C7;
}

.feature-card-green .feature-card-icon {
    background: #D1FAE5;
    color: #10B981;
}

.feature-card-purple .feature-card-icon {
    background: #EDE9FE;
    color: #8B5CF6;
}

.feature-card-orange .feature-card-icon {
    background: #FEF3C7;
    color: #F59E0B;
}

.feature-card-teal .feature-card-icon {
    background: #CFFAFE;
    color: #06B6D4;
}

.feature-card-body {
    flex: 1;
    min-width: 0;
}

.feature-card-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-card-body p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.feature-card-arrow {
    font-size: 14px;
    color: var(--text-light);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.feature-card:hover .feature-card-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

.feature-badge {
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
    animation: animate-pulse 2s infinite;
}

/* ═══════ BACK BUTTON ═══════ */
.btn-back-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-back-dashboard:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-2px);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    padding: 10px 18px;
    border-radius: 99px;
    width: 320px;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

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

.user-controls {
    display: flex;
    align-items: center;
    gap: 28px;
}

.notification-trigger {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-body);
    transition: var(--transition-fast);
}

.notification-trigger:hover {
    background-color: var(--danger-light);
}

.notification-trigger i {
    font-size: 20px;
    color: var(--text-muted);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-card);
}

.pulse-animation {
    animation: animate-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes animate-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .7;
        transform: scale(1.1);
        box-shadow: 0 0 8px var(--danger-color);
    }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 99px;
    transition: var(--transition-fast);
}

.user-profile:hover {
    background-color: var(--bg-body);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
}

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

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-icon {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* --- Dashboard Content Area --- */
.dashboard-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Global Filters */
.global-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--surface-card);
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
}

.filter-group i {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 15px;
}

.filter-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    border-radius: 8px;
}

/* --- Summary Cards --- */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background-color: var(--surface-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-right: 20px;
    flex-shrink: 0;
}

.card-primary .card-icon {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.card-success .card-icon {
    background-color: var(--success-light);
    color: var(--success-color);
}

.card-danger .card-icon {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

.glass-card.warning-glow {
    position: relative;
    overflow: hidden;
    border-color: #fecaca;
}

.glass-card.warning-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--danger-color), #f97316);
}

.card-details {
    flex-grow: 1;
}

.card-details h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.card-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.trend {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
}

.trend.positive {
    color: var(--success-color);
    background-color: var(--success-light);
}

.trend.negative {
    color: var(--danger-color);
    background-color: var(--danger-light);
}

/* --- Dashboard Bento Grid Layout (Target Ref Image) --- */
.dashboard-bento {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.bento-left {
    flex: 0 0 calc(60% - 12px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 400px;
}

.bento-right {
    flex: 0 0 calc(40% - 12px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 300px;
}

@media (max-width: 1100px) {

    .bento-left,
    .bento-right {
        flex: 100%;
    }
}

.bento-right-split {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 200px;
}

/* Chart Cards styling */
.chart-card {
    background: var(--surface-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.card-header h3 {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
}

.more-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.more-btn:hover {
    color: var(--text-muted);
}

/* Chart Wrappers */
.chart-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.line-chart-wrapper {
    height: 280px;
}

.bar-chart-wrapper {
    height: 250px;
}

.pie-chart-wrapper {
    height: 220px;
}

/* Best Selling Products */
.best-selling-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.product-item {
    text-align: center;
}

.product-img-box {
    background-color: var(--bg-body);
    border-radius: var(--border-radius-md);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 40px;
    color: white;
}

.bg-denim {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.bg-navy {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.bg-sneaker {
    background: linear-gradient(135deg, #475569, #94a3b8);
}

.product-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-item p {
    font-size: 13px;
    color: var(--text-muted);
}

.product-item p strong {
    color: var(--text-main);
}

/* Low Stock Items */
.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.low-stock-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.low-stock-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ls-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ls-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #1e293b;
}

.red-icon {
    color: #ef4444;
}

.brown-icon {
    color: #8b5cf6;
}

.ls-text h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.ls-text p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.ls-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.ls-alert i {
    color: var(--danger-color);
}

/* --- Table Section --- */
.table-section {
    background-color: var(--surface-card);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--bg-body);
}

.data-table th:first-child {
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
}

.data-table th:last-child {
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: #F8FAFC;
}

.data-table td {
    font-size: 15px;
    color: var(--text-main);
    vertical-align: middle;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prediction-value {
    font-weight: 700;
    color: var(--primary-color);
    background-color: var(--primary-light);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Status Badges */
.status {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-good {
    background-color: var(--success-light);
    color: var(--success-color);
}

.status-good::before {
    background-color: var(--success-color);
}

.status-warning {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.status-warning::before {
    background-color: var(--warning-color);
}

.status-danger {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

.status-danger::before {
    background-color: var(--danger-color);
}

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

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

    .topbar {
        padding: 0 16px;
    }

    .dashboard-content {
        padding: 16px;
    }

    .search-bar {
        width: 200px;
    }

    .global-filters {
        justify-content: flex-start;
    }
}