/* ===================================
   WMS Portal Dashboard Styles
   =================================== */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;

    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #ecf0f1;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* ===================================
   Dashboard Wrapper
   =================================== */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===================================
   Sidebar Styles
   =================================== */

.dashboard-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--secondary-color) 0%, #34495e 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.dashboard-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.dashboard-sidebar.collapsed .sidebar-logo,
.dashboard-sidebar.collapsed .user-info,
.dashboard-sidebar.collapsed .nav-section-title,
.dashboard-sidebar.collapsed .nav-link span,
.dashboard-sidebar.collapsed .btn-logout span {
    display: none;
}

/* Sidebar Header */
.sidebar-header {
    padding: -2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Sidebar User */
.sidebar-user {
    padding: 8px;
    display: flex;
    gap: 15px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.user-role {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    padding: 0 20px 10px;
    font-weight: 600;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 2px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 15px;
}

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

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

/* Menu Badge Counter */
.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    background: var(--danger-color);
    color: #ffffff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 8px rgba(231, 76, 60, 0.5);
    }
}

.dashboard-sidebar.collapsed .menu-badge {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(231, 76, 60, 0.2);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 15px;
}

.btn-logout:hover {
    background: var(--danger-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   Alert Messages
   =================================== */

.alert {
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.5;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    font-weight: 500;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
    font-weight: 500;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    font-weight: 500;
}

.btn-logout i {
    font-size: 18px;
}

/* ===================================
   Main Content Area
   =================================== */

.dashboard-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.dashboard-sidebar.collapsed + .dashboard-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Content Header */
.content-header {
    background: var(--bg-white);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

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

/* Content Body */
.content-body {
    flex: 1;
    padding: 30px;
}

/* ===================================
   Responsive Design
   =================================== */

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

    .dashboard-sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .mobile-menu-toggle {
        display: block;
    }
}

/* ===================================
   Card Styles for Content
   =================================== */

.dashboard-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-link:hover {
    transform: translateY(-5px);
}

.stat-card-link:hover .stat-card {
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-icon {
    font-size: 40px;
    opacity: 0.9;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-content p {
    font-size: 14px;
    opacity: 0.9;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg-light);
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background: var(--bg-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge i {
    font-size: 12px;
}

.badge.bg-success {
    background: var(--success-color);
    color: #ffffff;
}

.badge.bg-warning {
    background: var(--warning-color);
    color: #2c3e50;
}

.badge.bg-danger {
    background: var(--danger-color);
    color: #ffffff;
}

.badge.bg-info {
    background: var(--info-color);
    color: #ffffff;
}

.badge.text-dark {
    color: #2c3e50 !important;
}

/* ===================================
   Analytics Dashboard Enhancements
   =================================== */

/* Progress Bar */
.progress {
    height: 20px;
    border-radius: 10px;
    background-color: #ecf0f1;
    overflow: hidden;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    transition: width 0.6s ease;
}

/* Empty State */
.text-center.text-muted {
    color: #95a5a6 !important;
}

.text-center.text-muted i {
    color: #bdc3c7;
}

.text-center.text-muted p {
    font-size: 16px;
    margin-top: 10px;
}

/* Chart Container */
.card-body canvas {
    max-height: 300px;
}

/* Analytics Header Spacing */
.wms-form-header.mb-4 {
    margin-bottom: 30px !important;
}

/* Stat Card Responsive */
@media (max-width: 992px) {
    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 32px;
    }

    .stat-content h3 {
        font-size: 28px;
    }
}

/* Table Enhancements for Analytics */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 15px 12px;
}

.table thead th i {
    margin-right: 5px;
    color: var(--primary-color);
}

.table tbody tr {
    transition: background-color 0.2s;
}

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

.table tbody td {
    vertical-align: middle;
    padding: 12px;
}

/* Button Group in Tables */
.table .btn-group {
    display: flex;
    gap: 5px;
}

.table .btn-group .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.table .btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.table .btn-success:hover {
    background-color: #229954;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.table .btn-success:disabled {
    background: #6c757d !important;
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
}

.table .btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
}

.table .btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.table .btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Chart Legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Utilization Bar Custom Colors */
.progress-bar.utilization-low {
    background-color: #27ae60;
}

.progress-bar.utilization-medium {
    background-color: #f39c12;
}

.progress-bar.utilization-high {
    background-color: #e74c3c;
}

/* ===================================
   Stock Request Pages Styling
   =================================== */

/* Product Thumbnail Placeholder */
.product-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px dashed #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #95a5a6;
}

.product-thumbnail-placeholder i {
    font-size: 24px;
}

/* Seller Avatar */
.seller-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

/* Courier Badge */
.courier-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dark);
    border: 1px solid #dee2e6;
}

.courier-badge i {
    color: var(--primary-color);
}

/* Tracking Number */
.tracking-number {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-dark);
}

/* Date Badge */
.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

.date-badge i {
    color: var(--primary-color);
}

/* Stats Summary */
.stats-summary {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.stats-summary .stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.stats-summary .stat-item i {
    font-size: 20px;
}

.stats-summary .stat-item strong {
    color: var(--primary-color);
    font-size: 18px;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px 20px;
    border-bottom: 2px solid #dee2e6;
}

.dashboard-card .card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card .card-title i {
    color: var(--primary-color);
}

.dashboard-card .card-body {
    padding: 20px;
}

/* Confirmation Dialogs */
.btn-group .btn[onclick*="confirm"] {
    cursor: pointer;
}
