/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo h2 {
    color: #667eea;
    font-size: 20px;
    padding: 15px 0;
}

.nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #667eea;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 14px;
    color: #666;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    color: #333;
    font-size: 28px;
}

.page-header p {
    color: #666;
    margin-top: 5px;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.welcome-content h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.welcome-content .text-muted {
    color: rgba(255, 255, 255, 0.9);
}

.welcome-actions {
    display: flex;
    gap: 15px;
}

.welcome-actions .btn {
    background: white;
    color: #667eea;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Modern Stats Grid */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card-modern {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border-left: 5px solid transparent;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-card-modern.primary {
    border-left-color: #667eea;
}

.stat-card-modern.success {
    border-left-color: #10b981;
}

.stat-card-modern.warning {
    border-left-color: #f59e0b;
}

.stat-card-modern.danger {
    border-left-color: #ef4444;
}

.stat-card-modern.info {
    border-left-color: #3b82f6;
}

.stat-icon-modern {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat-details h3 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.stat-details p {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-trend {
    font-size: 12px;
    color: #10b981;
    font-weight: 500;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.chart-card canvas {
    height: 300px !important;
}

/* Alert Card */
.alert-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border-left: 5px solid #ef4444;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.alert-header h2 {
    font-size: 20px;
    color: #333;
}

/* Activity Card */
.activity-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.activity-header h2 {
    font-size: 20px;
    color: #333;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.3s;
}

.activity-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.activity-icon.success {
    background: #d1fae5;
}

.activity-icon.warning {
    background: #fef3c7;
}

.activity-content {
    flex: 1;
}

.activity-content strong {
    color: #333;
    font-size: 15px;
}

.activity-content p {
    margin: 3px 0 0 0;
    font-size: 13px;
}

.activity-time {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.activity-time small {
    color: #999;
    font-size: 12px;
}

/* Modern Table */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table-modern tbody tr {
    background: #f9fafb;
    transition: all 0.3s;
}

.table-modern tbody tr:hover {
    background: #f0f0f0;
    transform: scale(1.01);
}

.table-modern td {
    padding: 15px;
    border: none;
}

.table-modern tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.table-modern tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
}

.product-cell {
    display: flex;
    flex-direction: column;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
}

.stat-content h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

.stat-card.success {
    border-left: 4px solid #10b981;
}

.stat-card.warning {
    border-left: 4px solid #f59e0b;
}

.stat-card.danger {
    border-left: 4px solid #ef4444;
}

.stat-card.info {
    border-left: 4px solid #3b82f6;
}

.stats-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card-small {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Section */
.section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: #f8f9fa;
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* Modal */
.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.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 150px;
}

/* Scan Page */
.scan-container {
    max-width: 800px;
    margin: 0 auto;
}

.scan-methods {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.scan-instructions {
    text-align: center;
    margin: 20px 0;
    color: #666;
}

.scan-instructions p {
    margin: 5px 0;
}

.manual-search {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.barcode-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 16px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.item-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.barcode-display {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.barcode-display code {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.item-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.detail-item {
    padding: 10px;
    background: #f9fafb;
    border-radius: 5px;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.detail-value {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Issue/Return Grid */
.issue-return-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.issued-items-list {
    margin-top: 20px;
}

.text-muted {
    color: #666;
    font-style: italic;
}

.product-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.product-info h2 {
    color: #333;
    margin-bottom: 10px;
}

.product-info p {
    margin: 5px 0;
    color: #666;
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.code-block code {
    display: block;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chip small {
    font-size: 11px;
    opacity: 0.8;
}

.chip-success {
    background: #d1fae5;
    color: #065f46;
}

.chip-info {
    background: #dbeafe;
    color: #1e40af;
}

.tips-section {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tip-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.tip-card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.tip-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav {
        width: 100%;
    }
    
    .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .issue-return-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #barcodePrintArea,
    #barcodePrintArea * {
        visibility: visible;
    }
    
    #barcodePrintArea {
        position: absolute;
        left: 0;
        top: 0;
    }
}