:root {
    --primary: #6f42c1;
    --primary-dark: #5a32a3;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
}

body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.12);
}

.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(111, 66, 193, 0.04);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.badge-stock {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-good {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-low {
    background-color: #fff3cd;
    color: #856404;
}

.badge-out {
    background-color: #f8d7da;
    color: #842029;
}

.alert-low-stock {
    border-left: 4px solid var(--warning);
    background: linear-gradient(to right, #fffdf0, #fff);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.15);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-weight: 700;
    margin: 0;
}

.chart-container {
    position: relative;
    height: 300px;
}

.action-btn {
    padding: 4px 8px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
    .page-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-input {
    border: 2px solid var(--primary);
    border-radius: 8px;
}

.count-input:focus {
    box-shadow: 0 0 0 0.3rem rgba(111, 66, 193, 0.25);
}

.stockin-input:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

.table-danger {
    --bs-table-bg: rgba(220, 53, 69, 0.05);
}
