:root {
    /* --- Palette Modern --- */
    --primary-color: #2563eb;
    /* Rich Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Slate */
    --success-color: #10b981;
    /* Emerald */
    --danger-color: #ef4444;
    /* Red */
    --warning-color: #f59e0b;
    /* Amber */
    --info-color: #3b82f6;
    /* Blue */

    --bg-body: #f8fafc;
    /* Very light slate */
    --bg-card: #ffffff;
    --text-main: #0f172a;
    /* Dark Slate */
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --transition: all 0.2s ease-in-out;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700 !important;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* --- Cards & Containers --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

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

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
}

.btn-success {
    background-color: var(--success-color) !important;
}

.btn-danger {
    background-color: var(--danger-color) !important;
}

.btn-warning {
    background-color: var(--warning-color) !important;
    color: white !important;
}

/* --- Forms & Inputs --- */
.form-control,
.form-select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* --- Tables --- */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1rem;
}

.table thead th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-top: none;
    padding: 1rem;
}

.table tbody td {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    vertical-align: middle;
}

/* --- Utility / Legacy Overrides --- */

.form-control-checkbox {
    height: 20px;
    width: 20px;
    border-radius: 4px;
    cursor: pointer;
}

.img-icon {
    width: 40px;
    height: 32px;
    object-fit: contain;
}

.breadcrumb-item a {
    text-decoration: none !important;
    color: var(--primary-color) !important;
    font-weight: 500;
}

.author {
    color: var(--text-muted) !important;
    font-weight: 600;
}

.low-stock td {
    background-color: #fee2e2 !important;
    /* Soft Red */
    color: #991b1b !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrapper,
.container-fluid {
    animation: fadeIn 0.4s ease-out forwards;
}

/* --- Select2 Overrides (if used) --- */

/* --- Submenu Navigation --- */
.nav-treeview {
    background-color: rgba(255, 255, 255, 0.05);
    /* Very subtle contrast */
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.nav-treeview .nav-link {
    padding-left: 3rem !important;
    /* Deep indentation */
    font-size: 0.88rem !important;
    font-weight: 400 !important;
    color: var(--text-muted) !important;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.nav-treeview .nav-link:hover,
.nav-treeview .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(37, 99, 235, 0.05) !important;
    border-left-color: var(--primary-color);
    font-weight: 500 !important;
}

.nav-treeview .nav-icon {
    font-size: 0.8rem !important;
    opacity: 0.7;
    margin-right: 0.5rem;
}